There can be scenario where you need to download or clone multiple projects at the same time.
This can be daunting task if done one by one, so I thought of writing a PowerShell or Python script.
But as you all know why to reinvent the wheel if something is existing, so I researched the internet and found ghorg.
Cloning a single repository is straightforward and can be done using the git clone command. However, what if you need to clone multiple projects from the same organization? In such cases, using the git clone command for each repository can be time-consuming and repetitive.
ghorg is a tool that allows developers to clone multiple repositories from a GitHub/Gitlab/Gittea/Bitbucket organization in one go.
It was created to make it easier for developers to clone all repositories from an organization, especially when they need to work with multiple projects at the same time.
Here is the syntax we used:
.\ghorg.exe clone 12345678 –base-url=https://gitlab.com –scm=gitlab –token=$token –preserve-dir –path
12345678 is our group which has multiple projects, subgroups etc. in it.
Download ghorg from below link:
Extract the files
You can now utilize gitlab Pipeline or PowerShell and download all the projects in a group or whole organization if required.
Explore syntax of ghorg using help command
.\ghorg.exe –help
Happy ghorging
Thanks for reading…
Tech Wizard