I have a project in my computer with the following structure:
.
├── bin
├── code
│ └── src
├── data
├── doc
├── experiments
└── reports
└── summary
code/src and /reports/summary are submodules defined in .gitmodules
[submodule "code/src"]
path = code/src
url = ./code/src/
[submodule "reports/summary"]
path = reports/summary
url = /home/zunbeltz/Proyectos/reports/base/
I created a project in the gitlab of my workplace (version 7.9.4). After adding the new origin and git push -u origin master The links of the submodules are broken with a 500 error code.
I tried also in gitlab.com, (version 7.14) and I get a 404 error
Does someone know what is going here?
Note: I did post this message on the gitlab forum, but have any answer.
Pulling with submodules. Once you have set up the submodules you can update the repository with fetch/pull like you would normally do. To pull everything including the submodules, use the --recurse-submodules and the --remote parameter in the git pull command .
Merging the submodule In the main repository run the commands: git remote add models-origin [email protected]/exampleUser/models. git fetch models-origin. git merge --allow-unrelated-histories models-origin/master.
The list of steps required to clone a Git repository with submodules is: Issue a git clone command on the parent repository. Issue a git submodule init command. Issue a git submodule update command.
Show activity on this post. No, you don't need to add your submodule to your . gitignore : what the parent will see from your submodule is a gitlink (a special entry, mode 160000 ). That means: any change directly made in a submodule needs to be followed by a commit in the parent directory.
The idea of submodule is to reference nested git repo with an url that you can access.
./code/src/
and /home/zunbeltz/Proyectos/reports/base/
are file-based url that you can access locally.
But once pushed on Gitlab, said Gitlab wouldn't know how to interpreted/access those urls.
Hence the broken links.
As mentioned in the discussion:
On Gitlab, you would have to have 3 repos:
In the parent repo on GitLab, you would see the same structure as on the local parent repo
except GitLab would use a special icon to represent that folder.
That would represent a gitlink, a special entry in the index of a repo.
Ivan mentions in the comments the now (2018, three years later) official documentation "Using Git submodules with GitLab CI".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With