Reputation: 816
I have a few git repos which are different components in the same project. The overhead of maintaining so many repositories and switching between them is too much for me.
But, what stops me from putting them in the same repo is that I do not want the commits to mix (I don't want one commit which contains changes in two or more directories). This is important because part of the modules are forks of other projects and I might want to submit part of my work to the original repos.
The question is: Is there some tool which automatically splits a single commit into multiple commits (one per directory)?
(Even better: keeping the repos separate but having some mega-meta-repo which gives an illusion of a single repository and manages all the per-project commits under the hood ?) Thanks
Upvotes: 1
Views: 221
Reputation: 32260
I've been there too! Most times, submodules can be a PITA.
I recommend using a subtree (git-subtree
), which is available since Git 1.7.11. Each subtree has its own independent history. Here's the official documentation.
Atlassian has a nice introduction to subtrees, Alternatives To Git Submodule: Git Subtree.
Upvotes: 2