Skip to content

Instantly share code, notes, and snippets.

@KarsonAlford
Last active July 12, 2024 22:20
Show Gist options
  • Save KarsonAlford/f26f1bcca772d9ac6a76d8594155f923 to your computer and use it in GitHub Desktop.
Save KarsonAlford/f26f1bcca772d9ac6a76d8594155f923 to your computer and use it in GitHub Desktop.
gh-clone-all.ps1
# Install Github CLI
# winget install -e --id GitHub.cli
# Log into Github
# gh auth login
$clonePath = "c:/all"
$orgName = 'Your Org Name Goes Here!!!'
New-Item -ItemType Directory -Force -Path $clonePath
Push-Location $clonePath
# Your non organization repos
#gh repo list | ForEach-Object { gh repo clone $_.Split("`t")[0] }
# Organization repos (first 100)
gh repo list $orgName -L 100 | ForEach-Object { gh repo clone $_.Split("`t")[0] }
Pop-Location
@abelbraaksma
Copy link

Works like a charm! (a little hard to find, but ultimately from your comment in this answer https://stackoverflow.com/questions/19576742/how-to-clone-all-repos-at-once-from-github)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment