Skip to content

Instantly share code, notes, and snippets.

@alasarr
Created July 20, 2016 07:48
Show Gist options
  • Save alasarr/475cdd31435e8df9d78a511ba59d4b85 to your computer and use it in GitHub Desktop.
Save alasarr/475cdd31435e8df9d78a511ba59d4b85 to your computer and use it in GitHub Desktop.
Fetch all GIT repos. Useful for backup
Users:
curl -u "XXXX" -s https://api.github.com/users/malkab/repos\?per_page\=1000 | perl -ne 'print "$1\n" if (/"ssh_url": "([^"]+)/)' | xargs -n 1 git clone
ORGS:
curl -u "XXXX" -s https://api.github.com/orgs/geographicags/repos\?per_page\=1000 | perl -ne 'print "$1\n" if (/"ssh_url": "([^"]+)/)' | xargs -n 1 git clone
@alasarr
Copy link
Author

alasarr commented Jul 20, 2016

Adding --mirror flag to clone command should be considered

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