我们有一个只能通过 ssh/git(没有 https)访问的私有代码存储库,我们希望在那里托管我们的 go 代码/模块。
首先我试过:
git config --global url."git@code.internal.local:".insteadOf "https://code.internal.local/"
所以,以下两项工作都很好:
git clone git@code.internal.local:reponame.git
git clone https://code.internal.local/reponame
但是go get code.internal.local/reponame
失败了,因为 go 仍然坚持尝试 https://... 而不是 git。
package code.internal.local/reponame: unrecognized import path "code.internal.local/reponame": https fetch: Get "https://code.internal.local/reponame?go-get=1": dial tcp 192.168.0.5:443: i/o timeout
慕神8447489
慕容708150
慕哥9229398
相关分类