I would like to use the GitHub API to get commit information for files in the repository.
If you specify the following, you will get commit information for the entire repository.
requests.get(f"https://api.github.com/repos/ {OWNER}/{REPO}/commits")
For example, if there is a way to retrieve the commit list in the specified files in the repository as follows, please let me know.
https://api.github.com/repos/ {OWNER}/{REPO}/{FILE}/commits
The English version had almost the same questions and answers.
Is it possible to get commits history for one file ingithub api?- Stack Overflow
You can specify it in the following format:
http://api.github.com/repos/:owner/:repo/commits?path=PATH_TO_FILE
Example:
https://api.github.com/repos/izuzak/pmrpc/commits?path=README.markdown
The detailed documentation is as follows:
http://developer.github.com/v3/repos/commits/ #list-commits-on-a-repository
© 2024 OneMinuteCode. All rights reserved.