Following advice in Convert a git folder to a submodule retrospectively? I have prepared an online repository and I am ready to start testing by removing the old folder and replacing it with the submodule - see switching a subdirectory managed by git to a submodule.
But everywhere I looked people first commit the folder removal and then the addition of the submodule (random example1, example2).
This however results in a broken commit on master
(as the files in the subfolder are of course needed) and this is a nono.
So is there some reason people add the submodule in a separate commit ?
Is there some reason submodules updates should be in a separate commit in general ?