Re: EXT: Re: "Your branch is ahead of 'origin' by X commits"

From: Alfonsogonzalez, Ernesto (GE Digital) <hidden>
Date: 2016-12-02 19:29:25

Hi Matthieu,

It was my mistake, I had a local branch called “origin” which was the
upstream for master.
I sent more details in a later email, reproduced below. Sorry for the
false alarm.

Thanks,

Ernesto
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
quoted
Yes, it looks like I had a local branch “origin” which was behind by 108
commits. 

Setting upstream to the local branch correctly states "track local branch
origin”.

It was my mistake, there is no bug.

Thanks,


$ git rev-parse --symbolic-full-name origin
refs/heads/origin
# origin is a local branch

$ git show refs/heads/origin
commit ad8c3ee6cb7740627e4ecddb418c826bc8597d3d # old commit, 108 commits
behind master


$ git branch
...
* master
...
  origin
...

$ git show origin 
commit ad8c3ee6cb7740627e4ecddb418c826bc8597d3d
Merge: e16bda3 4b7564d

$ git branch --set-upstream-to=origin/master
Branch master set up to track remote branch master from origin


$ git branch --set-upstream-to=origin #correctly says "track local branch
origin"
Branch master set up to track local branch origin.

$ git status
On branch master
Your branch is ahead of 'origin' by 108 commits.
  (use "git push" to publish your local commits)
Untracked files:
  (use "git add <file>..." to include in what will be committed)

...
nothing added to commit but untracked files present (use "git add" to
track)


$ git branch -d origin
Deleted branch origin (was ad8c3ee).
$

$ git status
On branch master
Your branch is based on 'origin', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)





On 12/2/16, 5:42 AM, "Matthieu Moy" [off-list ref] wrote:
"Alfonsogonzalez, Ernesto (GE Digital)" [off-list ref]
writes:
quoted
Hi,

Git status tells me "Your branch is ahead of 'origin' by 108 commits.²,
but my local and origin/master are pointing to the same commit.

What am I doing wrong?

$ git diff origin/master
$ git status
On branch master
Your branch is ahead of 'origin' by 108 commits.
This line should say "ahead of 'origin/master'" in common setups, where
'origin/master' is the remote-tracking branch configured as upstream for
'master'.

My guess is that you have a badly configured upstream.

What does "git pull -v" say? What's the content of the [branch "master"]
section of .git/config?

-- 
Matthieu Moy
https://urldefense.proofpoint.com/v2/url?u=http-3A__www-2Dverimag.imag.fr_
-7Emoy_&d=DQIDAw&c=IV_clAzoPDE253xZdHuilRgztyh_RiV3wUrLrDQYWSI&r=izgsnUPc7
Qu6cAMH0HZnmitAbT-LmaLVojOu8tH2KqE&m=0Kz9dpPPuw6T-zLqzY80QygN-4VoMVQeauR_x
WR5fN8&s=DnD-WMGSm71Y05CEheJw-NdYA0FVP2ze6KqWxrEKswE&e= 
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help