Git的控制访问资源库 [英] Git controlled access to repository

查看:116
本文介绍了Git的控制访问资源库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Apache服务器一个Git仓库。怎样才能让我的开发人员能够完全访问即读写访问到存储库。我的工作在Windows平台上。

I have a git repository in Apache server. How can allow my developers to have full access i.e read and write access to the repository. I am working on windows platform.

推荐答案

我们的想法是从httpd的Apache配置文件中使用 的git-HTTP后端 EXE。结果
这是智能http协议,我在这个答案。

The idea is to call git directly from the httpd Apache config file using the git-http-backend exe.
This is part of the smart http protocol, that I mention in this answer.

Env GIT_PROJECT_ROOT C:/GIT/Apache/repositories
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
ScriptAliasMatch \
    "(?x)^/(.*/(HEAD | \
                    info/refs | \
                    objects/(info/[^/]+ | \
                             [0-9a-f]{2}/[0-9a-f]{38} | \
                             pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
                    git-(upload|receive)-pack))$" \
                    "C:/Program Files/git/libexec/git-core/git-http-backend.exe/$1"

该脚本(这在任何Git的分布)就可以通过http获得git的查询并返回结果。

That script (which is in any Git distribution) will be able to get a git query over http and return the result.

您可以在在Windows上设置的Git服务器使用的git-HTTP后端一个完整的例子。 exe文件

对于更细粒度的访问控制级别,您可以添加像一个授权层 gitolite 的httpd.conf (gitolite然后将调用打-HTTP后端是否授权混帐查询)。结果
我在cunjunction使用它与 LDAP(用于身份验证的一部分),但你不必使用LDAP,只要确保你的Apache配置设置为先验证用户身份,为了gitolite有一个用户ID一起工作(允许或拒绝)。

For a finer-grained access level control, you can add an authorization layer like gitolite in your httpd.conf (gitolite will then call hit-http-backend if it authorizes the git query).
I use it in cunjunction with an LDAP (for the authentication part), but you don't have to use an LDAP, just make sure your Apache config is set up to authenticate users first, in order for gitolite to have an user id to work with (allow or deny).

这篇关于Git的控制访问资源库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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