git push 异常 remote: error: insufficient permission

git push 到远程服务器时,抛出异常:

remote: error: insufficient permission for adding an object to repository database ./objects
remote: fatal: failed to write object
fatal: sha1 file '<stdout>' write error: Broken pipe
error: remote unpack failed: unpack-objects abnormal exit


解决办法:

[root@zhblog git]# ls
readme.txt  res.git  t2.git  test.git  t.git
[root@zhblog git]# id git
uid=1000(git) gid=1000(git) groups=1000(git)
[root@zhblog git]# chown -R git res.git/
[root@zhblog git]# cd res.git/
[root@zhblog res.git]# git config --bool core.bare true


重试:

Administrator@PC-20171115IKZF MINGW64 /e/res/res (master)
$ git push origin master
Enumerating objects: 6, done.
Counting objects: 100% (6/6), done.
Delta compression using up to 4 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (6/6), 16.44 MiB | 1.96 MiB/s, done.
Total 6 (delta 0), reused 0 (delta 0)
To 39.98.172.45:/home/git/res.git
 * [new branch]      master -> master

 

 

 

展开阅读全文