dev-resources.site
for different kinds of informations.
Clone ALL Github repos for a user on Windows
Published at
4/24/2020
Categories
community
Author
Greg Bulmash 🥑
Categories
1 categories in total
community
open
Recently I had to do this, found a shell script that cloned all repositories matching a search query, and edited it to meet my purposes.
You’ll need
- A working installation of Git with GitBash.
- A copy of jq in a directory that’s in your path (or in the directory where you’re running the script)
- Git set up to work with SSH. Alternatively, you might want to try changing “ssh_url” below to “clone_url” and that should pull the https link.
- An approximate count of the number of repos you’ll be cloning. Set the end of the loop in the first line to that number divided by 100, rounded up to the next whole number. For example, I had a little over 100 public repos to clone, so my loop is
1..2
.
The Script
for i in {1..2}
do curl "https://api.github.com/users/[your user name]/repos?per\_page=100&page=$i" \ | jq -r '.[].ssh\_url' >> urls.txtdonecat urls.txt | xargs -P8 -L1 git clone
Then just run the script in GitBash. sh [scriptname]
And that did it for me. Hope it helps.
Articles
12 articles in total
Moving Apple Music MP3 Playlists To Android
read article
Three Mechanisms to Protect Your Git Repositories
read article
Do You Need an SBOM?
read article
RealTek RTL8156B Works With Apple Silicon
read article
Top Secrets Management Tools for 2024
read article
Create a REST API with PHP and Laravel
read article
Adding (Partial) Skill Sets
read article
Learning Python By Example #2: Bagels
read article
5 Tips For Setting Up Local Debugging for Alexa Skills
read article
Clone ALL Github repos for a user on Windows
currently reading
Programmer Bedtime Stories: The Recursed Army
read article
Pixel 4: Three Tips from My First 36 Hours
read article
Featured ones: