git log --author=authorname

 

 --author=<pattern>, commits whose author matches any of the given patterns are chosen (similarly for multiple --committer=<pattern>).

 

它接受正则表达式,返回所有作者名字满足这个规则的提交。如果你知道那个作者的确切名字你可以直接传入文本字符串:

git log --author="John"

它会显示所有作者叫John的提交。作者名不一定是全匹配,只要包含那个子串就会匹配。

你也可以用正则表达式来创建更复杂的检索。比如,下面这个命令检索名叫Mary或John的作者的提交。

git log --author="John\|Mary"

注意作者的邮箱地址也算作是作者的名字,所以你也可以用这个选项来按邮箱检索。

如果你的工作流区分提交者和作者,--committer也能以相同的方式使用。

相关文章:

  • 2022-12-23
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-11-22
  • 2021-11-22
猜你喜欢
  • 2021-06-01
  • 2022-12-23
  • 2021-11-11
  • 2021-12-21
  • 2021-11-22
  • 2021-12-10
  • 2021-11-22
相关资源
相似解决方案