Powerful Python utility for automating comprehensive GitHub backups
Downloads your repositories and gists as ZIP archives with parallel processing for speed and detailed reporting for insight.
github-repos-downloader — a powerful Python utility for automating comprehensive backups of your GitHub repositories and gists. This tool downloads your code as .zip archives for safe keeping, with parallel processing for speed and detailed reporting for insight.
.zip archives in a single operationPrerequisites: Python 3.7+, curl command-line tool, GitHub Personal Access Token
Installation:
git clone https://github.com/aixandrolab/github-repos-downloader.git cd github-repos-downloader
Configure Token:
1. Go to GitHub Settings → Developer settings → Personal access tokens
2. Generate token with repo and gist scopes
3. Save token:
python app.py -t
Basic Usage:
| Command | Action |
|---|---|
python app.py -r | Download all your repositories |
python app.py -g | Download all your gists |
python app.py -r -g | Download both repositories and gists |
python app.py -r --verbose | Download repos with detailed output |
python app.py -r --timeout 120 | Download with 2-minute timeout per request |
python app.py -r --shutdown | Download repos and shutdown when done |
What Gets Backed Up?
The tool creates snapshot .zip archives of your code at a specific point in time (does not include full Git history).
[repository-name].zip in the repositories/ folder[gist-id].zip in the gists/ folderWhere Are Files Saved?
~/[your_github_username]_github_downloads/
├── repositories/
│ ├── project-one.zip
│ └── project-two.zip
├── gists/
│ ├── a1b2c3d4.zip
│ └── e5f6g7h8.zip
└── reports/
└── backup_report_20251215_143022.txt
Post-Backup Archiving: By default, the entire folder is compressed into a single .zip. Use --no-archive to skip.
| Argument | Description | Default |
|---|---|---|
-r, --repos | Download your repositories | False |
-g, --gists | Download your gists | False |
-t, --token | Update or set your stored GitHub token | False |
--no-archive | Do not create a final ZIP archive of the backup folder | False |
--timeout N | Set the timeout for each download operation | 30 |
--verbose | Print detailed real-time information | False |
--shutdown | Shutdown the computer 60 seconds after finish | False |
--reboot | Reboot the computer 60 seconds after finish | False |
Note: --shutdown and --reboot are mutually exclusive.
Optimizing Download Speed:
--timeout 120Handling API Rate Limits:
max_workers parameter if needed| Problem | Likely Cause | Solution |
|---|---|---|
| Failed to authenticate | Token invalid, expired, or lacks scopes | Run python app.py -t to update token |
| Download timeout | Network slow or repository large | Re-run with --timeout 120 |
| Some items fail to download | Repository renamed, deleted, or forked | Check report for failures — retries up to 3 times |
| "curl" command not found | curl not installed on system | Install curl: apt install curl (Ubuntu) |
~/.config/github_repos_downloader/github_token.jsonBy using this software, you agree to the full disclaimer terms.
Software provided "AS IS" without warranty. You assume all risks.
Full legal disclaimer: See DISCLAIMER.md
License: BSD 3-Clause License