How to update submodules
NicolaiRuckel opened this issue · comments
After running git-subtract --auto-exclude update
I was trying to update my submodules to their latest commits. The Readme states that all the git submodule
commands keep working, so I tried git submodule foreach git pull origin master
which pulled from the super project’s master branch and broke everything. What would be the correct command to update the submodules?
I think the root cause of the problem is changing the source url for all the submodules to .
erases the true upstream information. Any fresh clone of the repo will have no pointer to the true upstream (short of digging into .gitmodules
' history).
I'm gonna brainstorm some solutions, some of which are obviously bad:
- Never change your .git/config, even after adopting git-subtrac and rewriting .gitmodules. Users can shove it :D
- Save .gitmodules-subtrac to the repository; add documentation about swapping it out
- Build some smarts into git-subtrac to automatically do the previous?
- Extend git submodules to support multiple urls?
- Find out if "alternates" is a usable option?
submodule.alternateLocation
seems interesting at first glance, but maybe not.