Git history merge with Subtree

While developing an application, it may be the case that, what in the beginning seemed an external module, perfect to be used independently on the application being developed, may become part of the business logic and can not be easily re-used.

The quickest solution, even if probably the less manageable, would be to use a sub-module. If you prefer a better way, you could try joining the two repositories, including the history of developed modules so far. Subtree is a tool embedded into VCS git, that could be helpful.

It is a good alternative solution, compared to the one involving a sub-module, as it allows to choose the merging type, e.g. with or without tree squashing, selecting a given branch instead of another.