Is it possible to have different submodules within different branches? For example, branch 1 would only see submodule 1 and branch 2 would only see submodule 2.
One option is to use git submodule deinit
before moving to another branch, and then running git submodule init
and git submodule update
after returning to the first branch. This works, but adds a number of additional steps every time a new branch is to be checked out.
A similar question was asked here, but this was 10 years ago and I'm wondering if there is a more up-to-date way of doing this.