Skip to content

Instantly share code, notes, and snippets.

@thisivan
Created April 28, 2009 02:41
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thisivan/102895 to your computer and use it in GitHub Desktop.
Save thisivan/102895 to your computer and use it in GitHub Desktop.
Git: Track Remote Branches
# Create new remote branch
git push origin origin:refs/heads/new_branch_name
# Make sure everything is updated
git fetch origin
# Check your branch has been created
git branch -r
# Track a remote branch
git branch --track new_branch_name origin/new_branch_name
# Checkout remote branch
git checkout new_branch_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment