I like to pretend that git fetch is an auxiliary (plumbing) team.
The git fetch single argument form, which accepts only the remote, is the old, deprecated name for git remote update , which does the same.
A two-plus form that accepts remote access and a list of branches is the actual internal implementation of everything else. It is exposed because it is sometimes useful if you know what you are doing, or creating a script. An example of use will be if you want to check a branch before retrieving it correctly.
Imagine git fetch origin (e.g. git remote update ) basically:
git ls-remote origin , to see which branches are available on the origin . Then, for each branch found (which corresponds to the selection specification, the default is "all branches"):
git fetch origin thatbranch to perform low-level git fetch origin thatbranch .git branch -f origin/thatbranch FETCH_HEAD to move the "remote tracking branch" (your local copy of the remote branch) to FETCH_HEAD .
You can do this manually by eliminating the need for a git fetch argument with one argument and for git remote update (an even higher level). Obviously, this would not be very convenient.
source share