I have a local repository that includes multiple projects in separate subfolders, and I want to split it into separate, project-specific repositories without altering the actual folder structure. Here's what the folder tree currently looks like:
bigfolder/
.git/
project1/
subfolder1/
subfolder2/
project2/
subfolder1/
subfolder2/
What I want instead is this:
bigfolder/
project1/
.git/
subfolder1/
subfolder2/
project2/
.git/
subfolder1/
subfolder2/
I don't want to delete the top folder or move the project folders out from under it. I just want to have smaller, project-specific repositories that preserve the commit histories of the files in each project's folder.
I tried following the directions in this article on GitHub Docs, Splitting a subfolder out into a new repository, but when I cloned the bigfolder/ repository into the project1/ folder, it copied everything inside bigfolder into the project1 folder, including all of the project folders. Using git filter-repo deleted the files inside the all newly created project folders except the new project1 folder, but it left the folder tree intact. What am I doing wrong? Thanks in advance!