go get should use git ls-remote --get-url
to get remote git URLs, rather than git config remote.origin.url
#28794
Labels
git ls-remote --get-url
to get remote git URLs, rather than git config remote.origin.url
#28794
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do / expect-to-see / see-instead?
In my
~/.gitconfig
I have the following lines:This allows me to do e.g.
Running
go get -u
in the subsequent directory gives me:…which is fair, since:
…is not a real URL. However, there's a git command which seems to take care of doing any
insteadOf
substitutions, giving a "real" URL:ls-remote
seems to work better in the face of a single remote that is not calledorigin
:And it also seems (after a tiny amount of testing) to still do The Right Thing in the face of multiple remotes:
It seems like whichever part of the toolchain is currently doing a
git config remote.origin.url
should instead be runninggit ls-remote --get-url
.I have not investigated any knock-on effects with respect to other uses of
insteadOf
, e.g. the workarounds mentioned in #26134 or #27088.The text was updated successfully, but these errors were encountered: