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

在执行git pull时遇到错误:insufficient permission for adding an object to repository database .git/objects。通过一系列步骤解决此问题,包括备份.git目录,删除空对象文件,执行git fetch -p, git fsck --full,设置远程跟踪分支,并最终成功完成git操作。" 133116878,20038566,MATLAB在多无人机协同任务规划中的应用,"['无人机开发', 'MATLAB编程', '路径规划算法', '任务分配算法', '协同控制系统']
摘要由CSDN通过智能技术生成

突然报错,我好慌:

问题描述: 执行git pull,返回这坨:
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 3), 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

 

网上找了很多办法,亲测有用:

步骤一:进入项目根目录

cd /path/to/repo.git 
sudo chgrp -R groupname .
sudo chmod -R g+rwX .

步骤二:再次执行 git pull,出现以下这坨:
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
error: object file .git/objects/2b/4653bd306413ba6f70b65fc672ce897653da00 is empt

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值