Relative URL for Git submodule

I think that I should have use relative URL for Git submodule. Here, I explain why, and how I do.


In Gnuk git repository, it uses Chopstx as submodule. In NeuG git repository, it uses Chopstx and Fraucheky as submodule.

Git repositories of Gnuk and NeuG are available at different sites ( and It can be accessed by SSH or Git protocol, as registered user or anonymous user.

I was careless when I registered submodule under main project, and I wrongly included my username in its 'url', which will be incompatible for anonymous user.

I was also careless when I registered Chopstx at While Gnuk git repository is gnuk/gnuk, Chopstx git repository is chopstx/chopstx.


When anonymous user cloned Gnuk repository, he needed to change url of submodule manually.

When I cloned Gnuk repository from, I accessed for Chopstx, even though access to would be more natural.

Tidy it up

In May 2014, I moved to different machine. As this was good opportunity, I also changed roles and layouts of on this move.

I no longer serve git repositories from, but it is from (names are different, although it is actually same host).

When it was served from, I didn't have subdirectories like gnuk/ or chopstx/. This time, I moved gnuk to gnuk/gnuk, and I created chopstx/chopstx at, so that path layout will be as same as

Relative URL

I changed gnuk/.gitmodules to:

[submodule "chopstx"]
    path = chopstx
    url = ../../chopstx/chopstx.git

And neug/.gitmodules to:

[submodule "chopstx"]
    path = chopstx
    url = ../../chopstx/chopstx.git
[submodule "fraucheky"]
    path = fraucheky
    url = ../../chopstx/fraucheky.git

Now, anonymous user access of chopstx repository under gnuk will be anonymous user access.

SSH access of chopstx repository under gnuk to will be SSH access of