从Github拉到Android Studio

问题描述 投票:1回答:1

我在Github仓库中有两个分支,我想从其中一个分支中提取代码,然后在Android Studio中覆盖代码。

我已经尝试过什么。

  1. 我去了VCS -> Git -> Pull(拉)

enter image description here

  1. 点击拉取,这是拉取后的状态。

enter image description here

现在,当我在Android Studio中检查代码时,它仍然是相同的。什么都没有更新,我到底缺了什么?

android git android-studio github git-pull
1个回答
1
投票

好吧,所以我能够以某种方式解决这个问题。

我试着从我的终端(不是Android Studio上的终端)这样拉。

git pull {repo} {remot-branch}:{local-branch}。

上面写着这样的话: "非快进拒绝!".

我只是在 pull 命令中添加了 --force,就像这样。

git pull --force {repo} {remot-branch}:{local-branch}。

而且它的工作。

© www.soinside.com 2019 - 2024. All rights reserved.