It's worth mentioning that it's also very easy to set up git for use over ssh just about anywhere (digitalocean, linode, VM or container at home, etc)
The official docs cover it pretty well:
https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-...
If it's for your own use, you can skip the part about creating a `git` user, and host the files in eg `/home/$USER/repositories` instead. The repository setup instructions remain the same, just the path differs, and the `authorized_keys` file to add keys to will be in `/home/$USER` instead of `/home/git`.
It's so simple, I think it's worth showing just how simple. For a single user who has already SSH access to some server, and has installed Git on that server with apt/yum/whatever:
On the server:
mkdir project.git; cd project.git
git init --bare
In an existing Git repository on your client: git add remote newserver [email protected]:project.git
git push newserver master
[0]: https://github.com/jonashaag/klaus [1]: http://git.haldean.org