Git log pretty

git log --pretty=format:'%H' -n 1
%H: commit hash
%h: 縮短的commit hash
%T: tree hash
%t: 縮短的 tree hash
%P: parent hashes
%p: 縮短的 parent hashes
%an: 作者名字
%aN: mailmap的作者名字 (.mailmap對(duì)應(yīng),詳情參照[git-shortlog(1)](http://linux.die.net/man/1/git-shortlog)或者[git-blame(1)](http://linux.die.net/man/1/git-blame))
%ae: 作者郵箱
%aE: 作者郵箱 (.mailmap對(duì)應(yīng),詳情參照[git-shortlog(1)](http://linux.die.net/man/1/git-shortlog)或者[git-blame(1)](http://linux.die.net/man/1/git-blame))
%ad: 日期 (--date= 制定的格式)
%aD: 日期, RFC2822格式
%ar: 日期, 相對(duì)格式(1 day ago)
%at: 日期, UNIX timestamp
%ai: 日期, ISO 8601 格式
%cn: 提交者名字
%cN: 提交者名字 (.mailmap對(duì)應(yīng),詳情參照[git-shortlog(1)](http://linux.die.net/man/1/git-shortlog)或者[git-blame(1)](http://linux.die.net/man/1/git-blame))
%ce: 提交者 email
%cE: 提交者 email (.mailmap對(duì)應(yīng),詳情參照[git-shortlog(1)](http://linux.die.net/man/1/git-shortlog)或者[git-blame(1)](http://linux.die.net/man/1/git-blame))
%cd: 提交日期 (--date= 制定的格式)
%cD: 提交日期, RFC2822格式
%cr: 提交日期, 相對(duì)格式(1 day ago)
%ct: 提交日期, UNIX timestamp
%ci: 提交日期, ISO 8601 格式
%d: ref名稱
%e: encoding
%s: commit信息標(biāo)題
%f: sanitized subject line, suitable for a filename
%b: commit信息內(nèi)容
%N: commit notes
%gD: reflog selector, e.g., refs/stash@{1}
%gd: shortened reflog selector, e.g., stash@{1}
%gs: reflog subject
%Cred: 切換到紅色
%Cgreen: 切換到綠色
%Cblue: 切換到藍(lán)色
%Creset: 重設(shè)顏色
%C(...): 制定顏色, 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).
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容