如何在 Git 中查找特定用户的提交?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2954477/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 08:29:57  来源:igfitidea点击:

How to find commits by a specific user in Git?

gitversion-controlcommit

提问by user285020

Our project uses Git as the version control system and recently I needed to review someone's commits. How can I see a list of commits made by a specific user?

我们的项目使用 Git 作为版本控制系统,最近我需要某人的提交。如何查看特定用户所做的提交列表?

回答by Amber

git log --author=<pattern>will show the commit log filtered for a particular author. (--committercan be used for committer if the distinction is necessary).

git log --author=<pattern>将显示为特定作者过滤的提交日志。(--committer如果需要区分,可以用于提交者)。

http://git-scm.com/docs/git-log

http://git-scm.com/docs/git-log

回答by Cascabel

Try this:

尝试这个:

git log --author=<name or email>

or pass the same option to gitk, or if already in gitk, go to view > new view, and fill in the appropriate field. The name doesn't have to be exact; it's matched as a regex (a substring, in the trivial case) against the author field.

或者将相同的选项传递给gitk,或者如果已经在 gitk 中,请转到视图 > 新视图,然后填写相应的字段。名称不一定要准确;它作为正则表达式(一个子字符串,在平凡的情况下)与作者字段匹配。