2026-05-14
I was figuring out how to use cgit when I discovered that I can just “host” it with plain ssh.
Assuming you already have your ssh access to the server, make a bare 1 repository and upload it somewhere.
git clone --bare proj proj.git
sftp user@ip:foldernote the scp notation :folder here, if we want to add it as a remote, we have to use user@ip:<path_to_.git_folder>. 2
git remote add origin user@ip:folderThe above use the scp notation2…. and it’s done.
Honestly didn’t expect it to be this simple, but here we go, a fully functioning git remote without any web stuff or config.
After a while, it can be cumbersome to type some dir address into the clone, and using a normal user for that is not really a good idea for security.
It’s better to have a dedlicated and restricted git user that is used to manage the repos.
See https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server, the process is the same for FreeBSD.