HiveBrain v1.2.0
Get Started
← Back to all entries
snippetjavascriptTip

View Git commits by a certain author or committer

Submitted by: @import:30-seconds-of-code··
0
Viewed 0 times
committerviewauthorgitcertaincommits

Problem

When viewing the commit history of a Git repository, you might want to filter the commits by author or committer. As is often the case, Git has you covered.
When you're looking for commits made by a specific author, you can use git log --author=<author> to filter the commit history. Replace <author> with the name of the author you're interested in.
Similarly, to filter commits by a specific committer, you can use git log --committer=<committer>, replacing <committer> with the name of the committer you're interested in.

Solution

# Syntax: git log --author=<author>

git log --author="Duck Quacking"
# commit c191f90c7766ee6d5f24e90b552a6d446f0d02e4
# Author: 30 seconds of code
# Date: Tue Apr 6 11:11:08 2021 +0300
# [...]


Similarly, to filter commits by a specific committer, you can use git log --committer=<committer>, replacing <committer> with the name of the committer you're interested in.

Code Snippets

# Syntax: git log --author=<author>

git log --author="Duck Quacking"
# commit c191f90c7766ee6d5f24e90b552a6d446f0d02e4
# Author: 30 seconds of code
# Date: Tue Apr 6 11:11:08 2021 +0300
# [...]
# Syntax: git log --committer=<committer>

git log --committer="Duck Quacking"
# commit c191f90c7766ee6d5f24e90b552a6d446f0d02e4
# Author: 30 seconds of code
# Date: Tue Apr 6 11:11:08 2021 +0300
# [...]

Context

From 30-seconds-of-code: view-commits-by-author-or-committer

Revisions (0)

No revisions yet.