This is a popular topic here on discourse. Here are two of the existing threads, which have lots of useful info that you could explore.
Implementing a git-inspired version graph directly in ipfs:
Adding git repositories to ipfs and using IPLD to resolve that content on IPFS using the git commit hashes:
2 Likes