git local branch track remote

C++
git checkout --track origin/some_remote_branchgit branch --set-upstream foo upstream/foo
git branch --set-upstream-to=upstream/foo

git branch --set-upstream-to=upstream/foo foo
git branch -u upstream/foo foo
git branch -u upstream/foo

Source

Also in C++: