{"thread":{"id":"44594","subject":"Re: EXT: Re: \"Your branch is ahead of 'origin' by X commits\"","startedAt":"2016-12-02T19:29:25Z","lastAt":"2016-12-02T19:29:25Z","messageCount":1,"participants":["Alfonsogonzalez, Ernesto (GE Digital)"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"306807","messageId":"D466FE56.BC17%ernesto.alfonsogonzalez@ge.com","threadId":"44594","inReplyTo":null,"subject":"Re: EXT: Re: \"Your branch is ahead of 'origin' by X commits\"","fromName":"Alfonsogonzalez, Ernesto (GE Digital)","fromEmail":"ernesto.alfonsogonzalez@ge.com","sentAt":"2016-12-02T18:35:28Z","receivedAt":"2016-12-02T19:29:25Z","isPatch":false,"sender":{"key":"ernesto.alfonsogonzalez@ge.com","avatar":null},"body":"Hi Matthieu,\n\nIt was my mistake, I had a local branch called “origin” which was the\nupstream for master.\nI sent more details in a later email, reproduced below. Sorry for the\nfalse alarm.\n\nThanks,\n\nErnesto\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n>>>>>>>>>>\n\nYes, it looks like I had a local branch “origin” which was behind by 108\ncommits. \n\nSetting upstream to the local branch correctly states \"track local branch\norigin”.\n\nIt was my mistake, there is no bug.\n\nThanks,\n\n\n$ git rev-parse --symbolic-full-name origin\nrefs/heads/origin\n# origin is a local branch\n\n$ git show refs/heads/origin\ncommit ad8c3ee6cb7740627e4ecddb418c826bc8597d3d # old commit, 108 commits\nbehind master\n\n\n$ git branch\n...\n* master\n...\n  origin\n...\n\n$ git show origin \ncommit ad8c3ee6cb7740627e4ecddb418c826bc8597d3d\nMerge: e16bda3 4b7564d\n\n$ git branch --set-upstream-to=origin/master\nBranch master set up to track remote branch master from origin\n\n\n$ git branch --set-upstream-to=origin #correctly says \"track local branch\norigin\"\nBranch master set up to track local branch origin.\n\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$ git branch -d origin\nDeleted branch origin (was ad8c3ee).\n$\n\n$ git status\nOn branch master\nYour branch is based on 'origin', but the upstream is gone.\n  (use \"git branch --unset-upstream\" to fixup)\n\n\n\n\n\nOn 12/2/16, 5:42 AM, \"Matthieu Moy\" <Matthieu.Moy@grenoble-inp.fr> wrote:\n\n>\"Alfonsogonzalez, Ernesto (GE Digital)\" <ernesto.alfonsogonzalez@ge.com>\n>writes:\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>\n>This 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>\n>My guess is that you have a badly configured upstream.\n>\n>What does \"git pull -v\" say? What's the content of the [branch \"master\"]\n>section of .git/config?\n>\n>-- \n>Matthieu Moy\n>https://urldefense.proofpoint.com/v2/url?u=http-3A__www-2Dverimag.imag.fr_\n>-7Emoy_&d=DQIDAw&c=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI&r=izgsnUPc7\n>Qu6cAMH0HZnmitAbT-LmaLVojOu8tH2KqE&m=0Kz9dpPPuw6T-zLqzY80QygN-4VoMVQeauR_x\n>WR5fN8&s=DnD-WMGSm71Y05CEheJw-NdYA0FVP2ze6KqWxrEKswE&e= \n\n"}]}