Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab reference submodule in Readme.md

A gitlab project at contain submodule and both the project and submodule also contain a readme.md file. The readme.md of the top project is given

Top Readme.md
=============

[Link to folder](folder)

[Link to submodule folder](sub)

[Link to submodule Readme.md](sub/README.md)

The first link work as the brower opens at the subfolder but the other two link does not work, I get a page not found message.

How do you create links to files in a submodule as well as to the submodule as is self?

like image 471
Johan Avatar asked Sep 08 '25 08:09

Johan


1 Answers

Try instead to use the full https URL (https://gitlab.com/JohanVdBerg/doc-submodule) for the sub or sub/README.md file.

Your main repo only includes a reference (called gitlink) to the submodule, not the file itself.

The OP adds:

it is needed to point to the branch to which the submodule points to

Then the URLs would be:

  • for sub: https://gitlab.com/JohanVdBerg/doc-submodule/tree/<abranch>
  • for sub/README.md: https://gitlab.com/JohanVdBerg/doc-submodule/blob/<abranch>/README.md
like image 57
VonC Avatar answered Sep 10 '25 17:09

VonC