您的位置:首页 > 其它

Git显示漂亮日志的小技巧

2012-06-24 23:29 931 查看
原文:http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html (墙)
Git的传统log如下所示,你喜欢吗?


看看下面这个你喜不喜欢?(点击图片看大图)

要做到这样,命令行如下:
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --
这样有点长了,我们可以这样:
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 --"
然后,我们就可以使用这样的短命令了:
git lg
如果你想看看git log –pretty=format的参数,你可以看看这篇文章
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: