参考: https://stackoverflow.com/questions/3239274/git-commit-fails-due-to-insufficient-permissions

问题

  • git add 或者 git commit 之后报错:
error: insufficient permission for adding an object to repository database .git/objects
error: insufficient permission for adding an object to repository database .git/objects
error: Error building trees

解决

  1. sudo chown -R cygr-0101-01-0133 *
  2. cd .git
  3. sudo chown -R cygr-0101-01-0133 *

核心原因

https://stackoverflow.com/questions/28832815/git-commands-require-sudo-on-osx

其实就是我们的项目git clone的时候, 需要系统sudo权限, 和我们git安装与关系. 应该是ssh需要系统权限. 即使操作了, 以后git fetchgit push 也需要权限. 但最起码, 保存不恶心了...

解决办法

  • chown -R <user> myproject

解决git commit报错问题的更多相关文章

  1. git commit报错解决,绕过代码检查

    上一个项目用的svn,新项目用了git,很开心,终于学习了git了,本以为把git都学会了,但是还是遇到了一个不在自己学习的知识点范围内的问题,最后是同事帮忙解决的. 问题:第一次代码commit的时 ...

  2. linux 下解决git clone报错

    解决报错:error: The requested URL returned error: 401 Unauthorized while accessing   问题报错:error: The req ...

  3. git commit 报错 There was a problem with the editor 'vi'

    今天提交代码git  commit -a的时候出现了这个错误 上网查了一下,说是Vim的返回值出错了,出错的原因还在翻译英文, 先贴出解决方案吧 git config --global core.ed ...

  4. 解决Git操作报错

    情况一: 当我拉取的代码是最新的时候,git pull是可以正常的拉取的,但是却不可以提交,报错如下图: 情况二: 如果我目前不是最新的版本,需要git pull,此时拉取就会失败,报错如下图: 出现 ...

  5. 解决git push报错error: failed to push some refs to 的问题

    这个问题发生的背景一般是: 想把自己本地的某个项目关联到远程仓库并推送上去,接着他会做如下操作: 本地项目->远程创建仓库->本地关联远程->推送最新代码 最后一个步骤发生问题: 那 ...

  6. 解决 git pull 报错 fatal: refusing to merge unrelated histories

    我在Github新建一个仓库,写了License,然后把本地一个写了很久仓库上传. 先pull,因为两个仓库不同,发现refusing to merge unrelated histories,无法p ...

  7. git push报错大文件,删除后重新commit依然报错

    git push报错: github不能上传大文件,按道理删掉重新提交就行了 可是删掉后,git add -A,再git commit,再git push,依然报错 后来我想明白了 github上传时 ...

  8. centos git clone 报错 fatal: HTTP request failed 解决办法

    git clone报错提示 git clone https://github.com/xxxx.git Initialized empty Git repository in /root/xxxx/. ...

  9. 使用git clone 报错curl56 errno 10054解决方法

    使用git clone 报错curl56 errno 10054解决方法 ----------------版权声明:本文为CSDN博主「伽马射线爆」的原创文章,遵循CC 4.0 BY-SA版权协议,转 ...

随机推荐

  1. listen 55

    There are also green card qualifiers for some non-citizens who invest in America, and for refugees.难 ...

  2. 牛客网暑期ACM多校训练营(第三场)G:Coloring Tree(函数的思想)

    之前两次遇到过函数的思想的题,所以这次很敏感就看出来了.可以参考之前的题: https://www.cnblogs.com/hua-dong/p/9291507.html Christmas is c ...

  3. AtCoder Grand Contest 002 F:Leftmost Ball

    题目传送门:https://agc002.contest.atcoder.jp/tasks/agc002_f 题目翻译 你有\(n*k\)个球,这些球一共有\(n\)种颜色,每种颜色有\(k\)个,然 ...

  4. POJ1287(最小生成树入门题)

    Networking Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 7753   Accepted: 4247 Descri ...

  5. css3 实现运动动画 圆与椭圆

    圆: html <div class="demo4"><div></div></div> css .demo4{ width: 20 ...

  6. bzoj4176

    莫比乌斯反演 根据约数和个数公式 $ans = \sum_{i=1}^{n}\sum_{j=1}^{n}\sum_{x|i}\sum_{y|j}{[gcd(i, j)==1]}$ 交换枚举顺序 $an ...

  7. jquery中对于批量deferred的处理

    此代码仿照jquery源码中$.when()的实现 function test(i) { var dfd = $.Deferred(); if(i%2 == 0) { console.log(&quo ...

  8. [poj1222]EXTENDED LIGHTS OUT(高斯消元)

    题意:每个灯开启会使自身和周围的灯反转,要使全图的灯灭掉,判断灯开的位置. 解题关键:二进制高斯消元模板题. 复杂度:$O({n^3})$ #include<cstdio> #includ ...

  9. 《Java多线程编程核心技术》读后感(四)

    将任意对象作为对象监视器 synchronized同步代码块还支持任意对象,使用格式为synchronized(非this对象) package Second; public class Servic ...

  10. <c和指针>学习笔记2之数据和语句

    1 语句 (1)空语句----->本身只包含一个分号 (2)表达式语句 在表达式后面加上一个分号就可以把表达式转变为语句 (3)代码块 位于一对花括号之内的可选的声明和语句列表 (4)if语句 ...