我是靠谱客的博主 幽默巨人,最近开发中收集的这篇文章主要介绍[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, %cd)' --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).

转载于:https://www.cnblogs.com/xueweihan/p/5743368.html

最后

以上就是幽默巨人为你收集整理的[git]Git log 输出格式化(转载)的全部内容,希望文章能够帮你解决[git]Git log 输出格式化(转载)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(83)

评论列表共有 0 条评论

立即
投稿
返回
顶部