I have refactored my submodules in a project tree (lots of submodules deep).
I have been working my way up the tree of submodules. Now I am at the top level. So when I updated its submodules, all the submodules below still have local copies of submodules that are no longer part of the repo after moving them to the latest version.
so I want a way to go through the modules and clean them out.
I did: git clean -df
but this gives me the message: "would skip repository" for each unused copy of submodules that I am trying to remove. I can manually remove them with rm -rf submodule
, but I want to use clean since it does all in one command.
Note: these are not still actual submodules, since they have been removed correctly from the repo, but when switching between an old version and new version of the repo, the submodule update does not clear them away.
Here is a simple setup:
module/submodule1 -> version 1
now remove submodule1 -> version 2
- checkout version 1 (submodule1 folder is created)
- checkout version 2 (submodule1 folder is still there, but not part of the repo)
If I do a git submodule update --recursive --init
it also does not remove the unwanted SMs...
how can I tell git to remove those folder dregs between versions?