【发布时间】:2023-02-01 16:16:03
【问题描述】:
这是回应
not found: github.com/me/private-repo@v0.0.0-20220413034319-81fe8421f99f: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/ea2baff0eaed39430ee011ad9a011101f13b668d5fcbd9dffdfa1e0a45422b40: exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
我尝试使用新创建的 GitHub 个人访问令牌的密码在 ~/.netrc 中添加一条记录,并在 ~/.gitconfig 中添加配置
[url "ssh://git@github.com/"]
insteadOf = https://github.com/
所有这些都不起作用。
如果我通过 GOSUMDB=off go mod tidy 禁用总和检查,那么它可以工作,但我认为这对我来说不正确。
【问题讨论】:
标签: git go go-modules