I have a git repo setup on a computer on my local network (192.168.0.12). It has an entry in /etc/hosts
192.168.0.12 ubuntu-18-extssd
go get doesn't recognize my hostname (ubuntu-18-extssd
) as a host name so I use the IP address instead.
Now when I try with go get like this
go get 192.168.0.12/gitrepo/go-package-test-stringutil/stringpackage
it returns the error
package 192.168.0.12/gitrepo/go-package-test-stringutil/stringpackage: unrecognized import path "192.168.0.12/gitrepo/go-package-test-stringutil/stringpackage": https fetch: Get "https://192.168.0.12/gitrepo/go-package-test-stringutil/stringpackage?go-get=1": dial tcp 192.168.0.12:443: connect: connection refused
So I tell git to use ssh instead:
git config --global url."dean@192.168.0.12:".insteadOf "https://192.168.0.12/"
and in my ~/.gitconfig I have
[url "git@github.com:"]
insteadOf = https://github.com/
[url "dean@192.168.0.12:"]
insteadOf = https://192.168.0.12/
But go get still gives the same error. The entry for github works, though.
Why is the combination of go get
and git
still trying to use https when I've told it to use ssh instead?