赞
踩
在部署drone(CICD软件)后,触发提交时,drone-runner执行拉取仓库代码(在自己部署的gogs上)时出现该问题
Initialized empty Git repository in /drone/src/.git/
+ git fetch origin +refs/heads/master:
fatal: could not read Username for 'http://ip:port': terminal prompts disabled
原因提示为需要输入用户名密码,但由于这是CICD软件,并没有输入密码的时机,因此解决方案有两种:
cd ~
)git clone [你的git代码路径]
,发现需要输入密码,ctrl + c
中断touch .git-credentials
创建 .git-credentials 文件vim .git-credentials
编辑该文件http(s)://{你的用户名}:{你的密码}@你的git服务器地址
【注意选择 https/http,去掉花括号】ESC
输入 :wq
保存并退出git config --global credential.helper store
cat ~/.gitconfig
发现多了一项:[credential]
helper = store
git clone [你的git代码路径]
试试,不需要输入密码了fatal: could not read Username for ‘http://…’ : terminal prompts disabled 问题解决~
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。