Open rogerxu opened 6 years ago
shortlog
Git - git-shortlog Documentation
Show sorted list by number of commits for each author in all branches.
$ git shortlog -n -s -e --all
-n
- --numbered
-s
- --summary
-e
- --email
Show what changed for one week.
$ git log --no-merges --raw --since='1 week ago'
--no-merges
- Do not print commits with more than one parent.--raw
- For each commit, show a summary of changes using the raw diff format.Show graph log with 10 commits.
$ git log --graph --decorate --oneline --all -10
Alias
$ git config --global alias.lg "log --graph --decorate --oneline --all --color=always"
$ git config --global alias.lg "log --graph --decorate --all --pretty=format:'%C(auto)%h%d %Creset%s %C(green)(%cr) %C(blue)<%cn>' --color=always"
$ git config --global alias.ls "log --pretty=format:'%C(yellow)%h %C(green)%ci%C(auto)%d %Creset%s %C(blue)<%cn>'"
$ git config --global alias.ll "log --pretty=format:'%C(yellow)%h %C(green)%ci%C(auto)%d %Creset%s %C(blue)<%cn>' --numstat"
$ git lg -10
Auto refresh in every 2 seconds
$ watch --color git lg -10
$ git log --oneline
$ git log --abbrev-commit --pretty=oneline
$ git log --graph --decorate --all --pretty=format:'%C(auto)%h%d %Creset%s %C(green)(%cr) %C(blue)<%cn>' --color=always
%h
- abbreviated commit hash%d
- ref names, like the --decorate
option%s
- subject%cn
- committer name%cr
- committer date, relativegit log --after="2020-05-20" --before="2020-10-08"
git log --after="yesterday"
git log --after="today"
git log --after="2 week ago"
git log --author="roger"
Search with case insensitive
git log -i --grep="fix-123"
git log -i --grep="fix-123\|fix-456"
git log file.js
git log -i -S"function foo()"
Show diff content
git log -p
Show diff commits
git log master..develop
Git - git-log Documentation
Ten Useful Git Log Tricks | Hacker Noon