git - 另一个 GitLab 组的相对子模块 URL

标签 git gitlab

使用GitLab ,我在组 myteam 下设置了一个项目 myproject,该组位于以下 URL:

<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="62050b16220f1b010d0f12030c1b4c010d0f" rel="noreferrer noopener nofollow">[email protected]</a>:myteam/myproject.git

该项目有几个子模块,在 .gitmodules 文件中如下所示:

[submodule "libs/mylib"]
    path = libs/mylib
    url = <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="47202e33072a3e24282a3726293e6924282a" rel="noreferrer noopener nofollow">[email protected]</a>:myteam/mylib.git
[submodule "libs/theirlib"]
    path = libs/theirlib
    url = <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="99fef0edd9f4e0faf6f4e9f8f7e0b7faf6f4" rel="noreferrer noopener nofollow">[email protected]</a>:otherteam/theirlib.git

我想用相对 URL 替换这些绝对 URL。例如:

[submodule "libs/mylib"]
    path = libs/mylib
    url = ../mylib.git
[submodule "libs/theirlib"]
    path = libs/theirlib
    url = ../theirlib.git           # ???

虽然这适用于 mylib(因为它与 myproject 位于同一个 myteam 组中),但它显然不适用于 >theirlib,因为它位于 otherteam 组中。

有没有办法通过相对 URL 引用 theirlib

最佳答案

你可以直接使用

url = ../../otherteam/theirlib.git

关于git - 另一个 GitLab 组的相对子模块 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28684705/

相关文章:

git - Bonobo Git 服务器和 SVN

git push heroku master 权限被拒绝(公钥)。致命的 : The remote end hung up unexpectedly

angular - 调用了如何解决 "Function calls are not supported in decorators but ' StoreModule'。”

kubernetes - 与 Keycloak OIDC 集成的 Gitlab 注销失败

Git Tower 无法重新应用存储 : Conflicts in index

Git - 将 .git 目录移动到另一个驱动器,将源代码保留在原处

node.js - 无法完成 "npm run deploy"命令以便 React 在 Github Pages 上使用

gitlab - 什么是 gitlab runner

docker - docker gitlab镜像升级到8.6破坏了gitlab

java - 如何在没有访问 token 的情况下公开 Gitlab 包注册表?