apenwarr / git-subtrac

Keep the content for your git submodules all in one place: the parent repo.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  1. Never change your .git/config, even after adopting git-subtrac and rewriting .gitmodules. Users can shove it :D
  2. Save .gitmodules-subtrac to the repository; add documentation about swapping it out
  3. Build some smarts into git-subtrac to automatically do the previous?
  4. Extend git submodules to support multiple urls?
  5. Find out if "alternates" is a usable option? submodule.alternateLocation seems interesting at first glance, but maybe not.