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.

Poll: Self Hosting Git Repositories

64 pointsby gmemstrabout 3 years ago
I'm looking to setup a git host to at the very least mirror my git repositories, but more likely to migrate to full time. Suggestions are welcome, but I'm also curious what HN uses!

44 comments

rapnieabout 3 years ago
Gitea (originally a fork of Gogs) is moving fast, and they are adding ActivityPub federation support to the software. This will allow you to collaborate with projects hosted on remote Gitea instances (and other software once they add federation support too). If you are working on FOSS then Codeberg [1] is a good Gitea instance, which offer Woodpecker CI and Codeberg Pages.<p>[1] <a href="https:&#x2F;&#x2F;codeberg.org" rel="nofollow">https:&#x2F;&#x2F;codeberg.org</a>
评论 #31433639 未加载
评论 #31440911 未加载
评论 #31433276 未加载
评论 #31435789 未加载
iveqyabout 3 years ago
if it&#x27;s for personal use and no access rights are needed, just use ssh.<p>If you need to add more people, but don&#x27;t require access right for the git repos (i.e. everyone will be able to force push). Still use ssh, but create a git user and git-shell as the shell to improve security.<p>If you want to go one step up, I was looking at soft-serve, however it&#x27;s too immature yet. So I added a git-shell-commands folder and added list command that will list my git repos.<p>It&#x27;s really simple!<p>If you need access rights and reviews, things will be a bit more complicated. Although git-shell seems pretty easy to add some access rules to, if not gitolite is better. For browsing, cgit and gitweb should be obvious choices, however I don&#x27;t really see the point for a minor site.<p>For code review, I&#x27;m really voting for git-appraise to take off. Once I get a coworker, that&#x27;s what we will be using.
评论 #31433247 未加载
评论 #31438838 未加载
评论 #31433653 未加载
eixiepiaabout 3 years ago
Anything else than GitLab, it&#x27;s so slow and bloated. With every &quot;update&quot; it seems to get even slower and depend even more on javascript. I really hate how so many open source projects shifted to this abnormation because Microsoft acquired GitHub, I mean, regardless of what evil shit Microsoft could think up, it can&#x27;t be worse than having to deal with this javascript turd. If your web interface can&#x27;t even just display simple information like issues page or merge requests, without depending on a huge pile of steaming javascript, you have FAILED in web design. I cry every time I&#x27;m forced to use GitLab. Just my two cents.
i0nutzbabout 3 years ago
You may want to give more details about your usecase: do you need _only_ git hosting or other features too (e.g. issue tracker, CI&#x2F;CD pipelines)? How many users will use this setup? Do you have a dedicated machine or you run it locally (e.g. in a docker container?? Hosting locally or in cloud?<p>IIRC Gitolite was aquired by Gitlab a while back, Gitweb is not really a git hosting, it&#x27;s more like a web view of your `git log`<p>Gitlab needs at least a couple of gigs of RAM to run well, double&#x2F;triple that if you need CI&#x2F;CD.<p>I have no experience wiht gogs&#x2F;gitea.
评论 #31433754 未加载
评论 #31433055 未加载
bananaramallamaabout 3 years ago
If you don&#x27;t need a front-end, push and pull directly from git. <a href="https:&#x2F;&#x2F;git-scm.com&#x2F;book&#x2F;en&#x2F;v2&#x2F;Git-on-the-Server-Setting-Up-the-Server" rel="nofollow">https:&#x2F;&#x2F;git-scm.com&#x2F;book&#x2F;en&#x2F;v2&#x2F;Git-on-the-Server-Setting-Up-...</a>
评论 #31433328 未加载
8fingerlouieabout 3 years ago
Gitea all the way.<p>Lightweight (can run on a RPi unlike GitLab), does everything you expect, can work with SQLite or MySQL&#x2F;MariaDB or PostgreSQL, and can sync remote (GitHub&#x2F;Bitbucket&#x2F;whatever) repositories locally.
gsprabout 3 years ago
I voted &quot;other&quot;: I just put bare git repositories on my VPS, and interact with them over SSH. Tiny and simple cgit exposes a read-only HTTPS interface for the repos that I want to share publicly.
评论 #31433496 未加载
arichard123about 3 years ago
I use ssh, and a script that manages ssh keys and system user accounts, with a umask change and some symlinks. This means I can add read-only ssh access for deployment keys. The remote address would be of the form ssh:&#x2F;&#x2F;{clientname}[-ro]@domain:port&#x2F;~&#x2F;repos&#x2F;{reponame}.git<p>The [-ro] gives the readonly access. I use git-shell to prevent normal ssh access to the server on those accounts.
评论 #31433391 未加载
lf-nonabout 3 years ago
You may also want to include onedev [1][2] in your exploration (<a href="https:&#x2F;&#x2F;code.onedev.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;code.onedev.io&#x2F;</a>) if you also need good CI&#x2F;CD integration.<p>My experience (as a user) has been pretty good, though I was not involved in the adminstration&#x2F;setup related aspects but I have been told it doesn&#x27;t require a lot of maintenance effort.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;theonedev&#x2F;onedev" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;theonedev&#x2F;onedev</a> [2] <a href="https:&#x2F;&#x2F;code.onedev.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;code.onedev.io&#x2F;</a>
评论 #31436446 未加载
brynbabout 3 years ago
I made Redwood, a general purpose p2p&#x2F;distributed database (and blob store) with pluggable merge algorithms (including some cool CRDTs, like what @josephg is working on).<p>Turns out it makes for a great self-hosted git solution, so I made a git remote plugin that allows you to interact with it using regular vanilla git commands: <a href="https:&#x2F;&#x2F;github.com&#x2F;redwood&#x2F;redwood&#x2F;tree&#x2F;libp2p-connectivity2&#x2F;demos&#x2F;git-integration" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;redwood&#x2F;redwood&#x2F;tree&#x2F;libp2p-connectivity2...</a>
hamdouniabout 3 years ago
Gitea+drone [0] for all my projects for several years : dockerized for even more simplicity. An update is nearly just &#x27;compose pull &amp;&amp; compose up&#x27;.<p>[0] <a href="https:&#x2F;&#x2F;www.drone.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.drone.io&#x2F;</a>
harryvederciabout 3 years ago
I know this specifically asks for git, but I just want to mention fossil[0] here as it has git export, a built-in wiki + ticket system, etc, and is incredibly easy to self-host.<p>[0] <a href="https:&#x2F;&#x2F;fossil-scm.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fossil-scm.org&#x2F;</a> (created by Richard Hipp, the guy that made SQLite)
stevekempabout 3 years ago
I used to use a self-hosted instance of gitbucket:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;gitbucket&#x2F;gitbucket" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gitbucket&#x2F;gitbucket</a><p>That&#x27;s a single .WAR file, running under Java which was nice and easy to get started with, and even has support for some trivial CI&#x2F;CD actions. Unfortunately a sudden death of the docker container it was running with corrupted the internal database to the extent that it wouldn&#x27;t restart. (All my repositories were fine, on-disk, but the issues and similar stuff was mangled beyond belief.)<p>At that point I realized that I didn&#x27;t use the issues, or pull-request facilities except very very rarely, so I switched to using bare repositories on a remotely hosted virtual-server.
Tinkeringzabout 3 years ago
While I have not used it, softserve looks like a cool terminal&#x2F;SSH based remote git server.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;charmbracelet&#x2F;soft-serve" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;charmbracelet&#x2F;soft-serve</a>
angst_riddenabout 3 years ago
I just host on my VPS and use ssh to access. My VPS gets imaged nightly (for one kind of backup) and versioned back ups using Restic.<p>I only collaborate with folks who I trust enough to give accounts, which means most are just personal repos.
rollcatabout 3 years ago
SourceHut (<a href="https:&#x2F;&#x2F;sr.ht" rel="nofollow">https:&#x2F;&#x2F;sr.ht</a>) is open source, although I&#x27;ve never tried setting it up for self-hosting. Anyone here with experience?
评论 #31433420 未加载
stillbournealmost 3 years ago
I run gitlab on my kube cluster and installed that via helm charts and configured the omniauth system to communicate with my keycloak server via oidc. Overall complexity 6&#x2F;10 took about 5 hours to fuss with it the first time. Subsequent deployments became easier. I hear Gitea is also a good selfhosted solution and less complex to install. However, I went with Gitlab specifically because we use it at work and I want to practice gitops&#x2F;devops with it.<p><a href="https:&#x2F;&#x2F;docs.gitlab.com&#x2F;charts&#x2F;installation&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.gitlab.com&#x2F;charts&#x2F;installation&#x2F;</a>
lifepillarabout 3 years ago
I wonder whether people monitor resources consumed by processes… A couple of years ago I had installed Gitea, but it was constantly using between 5-10% CPU. I switched to Gogs, and it doesn’t waste CPU cycles. So, I have stayed with Gogs. My needs are minimal (self-hosting for personal use), so I could probably switch to something even more minimal, but so far Gogs works fine.
camgunzabout 3 years ago
I use stagit along with <a href="https:&#x2F;&#x2F;hosakacorp.net&#x2F;p&#x2F;stagit-server.html" rel="nofollow">https:&#x2F;&#x2F;hosakacorp.net&#x2F;p&#x2F;stagit-server.html</a> and basic auth for private repos. Works amazingly. I mess with it so infrequently I constantly forget the name of it (say it three times! stagit stagit stagit!)
gonewestabout 3 years ago
We&#x27;re serving git over https using apache2, where apache handles authentication via LDAP. We also serve subversion repos with a similar setup. We use separate web services for search, code review, CI, and issue tracking.<p>Running this way does involve more moving parts, but every part is relatively self-contained and we can replace one thing without disrupting everything.<p>[Edit] one other benefit I should add, all the other services like code review and CI are compatible with git and svn, so the development teams have consistent tools regardless which vcs they&#x27;re running for a particular project.
_cbdevabout 3 years ago
I prefer to do my project management in in disjunct tools from the actual source control (and I dislike the tech stack of most integrated solutions), so my main repository host is running fugit[1], which simply allows push&#x2F;pull access on a per-ssh-key basis. Some repositories are then exposed to the Web using cgit[2]<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;cbdevnet&#x2F;fugit" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cbdevnet&#x2F;fugit</a> [2] <a href="https:&#x2F;&#x2F;git.zx2c4.com&#x2F;cgit&#x2F;" rel="nofollow">https:&#x2F;&#x2F;git.zx2c4.com&#x2F;cgit&#x2F;</a>
markphipabout 3 years ago
You should add Gerrit to your list: <a href="https:&#x2F;&#x2F;www.gerritcodereview.com" rel="nofollow">https:&#x2F;&#x2F;www.gerritcodereview.com</a><p>Gitweb does not belong, it is just a repository viewer.
rvzabout 3 years ago
As long as you are not looking to go totally all in [0] on GitHub or any SaSS based solution then either self-host solution option is fine.<p>ReactOS is a fine example of this: [1]<p>[0] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22867803" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22867803</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;reactos&#x2F;reactos#code-mirrors" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;reactos&#x2F;reactos#code-mirrors</a>
captn3m0about 3 years ago
I sync stuff via the Gitea mirror feature. Works well.
评论 #31433214 未加载
winkabout 3 years ago
My main repos are all on Github (a few on bitbucket from back when Github did not have free private repos... how many years ago was that?) and I mirror them all with a simple cronjob of &quot;git pull --rebase&quot; (this gets into the normal backup cycle then)<p>I used to run gitolite (pre Github&#x27;s existence :P) and I&#x27;m thinking about gitea, but for now I am very happy with my setup.
dividedbyzeroabout 3 years ago
For those on Gitea: What CI (if any) are you using?
评论 #31435471 未加载
评论 #31438696 未加载
zeckalphaabout 3 years ago
No need to mirror as each checkout is a mirror. I just maintain checkouts of all the things with <a href="https:&#x2F;&#x2F;myrepos.branchable.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;myrepos.branchable.com&#x2F;</a>
sebazzzabout 3 years ago
Gitea is the best thing that comes near Github is you are resource constrained.
ww520about 3 years ago
Voted others. Just ssh into a Linux server. Have a special user account ‘git’ on the server to hold all the repos so they can just reside at the base directory of its home.<p>Access via ssh:&#x2F;&#x2F;git@server:~&#x2F;myproj1.git.
XorNotabout 3 years ago
I have a git folder in my home directory that I use syncthing to mirror.<p>I guess I would like a web interface that ran locally to provide other features, but the close to 0-maintenance and complete privacy of this works for me.
CommanderDataabout 3 years ago
Used to host gitlab on my Synology. But it&#x27;s so resource heavy I stopped. Also the migrations between versions weren&#x27;t always pain free and costed me many hours of my time.<p>I&#x27;m looking at alternatives.
评论 #31436206 未加载
rasculabout 3 years ago
Gitea is great, and there&#x27;s this reference getting more out of it:<p><a href="https:&#x2F;&#x2F;gitea.com&#x2F;gitea&#x2F;awesome-gitea" rel="nofollow">https:&#x2F;&#x2F;gitea.com&#x2F;gitea&#x2F;awesome-gitea</a>
livelaceabout 3 years ago
Gitea. Also, there are GitNex (mobile app for Gitea) and Jenkins plugin.
second--shiftabout 3 years ago
Gogs &#x2F; gitea fan here. Used both, can recommend either. One-liner docker command to set up &amp; a simple docker-compose.yml to declare everything in one place.
durnygburabout 3 years ago
SSH access through an user with git-shell as the shell. git init --bare on remote. Hosted on the tiniest VPS instance available.
nullbytesmatterabout 3 years ago
I highly, highly recommend cgit. It&#x27;s a lot safer than hosting accounts, databases, etc. It&#x27;s a read only frontend for bare repositories.
fullstopabout 3 years ago
I&#x27;m still running gitosis over here because of technical baggage. If I had the time and energy to escape it, I&#x27;d move to gitolite.
alfiedotwtfabout 3 years ago
For personal stuff, I use an s3 bucket that&#x27;s mounted locally via FUSE as the origin. A bit slow, but works out of the box!
jdrightabout 3 years ago
Radicle <a href="https:&#x2F;&#x2F;radicle.xyz&#x2F;" rel="nofollow">https:&#x2F;&#x2F;radicle.xyz&#x2F;</a>
vesinisaabout 3 years ago
GitLab has a decent CI functionality baked in, should it ever come to need.
dancemethisabout 3 years ago
Fork Gitea, remove Discord references for safety, perfect.
stn_zaabout 3 years ago
Suggestion: Don&#x27;t.*<p>But, if you have your mind set: GitLab is great.<p>(It WILL break at one point or another, and you will need to do recovery)
评论 #31433189 未加载
1MachineElfabout 3 years ago
SourceHut
blaise-pabonalmost 3 years ago
charm.sh softserve