美文网首页
【git】好用的git log

【git】好用的git log

作者: KKFantasy | 来源:发表于2016-09-23 18:26 被阅读0次

我们输入 git log 查看日志的时候是类似这样的:

一个比较屌的命令,输入

git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(blue)<%an>%Creset' --abbrev-commit --date=relative

然后日志这样了:

是不是比较清晰,整个分支的走向也很明确,但是每次都要输这么一大串是不是也很烦?这时候你就该想到 alias 啊:

git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"

参考文章:
从0开始学习 GITHUB 系列之「GIT 进阶」

相关文章

网友评论

      本文标题:【git】好用的git log

      本文链接:https://www.haomeiwen.com/subject/kintyttx.html