Skip to content

How do I get the creator of a file using the Github API? #24689

Discussion options

You must be logged in to vote

Hey @mkay581,

You can try:

GET /repos/:owner/:repo/commits

for example:

https://api.github.com/repos/atom/atom/commits

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 ORG and REPO variables 

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…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants