简体   繁体   中英

configure git so that “git pull” instead of “git pull origin master”?

Using git pull used to pull from the remote repository as expected - now, it's asking me to use git pull origin master . I don't quite understand the instructions it's giving me, saying I can add something to my configuration file:

[branch "master"]
remote = <nickname>
merge = <remote-ref>

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

Right now my configuration file looks like

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
[remote "origin"]
    url = |redacted|
    fetch = +refs/heads/*:refs/remotes/origin/*

So I'm guessing I need to add

[branch "master"]
    remote = origin
    merge = ??

What does "merge" need as its argument? What's a remote-ref(erence?)? I tried looking at http://git-scm.com/docs/git-config but it seems to be more about the command itself.

Thanks in advance!

try:

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

执行起来应该足够了

git config branch.master.remote origin

做就是了:

git branch --set-upstream master origin/master

一种简单的方法是使用git checkout -t在创建本地分支时设置跟踪。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM