Reputation: 121
I have a plain repository $main, without submodules. Inside it I add the library $lib into /3rdparty/$lib using git clone
.
Also $lib repository contains several submodules which I initialize and update.
So $main noticed that $lib's submodules are submobules and won't push theirs files into the $main.
Can I permanently add this submodules into $main?
Upvotes: 0
Views: 375
Reputation: 24471
If $lib is a submodule (as you said that you clone it I suppose so), $lib should be recoqnized as a git-repo and added as a submodule, $lib itself should track its own submodules.
$main should never find anything inside $lib, there's something wrong if it does.
Technically you should be able to add a submodule to the superproject and to as a submodule to one of the superprojects submodules, however it might conflict during checkouts and worktree updates and it's really bad taste.
You should also use git submodule add and not do a git clone in the superproject. A git submodule add (and submodule init/update etc.) will place the .git-dir inside the superprojects .git-dir which will allow git to handle the submodules better (delete them from the worktree when they are not needed for example).
And as a bottom line, you can't push files, you can add changes to files to commit and you can push commits.
Upvotes: 1