如何使用glide golang安装私人仓库 [英] how to install private repo using glide golang

查看:145
本文介绍了如何使用glide golang安装私人仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将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全局变量,现在您可以使用glidego getgodep等安装私有存储库.

Then set these git global variables, now you can install private repositories using glide, go get, godep, etc.

git config --global http.extraheader"PRIVATE-TOKEN:YOUR_ACCESS_TOKEN"

git config --global http.extraheader "PRIVATE-TOKEN: YOUR_ACCESS_TOKEN"

git配置--global url."git@bezos.gitlab.com:".inststof" https://bezos.gitlab.com/"

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

这篇关于如何使用glide golang安装私人仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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