我想获取某个Git仓库的所有贡献者列表。对于每个贡献者,我还想打印出他们最早和最晚提交的时间戳。有没有一种使用git命令行提取这些信息的方法?
我想获取某个Git仓库的所有贡献者列表。对于每个贡献者,我还想打印出他们最早和最晚提交的时间戳。有没有一种使用git命令行提取这些信息的方法?
git log --pretty=format:"%ae %ai" | sort | awk 'contributor == $1 { lastContribution = $0 } contributor != $1 { contributor = $1; if (lastContribution) print lastContribution; print } END { print lastContribution }'
%a
替换为%c
。%an
替换%ae
。git shortlog -sn
而您可以使用输出通过以下方式获取有关每个作者的信息:
git log --author=<pattern>