我需要的日期和格式提交一套github上的结果:如何使git日志输出只显示日期和散列在一行上?
Date Commit
19 Mar 2015 b6959eafe0df6031485509c539e22eaf2780919c
1 Apr 2015 9a1f13339cc7d43930440c2350ea3060b72c8503
1 Apr 2015 1e76036421ca4d72c371182fc494af514911b099
我能够得到这个命令的日期:
git log | grep Date: | awk '{print $4 " " $3 " " $6}'
与
提交git log | grep commit | awk '{print $2}'
如何组合这些命令,以便将两个结果打印在同一行中?
这里是git的日志的例子:
commit 1e76036421ca4d72c371182fc494af514911b099
Author: xxxx
Date: Wed Apr 1 17:35:36 2015 +0200
First web app commit
First web app commit
commit 9a1f13339cc7d43930440c2350ea3060b72c8503
Author: xxxx
Date: Wed Apr 1 17:28:42 2015 +0200
change from app to website
commit b6959eafe0df6031485509c539e22eaf2780919c
Author: xxx
Date: Thu Mar 19 18:58:33 2015 +0100
First remote commit: hello world
scheleton of the project now available
commit a41d419de46a59e72dbc52e5f39c9d8a8a9af72a
Author: xxxx
Date: Thu Mar 19 17:31:16 2015 +0100
Initial commit
谢谢!最后的建议完美地工作。 git log --date = short --pretty = format:“%ad%H” – Botacco