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
tangled.org but they had some security issues a few months back