Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

Get all commit sha's using github API calls

So let's say I need to get some statistical analysis done on all the changes induced to a file through commits from various committers.

 

I have with me the blob link.

 

Eg. 

https://github.com/Neoo1984/WEB-NEW/blob/d2542fce6c9c3ae35ba316636812c9d0d7ad9473/0-index-WEB.html

 

Now suppose I wanted to see all the version histories of the files I can just.

 

https://github.com/Neoo1984/WEB-NEW/commits/d2542fce6c9c3ae35ba316636812c9d0d7ad9473/0-index-WEB.htm...

 

However, I want this data to be easily machine parsable.

 

There seems to be no equivalent API call. Best I could get was:

 

https://api.github.com/repos/Neoo1984/WEB-NEW/commits/d2542fce6c9c3ae35ba316636812c9d0d7ad9473

 

But I want the hashess of all the previous changes to a SINGLE file. Not all changes for the specific commit.

 

Is this even possible??

1 Reply
Community Manager
Message 2 of 2

Re: Get all commit sha's using github API calls

Hi @XChikuX,

 

Thank you for being here! The Repo Commits API supports listing, viewing, and comparing commits in a repository. For more information. I believe you'd be able to accomplish your goal using the SHA parameter.

 

I hope this helps!

Best,

Andrea

Thanks for being here, sharing, and keeping our community awesome!
Best,
AndreaG

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!