Blog
Cloning all my GitHub repos faster than the default
A Bash + Git + jq script to fetch every repo I own with submodules, handling pagination and dry-run previews.
Date
14-10-2025
Tags
GitAutomationBashGitHub API
Blog
A Bash + Git + jq script to fetch every repo I own with submodules, handling pagination and dry-run previews.
14-10-2025
I wanted a faster, zero-click way to back up every GitHub repo I own, including submodules, without relying on the GitHub UI. The goal: a single command that pulls everything down (or simulates it) using SSH.
curl + GitHub API + jq to list all repos (with pagination).git clone --recurse-submodules to keep submodules in sync.--dry-run flag to preview what would be cloned without touching disk.GITHUB_TOKEN with repo metadata read access; uses SSH for cloning.GITHUB_TOKEN in your environment and ensure ssh-agent is running with your key added.CLONE_DIR in the script to choose where backups land.