You are probably aware of what the first part of your command will do. git fetch <remote> <some_branch>
will update the local tracking branch of the branch you specify. But this will not alter the actual local corresponding some_branch
on your machine.
When you do a git fetch
, Git has a special ref called FETCH_HEAD
which points to the branch which was just fetched. In this case, it would point to remote/some_branch
, since this is the branch which was just fetched. By doing
git checkout FETCH_HEAD
you would be checking out origin/some_branch
in a detached HEAD state. This may or not may not be what you intend, but in any case, your compound command would not actually update the local some_branch
. To do that, you would need an additional git merge
step, or to just do a git pull
from some_branch
.