TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Host Your Own Private Git Repos

1 点作者 deafcalculus将近 7 年前

1 comment

wahern将近 7 年前
It&#x27;s worth pointing out that you can host a public, read-only Git repository over HTTP <i>without</i> running any special software or permitting anonymous SSH. All you do is clone a bare Git repository into a directory that is publicly readable via your preferred HTTP daemon and run `git --bare update-server-info`. Et voila. It doesn&#x27;t provide a fancy web GUI[1], but it does allow people to clone, and at the end of the day that&#x27;s all you need for publishing your work to serious contributors.<p>For me this was the killer feature for transitioning to Git from SVN for my personal projects early on in the distributed SCM wars. I&#x27;ve been hosting my own services for over 15 years, and not having to manage niche daemons is extremely important to me from a time and security perspective. The only additional code I need to keep in mind is a simple post-receive hook that synchronizes a master Git repository to the public HTTP mirror on the same host, because I don&#x27;t want my master repositories accessible within the HTTP daemon&#x27;s chroot&#x27;d environment. I just hardlink that hook into any new repository I create.<p>Theoretically one could write a pure browser Git viewer and then the puzzle would be complete. The Git HTTP protocol doesn&#x27;t utilize &quot;index.html&quot;, so you can drop the JavaScript viewer into the same directory as the bare Git repository. Currently I put a simple HTML page at index.html telling people know that the directory is for cloning via a Git client (sometimes along with a link to the non-canonical Github mirror so people can view the code online).