git权限报错error: insufficient permission for adding an object to repository database

➜  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 

是因为项目的 .git 目录有些文件夹的权限是root用户,

解决办法,切换到root超级管理员,修改文件所属用户为当前电脑用户

chown -R xxxx: .git

 

你可能感兴趣的:(git)