Monday, 16 October 2017

How to clone all your GitHub projects


I have over 60 projects in GitHub, including forks, and thought that I really should back them up locally. I started doing it manually and after a few minutes realised that this is a job for the computer to do.

So, I wrote a quick script to do it for me.

To use the script, first install JSONPath.sh.

Then copy the script into a new empty directory. The script is available as a GitHub Gist from https://gist.github.com/mclarkson/5f53e0ca46e1f3989dc0b69b6818b410

Then you just type:

    ./clone-my-project.sh github_user_id

and it will clone them all, lovely!

NOTE: Look at the top of the source code to see how to change from cloning using ssh to cloning using https.

No comments:

Post a Comment