Date
May. 19th, 2024
 
2024年 4月 12日

Post: Git Error: insufficient permission for adding an object to repository database .git/objects

Git Error: insufficient permission for adding an object to repository database .git/objects

Published 12:09 Sep 16, 2015.

Created by @ezra. Categorized in #Version Control, and tagged as #Git.

Source format: Markdown

Table of Content

今天提交 Git 的时候出现一个错误,来看一下:

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

看字面意思是权限不完全,第一个想法是 chmod:

chmod -R 755 ~/Meniny.github.io

这里是将 ~/Meniny.github.io 权限设置为 755 ,也就是rwxr-xr-x ,其中 -R 表示其子路径的文件(夹)也将继承该权限。 提示是这样的:

chmod: Unable to change file mode on /Users/Meniny/Meniny.github.io/.git/objects/38/3e9005dd5092845436e91d5f3c5d52309a3219: Operation not permitted

问题出在哪里呢?我想到了 sudo -s:

sudo -s

回车,无异常,重新 chmod

chmod -R 755 ~/Meniny.github.io

接着用 addcommitpush,OK 无异常。

Pinned Message
HOTODOGO
I'm looking for a SOFTWARE PROJECT DIRECTOR / SOFTWARE R&D DIRECTOR position in a fresh and dynamic company. I would like to gain the right experience and extend my skills while working in great teams and big projects.
Feel free to contact me.
For more information, please view online résumé or download PDF
本人正在寻求任职 软件项目经理 / 软件技术经理 岗位的机会, 希望加⼊某个新鲜⽽充满活⼒的公司。
如有意向请随时 与我联系
更多信息请 查阅在线简历下载 PDF