git log format

it2022-05-05  91

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

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

比如 :

如果我们只想输出hash.

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

详细 命令 :

%H: commit hash%h: 缩短的commit hash%T: tree hash%t: 缩短的 tree hash%P: parent hashes%p: 缩短的 parent hashes%an: 作者名字%aN: mailmap的作者名字 (.mailmap对应,详情参照git-shortlog(1)或者git-blame(1))
转载请注明原文地址: https://win8.8miu.com/read-15792.html

最新回复(0)