I've been playing with this a little bit, and it looks like the easiest way to split this up is using git subtree split
:
split
Extract a new, synthetic project history from the history
of the subtree. The new history includes only the
commits (including merges) that affected , and each
of those commits now has the contents of at the
root of the project instead of in a subdirectory. Thus, the
newly created history is suitable for export as a separate
git repository.
So, for example, if I start with the openstack-puppet-modules repository, which includes a bunch of individual puppet modules, I could split them up first into individual branches like this (I am only using eight modules here to keep things short):
for x in apache aviator ceilometer certmonger cinder common \
concat firewall; do
git subtree split -P $x -b split-$x
done
Once this is finished running, I have:
$ git branch | grep split-
split-apache
split-aviator
split-ceilometer
split-certmonger
split-cinder
split-common
split-concat
split-firewall
split-pacemaker
Each of those branches contains only the history for the specific
directory. If I want to transform these into separate repositories, I
could do this:
for x in apache aviator ceilometer certmonger cinder common \
concat firewall; do
git init --bare ../repos/repo-$x
git push ../repos/repo-$x split-$x:master
done
Now I have a collection of repositories:
$ ls ../repos/
repo-apache repo-aviator repo-ceilometer repo-certmonger
repo-cinder repo-common repo-concat repo-firewall work-cinder
And I think we've achieved your goal.