Git development
 help / color / mirror / Atom feed
From: "Alfonsogonzalez, Ernesto (GE Digital)"  <ernesto.alfonsogonzalez@ge.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: EXT: Re: "Your branch is ahead of 'origin' by X commits"
Date: Fri, 2 Dec 2016 18:35:28 +0000	[thread overview]
Message-ID: <D466FE56.BC17%ernesto.alfonsogonzalez@ge.com> (raw)

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

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>

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" <Matthieu.Moy@grenoble-inp.fr> wrote:

>"Alfonsogonzalez, Ernesto (GE Digital)" <ernesto.alfonsogonzalez@ge.com>
>writes:
>
>> 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= 


             reply	other threads:[~2016-12-02 19:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 18:35 Alfonsogonzalez, Ernesto (GE Digital) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-12-01 22:03 EXT: Re: "Your branch is ahead of 'origin' by X commits" Alfonsogonzalez, Ernesto (GE Digital)
2016-12-01 22:20 ` Junio C Hamano
2016-12-01 22:23 ` Jeff King
2016-12-01 22:36   ` Alfonsogonzalez, Ernesto (GE Digital)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D466FE56.BC17%ernesto.alfonsogonzalez@ge.com \
    --to=ernesto.alfonsogonzalez@ge.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox