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

服务器pull代码的时候发现的错误:

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

说是权限错误,但是没想到.git目录需要设置777权限。

解决方案:

1
sudo chmod 7777 -R .git