Professional solution for automatic cloning and backup of all your GitHub repositories
Full backup of public and private repositories, smart updates, automatic retries, and detailed reports.
github-repos-backup-tools — a professional solution for automatic cloning and backup of all your GitHub repositories. Full backup of public and private repositories, smart updates, automatic retries, and detailed reports.
You can also use my other projects to work with repositories:
user_info.jsonbackups/ folder--all-branches flag to enable synchronization of ALL branches
~/github_repos_backup_tools/ # Main application folder
└── username/ # Your GitHub username
├── repositories/ # All cloned repositories
│ ├── repo1/ # Repository copy
│ ├── repo2/
│ └── ...
├── backups/ # All backup artifacts
│ ├── backup_report_2026-02-28_15-30-45.json
│ └── username_github_backup_2026-02-28_15-30-45.zip
├── config.json # Token file (automatically created)
└── user_info.json # Your GitHub profile information
1. Installation:
git clone https://github.com/smartlegionlab/github-repos-backup-tools.git cd github-repos-backup-tools
2. First Run:
python app.py -r
On first run, the program will ask for your GitHub token and save it.
3. Get GitHub Token:
repo (full repository access), read:org (access to organization repositories)| Command | Description |
|---|---|
-r | Clone/update repositories |
-t | Update token (delete old and request new) |
--no-archive | Disable archive creation (archive is created by default) |
--timeout N | Timeout for Git operations in seconds (default: 30) |
--all-branches | Enable full branch synchronization (slower, clones ALL branches) |
--shutdown | Shutdown computer after completion |
--reboot | Reboot computer after completion |
Usage Examples:
# Fast mode - only default branch (DEFAULT) python app.py -r # Full mode - ALL branches (slower but complete) python app.py -r --all-branches # Backup without archive python app.py -r --no-archive # With increased timeout python app.py -r --timeout 60 # Update token python app.py -t # Backup with shutdown python app.py -r --shutdown
Operation Modes:
| Mode | Command | Behavior | Use Case |
|---|---|---|---|
| Fast (Default) | python app.py -r | Code only, default branch after clone | Quick daily sync |
| Full | python app.py -r --all-branches | Full backup with ALL branches + sync | Complete backup |
Status Meanings in Logs:
| Status | Mode | Meaning |
|---|---|---|
| CLONE | Both | New repository - full clone |
| PULL | Fast | Code update (current branch only) |
| PULL | Full | Code + all branches update |
| SKIP | Fast | Skipped - no changes |
| SYNC | Full | Branch sync only - code hasn't changed |
| CLONE (recover) | Full | Re-clone on error |
Update Logic:
ls-remotegit pullgit rev-parse HEAD~/github_repos_backup_tools/[username]/config.json-t commandrepo and read:orgrepo and read:org permissions. Use -t to update.--timeout 60~/github_repos_backup_tools/[username]/config.json~/github_repos_backup_tools/[username]/backups/shutdown -c (Linux/macOS) or shutdown /a (Windows)user_info.jsonbackups/ folder~/github_repos_backup_tools/[username]/backups/--all-branches)******************************************************************************** ----------------------- GitHub Repositories Backup Tools ----------------------- 🔧 Arguments Parsing: Backup: Repositories, Archive Timeout: 30s Branches: ⚡ Fast mode (default branch only) Power: ❌ No action 🔐 GitHub Authentication Found existing user: smartlegionlab ✅ Authenticated as: smartlegionlab 🔍 Scanning repositories... ✅ Found 52 repositories 📁 Backup location: /home/user/github_repos_backup_tools/smartlegionlab [██████████████████████████████] 100.0% | 52/52/0 | SKIP | smartlegionlab/repo ✅ Repository processing complete! ============================================================ 📋 BACKUP REPORT ============================================================ 👤 User: smartlegionlab ⏱️ Duration: 0:05:18 📊 REPOSITORY STATISTICS: Total: 52 repositories ⏭️ Skipped: 52 repositories (no changes) ❌ Failed: 0 repositories ✅ Success rate: 100.0% ============================================================ 📦 Archive created: smartlegionlab_github_backup_2026-02-27_17-24-20.zip 📊 Size: 15.19 MB ------------------------------------------------------------------------------------ ----------------------- Copyright © 2026, Alexander Suvorov ------------------------ ************************************************************************************
By 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
Created by Alexander Suvorov
Copyright © 2026, Alexander Suvorov