I created a branch in which I converted a path in my repository to a submodule. I haven't merged that work into master
yet. Having finished converting that path to a submodule, I attempted to switch back to master
and got the following error:
The following untracked working tree files would be overwritten by checkout:
[ ... a list of files that are now being managed by a submodule ...]
Makes sense. So, I did git checkout --force master
. Then, when I switched back to the branch that tracks the path with a submodule, that path was empty except for the .git
pointer find that you find in submodules. To get the submodule re-checked out to the commit designated in the index, I need to do git submodule update --force
.
Is there a simpler way to handle this situation?