git push远程推送失败解决方式error: remote unpack failed: unable to create temporary object directory

具体操作场景

1. 我A服务器,使用root账号,创建了如下仓库:

git init --bare srs_server.git

然后在A服务器,添加了用户和组

groupadd mayuantao
useradd -m mayuantao -g mayuantao -s /bin/bash -d /home/mayuantao
passwd mayuantao

此时,git仓库的权限还是root账号的。

2. 在B服务器,git clone代码修改后,使用mayuantao用户push的时候,会报如下错误:

git push远程推送失败解决方式error: remote unpack failed: unable to create temporary object directory_第1张图片

3. 解决方式:

在A服务器此git仓库目录下,执行如下命令,可以使用组共享操作此git仓库

git core.sharedRepository group

再给mayuantao这个组操作赋权限

chown mayuantao:mayuantao srs_server.git/
cd srs_server.git/
chown mayuantao:mayuantao * -R

到这里就解决了,再去B服务器git push成功。

你可能感兴趣的:(git)