I want to find the number of commits done to specific github projects, and within them to specific files. I checked the github api docs but only found an API for actually returning all commits. This would be very inefficient since I have to do multiple api calls for paging thru all commits.
Anyone has a better idea?
The answer: Commited Commited has over 3,000,000 commits, making it the GitHub, most repo commits, world record holder!
1 accepted. Hi @Diliup-G , We don't have a limit on the number of commits per repository.
Update May 2013: see "File CRUD and repository statistics now available in the API"
You now can Get the last year of commit activity data
GET /repos/:owner/:repo/stats/commit_activity
Returns the last year of commit activity grouped by week. The days array is a group of commits per day, starting on Sunday.
Not completely what you are looking for, but closer.
Original answer (April 2010)
No, the current API doesn't support a 'log --all
' for listing all commmits from all branches.
The only alternative is presented in "Github API: Retrieve all commits for all branches for a repo", and list through all pages of all commits, branch after branch.
This seems so cumbersome than another alternative would actually to clone the Github repo and apply git commands on that local clone!
(mainly git shortlog
)
Note: you can also checkout that python script created by Arcsector.
With GraphQL API v4, you can get total commit count per branch with totalCount
for each branch:
{
repository(owner: "google", name: "gson") {
name
refs(first: 100, refPrefix: "refs/heads/") {
edges {
node {
name
target {
... on Commit {
id
history(first: 0) {
totalCount
}
}
}
}
}
}
}
}
Test it in the explorer
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With