https://guides.github.com/introduction/flow/
See which branch you're on:
$ git status
List the branches
$ git branch
Create a branch and switch to it:
$ git branch <branch-name>
$ git checkout <branch-name>
- or shorthand -
$ git checkout -b <branch-name>
Work on/edit some files, then add them & commit them
$ git add .
$ git commit -m "Your commit message here"
When ready to merge the new branch into master:
// switch to 'master' / move into the branch you want to merge into
$ git checkout master
$ git merge <branch-name>
To push the branch
$ git push origin <branch-name>
To delete a local branch
$ git branch -d <branch-name>
To delete branch from online repo
$ git push origin --delete <branch-name>
To remove a remote branch (if you know what you are doing!)
$ git push <remote-name> --delete <branch-name>