[git]Git log 输出格式化(转载)

转载于:https://havee.me/linux/2015-05/git-pretty-output.html

美化完的格式:

git log --graph --pretty=format:'%C(yellow)%h%Creset -%C(cyan)%d%Creset %s %Cgreen(%an, %cr)' --abbrev-commit

写入 ~/.gitconfig 中:
git config --global alias.ll "log --graph --pretty=format:'%C(yellow)%h%Creset -%C(cyan)%d%Creset %s %Cgreen(%an, %cr)' --abbrev-commit"

通过git ll查看,之前没有记录git log参数信息,这里记录下,免得后面再重新查找

参数说明
%Hcommit hash
%hcommit short hash
%Ttree hash
%ttree short hash
%Pparent hash
%pparent short hash
%an作者名字
%aN.mailmap 中对应的作者名字
%ae作者邮箱
%aE.mailmap 中对应的作者邮箱
%ad–date=制定的日期格式
%aDRFC2822 日期格式
%ar日期格式,例如:1 day ago
%atUNIX timestamp 日期格式
%aiISO 8601 日期格式
%cn提交者名字
%cN.mailmap 对应的提交的名字
%ce提交者邮箱
%cE.mailmap 对应的提交者的邮箱
%cd–data=制定的提交日期的格式
%cDRFC2822 提交日期的格式
%cr提交日期的格式,例如:1day ago
%ctUNIX timestamp 提交日期的格式
%ciISO 8601 提交日期的格式
%dref 名称
%eencoding
%scommit 信息标题
%f过滤 commit 信息的标题使之可以作为文件名
%bcommit 信息内容
%Ncommit notes
%gDreflog selector, e.g., refs/stash@{1}
%gdshortened reflog selector, e.g., stash@{1}
%gsreflog subject
%Cred切换至红色
%Cgreen切换至绿色
%Cblue切换至蓝色
%Creset重设颜色
%C(color)制定颜色,as described in color.branch.* config option
%mleft right or boundary mark
%n换行
%% araw %
%x00print a byte from a hex code
%w([[,[,]]])switch line wrapping, like the -w option of git-shortlog(1).
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值