I'm trying to clone all the repos under a certain organization called orgA
. They have over 100+ repos with groups, subgroups etc.
I'm trying to use GitLab's CLI tool to clone all the repos, but the glab clone
command is for a single group within the org. Not the entire org. So the following doesn't do the job:
glab repo clone -g <group-id> -p --paginate
I do not wish to use a thirdparty tool to do this, only curl
or glab
How can I simply clone an entire org?
Thanks
Turned out to be simple with an in liner shell script:
glab api /groups | jq ".[].id" | xargs -I {} glab repo clone -g {} -p --paginate
glab api /groups
makes an authenticate request to Gitlab's groups API to get all the groups related to an org.jq
to extract the ids of those groups.glab repo clone
command for each of those groups ids using xargs