github.sh 676 B

1234567891011121314
  1. #!/bin/bash
  2. CNTX={users|orgs}; NAME={username|orgname}; PAGE=1
  3. curl "https://api.github.com/$CNTX/$NAME/repos?page=$PAGE&per_page=100" |
  4. grep -e 'git_url*' |
  5. cut -d \" -f 4 |
  6. xargs -L1 git clone
  7. Note: Set CNTX=users and NAME=yourusername, to download all your repositories. Set CNTX=orgs and NAME=yourorgname,
  8. to download all repositories of your organization. The maximum page-size is 100, so you have to call this several
  9. times with the right page number to get all your repositories (set PAGE to the desired page number you want to download).
  10. URL: https://stackoverflow.com/questions/19576742/how-to-clone-all-repos-at-once-from-github#32833411