Splitting a repository

Sometimes a project tracked with Git is not one logical project but several projects. This may be fully intentional and there is nothing wrong with it, but there can also be cases where the projects tracked in the same Git repository really should belong to two different repositories. You can imagine a project where the code base grows and at some point in time, one of the subprojects could have value as an independent project. This can be achieved by splitting the subfolders and/or files that contain the project that should have its own repository with the full history of commits touching the files and/or folders.

Getting ready

In this example, we'll use the JGit repository so we'll have some history to filter through. The ...

Get Git: Mastering Version Control now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.