What problem does git subtree solve?
When and why should I use that feature?
I\'ve read that it is used for repository separation. But why would I not j
A real use case that we have where git subtree was a salvation:
The main product of our company is high modular and developed in several projects in separate repositories. All modules have their separate roadmap. Whole product is composed with all modules of concrete versions.
In parallel the concrete version of whole product is customized for each of our clients - seperate branches for each module. Customization have to be made sometimes in several project at once (cross-module customization).
To have a separate product life cycle (maintenance, feature branches) for customized product we introduced git subtree. We have one git-subtree repository for all customized modules. Our customization are everyday 'git subtree push' back to all original repositories to customization branches.
Like this we avoid managing many repos and many braches. git-subtree increased our productivity several times!
UPDATE
More details about solution that was posted to comments:
We created a brand new repository. Then we added each project that had client branch to that new repo as subtree. We had a jenkins job that was pushing back master changes to original repositories to client branch regularly. We worked just with "client repo" using tipical git flow with feature and maintenance branches.
Our 'client' repo had also building scripts that we also adapted for this particular client.
However there is a pitfall of presented solution.
As we were going farther and farther from the main core development of product the possible upgrade for that particular client was more and more difficult. In our case it was ok as the state of project before subtree had been already far a way of main path, so the subtree introduce at least order and possibility to introduce default git flow.