日期:2014-05-16  浏览次数:20634 次

git pull下载远程仓库出现问题
当我切换道master分支上pull的时候,出现下面错误:

You asked me to pull without telling me which branch you
want to merge with, and 'branch.master.merge' in
your configuration file does not tell me, either. Please
specify which branch you want to use on the command line and
try again (e.g. 'git pull <repository> <refspec>').
See git-pull(1) for details.

If you often merge with the same branch, you may want to
use something like the following in your configuration file:
    [branch "master"]
    remote = <nickname>
    merge = <remote-ref>

    [remote "<nickname>"]
    url = <url>
    fetch = <refspec>

See git-config(1) for details.

请各位高手指点啊,在线狂等中。。。
git

------解决方案--------------------
楼主git pull的时候失败可能是自己本地有修改没有提交导致的,你虽然没修改这些东西,但是看楼主这样子应该是编译过这个仓库吧,这样产生了一些新的文件没有加入追踪。如果楼主想去掉所有的,git checkout -f即可,然后再pull;
不过这样可能导致一些自己的修改没了,可以git commit -a,这个命令会把当前的修改提交到本地(新产生的文件不在追踪范围),然后再pull。建议楼主不要在master工作,自己单独建立一个分支,然后在需要时与master 进行下rebase即可,不知道回答的是不是楼主希望的。