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

submodule questions

From
CBCliff Brake <cliff.brake@gmail.com>
Date
May 28, 2010, 20:45 UTC
Message-ID
<AANLkTilWHMkf5e7PBgnrI1tsGUYOldnv6AWKU3GG02u2@mail.gmail.com>
Hello,
I've been trying to understand git submodules.
1) What is the purpose for the submodule lines in .git/config?
2) should 'git submodule sync' update the .git/config with submodule
info, or what exactly does 'git submodule sync' do?
I read the following:
http://therealadam.com/archive/2008/05/08/changing-git-submodule-urls/
 The author claims that:
    * Fork/create your own version of the submodule in question
    * Change the URL for the submodule in .git/config and .gitmodules
    * Cross your fingers and hope for the best

Does not work, but in my experience it does. On machine #1, I did the following:

1) created a new branch in the submodule dir, pushed the changes to a new repo.
2) modified .gitmodules to point to the new repo
3) push the changes in the parent repo
On Machine #2:
1) git pull
2) git submodules sync
3) git submodules update

Everything seemed to work. However, the .git/config submodule entry still points to the old location, even though 'git submodule update' seemed to work. Hence my confusion about what .git/config submodule entries are for.

Thanks, Cliff

Message 1 of 1 in “submodule questions”
  1. Cliff BrakeMay 28, 2010

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.