1. 語法
git log --pretty=format:"arg"
2. 說明
%H 提交對象(commit)的完整哈希字串
%h 提交對象的簡短哈希字串
%T 樹對象(tree)的完整哈希字串
%t 樹對象的簡短哈希字串
%P 父對象(parent)的完整哈希字串
%p 父對象的簡短哈希字串
%an 作者(author)的名字
%ae 作者的電子郵件地址
%ad 作者修訂日期(可以用-date= 選項定製格式)
%ar 作者修訂日期,按多久以前的方式顯示
%cn 提交者(committer)的名字
%ce 提交者的電子郵件地址
%cd 提交日期
%cr 提交日期,按多久以前的方式顯示
%s 提交說明
3. 常用舉例
顯示最近70條按照作者排序
git log --format="%h %an %s" | grep -v 'Merge' | head -n 70 |sort -k 2
顯示自己最近70條提交內容
git log --format="%h:%s" --author={your name} | grep -v 'Merge' | head -n 70
轉載自: https://my.oschina.net/guoenzhou/blog/3042931