Skip to content

Instantly share code, notes, and snippets.

@bkrauska
Created January 11, 2011 16:19
Show Gist options
  • Save bkrauska/774648 to your computer and use it in GitHub Desktop.
Save bkrauska/774648 to your computer and use it in GitHub Desktop.
Git Branching Cheat Sheet
// list local branches
git branch
// list remote branches
git branch -r
// list all branches
git branch -a
// create new branch
git branch <branch-name>
// create new branch from another branch
git brach <branch-name> <existing-branch-name>
// pull from master
git pull origin master
// switch to branch
git checkout <branch-name>
// push to branch
git push origin <branch-name>
// delete branch
git branch -d <branch-name>
// delete remote branch
git push origin :<branch-name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment