更漂亮的日誌

要在更漂亮的圖形結構中檢視日誌,請使用:

git log --decorate --oneline --graph

樣本輸出:

* e0c1cea (HEAD -> maint, tag: v2.9.3, origin/maint) Git 2.9.3
*   9b601ea Merge branch 'jk/difftool-in-subdir' into maint
|\  
| * 32b8c58 difftool: use Git::* functions instead of passing around state
| * 98f917e difftool: avoid $GIT_DIR and $GIT_WORK_TREE
| * 9ec26e7 difftool: fix argument handling in subdirs
* |   f4fd627 Merge branch 'jk/reset-ident-time-per-commit' into maint
...

由於它是一個非常大的命令,你可以分配一個別名:

git config --global alias.lol "log --decorate --oneline --graph"

要使用別名版本:

# history of current branch :
git lol

# combined history of active branch (HEAD), develop and origin/master branches :
git lol HEAD develop origin/master

# combined history of everything in your repo :
git lol --all