* "Your branch is ahead of 'origin' by X commits"
@ 2016-12-01 19:49 Alfonsogonzalez, Ernesto (GE Digital)
2016-12-01 21:47 ` Jeff King
2016-12-02 13:42 ` Matthieu Moy
0 siblings, 2 replies; 3+ messages in thread
From: Alfonsogonzalez, Ernesto (GE Digital) @ 2016-12-01 19:49 UTC (permalink / raw)
To: git@vger.kernel.org
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.
(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 show origin/master --oneline
92d392c Merge pull request #21 from org/branch
$ git show master --oneline
92d392c Merge pull request #21 from org/branch
$ git --version
git version 2.10.2
Thanks,
Ernesto
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: "Your branch is ahead of 'origin' by X commits"
2016-12-01 19:49 "Your branch is ahead of 'origin' by X commits" Alfonsogonzalez, Ernesto (GE Digital)
@ 2016-12-01 21:47 ` Jeff King
2016-12-02 13:42 ` Matthieu Moy
1 sibling, 0 replies; 3+ messages in thread
From: Jeff King @ 2016-12-01 21:47 UTC (permalink / raw)
To: Alfonsogonzalez, Ernesto (GE Digital); +Cc: git@vger.kernel.org
On Thu, Dec 01, 2016 at 07:49:40PM +0000, Alfonsogonzalez, Ernesto (GE Digital) wrote:
> $ git diff origin/master
> $ 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)
The "master" we are talking about here must always be
"refs/heads/master", since it will have come from resolving the HEAD
symbolic ref.
But here:
> $ git show origin/master --oneline
> 92d392c Merge pull request #21 from org/branch
>
> $ git show master --oneline
> 92d392c Merge pull request #21 from org/branch
The "master" in the second case could possibly find "master" as another
name. Is it possible you have a .git/master file (this may have been
created by accidentally running "git update-ref master" instead of "git
update-ref refs/heads/master")?
Or other things you could check:
# see what's on HEAD, which we know points to refs/heads/master
git show HEAD
# or just check refs/heads/master itself
git show refs/heads/master
# or just ask what "master" resolves to
git rev-parse --symbolic-full-name master
That last one actually seems to complain that "refname 'master' is
ambiguous' if you do have .git/master. I think that's a minor bug, as it
should presumably follow the normal disambiguation rules used for lookup
(in which .git/master always takes precedence over refs/heads/master).
-Peff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: "Your branch is ahead of 'origin' by X commits"
2016-12-01 19:49 "Your branch is ahead of 'origin' by X commits" Alfonsogonzalez, Ernesto (GE Digital)
2016-12-01 21:47 ` Jeff King
@ 2016-12-02 13:42 ` Matthieu Moy
1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Moy @ 2016-12-02 13:42 UTC (permalink / raw)
To: Alfonsogonzalez, Ernesto (GE Digital); +Cc: git@vger.kernel.org
"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
http://www-verimag.imag.fr/~moy/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-02 13:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-01 19:49 "Your branch is ahead of 'origin' by X commits" Alfonsogonzalez, Ernesto (GE Digital)
2016-12-01 21:47 ` Jeff King
2016-12-02 13:42 ` Matthieu Moy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).