【发布时间】:2020-09-06 01:01:21
【问题描述】:
当我安装一台新机器时,我想一次检出我存储在GitLab 的所有个人 Git 存储库。
我尝试了一些工具,例如 Gitlabber,但它们专注于群组。 Group namespaces are not the same as user namespaces 在 GitLab 中。我的项目没有组。
【问题讨论】:
标签: git gitlab migration clone
当我安装一台新机器时,我想一次检出我存储在GitLab 的所有个人 Git 存储库。
我尝试了一些工具,例如 Gitlabber,但它们专注于群组。 Group namespaces are not the same as user namespaces 在 GitLab 中。我的项目没有组。
【问题讨论】:
标签: git gitlab migration clone
根据@dinesh-balasubramanian 如何clone all repositories of a group in GitLab 的回答,我为此编写了一个命令。
read_api 范围创建personal access token
curl 和jq
git clone(替换之前的占位符)
for repo in $(curl -H "PRIVATE-TOKEN: XXXX-YOUR-TOKEN-XXXX" "https://gitlab.com/api/v4/users/XXXX-YOUR-USERNAME-XXXX/projects/?page=1&per_page=100" | jq .[].ssh_url_to_repo | tr -d '"'); do git clone $repo; done;
【讨论】: