拥有jenkins管道(不是multibranch,单管道):
git url 'ssh://git@xxx.git', credentialsId:'xxxx'
...
sh 'git push --set-upstream origin master'
git命令通过,但在创建提交并尝试推送后我得到:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我已经将密钥添加到git存储库,但我无法将数据推回到repo。什么是根本原因?
答案 0 :(得分:0)
在Jenkins从机上,您是否检查过.ssh文件夹和公共/私有ssh密钥的权限?
更多信息: https://superuser.com/questions/215504/permissions-on-private-key-in-ssh-folder
如果权限看起来不错,也许你的ssh密钥只对你的Git仓库有读取权限?
用于托管Git存储库的工具是什么?