Stephen Cagle

Menu

  • Home
  • Archives
  • About Me
  • RSS
October 17, 2020

Download all Github projects to a directory

I made the following script to download all Github projects into a directory. It is fun to see everything you have accumulated over the years. :)

curl -u <USERNAME>:<OAUTH_TOKEN> https://api.github.com/user/repos\?per_page\=100 | jq ".[].git_url" | tr -d '"' | while read in; do git clone $in; done

Notes

<USERNAME> is your github username.

<OAUTH_TOKEN> can be created from here. You only need the repo scope for this.

  • You may need to install jq as it isn't standard.
  • You will need to be authenticated or the git clone X will fail on non public repos.
  • API will only download up to 100 projects. If you have more than that you will have to page.

CAR & CDR system of productivity »

Copyright © 2020 Stephen Cagle