I am trying to migrate a single Core
subdirectory from a TFVC repository into a git repository. The source is used in multiple projects and the other subdirectories are never used but need to be fetched when cloning the repository. They are also conceptually unrelated.
The repo layout looks something like this:
$Project/Repo1/Main
$Project/Repo1/dev/branch1
+branch2
...
+branchN
$Project/Repo1/release/RelBranch1
...
and each branch has a flat folder structure, with the important Core
directory and loads of other unused directories (these are not empty, just unrelated to the Core
directory):
<branch-folder>
|-Core
|-Other
|-Other2
|-...
|-OtherN
The only way I see this happening is to migrate the source to git using git-tfs, then remove the other directories in the first commit. This seems clumsy, any investigation of the history of the repo will bring back the unwanted directories? Is there a better way of achieving the desired repo structure?
The new layout in git should contain only the Core
subdirectory of the repo with all the branches and as much history as possible. Fortunately, in all cases, there are no commits which reference files from both Core
directory and any of the Other
directories.
Ideally, I would like to merge several subdirectories from different TFVC repository into a single git repo, but I have focussed on the core problem in this question. At present, I'll be migrating each to a separate repo and then using submodules to glue them together.