Check commit authorship in GitHub using detailed steps via the web UI, Git commands, and API. Uncover authors and committers for every code change.
Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
Step 1: Access the GitHub Repository
First, open your web browser and navigate to the GitHub repository where you want to check commit authorship. Ensure you are signed in to your GitHub account if the repository is private.
Step 2: Open the Commits History
Click on the “Commits” link, typically found above the list of files in the default branch (e.g., main or master). It may look like this:
https://github.com/your-username/your-repo/commits/main
This page displays the full history of commits made to the default branch.
Step 3: Identify the Commit of Interest
Scroll through the list or use the search bar (press “t” to open file finder, or browser search) to locate the specific commit. Each entry shows:
f3a1b2c
).Click on the commit message or the commit hash to view detailed information.
Step 4: View Commit Details in GitHub UI
On the commit detail page, you’ll see two main sections for authorship:
GitHub displays both author and committer by username and avatar, for example:
Author: JaneDoe [[email protected]](mailto:[email protected])
Committer: JohnSmith [[email protected]](mailto:[email protected])
If author and committer are the same, GitHub will show only one combined entry.
Step 5: Check Commit Authorship Locally Using Git
If you have a local clone of the repository, open your terminal or Git Bash and navigate into the project folder:
cd path/to/your-repo
Run the following command to display detailed commit information:
git log --pretty=fuller
You’ll see output like this:
commit f3a1b2c4d5e6f7g8h9i0j
Author: Jane Doe [[email protected]](mailto:[email protected])
AuthorDate: Tue Feb 20 10:15:00 2024 -0500
Commit: John Smith [[email protected]](mailto:[email protected])
CommitDate: Tue Feb 20 11:00:00 2024 -0500
Fix typo in README.md
Here, Jane Doe is the author and John Smith is the committer.
Step 6: Use Git Blame to Find Line-Level Authorship
To see who last modified each line in a file, use the git blame
command:
git blame README.md
This shows each line prefixed by the commit hash, author, and date:
f3a1b2c4 (Jane Doe 2024-02-20 10:15:00 -0500) # Project Title
a7b8c9d0 (John Smith 2024-01-15 09:00:00 -0500) A short description of the project.
Step 7: Compare Author vs Committer Roles
git commit --author="Name "
or by configuring user.name
and user.email
in Git global or local config.To set a specific author when committing locally:
git commit --author="Alice Example [[email protected]](mailto:[email protected])" -m "Add feature X"
Step 8: Use the GitHub API to Retrieve Commit Authorship
For automation or scripts, use the GitHub REST API. Send a GET request to:
https://api.github.com/repos/your-username/your-repo/commits/f3a1b2c4d5e6f7g8h9i0j
You will receive a JSON response containing both author and committer objects:
{
"author": {
"login": "janedoe",
"id": 123456,
"email": "[email protected]"
},
"committer": {
"login": "johnsmith",
"id": 789012,
"email": "[email protected]"
},
...
}
Step 9: Troubleshoot Common Authorship Issues
user.name
and user.email
are set:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Step 10: Summary
By following these steps, you can confidently check who authored and who committed each change in a GitHub repository—both through the GitHub web interface and your local Git environment, as well as via automated API requests. This ensures transparency and accountability in collaborative projects.
When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.