git branch
git branch -a
git branch -r
git branch -m <old_branch> <new_branch>
git branch -m feature/old_branch feature/new_branch
git branch -D <branch>
git branch -D feature/branch
git push <remote-name> :<branch>
git push origin :feature/branch
git push <remote-name> --delete <branch>
git push origin --delete feature/branch
git tag
git ls-remote -t <remote-name>
git tag new_tag old_tag
git push --tags
git push origin :refs/tags/old_tag
git tag -d old_tag
git tag -a {version} -m "Add tag for version {version}"
Then push tag to the origin
git push --tags
Reference: http://darrinholst.com/post/359817782
git rebase -i <commit-hash>
git status --ignored
git clean -fdX
Reference: http://blog.evan.pro/keeping-a-clean-github-fork-part-1
Wayback: https://web.archive.org/web/20130325080957/http://blog.evan.pro/keeping-a-clean-github-fork-part-1
git remote add upstream <git-project-url>
git remote add <label> <git-project-url>
git fetch upstream
git merge --ff-only upstream/master
git pull --ff-only upstream master
git push origin master
git fetch --all
git checkout -b feature/<feature-name>
git push origin feature/<feature-name>
Reference: http://blog.evan.pro/properly-excluding-ide-specific-files-with-git
Wayback: https://web.archive.org/web/20140326213018/http://blog.evan.pro/properly-excluding-ide-specific-files-with-git
git config --global core.excludesfile ~/.gitignore_global
git status --porcelain -u | sed 's#^...##' | while read file; do gdu -s -b "$file"; done | sort -nr | awk ' { total = total+$1 } END { printf("%.2fMb\n",total/(1024*1024)) } '
Note: On Linux, gdu should be changed to du, and on OS X you must install the coreutils package.