来自 Bitbucket 的“Go Get"私人回购 [英] 'Go Get' Private Repo from Bitbucket

查看:36
本文介绍了来自 Bitbucket 的“Go Get"私人回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以基本上,我有一个 Openshift 项目,它在 Git 推送上使用Go get"下载所有库并即时构建项目,因此,我有一些代码我不希望人们从我的自己的库,为了正确编译,代码需要从 github.com 或其他存储库中获取,所以我创建了一个私有的 bitbucket.org 存储库,现在,作为公共存储库它工作正常,但是当我尝试'从我的私人仓库获取",它给了我禁止 403"

So basically, I have an Openshift Project that on Git push, downloads all libraries with 'Go get' and builds the project on-the-fly and so, I have some code I don't want people to see from my own library, and for it to compile properly, the code needs to be taken from github.com or another repo, so I created a private bitbucket.org repo, now, as a public repo it works fine, but when I try to 'Go Get' from my private repo, it gives me 'Forbidden 403'

我怎样才能避免这种情况发生?感谢您的阅读,祝您有美好的一天!

How can I avoid this occurency? Thank you for reading and have a nice day!

推荐答案

go get 在内部使用 git.以下一行代码将使 git 并因此 go get 通过 SSH 克隆您的包.

go get uses git internally. The following one liners will make git and consequently go get clone your package via SSH.

Github:

git config --global url."git@github.com:".insteadOf "https://github.com/"

比特桶:

git config --global url."git@bitbucket.org:".insteadOf "https://bitbucket.org/"

这篇关于来自 Bitbucket 的“Go Get"私人回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆