Git was designed for decentralized use. It's not as slick and polished as github, but it can get the job done and scales to infinity (the linux kernel has thousands of contributors and runs entirely dencentralized with git).
For write access it's more difficult without running your own server (which is super easy with gitea, gogs, etc. and just a couple clicks to setup on popular hosts like digital ocean). You could take an entirely decentralized approach and run things like the linux kernel--all patches (aka pull requests) get sent to an email list where they're reviewed, discussed, and integrated by the maintainer of the read-only repo.
For read-only access you can host a git repo on any static file store, like S3, netlify, digital ocean, etc. Just rsync/rclone/upload a bare repo from your machine and you're done: https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git...
For write access it's more difficult without running your own server (which is super easy with gitea, gogs, etc. and just a couple clicks to setup on popular hosts like digital ocean). You could take an entirely decentralized approach and run things like the linux kernel--all patches (aka pull requests) get sent to an email list where they're reviewed, discussed, and integrated by the maintainer of the read-only repo.