When I initially added my submodule, I specified a particular branch, as seen in the .gitmodule
file:
[submodule "externals/grpc/grpc"]
path = externals/grpc/grpc
url = [email protected]:me/grpc.git
branch = release-1.0
I want to change to the master branch of my submodule, so I changed the branch in .gitmodules
from release-1.0
to master
, and for good measure, just deleted the submodule from my parent git tree:
cd $submodules
rm -rf grpc
cd $gitroot
git submodule sync
git submodule update --init --recursive
Now, when I go back to my submodule, it's still checked out from a commit on the release-1.0
branch, not the latest master commit.
What steps am I missing to switch my submodule's branch?
.gitmodules
file does not include the branch field. It seems to work regardless of that, though. – Fifine