【环境】

OS: CentOS 6.5

Git: 1.7.1

【症状描述】

  Git 中心仓库路径 ~/project.git,克隆库路径 ~/project.clone,克隆库中包含一个文件 ~/project.clone/sample.js 。

  以 guest 账号登录服务器,在某个路径下执行 grunt,在克隆库目录下得到一个新的文件 ~/project.clone/sample.js。进入克隆库目录,执行 git commit ,提交成功,推送至中心库,返回错误提示 insufficient permission for adding an object to repository database 。

  另外克隆一个库为 ~/project2.clone ,手动修改其中的 ~/project.clone/sample.js ,提交成功,推送成功。

  由此可知,问题出在由 grunt 生成的 sample.js 文件。但 grunt 也是使用 guest 账号执行,双方权限一致,为什么会出现权限不足的情况,具体原因不详,只知道可能是用户组权限出了问题。

【解决方法】

  进入中心仓库:cd ~/project.git

  使用 sudo 更改目录权限:

$ sudo chmod -R g+ws *
$ sudo chgrp -R <groupname> *
$ git repo-config core.sharedRepository true

  以上需要 sudo 权限,<groupname> 是指当前用户所处的用户组,可以使用 $ groups <username> 命令来查看。

  再次执行 grunt ,提交成功,推送成功。

[Git] 解决 insufficient permission for adding an object to repository database的更多相关文章

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

    前言:这是在用jenkins去gitlab上面去拉下代码来编译,就报了这个错,在这里记录下,避免下次 报错:   17:08:17 error: insufficient permission for ...

  2. Git报错:insufficient permission for adding an object to repository database .git/objects

    在本地搭建Git服务器后,在开发机上push新代码,发现Git提示: insufficient permission for adding an object to repository databa ...

  3. git 权限问题:insufficient permission for adding an object to repository database .git

    在git pull 的时候报错:insufficient permission for adding an object to repository database .git (去仓库里的objec ...

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

    参照:http://stackoverflow.com/questions/1918524/error-pushing-to-github-insufficient-permission-for-ad ...

  5. git push error:error: insufficient permission for adding an object to repository database ./object解决

    在服务器代码库xxx.git文件夹中:1.sudo chmod -R g+ws *2.sudo chgrp -R mygroup * //mygroup是该文件夹的所有组3.git repo-conf ...

  6. git push不成功 insufficient permission for adding an object to repository database

    这常见于多用户. 1. 确保所有用户在同一个组: 2. 确保所有文件被组可读写. 当多个用户各自进行了push操作后,object目录下的文件可能各自属于各个用户.

  7. git推送报错: No path specified. See 'man git-pull' for valid url syntax或does not appear to be a git repository以及remote: error: insufficient permission for adding an object to repository databa

    本地(windows)代码想推送到linux自己搭建的git服务端,第一步是建立本地与服务端的关联,第二步是本地推送到服务端. 第一步需要看你的本地工程是否从git上clone来的,如果是clone来 ...

  8. git解决 remote: Permission to wuheng1991/site-manager.git denied to XXX

    1.问题 2.解决 生成一个新的SSH KEY ssh-keygen  -t rsa –C “youremail@example.com” 命令: 3.修改 .git/config中的url 4.gi ...

  9. git@github.com: Permission denied (publickey).////remote: Permission to xxx/test.git denied to xxx.等权限问题

    Error msg git@github.com: Permission denied (publickey) 或者: remote: Permission to xxx/test.git denie ...

随机推荐

  1. Pandas 的轴向连接 concat

    在pandas里面,另一种数据何必运算也被称为连接(concatenation).绑定(binding)或堆叠(stacking). Numpy的轴向连接, concatenation Numpy有一 ...

  2. SpagoBI 教程 Lesson 5: Creating a dashboard with BIRT and SpagoBI

    SpagoBI Lesson 5: Creating a dashboard with BIRT and SpagoBI Creating a dashboard with BIRT and Spag ...

  3. 第三百六十节,Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)的基本概念

    第三百六十节,Python分布式爬虫打造搜索引擎Scrapy精讲—elasticsearch(搜索引擎)的基本概念 elasticsearch的基本概念 1.集群:一个或者多个节点组织在一起 2.节点 ...

  4. Xianfeng轻量级Java中间件平台:流水号管理、组织机构管理

    流水号管理:现实中,经常都会和流水号打交道,至于什么是流水号,简而言之,就是按照特定格式要求产生的一个号码,并且总是按照递增的规则生成的,对于要求比较高的业务,需要流水号是连续的,比如移动营业厅排号小 ...

  5. Java多线程(九)之ReentrantLock与Condition

    一.ReentrantLock 类   1.1 什么是reentrantlock   java.util.concurrent.lock 中的 Lock 框架是锁定的一个抽象,它允许把锁定的实现作为 ...

  6. Spring集成线程池

    自己在程序中手动New很容易造成线程滥用,创建线程也是比较消耗资源的操作,所以建议如果有此需求,将线程池统一交给Spring框架进行管理. 如下: <!--Spring 集成线程池,不允许自己开 ...

  7. 决策树之Cart算法一

    Contents    1. CART算法的认识    2. CART算法的原理    3. CART算法的实现 1. CART算法的认识 Classification And Regression ...

  8. semi-global matching 算法总结

    semi-global matching(缩写SGM)是一种用于计算双目视觉中disparity的半全局匹配算法.在OpenCV中的实现为semi-global block matching(SGBM ...

  9. RGB转LAB色彩空间

    1.原理 RGB无法直接转换成LAB,需要先转换成XYZ再转换成LAB,即:RGB——XYZ——LAB 因此转换公式分两部分: (1)RGB转XYZ 假设r,g,b为像素三个通道,取值范围均为[0,2 ...

  10. daterangepicker日历插件使用参数注意问题

    显示具体时间时分秒: timePicker设置为true,//有些资料写的pickerTime不太对 重点大坑:修改时间默认展示格式,把fomat写在locale中,网上很多资料说直接写在datera ...