Set username:
git config --global user.name "MyName" # global settings
git config --local user.name "My Name" # just for the current repository
Set mail address:
git config --global user.email "my@mail.address"
git config --local user.email "my@mail.address"
Set default editor:
git config --global core.editor "vim"
Disable pageing output:
git config --global pager.branch false
If you are on the branch
git branch -m new-name
If you are on a different branch
git branch -m old-name new-name
git push origin :old-name new-name
git push origin -u new-name
git push origin :branch-name
Sign off all single commits from a branch and cherry-pick them to the master branch
git cherry -v master BRANCH-YOU-LIKE-TO-MERGE | cut -f2 -d ' ' | while read LINE; do git cherry-pick -s ${LINE}; done