An excellent tool I have used for similar purposes in the past (although it can do other things as well) is git-subtree. I recommend checking it out: <a href="https://github.com/apenwarr/git-subtree" rel="nofollow">https://github.com/apenwarr/git-subtree</a><p>Edit a more useful page: <a href="https://github.com/apenwarr/git-subtree/blob/master/git-subtree.txt" rel="nofollow">https://github.com/apenwarr/git-subtree/blob/master/git-subt...</a>