There are also open source alternatives like Gitea. But a centralized service isn't even needed. Git was designed from ground up to allow pulling peer-to-peer, it's just less convenient.
I see. I think i even remember someone working on a NOSTR variant, but that's maybe a false memory. Anyhow :)
EDIT: indeed, there is... https://github.com/NostrGit/NostrGit (last mod 1 year ago though)