git push failed Because the Fault of insufficient permission for adding an object

来源:互联网 发布:网路优化 编辑:程序博客网 时间:2024/06/06 02:19

Here is the fault print:

Counting objects: 3, done.Writing objects: 100% (3/3), 214 bytes | 0 bytes/s, done.Total 3 (delta 0), reused 0 (delta 0)remote: error: insufficient permission for adding an object to repository database objectsremote: fatal: failed to write objecterror: unpack failed: unpack-objects abnormal exitTo git@192.168.1.102:/home/git/test.git ! [remote rejected] master -> master (unpacker error)error: failed to push some refs to 'git@192.168.1.102:/home/git/test.git'

The reason is that the git repo doesn’t have the authority.Input the ls -alh to check the owner of the git repo(mine is test.git):

ls -alh test.git

and see that the owner and group owner is root ,change to current user git:

sudo chown -R git:git git_repo(test.git)
阅读全文
0 0
原创粉丝点击