The Git plugin now (at least since 5.7.0) has on option to delete untracked nested repositories.
Documentation: Remove subdirectories which contain .git subdirectories if this option is enabled. This is implemented in command line git as git clean -xffd.