My super-project has two branches - master and dev. I initially had a submodule in both these branches, but now I need to keep it only in the dev branch. To do that, I switched to the master branch and removed it from there (following the instructions outlined here). Now every time I switch from the dev branch to the master branch, I get a message saying warning: unable to rmdir path/to/submodule: Directory not empty. Also, every time I do git status
in the master branch, git lists the submodule under Untracked files.
Is there a way I can tell git not to complain about this submodule? I tried adding the submodule path to .gitignore
in the master branch, but that doesn't seem to have helped. Also, I am curious why git does not complain when a folder exists in one branch and not in another, but it does when a submodule exists in one branch and not in another?
Edit: I did not delete the relevant section from the .git/config
file when removing the submodule as I still wanted it in the dev branch.