windows下jenkins批处理执行(Execute Windows batch command)git pull失败解决方案
windows下jenkins批处理执行(Execute Windows batch command)git pull失败解决方案
当你本地执行git pull 没有问题的时候,并且也不需要输入用户名和密码的时候,在jenkins执行批处理的时候执行git pull,任务执行失败,报错如下:
D:\test-project\ltest-ui>git -c credential.helper= -c core.quotepath=false -c log.showSignature=false pull --progress --no-stat -v --progress origin master
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'http://XX.XX:xxxx': No such file or directory
- 失败原因:
不是因为要输入用户名和密码,因为你本地也不需要输入,是因为搭建的仓库它是私有的仓库。
- 解决方案1:
git remotes 地址改为 http://邮箱(或用户名):密码@仓库 格式
例:http://16000:123456@git.test.com/abc/projectName.git
- IDEA修改参考操作:
重新Jenkins执行可以git pull成功,此种方案比较适用于公司项目设置为私有项目,需要本地打包发布,你又不方便修改仓库设置的场景。
- 解决方案2:
如果是你自己创建的项目,只要取消私有仓库勾选即可:如下:
部分内容引用:
更多推荐
所有评论(0)