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.

14 October 2025 · Git, Automation, Bash, GitHub API

Why #

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.

What I built #

How it works (high level) #

  1. Requires GITHUB_TOKEN with repo metadata read access; uses SSH for cloning.
  2. Fetches paginated repo lists via GitHub API, writes targets into a loop.
  3. For each repo: clone with submodules if missing; otherwise skip.
  4. Optional dry-run prints planned actions only.

Notes #