我在.gitconfig
中有以下内容:
[format]
pretty = %C(yellow)%h%Cred%d%Creset - %C(cyan)%an %Creset: %s %Cgreen(%cr)
这将使
git log
的输出看起来像这样(加上一些漂亮的颜色):6b1d043 (origin/master) - Ismail Badawi : Don't redirect to index after saving query. (28 hours ago)
df98a3e - Ismail Badawi : Store example queries in database & cache results (30 hours ago)
6de44ab - Ismail Badawi : Add sanity check tests for different pages. (31 hours ago)
7b6b46b - Ismail Badawi : Save query results for saved queries. (31 hours ago)
我认为这种格式易于浏览。但我不喜欢它也影响了
git show
;特别是,我希望在git show
的输出中能够看到完整的提交信息,而不仅仅是标题行;还有实际日期,而不是相对日期,作者电子邮件等。是否有办法为
git log
和git show
使用不同的默认格式?