1. 程式人生 > 實用技巧 >Git顯示漂亮日誌的小技巧

Git顯示漂亮日誌的小技巧

2019獨角獸企業重金招聘Python工程師標準>>> hot3.png

轉自:酷殼 – CoolShell.cn

原文: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