【发布时间】:2020-05-04 22:14:55
【问题描述】:
我已经开始从事 Golang 项目。使用 make 构建时,出现以下错误:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
为了解决这个问题,我在浏览过类似的帖子go get results in 'terminal prompts disabled' error for github private repo 后做了以下工作:
export GIT_TERMINAL_PROMPT=1
但这并没有解决问题,现在它似乎在无限循环询问用户名和密码。
我的 git 配置如下:
$git config --list
remote.origin.url=git@github.com:GolangProjects/Project1.git
即使在这个配置之后,为什么它继续使用 https 而不是 SSH,没有得到任何线索。请帮忙。
【问题讨论】:
-
您的 Makefile 是否包含对
git的任何调用或任何可能使用它的程序,例如包管理器?你的项目中有子模块吗? -
是的,作为构建的一部分,它会拉取并安装 go 依赖项。
-
考虑提供minimal reproducible example。你从你的 Makefile 运行什么命令?
标签: git