Disable vim in "git log" & "git branch"
git config --global pager.log false
git config --global pager.branch false
Get current branch name
Works with git version < 2.2
git rev-parse --abbrev-ref HEAD
Works with git version >= 2.2
git branch --show-current
Checkout file from different branch
git checkout <branch_name> -- <paths>
Git push with authentication
git push -u origin <branch_name>
Remove all branches except master
git branch | grep -v "master" | xargs git branch -D