by lucasoshiro · 2y ago · 0 comments
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
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.
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.