Miscellaneous
Everyday Git in twenty commands or so
git help everyday
Untrack files without deleting
git rm --cached <file_path>
Alternatives:
git rm --cached -r <directory_path>
Don’t consider changes for tracked file.
git update-index --assume-unchanged <file_name>
Check if the change was a part of a release.
git name-rev --name-only <SHA-1>
List ignored files.
git check-ignore *
Count unpacked number of objects and their disk consumption.
git count-objects --human-readable
Prune all unreachable objects from the object database.
git gc --prune=now --aggressive
Instantly browse your working repository in gitweb.
git instaweb [--local] [--httpd=<httpd>] [--port=<port>] [--browser=<browser>]
Find lines matching the pattern (regex or string) in tracked files
git grep --heading --line-number 'foo bar'
Backup untracked files.
git ls-files --others -i --exclude-standard | xargs zip untracked.zip
Send a collection of patches as emails
git send-email [<options>] <file|directory>…
git send-email [<options>] <format-patch options>