I had a remote branch that I was already using and I wanted to update the refs on it, so I typed git fetch <remote> <branch> and the branch did not update with the latest refs. I found I had to use git fetch <remote> (without a branch) to get the current remote updates on that branch. Could someone please explain?
Add a comment
|
1 Answer
git fetch <remote> <branch> will fetch the single given branch from the given remote and store it in FETCH_HEAD.
git fetch <remote> will use the default refspec which is usually configured as remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* and therefore will fetch all branches and stores them in the corresponding remote branch.
1 Comment
rpq
Unless I'm missing something, I don't see the specific (and apparently additional) step that git fetch <remote> is performing over git fetch <remote> <branch> when encountering the specific <branch>. Do you know what that is?