I ran a ssh server for a while to store git repositories. We had some with secrets in and I didn't want them on github. I needed to provide read only access and read write access for only some of the repos. I ended up with a bash script that configure system users and groups and permissions to do the job. It's here:
https://github.com/artumi-richard/ssh-git-hosting
I stopped using it years ago. It had the additional advantage of no artificial limits (file sizes etc).