我有一个远程的origin/master
以及一个叫做remote_branch
的远程分支。
我还有一个本地的master
和一个叫做local_branch
的本地分支。当我尝试使用git pull master local_branch
将本地的master
合并进local_branch
时,会得到以下提示。
fatal: 'master' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
但是,当我执行 git branch
命令时,我看到了这个:
* loca_branch
master
为什么我不能从本地的master
分支拉取代码?
git fetch
(为了稍后执行git merge
),它会获取origin/master
。但我想让 git 查找本地的master
... - four-eyesorigin/master
合并到local_branch
上:git fetch && git merge origin/master local_branch
。pull
命令是fetch
和merge
的快捷方式。 - Frodon