没有足够的权限在智能HTTP推到Git的共享回购 [英] Insufficient Permission Pushing to Git Shared Repo over Smart HTTP

查看:160
本文介绍了没有足够的权限在智能HTTP推到Git的共享回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我们团队评估Git和要求之一是使用HTTPS作为传输方式。我一直在试图遵循的git-HTTP -backend 文档以及设置此功能使用新的智能HTTP传输一些稀疏的博客,但我只是没有得到它的工作。我知道这可能是一些愚蠢的事,但我绞尽脑汁想了它无济于事。不要假设使用git任何真正的知识,我是pretty新的工具。

I'm trying to evaluate git for our team and one of the requirements is to use HTTPS as the transport method. I've been trying to follow the git-http-backend documentation as well as some sparse blogs on setting this up using the new Smart HTTP transport, but am just not getting it working. I know that it's probably something stupid, but I've racked my brain over it to no avail. Don't assume any real knowledge with git, I'm pretty new to the tool.



现在,我可以克隆通过HTTP就好了,但是当我尝试推送,客户得到:


Right now I can clone over HTTP just fine, but when I try and push, the client gets:

$ git push
Username:
Password:
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 291 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
error: unpack failed: unpack-objects abnormal exit



服务器Apache的错误日志说:


The server Apache error log says:

错误:将对象添加到库数据库./objects权限不够

error: insufficient permission for adding an object to repository database ./objects

致命的:无法写入对象



Apache的配置:


Apache config:

SetEnv GIT_PROJECT_ROOT /opt/git
SetEnv GIT_HTTP_EXPORT_ALL
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/

<Location /git>
        AuthType Basic
        AuthName "Private Git Access"
        Require valid-user
        AuthUserFile /opt/git/passwords
</Location>


显然,我的第一个念头是文件权限,所以我做了一个快速的 CHOWN R的阿帕奇中:/ opt / git的

Obviously my first thought was file permissions, so I did a quick chown -R apache: /opt/git

# ls -l /opt/git
drwxr-xr-x. 7 apache apache 4096 Aug 12 11:06 project.git

但我仍然得到同样的错误。

But I still get the same error.

谢谢,我非常AP preciate任何帮助,我能得到这一点。

Thanks, I very much appreciate any help I can get on this.

推荐答案

尝试运行:

git repo-config core.sharedRepository true

这已经解决了类似的问题对我来说。从文档:

This had solved similar issue for me. From the docs:

core.sharedRepository

core.sharedRepository

如果属实,资源库是在多个用户之间进行共享
  组(确保所有的文件和对象是组可写)。

If true, the repository is made shareable between several users in a group (making sure all the files and objects are group-writable).

您可以验证步骤,这里给出的(这绝对是一个权限/组的问题):

Can you verify the steps as given here ( this is definitely a permissions / groups issue):

http://parizek.com/?p=177

这篇关于没有足够的权限在智能HTTP推到Git的共享回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆