Skip to content

Instantly share code, notes, and snippets.

@armelo24
Forked from markSci5/Git checkout remote branch
Created February 20, 2019 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save armelo24/8a4b67a75fe3d650d6027785413eba21 to your computer and use it in GitHub Desktop.
Save armelo24/8a4b67a75fe3d650d6027785413eba21 to your computer and use it in GitHub Desktop.
Git checkout remote branch
//To fetch a branch, you simply need to:
git fetch origin
//This will fetch all of the remote branches for you. With the remote branches
//in hand, you now need to check out the branch you are interested in, giving
//you a local working copy:
git checkout -b test origin/test
//Or
git branch test origin/test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment