Funny you should ask. I had actually written this up back then – for a FreeBSD install because it’s what I use.
https://herrbischoff.com/2021/10/how-to-install-cgit-with-gi...
I’ve also tripped over something regarding “master” and “main” branches that’s easily fixed:
https://herrbischoff.com/2022/05/cgit-missing-idle-column-on...
If you want it even simpler, just run
mkdir repo.git && cd repo.git
git init —bare
in a folder on a server you have SSH access to and clone it on your local machine like git clone user@server:/path/to/repo.git