People have apparently started believing that in order to use git,
you'd have to also have to host the project on Github or Gitlab:

* A few weeks ago, a friend told me that he keeps [his `pass` password repository](https://www.passwordstore.org/) on Github.
* [Beej wrote a guide on git](https://beej.us/guide/bggit/) and the Github workflow is very prominent in it
* I came home from FOSDEM with a Github and a Gitlab sticker, but not with one for `git send-email` or cgit.

I feel that is is underreported that
**you can easily host Git repos on a normal Unix account**.
I use this all the time myself for my personal projects --
I maintain far more repositories locally over SSH than I expose on hosted platforms.
This is not visible on the public internet,
but maybe that makes it especially mention-worthy.

## How it's done

All you need is an account on a Unix/Linux machine, which you can reach over SSH.

1. On the remote side, set up the repo:

   ```
   mkdir -p ~/repos/foobar.git
   cd ~/repos/foobar.git
   git init --bare
   ```

2. On the local side, set up the remote:

   ```
   git remote add foobar user@hostname:repos/foobar.git
   git push --set-upstream foobar main
   ```

There is not much more to it. Now you can push and pull.

A more detailed description that also covers SSH keys can be found in the [Git Book](https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server).

## What if I need more?

<img src="/images/git-send-email-300.png" style="float: right; border: 1px solid black; margin-left: 0.5em; max-width: 40%;">

The approach scales and extends to bigger endeavors as well.

* **Web UI:** You can set up [cgit](https://git.zx2c4.com/cgit/about/) on a web server to render your repositories.
* **Code review:** Some projects do code reviews over [`git send-email`](https://git-send-email.io/).
The Linux kernel is known for this and scales up to thousands of developers.

If a project grows and you want to work with people who can't wrap their heads around this,
you can still fall back to a hosted platform after the fact and push your repository there later.
