I've never been able to get a clear answer to this question.
For a long time, and at the advisement of a coworker, I've been doing this:
git fetch origin
git pull origin <mybranch>
I've been told (and have seen) that git pull
does not behave the same way if you do not first do git fetch
. You don't get any remote changes.
But all I see online is that git pull
is the equivalent of git fetch
followed by git merge
. If that were true, git pull
would include git fetch
, and I wouldn't need an explicit git fetch
first, right? But that doesn't seem to be the case.
So what I'm looking for is some explicit documentation that describes the observed behavior of git pull
. (I know I'll probably also get lots of advice to switch to git fetch
→ git merge
; that's fine too, but I'm really interested in git pull
.)