##Branch Management
show all branches git branch -v
git branch -a
delete branch git branch -d
clone a single branch git clone -b mybranch --single-branch git://sub.domain.com/repo.git
##Discard Changes / Commits
Discard all local changes and commitsgit reset --hard origin/master
##Manage commit histories
Remove all commit hstories for file contains sensitive data:
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch Rakefile' --prune-empty --tag-name-filter cat -- --all
git push origin --force --all
Merge the previous two commits into one: git reset --soft HEAD~2
and then re-commit
##Other
Ignore file mode changes: git config core.fileMode false