2.6. Branch and merge - shinokada/gitnotes GitHub Wiki
Branch
git checkout -b new-branch
git branch
# do something with the new-branch
# add and commit in the new-branch
git checkout master
git merge new-branch
# delete it
git branch -d newbranch
# after messing up a branch delete a branch
git checkout master
git branch -D mess-branch
git push origin --delete <branch_name>
git branch -d <branch_name>