TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Host Your Own Private Git Repos

1 pointsby deafcalculusalmost 7 years ago

1 comment

wahernalmost 7 years ago
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).