Hello! I am using the [Repo Commits API](http://The%20Repo Commits API) to get a list of commits. How do I find out the github user who first committed the file (the creator)? Thanks in advance!
This API supports the same qualifiers as GitHub.com. To learn more about the format of the query, we recommend checking out these guides:
If it helps, we also expose an API for searching commits:
That endpoint has an author email and committer email qualifier that might be helpful:
Thanks for the information and this is slightly helpful but still doesn’t answer my question. How would I find the creator of a file by using the Search API to search commits? Or am I missing something?
You can try:
Whereas, the first committer is Lee Dohm.
Or, on GitHub enterprise:
Use the Commits API to list committer information for the first commit.
Be sure to adjust the
curl -u LOGIN:TOKEN https://HOSTNAME/api/v3/repos/ORG/REPO/commits | jq '[last(.)] | . | .committer.login, .committer.html_url'
For example, using
SuperDevs/RepoForTestOne it would be:
curl -u LOGIN:TOKEN https://HOSTNAME/api/v3/repos/SuperDevs/RepoForTestOne/commits | jq '[last(.)] | . | .committer.login, .committer.html_url'
testone <------------- The login of the user who made the first commit on the repository.