{"thread":{"id":"44588","subject":"\"Your branch is ahead of 'origin' by X commits\"","startedAt":"2016-12-01T21:21:28Z","lastAt":"2016-12-02T13:42:28Z","messageCount":3,"participants":["Alfonsogonzalez, Ernesto (GE Digital)","Jeff King","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"306756","messageId":"D465BDE6.B7DE%ernesto.alfonsogonzalez@ge.com","threadId":"44588","inReplyTo":null,"subject":"\"Your branch is ahead of 'origin' by X commits\"","fromName":"Alfonsogonzalez, Ernesto (GE Digital)","fromEmail":"ernesto.alfonsogonzalez@ge.com","sentAt":"2016-12-01T19:49:40Z","receivedAt":"2016-12-01T21:21:28Z","isPatch":false,"sender":{"key":"ernesto.alfonsogonzalez@ge.com","avatar":null},"body":"Hi,\n\nGit status tells me \"Your branch is ahead of 'origin' by 108 commits.²,\nbut my local and origin/master are pointing to the same commit.\n\nWhat am I doing wrong?\n\n$ git diff origin/master\n$ git status\nOn branch master\nYour branch is ahead of 'origin' by 108 commits.\n  (use \"git push\" to publish your local commits)\nUntracked files:\n  (use \"git add <file>...\" to include in what will be committed)\n\n...\nnothing added to commit but untracked files present (use \"git add\" to\ntrack)\n$ \n\n\n\n$ git show origin/master --oneline\n92d392c Merge pull request #21 from org/branch\n\n$ git show master --oneline\n92d392c Merge pull request #21 from org/branch\n\n\n$ git --version \ngit version 2.10.2\n\n\n\n\nThanks,\n\nErnesto\n\n"},{"id":"306759","messageId":"20161201214750.awin75rfums6mjrv@sigill.intra.peff.net","threadId":"44588","inReplyTo":"D465BDE6.B7DE%ernesto.alfonsogonzalez@ge.com","subject":"Re: \"Your branch is ahead of 'origin' by X commits\"","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-12-01T21:47:50Z","receivedAt":"2016-12-01T21:47:58Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Dec 01, 2016 at 07:49:40PM +0000, Alfonsogonzalez, Ernesto (GE Digital) wrote:\n\n> $ git diff origin/master\n> $ git status\n> On branch master\n> Your branch is ahead of 'origin' by 108 commits.\n>   (use \"git push\" to publish your local commits)\n> Untracked files:\n>   (use \"git add <file>...\" to include in what will be committed)\n\nThe \"master\" we are talking about here must always be\n\"refs/heads/master\", since it will have come from resolving the HEAD\nsymbolic ref.\n\nBut here:\n\n> $ git show origin/master --oneline\n> 92d392c Merge pull request #21 from org/branch\n> \n> $ git show master --oneline\n> 92d392c Merge pull request #21 from org/branch\n\nThe \"master\" in the second case could possibly find \"master\" as another\nname. Is it possible you have a .git/master file (this may have been\ncreated by accidentally running \"git update-ref master\" instead of \"git\nupdate-ref refs/heads/master\")?\n\nOr other things you could check:\n\n  # see what's on HEAD, which we know points to refs/heads/master\n  git show HEAD\n\n  # or just check refs/heads/master itself\n  git show refs/heads/master\n\n  # or just ask what \"master\" resolves to\n  git rev-parse --symbolic-full-name master\n\nThat last one actually seems to complain that \"refname 'master' is\nambiguous' if you do have .git/master. I think that's a minor bug, as it\nshould presumably follow the normal disambiguation rules used for lookup\n(in which .git/master always takes precedence over refs/heads/master).\n\n-Peff\n"},{"id":"306794","messageId":"vpqk2bisb0z.fsf@anie.imag.fr","threadId":"44588","inReplyTo":"D465BDE6.B7DE%ernesto.alfonsogonzalez@ge.com","subject":"Re: \"Your branch is ahead of 'origin' by X commits\"","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2016-12-02T13:42:04Z","receivedAt":"2016-12-02T13:42:28Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"\"Alfonsogonzalez, Ernesto (GE Digital)\" <ernesto.alfonsogonzalez@ge.com>\nwrites:\n\n> Hi,\n>\n> Git status tells me \"Your branch is ahead of 'origin' by 108 commits.²,\n> but my local and origin/master are pointing to the same commit.\n>\n> What am I doing wrong?\n>\n> $ git diff origin/master\n> $ git status\n> On branch master\n> Your branch is ahead of 'origin' by 108 commits.\n\nThis line should say \"ahead of 'origin/master'\" in common setups, where\n'origin/master' is the remote-tracking branch configured as upstream for\n'master'.\n\nMy guess is that you have a badly configured upstream.\n\nWhat does \"git pull -v\" say? What's the content of the [branch \"master\"]\nsection of .git/config?\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}