Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Something that few people remember is that if you have access to a filesystem through SSH, then you can have a remote Git repository with no configuration!

In the remote machine, you only need to create a bare repository:

git init --bare

And in your "client" machines you use it like any other remotes:

git remote add my_remote my_user@my_host:path_to_repo

It can be useful if for some reason you don't want to use GitHub/GitLab/Bitbucket/etc or as a glorified scp



For quite a while before I built my homelab, my git server was a flash drive plugged into my OpenWRT router.

Honestly I still kind of prefer that to gitlab et al. It's nice to not have to leave my terminal to setup a new repo. It takes so much more effort to log into a website and dismiss a bunch of notifications before I can click even more buttons to create a new repo.

I like having all my repos accessible through the website, but I really just want to create new projects through ssh like a civilized person.


Yes this is exactly how I do my private git hosting!

    ssh example.com 'git init --bare git/foo.git'
    git remote add origin example.com:git/foo.git
For other services too there are usually simple solutions like this. The low spec VPS never even sweats this way.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: