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!
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://codeberg.org" rel="nofollow">https://codeberg.org</a>
if it's for personal use and no access rights are needed, just use ssh.<p>If you need to add more people, but don'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's too immature yet. So I added a git-shell-commands folder and added list command that will list my git repos.<p>It'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't really see the point for a minor site.<p>For code review, I'm really voting for git-appraise to take off. Once I get a coworker, that's what we will be using.
Anything else than GitLab, it's so slow and bloated. With every "update" 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't be worse than having to deal with this javascript turd. If your web interface can'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'm forced to use GitLab. Just my two cents.
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/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'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/triple that if you need CI/CD.<p>I have no experience wiht gogs/gitea.
If you don't need a front-end, push and pull directly from git. <a href="https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server" rel="nofollow">https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-...</a>
Gitea all the way.<p>Lightweight (can run on a RPi unlike GitLab), does everything you expect, can work with SQLite or MySQL/MariaDB or PostgreSQL, and can sync remote (GitHub/Bitbucket/whatever) repositories locally.
I voted "other": 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.
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://{clientname}[-ro]@domain:port/~/repos/{reponame}.git<p>The [-ro] gives the readonly access. I use git-shell to prevent normal ssh access to the server on those accounts.
You may also want to include onedev [1][2] in your exploration (<a href="https://code.onedev.io/" rel="nofollow">https://code.onedev.io/</a>) if you also need good CI/CD integration.<p>My experience (as a user) has been pretty good, though I was not involved in the adminstration/setup related aspects but I have been told it doesn't require a lot of maintenance effort.<p>[1] <a href="https://github.com/theonedev/onedev" rel="nofollow">https://github.com/theonedev/onedev</a>
[2] <a href="https://code.onedev.io/" rel="nofollow">https://code.onedev.io/</a>
I made Redwood, a general purpose p2p/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://github.com/redwood/redwood/tree/libp2p-connectivity2/demos/git-integration" rel="nofollow">https://github.com/redwood/redwood/tree/libp2p-connectivity2...</a>
Gitea+drone [0] for all my projects for several years : dockerized for even more simplicity. An update is nearly just 'compose pull && compose up'.<p>[0] <a href="https://www.drone.io/" rel="nofollow">https://www.drone.io/</a>
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://fossil-scm.org/" rel="nofollow">https://fossil-scm.org/</a> (created by Richard Hipp, the guy that made SQLite)
I used to use a self-hosted instance of gitbucket:<p><a href="https://github.com/gitbucket/gitbucket" rel="nofollow">https://github.com/gitbucket/gitbucket</a><p>That'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/CD actions. Unfortunately a sudden death of the docker container it was running with corrupted the internal database to the extent that it wouldn'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'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.
While I have not used it, softserve looks like a cool terminal/SSH based remote git server.<p><a href="https://github.com/charmbracelet/soft-serve" rel="nofollow">https://github.com/charmbracelet/soft-serve</a>
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.
SourceHut (<a href="https://sr.ht" rel="nofollow">https://sr.ht</a>) is open source, although I've never tried setting it up for self-hosting. Anyone here with experience?
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/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/devops with it.<p><a href="https://docs.gitlab.com/charts/installation/" rel="nofollow">https://docs.gitlab.com/charts/installation/</a>
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.
I use stagit along with <a href="https://hosakacorp.net/p/stagit-server.html" rel="nofollow">https://hosakacorp.net/p/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!)
We'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're running for a particular project.
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/pull access on a per-ssh-key basis. Some repositories are then exposed to the Web using cgit[2]<p>[1] <a href="https://github.com/cbdevnet/fugit" rel="nofollow">https://github.com/cbdevnet/fugit</a>
[2] <a href="https://git.zx2c4.com/cgit/" rel="nofollow">https://git.zx2c4.com/cgit/</a>
You should add Gerrit to your list: <a href="https://www.gerritcodereview.com" rel="nofollow">https://www.gerritcodereview.com</a><p>Gitweb does not belong, it is just a repository viewer.
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://news.ycombinator.com/item?id=22867803" rel="nofollow">https://news.ycombinator.com/item?id=22867803</a><p>[1] <a href="https://github.com/reactos/reactos#code-mirrors" rel="nofollow">https://github.com/reactos/reactos#code-mirrors</a>
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 "git pull --rebase" (this gets into the normal backup cycle then)<p>I used to run gitolite (pre Github's existence :P) and I'm thinking about gitea, but for now I am very happy with my setup.
No need to mirror as each checkout is a mirror. I just maintain checkouts of all the things with <a href="https://myrepos.branchable.com/" rel="nofollow">https://myrepos.branchable.com/</a>
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://git@server:~/myproj1.git.
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.
Used to host gitlab on my Synology. But it's so resource heavy I stopped. Also the migrations between versions weren't always pain free and costed me many hours of my time.<p>I'm looking at alternatives.
Gitea is great, and there's this reference getting more out of it:<p><a href="https://gitea.com/gitea/awesome-gitea" rel="nofollow">https://gitea.com/gitea/awesome-gitea</a>
Gogs / gitea fan here. Used both, can recommend either. One-liner docker command to set up & a simple docker-compose.yml to declare everything in one place.
Suggestion: Don'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)