Skip to content

Instantly share code, notes, and snippets.

@razonyang
Created April 1, 2023 05:21
Show Gist options
  • Save razonyang/467ffd51ada0b0d1f9ec54dfab6ba28e to your computer and use it in GitHub Desktop.
Save razonyang/467ffd51ada0b0d1f9ec54dfab6ba28e to your computer and use it in GitHub Desktop.
Clone all GitHub repos at once.
curl "https://api.github.com/orgs/orgname/repos?page=1&per_page=100" |
  grep -e 'ssh_url*' |  
  cut -d \" -f 4 |
  xargs -L1 git clone
  1. Replace the orgname with the organization name.
  2. Replace ssh_url with clone_url to use HTTPS instead of SSH.
curl "https://api.github.com/users/username/repos?page=1&per_page=100" |
  grep -e 'ssh_url*' |  
  cut -d \" -f 4 |
  xargs -L1 git clone

Replace the username with your own.

  1. Replace ssh_url with clone_url to use HTTPS instead of SSH.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment