why does it say “Your branch is ahead of origin/master by 857 commits” when I need to *pull* origin master

后端 未结 5 1128
予麋鹿
予麋鹿 2020-12-24 14:16

Firstly, I\'m aware of a number of similarly worded questions, eg:

  • How can I find the location of origin/master in git, and how do I change it?
  • git:
5条回答
  •  时光取名叫无心
    2020-12-24 14:40

    I had this question too. I searched a bit and found out that, we occasionally run 'git pull upstream master' to fetch the latest changes from upstream master to our local master which is a forked branch. However these updated changes are not pushed to our remote master yet. Hence the message says 'our local is x commits ahead of remote master'. Before proceeding with new code or modification in forked branch environment, it's better to run the following commands

    git checkout master_branch;
    git pull upstream master;
    git push

提交回复
热议问题