Submodules are aggravating and in my experience, usually a bad idea. What I do in some of my projects is combine nested repositories and .gitignore
entries. So the nested repos are ignored by the outer container repo, but I don't have to hassle with submodules at all.
In my situation, I usually use my own scripts to handle things like cloning, updating, and cleaning up the nested repos. It's not difficult to cook up something like that.
Here is a Perl example of something I do for managing Vim plugins as nested repositories. Full script at this URL, snippet of it below.
https://github.com/tangledhelix/dotfiles/blob/master/install.pl
# install or update vim bundles
sub vim_bundle_installer {
my $bundle_path = "$ENV{HOME}/.vim/bundle";
mkdir $bundle_path unless -d $bundle_path;
foreach my $bundle (keys %vim_bundles) {
my $repo = $vim_bundles{$bundle};
unless ($repo =~ /^(https?|git):\/\//) {
if ($use_ssh) {
$repo = "git\@github.com:$repo.git";
} else {
$repo = "https://github.com/$repo.git";
}
}
my $this_bundle_path = "$bundle_path/$bundle";
if (-d $this_bundle_path) {
next if $vim_newmods_only;
if ($vim_do_updates) {
print " updating vim bundle $bundle\n";
system "cd $this_bundle_path && git pull";
} else {
print " skipping vim bundle $bundle (already exists)\n";
}
} else {
print " cloning vim bundle $bundle\n";
system "git clone $repo $this_bundle_path";
}
}
}
sub vim_newmods_installer {
$vim_newmods_only = 1;
vim_bundle_installer();
}
sub vim_bundle_updater {
$vim_do_updates = 1;
vim_bundle_installer();
}