go get报错:fatal: could not read Username ... terminal prompts disabled

问题terminal prompts disabled

go get 报错 terminal prompts disabled

go get xxx.com/xxx/xxx
# cd .; git clone https://xxx.com/xxx/xxx.git
Cloning into 'xxx'...
fatal: could not read Username for 'https://xxx.com: terminal prompts disabled
package xxx: exit status 128

解决方案

方案一

临时解法:手动输入用户名密码

env GIT_TERMINAL_PROMPT=1 go get xxx.com/xxx/xxx

方案二

长期解法:使用已经配置好的git密钥

以GITHUB为例

git config --global --add url."[email protected]:".insteadOf "https://github.com/"
发布了27 篇原创文章 · 获赞 2 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/jackgo73/article/details/90604180