Skip to content

Instantly share code, notes, and snippets.

@iwatakeshi
Last active August 29, 2015 14:04
Show Gist options
  • Save iwatakeshi/b3535f1341e927f3d0d5 to your computer and use it in GitHub Desktop.
Save iwatakeshi/b3535f1341e927f3d0d5 to your computer and use it in GitHub Desktop.
Git Basics
#Note: Make sure all changes in your working directory have
#been commited and pushed to the repo!
#List the existing branches
git branch -a
#Create a new branch and switch to it
git checkout -b [name of new branch]
#Switch to existing branch (without brackets)
git checkout [name of existing branch]
#Get branch status (used in case something isn't right)
git status
#Clone a branch
git clone [the URL of the branch that is to the right of your github dashboard]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment