0

Can someone tell me why git repeatedly tells me I'm ahead a ridiculous number of commits (when in fact I'm not), and why I need to push in order for git to realize that?

> git status
# On branch dev
# Your branch is ahead of 'origin/dev' by 230 commits.

>git push origin dev
Everything up-to-date

Not such a big deal, but always getting a little adrenaline rush when pushing.

Nicolas78
  • 5,124
  • 1
  • 23
  • 41
  • 1
    Adrenaline is a perfect replacement for caffeine. And it comes for free in your case ;) – tessi Apr 15 '13 at 15:39
  • I'd just delete the local branch and check it out again to solve the problem. Make sure you really pushed all your changes ;-) – Raphael Michel Apr 15 '13 at 15:40
  • @rami, my point is that there is no problem at all. it's just a regular inconsistence in git's reporting and I'm wondering whether this is do to a problem or just a random hickup. – Nicolas78 Apr 15 '13 at 15:56

1 Answers1

1

When I get the # Your branch is ahead of 'origin/dev' by x commits. message, a git fetch usually fixes it for me.

Ross
  • 786
  • 5
  • 11
  • yea I guess the `fetch` part of the `pull` is what fixes it for me too, but that still doesn't answer what's going on there! ;) – Nicolas78 Apr 15 '13 at 16:00
  • 1
    The message appears when the FETCH/HEAD pointer doesn't get updated during a `git pull`. [This answer](http://stackoverflow.com/a/1743870/1615761) explains it pretty well. – Ross Apr 15 '13 at 16:23