设置只读http访问git repo [英] Setting up read-only http access to git repo

查看:144
本文介绍了设置只读http访问git repo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过http 访问远程git仓库,但仅限于克隆
也许借助于nginx(已经运行)和 git -http-backend git-http-fetch




你想设置smart HTTP(推荐),或者愚蠢的HTTP一个?



对于哑HTTP,它足以禁止(或者不设置)WebDAV - 这是对于智能HTTP,请遵循匿名读取访问指导,但认证写入访问

/ em>在 git-http-backend a> manpage,将其从Apache转换为nginx,并稍微修改。请注意,匿名读取但经过身份验证的写入文档可能不完整,但您不必担心无论如何都无法正确写入(推送)访问,不是吗?


how can I have a remote git repo which is accessible via http but only for cloning? Maybe with the help of nginx (already running) and git-http-backend (git-http-fetch ?).

解决方案

NOTE: I assume that you meant anonymous read-only access; there is no way to distinguish between clone and fetch in git, I think.


Do you want to set up "smart" HTTP (recommended), or "dumb" HTTP one?

For "dumb" HTTP it is enough to forbid (or just do not set up) WebDAV - this is how pushes come with "dumb" HTTP (no git on server side).

For "smart" HTTP follow directions for anonymous read access but authenticated write access in git-http-backend manpage, translating it from Apache to nginx, and modifying slightly. Note that documentation for anonymous read but authenticated write might be incomplete, but you do not worry about authenthicated write (push) access succeding anyway, isn't it?

这篇关于设置只读http访问git repo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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