使用GitLab,我在myproject
群下设置了一个项目myteam
,该群组位于以下网址:
git@mycompany.com:myteam/myproject.git
该项目有几个子模块,.gitmodules
文件中的子模块如下:
[submodule "libs/mylib"]
path = libs/mylib
url = git@mycompany.com:myteam/mylib.git
[submodule "libs/theirlib"]
path = libs/theirlib
url = git@mycompany.com:otherteam/theirlib.git
我想用相对网址替换这些绝对网址。例如:
[submodule "libs/mylib"]
path = libs/mylib
url = ../mylib.git
[submodule "libs/theirlib"]
path = libs/theirlib
url = ../theirlib.git # ???
虽然这适用于mylib
(因为它与myteam
组位于同一myproject
组),但它显然不适用于theirlib
,就像它在otherteam
组中一样。
有没有办法通过相对网址引用theirlib
?
答案 0 :(得分:0)
你可以使用
url = ../../otherteam/theirlib.git