千家信息网

git log中有哪些format

发表于:2026-11-03 作者:千家信息网编辑
千家信息网最后更新 2026年11月03日,本篇内容主要讲解"git log中有哪些format",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"git log中有哪些format"吧!默认git lo
千家信息网最后更新 2026年11月03日git log中有哪些format

本篇内容主要讲解"git log中有哪些format",感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习"git log中有哪些format"吧!

默认git log 出来的格式并不是特别直观,很多时候想要更简便的输出更多或者更少的信息,这里列出几个git log的format。 可以根据自己的需要定制。

git log命令可一接受一个--pretty选项,来确定输出的格式.

比如 :

如果我们只想输出hash.

git log --pretty=format:"%h"

详细 命令 :

'%H': commit hash

'%h': abbreviated commit hash

'%T': tree hash

'%t': abbreviated tree hash

'%P': parent hashes

'%p': abbreviated parent hashes

'%an': author name

'%aN': author name (respecting .mailmap, see git-shortlog or git-blame)

'%ae': author email

'%aE': author email (respecting .mailmap, see git-shortlog or git-blame)

'%ad': author date (format respects --date= option)

'%aD': author date, RFC2822 style

'%ar': author date, relative

'%at': author date, UNIX timestamp

'%ai': author date, ISO 8601-like format

'%aI': author date, strict ISO 8601 format

'%cn': committer name

'%cN': committer name (respecting .mailmap, see git-shortlog or git-blame)

'%ce': committer email

'%cE': committer email (respecting .mailmap, see git-shortlog or git-blame)

'%cd': committer date (format respects --date= option)

'%cD': committer date, RFC2822 style

'%cr': committer date, relative

'%ct': committer date, UNIX timestamp

'%ci': committer date, ISO 8601-like format

'%cI': committer date, strict ISO 8601 format

'%d': ref names, like the --decorate option of git-log

'%D': ref names without the " (", ")" wrapping.

'%e': encoding

'%s': subject

'%f': sanitized subject line, suitable for a filename

'%b': body

'%B': raw body (unwrapped subject and body)

'%N': commit notes

'%GG': raw verification message from GPG for a signed commit

到此,相信大家对"git log中有哪些format"有了更深的了解,不妨来实际操作一番吧!这里是网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

输出 内容 命令 更多 格式 学习 实用 更深 简便 直观 信息 兴趣 实用性 实际 操作简单 方法 时候 朋友 网站 频道 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 互联网科技有限公司 互联网加科技 互联网科技工作委员会主任 互联网与科技金融数据 银优互联网科技有限公司 唐信互联网科技 大连 深圳天众互联网科技公司 互联网 新科技 互联网养老 桔豆科技 浙江互联网科技研学营 宝灵互联网科技有限公司 中国科技创新与世界互联网大会 伊宁互联网科技做什么的 产业互联网科技服务公司 本届互联网大会上的黑科技 求路客互联网科技电话 好易买互联网科技 绵阳真晨互联网科技有限公司 杭州融税互联网科技有限公司 宁波允成互联网科技有限公司 为想互联网科技怎么样 科技互联网的估值 茂名市互联网科技产业园 中化能源互联网科技招聘 杭州壁岐互联网科技有限公司 伍佰万互联网科技怎么赚钱 广州千川互联网科技有限公司 科技信息时代互联网发展 互联网的黑科技实验室 广州全民伙伴互联网科技有限公司
0