Search code examples
git

how to filter git-branch by author


How can I list branches filter by (last) author name?

For example, I want to get only main and mybranch by filtering "yukihane" from following repository.

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

      init

Solution

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