GIT Problem: 'master' is beyond 'remotes/origin/master'
I am having some strange problem with my GIT repository. I have two branches, 'master' and 'staging'. I usually work on 'staging' and the owner of the project works on 'master'. So what I do with master is usually just switch to it (git checkout master) to it, pull the changes, then switch back to staging and merge the master with staging. Basically, I don't make any updates to the master branch. Now can any body explain the problem in this image:
How comes my 'master' is beyond 'remotes/origin/master' while I take the commits from 'remotes/origin/master'?!! And how is it possible to make 'master' and 'remotes/origin/master' both points to the last commit?
UPDATE: To answer Jefromi's questions in the first comment, I want to add: The 5 commits all come from the other developer working on the master branch. That is, when I did "git pull origin m开发者_Go百科aster" (while on the master branch), I got those additional 5 commits and the 'master' label moved to the last commit, but not the 'remotes/origin/master'. Now, whenever I switch to the master branch, I get this message:
"Your branch is ahead of 'origin/master' by 5 commits."
I had a similar question, see here:
git: setting a single tracking remote from a public repo
You could try:
$ git pull # with no mention of origin or master
If that does not work, try setting up the branch as described at the bottom of the original post linked above.
I have a feeling of this having changed in different quite recent versions of git, you should say what version you are using.
精彩评论