Programming

GitHub - List commits by author

25 September 2026 · 8 min read

GitHub - List commits by author

Managing code repositories effectively often involves tracking contributions from various team members. Understanding who committed what and when is crucial for code review, debugging, and overall project management. If you’re using GitHub, a powerful platform for version control and collaboration, you’ll frequently need to list commits by author. This process allows you to filter commits based on the individual who made them, giving you insights into their specific contributions and activities within the repository. Mastering this skill can significantly improve your workflow and collaboration efficiency on GitHub projects of any size. This article dives into multiple methods for achieving this, from using the command line to leveraging GitHub’s web interface and APIs.

Using the Command Line to List Commits by Author

The command line interface (CLI) offers a robust and flexible way to interact with Git repositories, including those hosted on GitHub. Using the git log command with specific parameters, you can easily list commits by author. This method is particularly useful for developers comfortable with the terminal and those who need to automate commit listing as part of their workflows. The command line provides a granular level of control, allowing you to specify date ranges, commit message patterns, and other criteria to refine your search.

To list commits by author via the command line, you can use the following command: git log --author="Author Name". Replace “Author Name” with the actual name of the author you want to filter by. For example, git log --author="John Doe" will display all commits made by John Doe. You can also use regular expressions for more complex searches. For example, git log --author="Doe" will list commits made by anyone with “Doe” in their name. Furthermore, you can combine this with other git log options to filter by date (--since, --until), commit message (--grep), or branch (branch_name).

Beyond basic filtering, the command line allows for customized output formatting. You can use the --pretty option to control how the commit information is displayed. For example, git log --author="John Doe" --pretty=format:"%h - %an, %ar : %s" will show the commit hash, author name, relative date, and commit message in a concise format. Experimenting with different --pretty formats can help you tailor the output to your specific needs. According to Atlassian’s Git tutorial, “The git log command is one of the most powerful tools in the Git arsenal,” underscoring its importance for repository management [^1^].

Leveraging GitHub’s Web Interface

GitHub’s web interface provides a user-friendly way to list commits by author without needing to use the command line. This is especially convenient for those who prefer a visual interface or who are less familiar with Git commands. The web interface allows you to quickly browse commit history and filter by author, making it easy to identify specific contributions within a repository.

To list commits by author on GitHub’s web interface, navigate to the repository’s “Commits” tab. This tab typically displays a list of all commits made to the repository. In the search bar, you can type author:username, replacing “username” with the GitHub username of the author you want to filter by. For example, author:octocat will display all commits made by the user “octocat”. This method provides a simple and direct way to narrow down the commit list.

The GitHub web interface also allows you to combine author filtering with other search criteria. You can search for commits that contain specific keywords in the commit message alongside filtering by author. This feature can be incredibly useful when trying to locate specific changes made by a particular author within a larger codebase. Remember that the search is case-insensitive, so “author:Octocat” will work just as well as “author:octocat”. GitHub’s search functionality provides a powerful way to explore the commit history, as mentioned in GitHub’s official documentation [^2^].

Using the GitHub API

For more advanced use cases, such as automating commit analysis or integrating commit data into other applications, the GitHub API provides a programmatic way to list commits by author. The API allows you to retrieve commit information in a structured format (typically JSON), which can then be easily processed and analyzed. This approach is particularly useful for building custom dashboards, generating reports, or creating tools that analyze commit patterns.

To use the GitHub API to list commits by author, you’ll need to make a request to the appropriate endpoint. The primary endpoint for retrieving commits is /repos/:owner/:repo/commits. You can filter by author by including the author parameter in your request. For example, to retrieve commits made by a specific email address, you would use a URL like this: https://api.github.com/repos/owner/repo/commits?author=email@example.com. Remember to replace “owner” and “repo” with the actual owner and repository name, respectively. You might need to authenticate to avoid rate limiting. You can find detailed instructions on how to authenticate in the GitHub API documentation [^3^].

When using the GitHub API, it’s important to handle pagination. The API typically returns results in pages, so you’ll need to iterate through the pages to retrieve all commits. The response headers will include links to the next, previous, first, and last pages. Proper error handling is also crucial, as the API may return errors for various reasons, such as invalid parameters or rate limits. The GitHub API provides a powerful and flexible way to access commit data, enabling you to build sophisticated tools and integrations. The benefits of using APIs for developers are significant, increasing efficiency and streamlining various software development tasks.

Advanced Techniques and Considerations

Beyond the basic methods, several advanced techniques and considerations can further refine your ability to list commits by author. These include using aliases for frequently used commands, understanding the implications of different author identities, and leveraging third-party tools for enhanced analysis.

One useful technique is to create Git aliases for frequently used git log commands. For example, you can create an alias called “authorlog” that automatically filters by author: git config --global alias.authorlog 'log --author="$1"'. Then, you can simply use git authorlog "Author Name" to list commits by author. This can save you time and effort, especially if you frequently need to filter commits.

When working with multiple contributors, it’s important to be aware of potential variations in author identities. Some developers may use different email addresses or names when committing code. This can make it challenging to accurately list commits by author. To address this, you may need to consolidate author identities using Git’s .mailmap file or by manually correcting author information. Additionally, various third-party tools can help you analyze commit history and identify potential inconsistencies in author identities. These tools often provide advanced filtering and reporting capabilities, making it easier to gain insights into team contributions. Here are some considerations to keep in mind:

  • Use aliases for frequently used commands to save time.
  • Consolidate author identities for accurate reporting.

Here’s a step-by-step guide to setting up a Git alias:

  1. Open your terminal.
  2. Type git config --global alias.authorlog 'log --author="$1"' and press Enter.
  3. Now, you can use git authorlog "Author Name" to view commits by the specified author.

These advanced strategies significantly improve the efficiency and accuracy of tracking contributions. They offer insights for better project management and code review.

Infographic here
This paragraph is optimized as a featured snippet. To **list commits by author** on GitHub, use the command `git log --author="Author Name"` in your terminal. Replace "Author Name" with the name of the author you want to filter by. This command will display all commits made by that specific author in the repository. Using this simple command helps you track individual contributions and manage code effectively.

FAQ

How do I list commits by author and date range?
You can combine the `--author`, `--since`, and `--until` options with the `git log` command. For example: `git log --author="John Doe" --since="2023-01-01" --until="2023-12-31"`.
Can I list commits by author using a partial name?
Yes, you can use regular expressions in the `--author` option. For example: `git log --author="Doe"` will list commits by anyone with "Doe" in their name.
How can I view the commit history of a specific file by author?
You can add the file path to the `git log` command. For example: `git log --author="John Doe" path/to/file.txt`.
Hopefully, this comprehensive guide has equipped you with the knowledge to effectively **list commits by author** using the command line, GitHub's web interface, and the GitHub API. By mastering these techniques, you can gain valuable insights into team contributions, streamline code review processes, and improve overall project management. Remember to practice these methods and explore the various options available to tailor your approach to your specific needs. This ensures you are always on top of who is contributing what to your projects.

Now that you understand how to list commits by author, consider exploring other Git commands and GitHub features to further enhance your workflow. Understanding branching strategies or contribution workflows can be immensely beneficial. If you’re looking to deepen your understanding of Git and GitHub, consider exploring resources like advanced Git branching techniques. Happy coding!

[^1^]: Atlassian Git Tutorial: https://www.atlassian.com/git/tutorials/using-branches

[^2^]: GitHub Search Documentation: https://docs.github.com/en/search-github

[^3^]: GitHub API Documentation: https://docs.github.com/en/rest

Question & Answer :
Is there any way on GitHub to list all commits made by a single author, in the browser (neither locally, e.g. via git log, nor via the API)?

Clicking on a user name in the list of commits (Commit History) simply leads to that user’s profile page. Examining the GitHub UI and searching (Google, StackOverflow) does not reveal a way to do this.

If the author has a GitHub account, just click the author’s username from anywhere in the commit history, and the commits you can see will be filtered down to those by that author:

Screenshot showing where to click to filter down commits

You can also click the ’n commits’ link below their name on the repo’s “contributors” page:

Another screenshot

Alternatively, you can directly append ?author=<theusername> or ?author=<emailaddress> to the URL. For example, https://github.com/jquery/jquery/commits/master?author=dmethvin or https://github.com/jquery/jquery/commits/[email protected] both give me:

Screenshot with only Dave Methvin’s commits

For authors without a GitHub account, only filtering by email address will work, and you will need to manually add ?author=<emailaddress> to the URL - the author’s name will not be clickable from the commits list.


You can also get the list of commits by a particular author from the command line using

git log --author=[your git name] 

Example:

git log --author=Prem