Skip to content

Instantly share code, notes, and snippets.

@dracco1993
Last active July 25, 2024 15:33
Show Gist options
  • Save dracco1993/245f33cf6286d8ab27d55cb34b40d191 to your computer and use it in GitHub Desktop.
Save dracco1993/245f33cf6286d8ab27d55cb34b40d191 to your computer and use it in GitHub Desktop.
Clone all repos using a personal access token
#!/bin/bash
ORG=organization;
ACCESS_KEY=0000000000000000000000000000;
for i in $(curl -H "Authorization: Bearer $ACCESS_KEY" "https://api.github.com/orgs/$ORG/repos?per_page=1000" | sed '/[ ]*"clone_url":/!d;s/[^:]*: "//;s/",$//'); do
echo git clone $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment