问题
Is there a posssiblity to have a submodule on one branch and not to have it on another? Is it possible to remove a submodule on a specific branch but to have it on other branches? Or add a submodule to experimental branch only.
回答1:
Your submodules are defined by your .gitmodules file, which is just another file in your repository, version like everything else. So if you change it in a branch, it's changed. Thus, all your questions can be answered 'yes'.
来源:https://stackoverflow.com/questions/29849176/remove-git-submodule-from-branch