Hacker News new | ask | show | jobs
by comrade1234 5 hours ago
Git is pretty simple to host yourself. For literally decades I've used git and gitolite to host git for me and a revolving team of developers.

But if you want it to be public though where anyone can access/fork it then you have to deal with "spam".

2 comments

How do you deal with bot traffic and traffic from AI that's trying to get training data from your codebase
Same way you would for any other server. And I mean that 100% literally, given that at the command-line level the remote is simply a URL: https://git-scm.com/docs/git-remote
Only developers that have sent me their public ssh key have access to
I'm not familiar with git, but can you post a read-only version publicly so others can still access all the commit history but not be subjected to pull requests?
That's pretty much what git over https does by default (is it even possible to do read-write to a git repo over https instead of ssh?).

https://git-scm.com/docs/http-protocol

> is it even possible to do read-write to a git repo over https instead of ssh?

Yes; it's not only possible but very common: https://docs.github.com/en/get-started/git-basics/about-remo...

(IIRC it is in fact actually even sometimes preferable from a security standpoint; or at least that's the tentative conclusion I've reached under a few specific circumstances over the years, although the exact details elude my memory at the moment.)

If you have somewhere to host it you can go with https://forgejo.org/ and have control over everything.
Git doesn’t even need to be “hosted” in the traditional sense. The whole point of it is that it is distributed and you don’t actually need a centralized source of truth.