threads / discuss / 63516

git config submodule.<name>.url cannot be a relative URL not sufficiently documented

Subject: git config submodule.<name>.url cannot be a relative URL not sufficiently documented

## tl;dr

One message between May 24, 2025 and May 24, 2025.

replies: 0people: 1as markdown or json

Wilson, Chris G· May 23, 2025, 19:17 UTC · lore
Git Team:
Thank you for all the work you've done. 
We recently ran into an issue where we needed to modify the URLs of some submodules in repository as specified in the .gitmodules file from an absolute URL to a relative one for a CI/CD system. With a desire to leave the original repository completely untouched, we played around with using git config submodule.<name>.url to update to a relative URL. As you probably already can determine, this didn't work. We ended up having to sed the .gitmodules file in place. 

I propose an update to the documentation for git config (as I found in https://git-scm.com/docs/git-config) to specify that submodule.<name>.url must be an absolute URL and cannot be a relative URL (or will be treated as a relative path on the filesystem). Alternatively, an option in git config (or maybe git submodule?) to treat the provided URL as behaved in .gitmodules would also be appreciated.

Thank you for your time. 

Sincerely, Chris Wilson

← back to recent threads