go 拉取仓库依赖报错:fatal: could not read Username for ‘https://code.byted.org‘: terminal prompts disabled

Posted 是馄饨呀

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了go 拉取仓库依赖报错:fatal: could not read Username for ‘https://code.byted.org‘: terminal prompts disabled相关的知识,希望对你有一定的参考价值。

文章目录

在我们用 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

以上是关于go 拉取仓库依赖报错:fatal: could not read Username for ‘https://code.byted.org‘: terminal prompts disabled的主要内容,如果未能解决你的问题,请参考以下文章

Git 拉取Gitee仓库报错:“fatal: unable to access ''": Failed to connect to 127.0.0.1 port 1080:

Git拉取分支报错(fatal:‘XXX' is not a commit and a branch ‘XXX' cannot be created from it)

git fetch upstream 报错 XXX Permission denied (publickey). fatal: Could not read from remote repositor

ssh: Could not resolve hostname git.*****-inc.com : Temporary failure in name resolution fatal: The

github拉取项目的时候报出git@github.com: Permission denied (publickey).fatal: Could not read from remote r

github拉取项目的时候报出git@github.com: Permission denied (publickey).fatal: Could not read from remote r