I have a number of projects that are in separate Git repositories right now. They are, likewise, in separate eclipse projects (because I was unable to use parent projects using the Maven plugin for a long time due to bugs in the m2 plugin). Now that works.
So I combined the projects in Maven, making a base pom project, adding that as the parent to the others. Then I nested the subprojects.
When I went to commit the base project as a git project, it had decided that the subdirectories were submodules, even though there was no .gitmodules file in the root directory.
Looks like the only way to get this done would be to lose all the history in the projects that are being combined.
Just to be super clear, current have:
Project A (repo A)
Project B (repo B)
Project C (repo C)
what I want is:
New Base Project D (repo D)
/Project A
/Project B
/Project C
I would rather not lose any history but if I have to, I guess I could attic the prior versions. I don't think I want submodules, as those seem to be geared towards including remote repos that are not under your control.
Turned the solution into a bash script. It assumes that the subs you want to add are in subdirectories on the same level with the parent. Here it is:
#! /bin/bash
git remote add -f $1 ../$1
git merge -s ours --no-commit $1/master
git read-tree --prefix=$1 -u $1/master
git commit -m "Added project $1"
Git is amazing..