Skip Navigation

mass-git-scripts: Bash Scripts for Mass-Cloning & Updating Git Repos

GitHub - f3rno64/mass-git-scripts: A collection of scripts for working with a few or a large number of git repos at once.

After an unexpected need to reset my work machine πŸ˜“, and needing to set up my development environment again by hand πŸ› οΈ, I decided to create a solution to quickly restore my local git repositories (and associated folder structure) πŸ”„.

I took this opportunity to write two bash scripts that clone and update all repositories on GitHub belonging to either a user or an organization πŸ“¦.

This means that, for example, with a single command ⌨️, you can clone hundreds or thousands of repositories, with high levels of concurrency (50 clones in parallel is doable πŸ’¨).

The scripts allow for a configurable clone depth, a limit for the number of repositories cloned, and a level of concurrency that decides how many clones are run in parallel πŸ“ˆ.

By running the following command:

 
    
git-clone-all --owner f3rno64 --limit 200 --jobs 40 --dir ./f3rno64

  

I was able to clone all 174 personal repositories πŸ“š, with full commit histories and all tags & branches, in 58 seconds ⏱️.

I wrote a blog post describing this in more detail here πŸ“, check it out for a breakdown of the arguments and examples of usage.

The GitHub repository is f3rno64/mass-git-scripts and the README also includes examples and general usage instructions πŸ—‚οΈ.

Please check it out and let me know what you think! πŸ’¬

I hope you find it useful, and any feedback or suggestions for improvement would be greatly appreciated! πŸ™

Comments

0