[git]Git log 输出格式化(转载)
2023-02-18 16:47:23 时间
美化完的格式:
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
参数信息,这里记录下,免得后面再重新查找
参数 | 说明 |
---|---|
%H | commit hash |
%h | commit short hash |
%T | tree hash |
%t | tree short hash |
%P | parent hash |
%p | parent short hash |
%an | 作者名字 |
%aN | .mailmap 中对应的作者名字 |
%ae | 作者邮箱 |
%aE | .mailmap 中对应的作者邮箱 |
%ad | –date=制定的日期格式 |
%aD | RFC2822 日期格式 |
%ar | 日期格式,例如:1 day ago |
%at | UNIX timestamp 日期格式 |
%ai | ISO 8601 日期格式 |
%cn | 提交者名字 |
%cN | .mailmap 对应的提交的名字 |
%ce | 提交者邮箱 |
%cE | .mailmap 对应的提交者的邮箱 |
%cd | –data=制定的提交日期的格式 |
%cD | RFC2822 提交日期的格式 |
%cr | 提交日期的格式,例如:1day ago |
%ct | UNIX timestamp 提交日期的格式 |
%ci | ISO 8601 提交日期的格式 |
%d | ref 名称 |
%e | encoding |
%s | commit 信息标题 |
%f | 过滤 commit 信息的标题使之可以作为文件名 |
%b | commit 信息内容 |
%N | commit notes |
%gD | reflog selector, e.g., refs/stash@ |
%gd | shortened reflog selector, e.g., stash@ |
%gs | reflog subject |
%Cred | 切换至红色 |
%Cgreen | 切换至绿色 |
%Cblue | 切换至蓝色 |
%Creset | 重设颜色 |
%C(color) | 制定颜色,as described in color.branch.* config option |
%m | left right or boundary mark |
%n | 换行 |
%% a | raw % |
%x00 | print a byte from a hex code |
%w([[,[,]]]) | switch line wrapping, like the -w option of git-shortlog(1). |
相关文章
- GitlabRunner+K8S 实现自动化发布
- C/C++ Qt StandardItemModel 数据模型应用
- GIT分布式版本控制系统 | 命令讲解入门
- Linux自动挂载 (autofs)
- Linux 计划任务
- NFS (网络文件系统) | CentOS7 升级系统和内核 | Linux man 命令汉化
- Linux快捷键 | 破解密码 | 正则 | 永久行号显示
- Linux权限管理
- Linux用户账号管理
- Linux逻辑分区| 扩容 | 挂载
- Jgit的使用笔记
- 利用Github Action实现Tornadofx/JavaFx打包
- Linux基础命令
- Linux 基础篇 vim | 网卡
- Linux网络管理 | 三种模式
- Linux打包 | 压缩
- Linux进程管理
- Linux防火墙 | 服务管理
- Linux基础篇
- Linux vim | vi 的使用