This PowerShell script will mirror all your GitHub repositories for a complete backup and also create a readable clone for each repository so you can access files like README.md and source code.
- Full mirror backup of all repos including all branches, tags, and refs.
- Separate readable clone for each repo.
- Automatic update of both mirror and clone.
- Works with PowerShell and GitHub CLI.
-
Mirror (
*.git)- Saves all branches, tags, and refs.
- Useful for full backup, restores, or migration.
- Does not contain files in a working directory.
-
Readable clone
- Normal Git clone with all files visible.
- Allows browsing code, README, documentation, etc.
- Automatically updated from the mirror.
⚠️ WARNING: Mirrors download everything including old branches and tags, which can take a lot of space.
- Git installed.
- GitHub CLI installed and logged in.
- PowerShell execution policy allowing script execution:
Set-ExecutionPolicy RemoteSigned