git pull origin master does not update origin/master?
It's a bit weird, but if you use git pull [remote] <refspec>
it actually doesn't update the remote refs. It sort of makes sense if you think about it a certain way: since you're specifying a specific ref to fetch, it doesn't have to look up anything about your remote branches, so it doesn't inherently know what remote branch it should update. It of course could figure it out, and I wouldn't be surprised if it gets fixed eventually, but that's the existing behavior. (There may be messages on the mailing list about it - I don't know.)
You can easily work around it, though. If you use git pull origin/master
, since you're specifying what to fetch via a remote branch, it should update that remote branch. And if you're on your master branch anyway (or any other branch tracking origin/master), you can just do git pull
and let it fill in the defaults, and it will update remote branches.
This is documented in the git-pull
man page, most concisely under EXAMPLES but also elsewhere. The relevant part:
Merge into the current branch the remote branch next:
$ git pull origin next
This leaves a copy of next temporarily in FETCH_HEAD, but does not update any remote-tracking branches. Using remote-tracking branches, the same can be done by invoking fetch and merge:
$ git fetch origin $ git merge origin/next