搭建git服务器出现insufficient permission … database ./objects的解决


尝试搭建一个git服务器,本地分支推送到远程服务器上时出现了下面的错误:

[c]

wangminli@debian:~/myproject$ git remote add origin git@xxx.xxx.xxx.xxx:/opt/git/project.git

 

wangminli@debian:~/myproject$ git push origin master
git@115.28.86.226′s password:
Counting objects: 3, done.
Writing objects: 100% (3/3), 214 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
<strong>error: insufficient permission for adding an object to repository database ./objects</strong>

fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To git@115.28.86.226:/opt/git/project.git
! [remote rejected] master -> master (n/a (unpacker error))
error: 无法推送一些引用到 ‘git@115.28.86.226:/opt/git/project.git’

[/c]

根据提示,应该是仓库的所有者出现了问题,导致不能访问该仓库。

来到服务器端的git仓库,修改仓库所有者:

[c]

[root@Debian git]# chown -R git:git project.git/(仓库的名字)

[/c]

修改后再次推送这个本地分支,可以推送成功啦~!

[c]

wangminli@debian:~/myproject$ git remote add origin git@115.28.86.226:/opt/git/project.git
fatal: remote origin already exists.
wangminli@debian:~/myproject$ git push origin master
git@115.28.86.226′s password:
Counting objects: 3, done.
Writing objects: 100% (3/3), 214 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To git@115.28.86.226:/opt/git/project.git
<strong>* [new branch] master -> master</strong>

[/c]

Reference

小组级git服务器搭建


分享到:

3 条评论

昵称
  1. 不错的文章,内容十全十美.

  2. 不错的文章,内容文从字顺.

  3. I wish to point out my gratitude for your kindness in support of those individuals that must have help with that issue. Your special dedication to getting the solution up and down appeared to be surprisingly insightful and has all the time enabled people like me to achieve their pursuits. Your new valuable guide signifies much to me and even more to my mates. With thanks; from each one of us.
    cheap nba basketball jerseys http://www.ihomesaver.com/olm/index.asp