How to Search for Commits by Author or Message
In a hurry? Watch our brief 1-minute vertical video that summarizes the info below.
The git log command is a powerful tool for inspecting the history of a repository. But when the history is long, it can be hard to find what you're looking for.
Luckily, git log comes with a variety of options to filter the commit history!
The Git Cheat Sheet
No need to remember all those commands and parameters: get our popular "Git Cheat Sheet" - for free!
Searching by Commit Message
To search for commits that contain a specific word or phrase in their message, you can use the --grep flag:
$ git log --grep="fix bug"
By default, this search is case-sensitive. To make it case-insensitive, you can add the -i flag:
$ git log --grep="fix bug" -i
Searching by Author
You can also filter commits by author using the --author flag:
$ git log --author="John Doe"
Combining Filters
You can combine multiple filters to narrow down your search even further. For example, to find all commits by a specific author within a certain time frame, you can combine the --author and --since flags:
$ git log --author="John Doe" --since="2023-01-01"
No Command Line Needed
Searching Commits in Tower
In the Tower Git client, you can easily filter your commit history. A dedicated search bar allows you to filter by message, author, file path, commit hash, and date. Of course, you can also combine these filters to narrow down your search.
Download the Cheat SheetFree
Get 18 of our most popular Cheat Sheets in one handy ZIP!

Thanks! Please Check Your Inbox!
Want to win one of our awesome Tower shirts?
Tell your friends about the package!
