jenkins报错: error: insufficient permission for adding an object to repository database .git/objects

前言:这是在用jenkins去gitlab上面去拉下代码来编译,就报了这个错,在这里记录下,避免下次

报错:

17:08:17 error: insufficient permission for adding an object to repository database .git/objects

17:08:17 fatal: failed to write object

17:08:17 fatal: unpack-objects failed


解决方法:

权限问题

1.jenkins上面配置节点上面的用户,没有root权限,也就是没法sudo,去/etc/sudoers/下面改下。

2.赋权.  修改git仓库权限 sudo  chown -R user:user   XXX.git

你可能感兴趣的:(jenkins报错: error: insufficient permission for adding an object to repository database .git/objects)