陈皓:Git显示漂亮日志的小技巧

来源:互联网 发布:java中decode什么意思 编辑:程序博客网 时间:2024/04/30 02:46

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

(全文完)

(转载本站文章请注明作者和出处 酷壳 – CoolShell.cn ,请勿用于任何商业用途)


原创粉丝点击