Filtering Git log based on author (Git)

In a busy repo, you sometimes want to filter to git log by commit author - whether to exclude commits from a prolific author, or to review all commits by a specific author.

This snippet tells git log to include or exclude by author

Details

  • Language: Git

Snippet

# Show only commits by author
git log --author="$AUTHOR"

# Exclude commits by author
git log --perl-regexp --author='^((?!AUTHOR).*)$'