在Golang中导入私人仓库时版本和https引用无效

加布里埃尔·佐里拉:

尝试在golang中将私有存储库作为软件包导入。做了:

git config --global [email protected]:.insteadOf https://github.com/

因此,理论上所有对https的引用都将替换为ssh版本。

github.com/XXX/util

是我的私人仓库,是go模块。

我去得到-v并得到:

[gabriel@xiridio backend]$ go get -v
go: finding module for package github.com/XXX/util
go: downloading github.com/XXX/util v0.0.0-20200411022955-454673685ff5
go: finding module for package github.com/XXX/util
main.go:12:2: github.com/XXX/[email protected]: verifying module: github.com/XXX/[email protected]: reading https://sum.golang.org/lookup/github.com/!X!X!X/[email protected]: 410 Gone
        server response:
        not found: github.com/XXX/[email protected]: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /tmp/gopath/pkg/mod/cache/vcs/f1fdc5cc42a6995f954688df06783c05d28e4a60e9aaf6930a88a2487b913907: exit status 128:
                fatal: could not read Username for 'https://github.com': terminal prompts disabled

似乎存在“版本”问题,并且由于某些原因,仍然引用了https。我还可以做些什么?

VonC:

可以肯定的是,我更喜欢在git config命令中使用引号:

git config --global url."[email protected]:".insteadOf "https://github.com/"

请参阅此要点作为示例

这包括:

使用的一种替代方法[email protected]是在GitHub帐户上生成个人访问令牌,为其授予回购访问权限,然后改为使用以下代码:

git config --global url."https://${GITHUB_TOKEN}:[email protected]/".insteadOf "https://github.com/"

还要检查“ go get导致GitHub私有存储库的'终端提示被禁用'错误 ”,其中提到了的使用GOPRIVATE

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

当在jFrog / Bintray中导入github仓库上传库时,导入Github仓库按钮被禁用

在表中导出和导入库存仓库

Yocto-使用https获取私人仓库

如何使用glide golang安装私人仓库

在 sbt 项目中导入 maven 仓库

GoLand导入Go模块公共仓库因版本无效而失败

在Golang中导入模块时如何捕获错误?

在golang中导入存档/ tar时docker run失败

在setup.py中为私人git仓库指定版本

导入gin-gonic / gin时,golang上的golang:alpine docker容器在macOS上抛出“ go.string的无效符号版本”

在 Python 中导入模块和函数时出现问题

在python3.6中导入caffe时rrule.py中的无效语法错误

在 Python 2.7 中导入 postgis 时如何修复无效的语法错误?

SyntaxError:我在python3中导入Avro时语法无效

在 Laravel 7 中导入 excel 文件时显示错误“日期值无效”

私人Github仓库的私人页面

为什么在vuejs中导入Twilio无效?

在 python 2.7 中导入 nltk 的语法无效

在Python中导入xgboost时出现“找不到版本'GOMP_4.0'”-Ubuntu

使用OpenXML在数据集中导入Excel时,“对象引用未设置为对象的实例”

导入html页面时,如何在msaccess中导入和删除网站的前两行

在android studio中导入项目-版本控制

Sphinx交叉引用中断了在父模块中导入和记录的继承对象

在 Python 中导入时未解析的引用

去建立私人仓库

Appveyor克隆私人仓库

在Golang中导入自定义包

如何在golang中导入本地包?

在Firefox中导出和还原私人浏览会话