When I add a Git submodule to a Git repository like this,
git submodule add ssh://server/proj1/ proj1
git submodule init
git submodule update
the added submodule will be in detached HEAD mode. I don't know well what that is, but I know that the submodule will be linked to specific revision of the target repository.
I don't know how it actually works, anyway it looks like a proxy branch exists there. I solved this by switching to master branch.
cd proj1
git checkout master
This will switch current branch actual master HEAD, but this does not update the linkage. So If you clone the whole repository again, it will still be linked to old revision.
If I want to make it to be linked to most recent revision (HEAD) always, what should I do?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…