查找特定文件的最频繁提交者 [英] Finding the most frequent committer to a specific file

查看:55
本文介绍了查找特定文件的最频繁提交者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给出git存储库中的特定文件,我将如何查找谁是该文件中最频繁的提交者?

Given a specific file in a git repository, how would I go about finding who are the most frequent committers in that file?

推荐答案

您可以使用 git shortlog 为此:

git shortlog -sn -- path/to/file

这将打印出该路径的作者列表,并按提交计数排序并加前缀.

This will print out a list of authors for the path, ordered and prefixed by the commit count.

通常,此命令用于快速获取更改摘要,例如生成变更日志.使用-s,将抑制更改摘要,仅保留作者姓名.并与-n配对,输出按提交计数排序.

Usually, this command is used to get a quick summary of changes, e.g. to generate a changelog. With -s, the change summaries are suppressed, leaving only the author names. And paired with -n, the output is sorted by the the commit count.

当然,除了文件的路径外,您还可以使用目录的路径来查看对该路径的提交.而且,如果您完全偏离了路径,那么git shortlog -sn会为您提供整个存储库的统计信息.

Of course, instead of the path to a file, you can also use a path to a directory to look at the commits to that path instead. And if you leave off the path completely, git shortlog -sn gives you statistics for the whole repository.

这篇关于查找特定文件的最频繁提交者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆