git pull error (no local branch)

来源:互联网 发布:windows安装hadoop2.7 编辑:程序博客网 时间:2024/06/06 04:02

Error:

$ git pull
Password:
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.


Solution:

view ./git/config 

no section

1[branch"master"]
2remote= origin
3merge= refs/heads/master

Run commands below

1$ git config branch.master.remote origin
2$ git config branch.master.merge refs/heads/master


0 0
原创粉丝点击