【发布时间】:2021-07-08 18:59:00
【问题描述】:
#1 我关注了一些关于如何使用两个不同的 ssh 密钥访问 github 或 bitbucket 的文章,当我执行 git clone ... 时它工作正常。所以,我可以毫无问题地进行git clone git://git@github.com/... 和git clone git://git@mycompany-bitbucket.org/...。
#2 我还关注了一些关于如何使用私有仓库的文章
但是,如果我将两篇文章(#1 和 #2)结合起来,go get ... 将始终使用 https://api.bitbucket.org/2.0/repositories/...。那么,有没有办法强制go get ... 使用https://api.mycompany-bitbucket.org/2.0/repositories/ 之类的东西?
【问题讨论】:
-
您是否尝试在本地机器上设置
url.<base>.insteadOf替换规则? -
更可行的解决方案可能是建立一个公司 goproxy(参见
GOPROXY portocolsection in the docs),但我不知道这种代理的标准实现。
标签: git go ssh bitbucket go-get