remote-branch - git list remote branches - How do I check out a remote Git branch?

git checkout remote branch to local / git / git-checkout

Somebody pushed a branch called test with git push origin test to a shared repository. I can see the branch with git branch -r.

Peter Mortensen



Answer #1

To clone a Git repository, do:

git clone <either ssh url /http url>
git checkout -t origin/future_branch (for example)

If you want to override your local branch name on checkout:

git checkout -t -b enhancement origin/future_branch