Live data from Hacker News

You already have a Git server

maurycyz.com

1–10 of 454 posts

Re: You already have a Git server

#6
post #4
post #3

Interesting. I am just trying to decide between self-hosting Forgejo and other options for hosting Git in own private network.

am using gitea. but thinking of switching to serve (charm).

I'm also using gitea, running on RPI5. Setup took like 15 mins, highly recommend.

Re: You already have a Git server

#8
One note, xcode and maybe some other clients can't use http "dumb mode". Smart mode is not hard to set up, but it's a few lines of server config more than this hook.

TIL about the update options for checked out branch. In practise though usually you want just the .git "bare" folder on server

Re: You already have a Git server

#9
I've used Git over SSH for several years for personal projects. It just works with no additional overhead or maintenance.

Tip: create a `git` user on the server and set its shell to `git-shell`. E.g.:

  sudo useradd -m -g git -d /home/git -s /usr/bin/git-shell git
You might also want to restrict its directory and command access in the sshd config for extra security.

Then, when you need to create a new repository you run:

  sudo -u git git init --bare --initial-branch=main /home/git/myrepo.git
And use it like so:

  git clone git@myserver:myrepo.git
Or:

  git remote add myserver git@myserver:myrepo.git
  git push -u myserver main
This has the exact same UX as any code forge.

I think that initializing a bare repository avoids the workarounds for pushing to a currently checked out branch.

Re: You already have a Git server

#10

Maybe I'm too old, but are there people that really didn't know that any ssh access is sufficient for using git?

most people think git = github

I always found these sort of categorical denigrations to be off base. If most people do think git = github then that's because they were taught it by somebody. A lot of somebodies for "most people". Likely by the same somebodies who also come to places like this. It has always taken a village to raise a child and that is just as true for an infant as a junior programmer. But instead we live in a sad world of "why didn't schools teach person x"
Post reply on HN