Skip to content

Instantly share code, notes, and snippets.

@Plaenkler
Last active April 16, 2024 13:51
Show Gist options
  • Save Plaenkler/236c2d59f8f410493df312c5c7fc6740 to your computer and use it in GitHub Desktop.
Save Plaenkler/236c2d59f8f410493df312c5c7fc6740 to your computer and use it in GitHub Desktop.
Clone all your repositories at once

Challenge

All repositories of any user or organization should be cloned at once

Solution

  1. Install the GitHub CLI and then open a terminal
  2. Authenticate yourself at GitHub with the command "gh auth login"
  3. Write a script that clones all Repos from a given user or organisation
gh repo list **YourUserOrOrga** --limit 4000 | while read -r repo _; do
  gh repo clone "$repo" "$repo"
done
  1. Execute the script using your preferred CLI application

Further information

https://github.com/cli/cli

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