flocks.dev

How I do my computing

Using git bare repository

This is nothing revolutionnary but it's worth reminding that if you already own a VPS, or any server, and you need to create private git repository, you don't need to use github or any equivalent platform.

Sometimes, you work on a side project that is intended to remain private. You still want git history, for obvious reason, and you still want to be able to clone the repo and work from multiple PC.

If you already own a VPS, or any kind of server, that is accessible via SSH and git is installed there, you already own a GIT server.

You just need to init a bare repo with

git init --bare .

And that's it!

On your PC, just config the remote so it points to your server.

git remote add origin username@URL-SERVER:~/path/to/repo