栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Go语言

could not read Username ... terminal prompts disabled

Go语言 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

could not read Username ... terminal prompts disabled

问题描述:

使用goland初始化go 项目加载go.mod时,报错误提示:

fatal: could not read Username ... terminal prompts disabled

问题定位:

由于加载go.mod使用的是go get命令,其中go get 命令用于从远程代码仓库(比如 Github )上下载并安装代码包,由于使用的是内网的仓库的依赖包,所以猜测可能是没有配置git config相关的配置

通过命令git config --list或vi ~/.gitconfig查看git的配置信息

$ git config --list  

        user.name=test

        user.email=test@gmail.com

        .....          

解决方案:

添加用户名或密码配置或修改为ssh访问仓库

1. 修改配置文件~/.gitconfig, 添加配置信息

[user]
# Please adapt and uncomment the following lines:
    name = test
    email = test@gmail.com  

[url "ssh://git@github.com:"]
    insteadOf = https://github.com/

2. 直接使用git config配置

git config --global user.name "test"  

git config --global user.email test@gmail.com  

git config --global --add url."git@github.com:".insteadOf "https://github.com/"

3. 修改GIT_TERMINAL_PROMPT配置

export GIT_TERMINAL_PROMPT=1

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/989913.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号