I was on branch1 when I checkout branch2 like this (both branches are existing).
branch1
branch2
git checkout origin/branch2
then I got a
you should use git checkout --track origin/branch2 to create a local branch of branch2, which tracking the remote origin/branch2
git checkout --track origin/branch2
origin/branch2