设置只读http访问git repo [英] Setting up read-only http access to git repo
问题描述
如何通过http 访问远程git仓库,但仅限于克隆?
也许借助于nginx(已经运行)和 git -http-backend
( git-http-fetch $ c $注意:我假设你的意思是匿名的只读访问权限,而不是只读访问权限。我认为没有办法区分clone和git中的获取。
你想设置smart HTTP(推荐),或者愚蠢的HTTP一个?
对于哑HTTP,它足以禁止(或者不设置)WebDAV - 这是对于智能HTTP,请遵循匿名读取访问指导,但认证写入访问 / em>在 git-http-backend
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屋!