A GitHub CLI extension that syncs all repositories between a GitHub organization and a local directory.
When you manage multiple repos under a GitHub org, keeping your local workspace in sync becomes tedious. This extension:
- Detects which repos exist remotely, locally, or both
- Syncs repos that exist in both places (
git pull --ff-only) - Clones repos that only exist remotely (with confirmation)
- Creates & pushes repos that only exist locally (with confirmation)
- Matches renamed folders by checking remote URLs (e.g., local
my-app/pointing toorg/my-application)
gh extension install crankd/gh-org-repo-sync# Interactive mode — prompts before clone/push actions
gh org-repo-sync --org <org> --dir <path>
# Preview what would happen
gh org-repo-sync --org <org> --dir <path> --dry-run
# Auto-approve all actions
gh org-repo-sync --org <org> --dir <path> --yes| Flag | Description | Default |
|---|---|---|
--org <org> |
GitHub organization name | required |
--dir <path> |
Local directory containing repos | current directory |
--dry-run |
Show plan without executing | false |
--yes |
Skip confirmation prompts | false |
-h, --help |
Show help message |
═══════════════════════════════════════════════════
Org Repo Sync: my-org ↔ /Users/me/projects/my-org
═══════════════════════════════════════════════════
SYNC (pull latest)
● api-server
● web-app
● local-name → remote-name
CLONE (remote → local)
● my-org/new-service
PUSH (local → new remote)
● my-local-tool
Total: 3 sync, 1 clone, 1 push (5 repos)
- Exact name match — local folder name equals remote repo name
- Remote URL match — if the local folder's
originremote URL contains the org repo name (handles renamed local folders)
- SYNC runs automatically (fast-forward pull only, safe operation)
- CLONE and PUSH prompt individually unless
--yesis passed - New repos are created as private by default
- For PUSH, the local remote URL is updated to point to the new org repo
- Non-git directories and hidden directories are skipped
- GitHub CLI (
gh) v2.0+ gitpython3(for JSON parsing)- Authenticated with
gh auth login
MIT