I have the following directory structure:
Parent/ contains Child1/ Child2/ ... ChildN/
Each of the Child directories is its own git repository with commit histories, etc. I have realized that it would make more sense to make Parent a git repository with the children as subrepositories (presumably using git-subtree or something). This is because the child directories are all components of the same project.
I have looked at various answers, but they all involve pushing/pulling from some remote repo, whereas everything is local to my machine in this case (and I would like to keep it that way--plus, I don't know how to work with remotes).
So my question is: how to I create the Parent repository in such a way that the children are part of it but retain their individual histories and without reference to any remote repository?
Reason this is different from the proposed duplicate: The link about remote repos being on a local hard drive is helpful and definitely makes the other answers on SO more accessible. I just tried the procedure in the linked question on merging two repositories, and it almost does the job but is laborious and labor-prone in my case. In that question, two repositories are to be merged to create a third repository, whereas in my case, a number of repositories need to become the directories of a new repository.
To use the proposed duplicate answer, I would have to make a copy of Parent, say Parent_copy, then delete everything from Parent, create the Parent .git directory, then merge in the Child directories one at a time. In the process, the contents of each Child would be either copied from Parent_copy/Child into Parent or ignored (based on a .gitignore file). Then I could recreate e.g. Parent/Child1 as an empty directory, move the files from Parent, and copy the ignored files from Parent_copy/Child1. So it would work, but is a bit laborious and error-prone. I wonder is there is a more efficient way, ideally treating the Child directories in place?