Git顯示漂亮日誌的小技巧
阿新 • • 發佈:2020-10-22
原文:http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html(牆)
Git的傳統log如下所示,你喜歡嗎?
看看下面這個你喜不喜歡?(點選圖片看大圖)
要做到這樣,命令列如下:
1 |
git log --graph --pretty=
format
:
'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
|
這樣有點長了,我們可以這樣:
1 |
git config --global
alias
.lg
"log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
|
然後,我們就可以使用這樣的短命令了:
1 |
git lg
|
如果你想看看git log –pretty=format的引數,你可以看看 這篇文章。
(全文完)
轉載於:https://my.oschina.net/dochong/blog/68300