1

I have a git repo at [email protected]:some-org/some-repo.git.

I have another git repo at [email protected]:other-org/other-repo.git.

I want to add other-repo as a submodule in some-repo.

How do I make the submodule url relative?

I have attempted:

  url = ../other-org/other-repo.git

This results in git attempting to fetch

[email protected]:some-org/other-org/other-repo.git

which is obviously wrong.

2
  • 3
    Try ../../other-org/other-repo.git Commented Jul 10, 2025 at 18:35
  • @phd, that solved it. If you like make this an answer and I will accept it. Commented Jul 14, 2025 at 16:50

1 Answer 1

1

Solution:

url = ../../other-org/other-repo.git

Explanation: the first ../ applied to the URL [email protected]:other-org/other-repo.git makes it [email protected]:other-org/. The second ../ makes it [email protected]:. Then other-org/other-repo.git appended which makes the new URL [email protected]:other-org/other-repo.git.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.