完全困惑了。
go 1.13.5 使用模块
我正在尝试从 github 导入私人仓库。搜索只会增加混乱,而不是减少混乱。我尝试了多种方法,包括钥匙串助手,但我进展缓慢。
SSH已启用并且测试时建立连接成功
我的全局 gitconfig 在 C:/Users/me 中:
[user]
name = xxxxxxx
email = xxx.xxx@me.com
[core]
autocrlf = input
[alias]
st = status
[url "ssh://git@github.com/"]
insteadOf = https://github.com/
Run Code Online (Sandbox Code Playgroud)
去获取 github.com/user/repo@master 产生
go: finding github.com master
go: finding github.com/user master
go: finding github.com/user/repo master
go: finding github.com/user/repo master
go: downloading github.com/user/repo v0.0.0-20191211180807-ee1bcd94c84f
verifying github.com/user/repo@v0.0.0-20191211180807-ee1bcd94c84f:
github.com/user/repo@v0.0.0-20191211180807-ee1bcd94c84f: reading
https://sum.golang.org/lookup/github.com/!user/repo@v0.0.0-20191211180807-
ee1bcd94c84f:410 Gone
Run Code Online (Sandbox Code Playgroud)
该链接产生:
not found: github.com/user/repo@v0.0.0-20191211180807-ee1bcd94c84f: invalid version: git
fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in/tmp/gopath/pkg/mod/cache/vcs/9524fc42cfd4910346f55f112665f9a51df7c4b31085d50baa5e01453e55ca58:
exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Run Code Online (Sandbox Code Playgroud)
不管我做什么,我都会收到“无法读取用户名”的消息,但我认为应该使用 SSH 而不是 HTTPS
这是怎么回事??
到目前为止,我还没有感觉到对模块的热爱让我的生活变得更轻松......
经过更多搜索和大量实验后,问题在于下载私人存储库时校验和失败,因为根据定义,没有定义校验和。
这被埋藏在 Github 上的一系列回应中。有一个待解决的问题需要改进文档。好主意。
这对我有用:
GONOSUMDB=github.com/username/*
go get github.com/username/repo
Run Code Online (Sandbox Code Playgroud)