如何按作者过滤 git-branch

how to filter git-branch by author

如何按(最后)作者姓名列出分支过滤器?

例如,我只想通过从以下存储库中过滤“yukihane”来获得 mainmybranch

* commit 9315faf698c4f733e96047ffe65a636330a4edc1 (origin/others, others)
| Author: other <other@example.com>
| Date:   Tue Apr 19 09:00:50 2022 +0900
|
|     others
|
| * commit c37b840649c71080eb0705e6800f359a22c1183a (HEAD -> mybranch, origin/mybranch)
|/  Author: yukihane <yukihane@example.com>
|   Date:   Tue Apr 19 08:54:02 2022 +0900
|
|       my commit
|
* commit f4e0a4721a066d1777eb7a21efdf0ede3874a4e0 (origin/main, main)
  Author: yukihane <yukihane@example.com>
  Date:   Tue Apr 19 08:53:30 2022 +0900

      init

[文档] [1] 的内容如下: [1]: https://git-scm.com/docs/git-log

按作者筛选:

--author= --committer= Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression). With more than one --author=, commits whose author matches any of the given patterns are chosen (similarly for multiple --committer=).

按分支过滤:

--branches[=] Pretend as if all the refs in refs/heads are listed on the command line as . If is given, limit branches to ones matching given shell glob. If pattern lacks ?, , or [, / at the end is implied.

其他资源:

  • 按作者筛选:How can I view a git log of just one user's commits?
  • 按分支筛选:Does git log --branches work?

虽然现在尝试了,但我在使 --branches 选项按预期工作时遇到了问题。上面的link^^^可能有帮助。

git log --branches --no-walk --author=yukihane