我没有使用github,我们在机器上搭建了git。
我从主分支(master)创建了一个叫做experiment的新分支。但是当我尝试执行git pull时,我得到以下消息。
> git pull
You asked me to pull without telling me which branch you
want to merge with, and 'branch.experiment.merge' in
your configuration file does not tell me either. Please
specify which branch you want to merge on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.
这里是git remote show origin的结果
> git remote show origin
* remote origin
Fetch URL: ssh://git.domain.com/var/git/app.git
Push URL: ssh://git.domain.com/var/git/app.git
HEAD branch: master
Remote branches:
experiment tracked
master tracked
Local branches configured for 'git pull':
master merges with remote master
Local refs configured for 'git push':
experiment pushes to experiment (local out of date)
master pushes to master (up to date)
我从上面的消息中了解到,experiment分支被映射到origin/experiment。我的本地仓库已经知道它已经过时了。那我为什么不能用git pull命令呢?
这是我创建该分支的方式:
git co -b experiment origin/experiment
git pull
对于某些分支有效而对于其他分支无效呢?通常,git pull
会从远程拉取当前检出的分支,但在某些情况下它不起作用,你会得到OP所描述的错误信息。我不明白为什么会出现这种差异。 - geoidesic