Skip to content

Instantly share code, notes, and snippets.

@Tyrrrz
Created March 4, 2026 18:18
Show Gist options
  • Select an option

  • Save Tyrrrz/5b4e20203b2e0e455deb32b3dcb63a3d to your computer and use it in GitHub Desktop.

Select an option

Save Tyrrrz/5b4e20203b2e0e455deb32b3dcb63a3d to your computer and use it in GitHub Desktop.
Clone-AllPublicRepos.ps1
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