解决方法在我们用 go mod tidy更新项目依赖包的时候,有可能会遇到这个问题,这个主要问题是git没有配置的问题。
在控制台输入以下命令,这个主要是配置我们拉取依赖源是哪一个,添加相应的仓库源
vim ~/.gitconfig
[user]
email = email
name = name
[url "git@github.com/:"]
insteadOf = https://github.com/"
还有一种是将ssh替代成https的方式
git config --global --add url."git@github.com:".insteadOf "https://github.com/"
参考文档:
https://medium.com/easyread/today-i-learned-fix-go-get-private-repository-return-error-terminal-prompts-disabled-8c5549d89045
https://stackoverflow.com/questions/32232655/go-get-results-in-terminal-prompts-disabled-error-for-github-private-repo
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)