Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can’;t让子模块在gitlab中工作_Gitlab_Git Submodules - Fatal编程技术网

Can’;t让子模块在gitlab中工作

Can’;t让子模块在gitlab中工作,gitlab,git-submodules,Gitlab,Git Submodules,我的计算机中有一个具有以下结构的项目: . ├── bin ├── code │ └── src ├── data ├── doc ├── experiments └── reports └── summary code/src和/reports/summary是在.gitmodules中定义的子模块 [submodule "code/src"] path = code/src url = ./code/src/ [submodule "reports/summary"] path = re

我的计算机中有一个具有以下结构的项目:

.
├── bin
├── code
│ └── src
├── data
├── doc
├── experiments
└── reports
└── summary
code/src和/reports/summary是在.gitmodules中定义的子模块

[submodule "code/src"]
path = code/src
url = ./code/src/

[submodule "reports/summary"]
path = reports/summary
url = /home/zunbeltz/Proyectos/reports/base/
我在我工作场所的gitlab中创建了一个项目(版本7.9.4)。在添加新的原点和 git-push-u源主机 子模块的链接中断,错误代码为500

我也在gitlab.com(7.14版)上试过,结果发现一个404错误

有人知道这是怎么回事吗


注意:我确实在gitlab论坛上发布了这条消息,但没有任何答案

子模块的思想是使用您可以访问的url引用嵌套的git repo

/code/src/
/home/zunbeltz/Proyectos/reports/base/
是基于文件的url,您可以在本地访问。
但一旦推到Gitlab上,他说Gitlab将不知道如何解释/访问这些URL。
因此,断开的链接

作为:

在Gitlab上,您必须有3个回购协议:

  • 一个用于母公司回购
  • 每个子模块一个
在GitLab上的父repo中,您将看到与本地父repo相同的结构 除此之外。
这将代表一种回购协议


提到了现在(2018年,三年后)的官方文件“

我同意绝对路径(这可能是错误的,这是我做过的几个试验之一)。但是gitlab现在应该是具有相对路径的。@zunbeltz是:子模块的url应该是gitlab url,这反过来会在gitlab上显示这种图标:嗯,这不完全正确。我们在.gitmodules文件中使用子模块的相对URL,因为我们使用来自同一GitLab服务器的repo。将相对URL(git子模块同步)转换为.git/config中的正确绝对URL。相对路径对GitLab服务器的重命名\移动有很大帮助。@VonC,对于相对路径-不完全是,对于绝对远程URL-是的,它们在一个地方很麻烦,因为我们现在要重命名GitLab服务器。顺便说一句,GitLab现在正式推荐使用相对的:@Ivan OK。谢谢你的链接。为了提高可见性,我在答案中加入了它。如果您希望子模块与superproject来自同一个GitLab服务器,那么绝对可以使用相对远程URL。只需计算路径中“../”部分的正确数量。