How to clone all projects of a group at once in GitLab?

后端 未结 15 1431
[愿得一人]
[愿得一人] 2020-12-23 02:02

In my GitLab repository, I have a group with 20 projects. I want to clone all projects at once. Is that possible?

15条回答
  •  生来不讨喜
    2020-12-23 02:57

    One liner with curl, jq, tr

    for repo in $(curl -s --header "PRIVATE-TOKEN: your_private_token" https:///api/v4/groups/ | jq ".projects[].ssh_url_to_repo" | tr -d '"'); do git clone $repo; done;
    

    For Gitlab.com use https://gitlab.com/api/v4/groups/

提交回复
热议问题