If the project you're working on has, say, 39 repositories and counting in GitLab and you need all the repos checked out for some reason, here's how to do it.
API
permissions. In your terminal, store this key in an env variable.For example:
$ TOKEN=gl_blablabla
$ GITLAB_URL=https://gitlab.com
$ mkdir awesome_microservice_project && cd awesome_microservice_project
$ mkdir devops && pushd devops
$ GROUP_ID=313373
$ for repo in $(curl -s --header "PRIVATE-TOKEN: your_private_token" $GITLAB_URL/api/v4/groups/$GROUP_ID | jq -r ".projects[].ssh_url_to_repo"); do git clone $repo; done;
$ popd
$ mkdir terraform && pushd terraform
$ GROUP_ID=313374
$ for repo in $(curl -s --header "PRIVATE-TOKEN: your_private_token" $GITLAB_URL/api/v4/groups/$GROUP_ID | jq -r ".projects[].ssh_url_to_repo"); do git clone $repo; done;
etc.
If you then need to pull changes made by your colleagues, this one liner will check out all the files
$ for repo in $(find . -type d -name .git -exec dirname {} \;); do pushd $repo; git pull; popd; done
gita
You could use the tool gita
from
github/nosarthur
Show archive.org snapshot
. This is available in the ubuntu repo.
gita add *
in the directory where the repos live on your machine.gita fetch
, gita pull