Skip to content

Instantly share code, notes, and snippets.

@mkoby
Created March 6, 2013 16:57
Show Gist options
  • Save mkoby/5100894 to your computer and use it in GitHub Desktop.
Save mkoby/5100894 to your computer and use it in GitHub Desktop.
Version Control with Git - 05 - Branching
#Create a new 'dev' branch in Git
git branch dev
#See a list of branches
git branch
#You can switch to the branch using 'checkout'
git checkout dev
#If you want to checkout and create a new branch in a single command run
git checkout -b dev #creates and places you in the new dev branch
#After you make changes to in the branch, you can merge this branch back into your 'master' branch
#First, checkout master
git checkout master
#Now merge the branch using the 'merge' command
git merge dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment