git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Why do git submodules require manual checkouts and commits?

From
Sskillzero@gmail.com <skillzero@gmail.com>
Date
May 16, 2008, 04:16 UTC
Message-ID
<2729632a0805152116o3c998324xb401674207dd2e1e@mail.gmail.com>

Why do git submodules require manually committing the submodule itself to each super repository after something in the submodule repository changes? Is there some reason the super repository can't just "link" to the submodules by branch name? It seems that if the .gitsubmodules also specified the branch to use:

[submodule "libfoo"]
	path = libs/foo
	url = git://foo.com/git/libfoo.git
	branch = master
[submodule "libbar"]
	path = libs/bar
	url = git://bar.com/git/libbar.git
	branch = stable

Then a git pull (or git clone) of the super repository could also pull in all submodules. A commit to a file in a submodule would then be automatically reflected in the super repository (since the super repository would always pull HEAD of that branch).

Is this difficult (or somehow undesirable)?
Next: Johannes Schindelin
Message 1 of 9 in “Why do git submodules require manual checkouts and commits?”
  1. skillzero@gmail.comMay 16, 2008
  2. Johannes SchindelinMay 16, 2008
  3. Avery PennarunMay 16, 2008
  4. Johannes SchindelinMay 16, 2008
  5. Avery PennarunMay 16, 2008
  6. Johannes SchindelinMay 16, 2008
  7. Avery PennarunMay 16, 2008
  8. Lars HjemliMay 16, 2008
  9. skillzero@gmail.comMay 19, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.