You need to fetch upstream changes so your local repository includes the relevant objects (git fetch --all
or git fetch <remote>
).
Afterwards you can perform a checkout using git checkout <branch>
(if you like to do it explicitly, you can type git checkout -b <branch> <remote>/<branch>
; the local name doesn't have to be the same as the remote). If you don't already have a local branch of that name, it will checkout the remote branch and track it.
As an alternative to this, you can use git pull <remote> <branch>
, but this will - with default settings - merge the remote branch into your current, which is probably not what you want.