Branching

List local branches

git branch  

List remote branches

git branch -r  

List all branches

git branch -a  

Create new branch

git checkout -c features/featurex  

Delete local branch

git branch -d features/featurex  

Delete remote branch

git push origin --delete featurex  

Misc

View unpushed commits

git log origin/master..HEAD  

Delete last X commits

git reset --hard HEAD~X (HEAD~1, HEAD~2, etc.)  

Use Windows Credential manager

git config --global credential.helper wincred  

Init in non-empty repo

git init  
git remote add origin https://github.com/FlyingPie/linuxhome.git  
git fetch  
git reset origin/master  
git checkout -t origin/master  

Enable long file names

git config core.longpaths true  

Split subfolder into repo

https://help.github.com/articles/splitting-a-subfolder-out-into-a-new-repository/