docs/log-and-history.md
git help -g
git log -S'<a term in the source>'
git log -p <file_name>
git diff --name-only --diff-filter=U
git diff-tree --no-commit-id --name-only -r <commit-ish>
git diff
git diff --cached
Alternatives:
git diff --staged
git diff HEAD
git log --no-merges --raw --since='2 weeks ago'
Alternatives:
git whatchanged --since='2 weeks ago'
git log --no-merges --stat --reverse master..
git ls-files -t
git ls-files --others
git ls-files --others -i --exclude-standard
git log --pretty=oneline --graph --decorate --all
Alternatives:
gitk --all
git log --graph --pretty=format:'%C(auto) %h | %s | %an | %ar%d'
git log --graph --decorate --oneline $(git rev-list --walk-reflogs --all)
git diff --word-diff
git difftool [-t <tool>] <commit1> <commit2> <path>
git log Branch1 ^Branch2
git log -<n>
Alternatives:
git log -n <n>
git diff --name-only | uniq | xargs $EDITOR
git log --show-signature
git show <branch_name>:<file_name>
git log --first-parent
git log --follow -p -- <file_path>
git log --all --grep='<given-text>'
git log --oneline master..<branch-name> | tail -1
Alternatives:
git log --reverse master..<branch-name> | head -6
git blame <file-name>
git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s removed lines: %s total lines: %s
", add, subs, loc }' -
Alternatives:
git log --author='_Your_Name_Here_' --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s
", add, subs, loc }' - # on Mac OSX
git log --show-notes='*'
git log --branches --not --remotes
Alternatives:
git log @{u}..
git cherry -v
git diff --ignore-all-space | git apply --cached
git blame -L <start>,<end>
git var -l | <variable>
git rev-parse --show-toplevel
git log --since='FEB 1 2017' --until='FEB 14 2017'
git log --perl-regexp --author='^((?!excluded-author-regex).*)$'
git show
git reflog