➜  atd git:(b4.232) ✗ git pull
remote: Counting objects: 78, done.
remote: Compressing objects: 100% (77/77), done.
remote: Total 78 (delta 60), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database .git/objects
fatal: failed to write object
fatal: unpack-objects failed

git报错 insufficient permission for adding an object to repository database

出现的原因是:没有版本库所在目录的写权限,导致新的文件无法上传。

所以注意,在使用

sudo git init --bare xx.git

创建一个版本库之后,需要把权限调整一下,不然使用sudo创建后,是需要root权限的
更改xx.git版本库的权限命令:

sudo chown -R user:group xx.git

或只有用户无组的情况

chown -R user: xx.git

参考链接:

https://www.cnblogs.com/lipijin/p/4222164.html

https://blog.csdn.net/chenghuan1990/article/details/82460160

标签: none

添加新评论

选择表情