How to get qualified git url remote using url. <Base> .insteadOf?

I am working with a Git repository using the url scheme . <base> .insteadOf to store the actual repo url in my ~ / .gitconfig. One of the applications I use is trying to figure out the access scheme (ssh, http, etc.) to the repo using git -config, but this fails, because the output looks something like this:

# git config --get remote.origin.url
gerrithost:department/project

Where gerrithost is configured in my ~ / .gitconfig:

[url "ssh://machine.dn.tld:29418/"]
insteadOf = gerrithost:

The application expects the output of Git config --get remote.origin.url to look like this:

ssh://machine.dn.tld:29418/department/project

git remote -v displays the allowed URLs, but I will need to parse the output to get the correct remote and field.

URL- git -config ( ) Git remote?

+4
1

Stefan Näwe , , ,

git ls-remote --get-url

. ls-remote.

+1

Source: https://habr.com/ru/post/1539264/


All Articles