Created
March 4, 2026 18:18
-
-
Save Tyrrrz/5b4e20203b2e0e455deb32b3dcb63a3d to your computer and use it in GitHub Desktop.
Clone-AllPublicRepos.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gh auth login --web | |
| $author = "tyrrrz" | |
| $outputDir = "." | |
| $repos = gh repo list $username ` | |
| --no-archived ` | |
| --limit 1000 ` | |
| --json nameWithOwner ` | |
| --jq ".[].nameWithOwner" | |
| foreach ($repo in $repos) { | |
| $repoName = $repo.Split("/")[1] | |
| $targetPath = Join-Path $outputDir $repoName | |
| if (Test-Path $targetPath) { | |
| Write-Host "Skipping: $repoName (already exists)" | |
| } else { | |
| Write-Host "Cloning: $repo..." | |
| git clone "https://github.com/$repo.git" $targetPath | |
| } | |
| } | |
| Write-Host "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment