A straightforward Python CLI tool to sync your GitHub repositories to your local machine.
Run:
ghsync configThis guides you through setup and saves your settings in config.json in the current directory:
{
"username": "",
"pat": "",
"backup_path": "",
"lfs": true,
"ignored_repos": ["repo-1", "repo-2"]
}username: Your GitHub username.pat: Personal Access Token (optional; required only for syncing private repos).backup_path: Folder where your repositories will be stored (default:backup).lfs: Set totrueto include Git LFS files; default isfalse.ignored_repos: List the names of repos to ignore, or leave empty to sync all.
Run:
ghsync sync- First run: Downloads all your repositories to
backup_path. - Subsequent runs: Updates existing repos and fetches any new ones.
Tip: Run periodically to keep your local copy current.
backup
Compresses your backup folder into a timestamped.zipand deletes the original. Next time you runsync, repos are re-downloaded. Useful for safe storage.
What if I leave the PAT configuration empty?
All of your public repositories will be synced normally. Syncing private repositories require a PAT with the permission to read them.
Will I be able to work on the synced repositories?
No. The app uses git clone --mirror to download the repositories, so there will not be a working directory.