On Nov 10, 8:05 pm, David Doria <daviddo...@gmail.com> wrote:
> I don't understand what it means by
> "Your branch is ahead of origin/master"
It means that your current branch has commits that are not present in
the origin/master remote-tracking branch.
> Even if I do a
> git reset --hard origin/master
> git pull origin master
This last command is likely your problem. More below...
> git tells me:
> [dor...@localhost ITK]$ git status
> # On branch master
> # Your branch is ahead of 'origin/master' by 145 commits.
> nothing to commit (working directory clean)
> How can that be? Shouldn't it be exactly equal to origin/master now?
Your 'git pull' has two arguments. The first is the remote and the
second is the "refspec".
In its full form, a refspec has a source and a destination ref pattern
separated by a colon. This is normally used to "download" refs from a
remote repository into your repository's remote-tracking branches like
this: "refs/heads/*:refs/remotes/origin/*" You can see this type of
full refspec in your .git/config file for each of your remotes. In
addition, the special ref FETCH_HEAD is update with the refs that have
When a refspec without a colon is used with pull (or fetch), it is
interpreted as having an empty destination ref pattern. This means no
remote-tracking branches are updated; FETCH_HEAD is updated though.
So, your 'git pull origin master' command downloads ref/heads/master
from the origin remote (storing it in FETCH_HEAD) and merges it into
The effective result is that your HEAD was merged with origin's master
branch, but your remote-tracking branches were "left behind".
If you just use 'git pull' (without specifying a remote or refspec),
it will do what you expect: when you have your local master branch
checked out, it will update the origin/* remote-tracking branches and
merge the (updated) origin/master into your master.
You received this message because you are subscribed to the Google Groups "Git
for human beings" group.
To post to this group, send email to git-us...@googlegroups.com.
To unsubscribe from this group, send email to
For more options, visit this group at