Given your requirements, I think a Git repository might suffice, at least for a start.
If you want true collaborative editing, though, (as in, two separate developer working on the same file, Google Docs style), that needs a much sophisticated system, and I haven't found an open source solution for that. If you are willing to create one, I'm all ears, and count me in as a contributor!