我刚刚克隆了Keras存储库,并对查看git日志感兴趣。我最初尝试使用一种漂亮的格式,并在最后4次提交时获得了以下结果:
me@ARL--M6800:~/Downloads/keras$ git log --pretty=format:"%cn %cd %h"
François Chollet Tue Jan 17 13:29:21 2017 -0800 55487f3
François Chollet Mon Jan 16 17:14:16 2017 -0800 1c6db08
François Chollet Mon Jan 16 10:05:35 2017 -0800 e54d795
François Chollet Sat Jan 14 21:33:04 2017 -0800 82ca6d4但是,当我没有格式化输出时,我得到了最后4次提交的结果:
commit 55487f33b135849cdda49bcc75778976d94a2575
Author: Javier Dehesa <javidcf@gmail.com>
Date: Tue Jan 17 21:29:21 2017 +0000
...
commit 1c6db0815853f7c5421b8057e9167f19b5b94812
Author: Petr Baudis <pasky@ucw.cz>
Date: Tue Jan 17 02:14:16 2017 +0100
...
commit e54d7951f2a82629c71c77ca842ba032b523fe84
Author: Pat York <pat.york@nevada.unr.edu>
Date: Mon Jan 16 10:05:35 2017 -0800
...
commit 82ca6d418588ccd61d663ec8029937290b62d583
Author: Mohanson <mohanson@outlook.com>
Date: Sun Jan 15 13:33:04 2017 +0800虽然散列匹配,但作者和提交日期不匹配。有人知道这是为什么吗?这意味着什么?
发布于 2017-01-19 14:52:22
你应该用
git log --pretty=format:"%an %ad %h"%cn给出提交者名称和作者名称%(显示在“普通”日志中)
在这篇文章中:
· %an: author name
· %aN: author name (respecting .mailmap, see git-shortlog(1) or git-blame(1))
· %ae: author email
· %aE: author email (respecting .mailmap, see git-shortlog(1) or git-blame(1))
· %ad: author date (format respects --date= option)与
· %cn: committer name
· %cN: committer name (respecting .mailmap, see git-shortlog(1) or git-blame(1))
· %ce: committer email
· %cE: committer email (respecting .mailmap, see git-shortlog(1) or git-blame(1))
· %cd: committer date (format respects --date= option)
· %cD: committer date, RFC2822 stylehttps://stackoverflow.com/questions/41729252
复制相似问题