Azure DevOps submodule addressing

Viewed 129

In my organization, some people use ssh: while others use https: when accessing Git on Azure DevOps.

This causes a problem with submodules, as the .gitmodules file usually holds the full URL to the submodules repository (which obviously are different for https: and ssh:).

You can also use relative paths in .gitmodules though. If the submodule is another repository in the same project, the URL is simply ../{repository}.

If the submodule is in another project in the same Azure Devops organization, the URL is simply ../../{project}/{repository}, right?

Well, for ssh: the answer is yes, but for https: the URL unfortunately is ../../../{project}/_git/{repository}.

Why on earth MS designed it like this, is beyond me.

My question is: Does anyone have a solution for this? Is Git URL rewrite a feasible solution?

PS. If you think this is less than optimal design by MS, you might want to upvote my suggestion to MS here: https://developercommunity.visualstudio.com/t/Drop-the-_git-in-the-Git-https-URL/1643086?space=21&entry=suggestion

PPS. If you clone a repository via https: and successively modify your .gitmodules url to ../../{project}/{repository}, it apparently works. But you wont be able to clone it again via https: with this modified .gitmodules.

0 Answers
Related