I'm using git submodule
in order to track a subproject. The submodule points at a specific branch, but I now need to change it.
I've tried to manually edit the .gitmodules
file and change the branch =
entry, but every command to update the repo I give later doesn't do anything or fails.
I've tried
git submodule sync # Succeeds, but nothing happens
git submodule update # Doesn't do anything
git submodule update --remote # fails with Needed a single revision
The subproject did correctly check out and gitk in there shows that it does indeed have the new branch that I need to switch to. I could do this manually and commit the new hash but I'm not sure whether git submodule
would truly understand the change this way.
I've also tried deleting all submodule folders (including inside the .git
folder) and re-running
git submodule update --init --recursive --remote
But I still get the project to the same state as before (I assume because it's still updating to the committed hash).