https://github.com/scriptogre/get-forks-with-commits-ahead
A script that retrieves the forks of a GitHub repository and determines the number of commits ahead of the base repository. The script uses the GitHub API to retrieve the forks and their commit history. The script also saves progress to a JSON file to allow for resuming the script if it is interrupted.
https://github.com/scriptogre/get-forks-with-commits-ahead
Last synced: 4 days ago
JSON representation
A script that retrieves the forks of a GitHub repository and determines the number of commits ahead of the base repository. The script uses the GitHub API to retrieve the forks and their commit history. The script also saves progress to a JSON file to allow for resuming the script if it is interrupted.
- Host: GitHub
- URL: https://github.com/scriptogre/get-forks-with-commits-ahead
- Owner: scriptogre
- Created: 2023-04-14T16:05:11.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-14T16:09:04.000Z (about 3 years ago)
- Last Synced: 2026-04-01T05:53:22.962Z (3 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Forks Commit Comparison
This script fetches forks of a GitHub repository and checks which forks have commits ahead of the base repository. The results are saved in a JSON file for further analysis.
## Requirements
- Python 3.7 or higher
- `requests` library
To install the `requests` library, run:
```bash
pip install requests
```
## Usage
1. Update the `.env` file with your GITHUB_TOKEN (your GitHub personal access token), GITHUB_OWNER & GITHUB_REPO (username of target repository's owner and repository's name) and PROGRESS_FILENAME (the name of the file to keep track of progress).
2. Run the script:
```bash
python forks_commit_comparison.py
```
3. The script will analyze the forks and save the results in a JSON file named `progress.json`. This file contains forks with commits ahead of the base repository and the number of commits ahead for each fork.
## Note
Please be aware of the GitHub API rate limits. Unauthenticated requests are limited to 60 requests per hour, and authenticated requests are limited to 5000 requests per hour. This script uses authenticated requests. If you reach your rate limit, the script will error out. You will then need to resume after the rate limit reset time.
## License
This project is licensed under the MIT License.