Great software that could be reused elsewhere is often bound in a larger repository (such as “the main project”). This binding can prevent code from being truly reused elsewhere. A typical solution to this problem is simply copying the files into a new repo and write a commit like git commit -m "Move everything from the old project" . Unfortunately, the history of that new repository is entirely removed, and along with that, all the design opinions and context for why changes ended up how they did.

Wouldn't it be nice if we could move all those files into a new repo and keep the relevant history? It’s time for you to learn about subtree split.