That would be... git. It's specifically designed to be used in the distributed manner that you describe.
tangled.org but they had some security issues a few months back
what issues? i think you are thinking of radicle https://radicle.dev/2026/09/23/disclosure-of-vulnerability-i...
ooops yes sorry about that got them totally mixed up
Or Git