【发布时间】:2017-04-05 14:00:53
【问题描述】:
多年来,我一直在努力在 Redhat 上的 apache 下设置 Git。
- Apache 版本:erver 版本:Apache/2.4.6 (Red Hat Enterprise Linux)
- Git 版本 1.8.3.1
- Red Hat Enterprise Linux Server 7.1 Beta 版
- apache下的Git配置:
<VirtualHost *:80> SetEnv GIT_PROJECT_ROOT /var/www/git SetEnv GIT_HTTP_EXPORT_ALL ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/ <Directory "/usr/libexec/git-core*"> Options ExecCGI Indexes Order allow,deny Allow from all Require all granted </Directory> <LocationMatch "^/git/.*/git-receive-pack$"> AuthType Basic AuthName "Git Access" AuthUserFile /var/www/passwd.git Require valid-user </LocationMatch> </VirtualHost>
- 在我做的服务器站点上
mkdir /var/www/test1 cd /var/www/git/test1 # init repo git init --bare touch git-daemon-export-ok cp hooks/post-update.sample hooks/post-update git config http.receivepack true git config core.sharedRepository group git update-server-info chown -R apache:apache . chmod -R 775 .
- 服务器上的 Git 配置文件如下
[core] repositoryformatversion = 0 filemode = true bare = true sharedRepository = group [http] receivepack = true
在我将裸服务存储库 /var/www/git/test1 克隆为之后
当我从客户端推送任何更改时,我仍然收到错误
$ git push origin master Counting objects: 3, done. Writing objects: 100% (3/3), 202 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) Username for 'http://192.168.26.129': briangit remote: error: insufficient permission for adding an object to repository database ./objects remote: fatal: failed to write object error: unpack failed: unpack-objects abnormal exit To http://192.168.26.129/git/test1 ! [remote rejected] master -> master (unpacker error) error: failed to push some refs to 'http://192.168.26.129/git/test1'
我在网上做了很多研究,并尽了一切可能的尝试。 我真的不知道问题是什么。请帮忙。
【问题讨论】:
-
它是裸(空)回购吗?