问题描述
我正在将glide
用作golang项目的软件包管理.我无法使用glide get bezos.gitlab.com/gomock
获取私有存储库.
I am using glide
as package management for my golang project. I can't able to get private repositories using glide get bezos.gitlab.com/gomock
.
询问用户名&密码,即使我提供了正确的凭据,它也会引发错误.请提出任何想法.
It asks username & password even i give correct credentials, it ended up throwing error. Please suggest any idea.
推荐答案
与glide
或任何其他程序包管理工具无关.您必须在git http.extraheader中设置create和gitlab访问令牌.
It is nothing do with glide
or any other package management tools. You have to set create and set gitlab access token in your git http.extraheader.
转到您的gitlab 设置->访问令牌并创建新的访问令牌,请确保仅将其复制一次.
Go to your gitlab settings -> access token and create new access token, make sure to copy the token it available only once.
然后设置这些git全局变量,现在您可以使用glide
,go get
,godep
等安装私有存储库.
Then set these git global variables, now you can install private repositories using glide
, go get
, godep
, etc.
git配置--global url."[email protected]:".inststof" https://bezos.gitlab.com/"
git config --global url."[email protected]:".insteadOf "https://bezos.gitlab.com/"
这篇关于如何使用glide golang安装私人仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!