转自:酷壳 – CoolShell.cn 

原文:http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html (墙)

Git的传统log如下所示,你喜欢吗?

Git显示漂亮日志的小技巧

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

Git显示漂亮日志的小技巧

要做到这样,命令行如下:

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

相关文章:

  • 2022-02-15
  • 2022-02-07
  • 2022-12-23
  • 2021-09-30
  • 2022-01-12
  • 2021-06-04
  • 2022-12-23
猜你喜欢
  • 2021-12-01
  • 2021-10-01
  • 2022-12-23
  • 2021-05-11
  • 2021-09-14
  • 2022-01-22
相关资源
相似解决方案