# In order to checkout a remote branch,
# you have to first fetch the contents of the branch
git fetch --all
# In mordern version of Git, cehckout the remote branch like a local branch
git checkout <remotebranch>
# Older versions of Git requiers the creation of a new branch based on the remote
git checkout -b <remotebranch> origin/<remotebranch>
git checkout --track origin/<branchname>
# In modern versions of Git, you can checkout the remote branch like a local branch.
git checkout <remotebranch>
# Older versions of Git require the creation of a new branch based on the remote.
git checkout <remotebranch> origin/<remotebranch>
In this case, you probably want to create a local test branch which is tracking the remote test branch:
$ git branch test origin/test
In earlier versions of git, you needed an explicit --track option, but that is the default now when you are branching off a remote branch.
To create the local branch and switch to it, use:
$ git checkout -b test origin/test
$ git checkout -t remote_name/remote_branch
git fetch
git checkout test
git checkout -t origin/future_branch (for example)