使用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/