pull-only repo's 'git status' saying the branch is ahead of origin/master. Why?

后端 未结 5 1644
别跟我提以往
别跟我提以往 2020-12-10 12:01

So here\'s the situation:

$ git status
# On branch master
# Your branch is ahead of \'origin/master\' by [x] commits.
#

5条回答
  •  执念已碎
    2020-12-10 12:50

    Note: this question was recently linked-to from Git: unable to get remote and local/server the same. Note that the date on the original question is September 2011; the then-most-current version of Git was 1.7.10. Git is now at version 2.26.2.

    In versions of Git predating Git 1.8.4, running git pull origin master suppresses updating the local name origin/master. (So does running git fetch origin master.)

    Running git fetch, with no additional arguments, causes all versions of Git—before and after 1.8.4—to update all remote-tracking names, including origin/master. So that's the real explanation behind this mystery.

提交回复
热议问题