Page 1 of 1

Super Useful Script - Clone All Git Repos From A User

PostPosted: Sat Feb 04, 2017 19:27
by TheReaperKing
I wanted to download all the great mods from the minetest-mods repo section on github but it would have taken forever to individually clone them all. After a lot of trial and failure I finally found a nice script to do all that cloning for me! If you want to clone all of a users repos you just change the username in the script. I believe this works on both Windows and Linux and maybe Mac too. I tested it on Linux.

Just put this code in a text file and rename the extension .sh for Linux and .bat for Windows

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
USER=minetest-mods; PAGE=2
curl "https://api.github.com/users/$USER/repos?page=$PAGE&per_page=100" |
  grep -e 'git_url*' |
  cut -d \" -f 4 |
  xargs -L1 git clone


Caution: This script has made me go power/download crazy and my HD is quickly filling up with tons of awesome modders mods so be warned!

I hope someone finds this useful and have a great day!
-Mike

Re: Super Useful Script - Clone All Git Repos From A User

PostPosted: Sun Feb 05, 2017 18:53
by TheReaperKing
Just a little update to the script, for minetest-mods PAGE had to be set to 2 instead of 1 because there are over 100 repos.