1

I am fairly new to Git, so I apologize in advance. When I execute command 'git status' on my local copy, it shows that I am 3 commits ahead of the remote. But When I try to 'git push', I get the message that everything is up to date. Can someone please tell me what is going on here?

The output:

$ git status On branch master
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)

nothing to commit, working directory clean
Roland Smith
  • 42,427
  • 3
  • 64
  • 94
billy_blanks
  • 105
  • 1
  • 3
  • 12
  • Are you sure that (A) it's not telling you that you're 3 commits *behind* the remote? and (B) that you've got your upstream remote branch set, so when you do `git push` it actually tries to push where it's supposed to? Does `git push origin yourbranch` give you the same result? – scrowler Apr 29 '15 at 02:53
  • 1
    Try using `gitk --all` to view what the history looks like. To get relevant answers, please post the complete output of `git status`, `git branch -vv` and `git --version`. – Matthieu Moy Apr 29 '15 at 07:48
  • 1
    @Billy: could you post some code? (that is, the output of `git status` at least) It could help to diagnose. – serv-inc Apr 29 '15 at 11:41
  • Thank you all for replying. This is the output of the git status: $ git status On branch master Your branch is ahead of 'origin/master' by 3 commits. (use "git push" to publish your local commits) nothing to commit, working directory clean – billy_blanks Apr 29 '15 at 16:02
  • The answer is given in another stackoverflow posting: https://stackoverflow.com/questions/1741143/git-pull-origin-mybranch-leaves-local-mybranch-n-commits-ahead-of-origin-why –  Jun 12 '16 at 09:23

0 Answers0