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

Re: Submodule update fetching with outer repo's default branch

From
RARicardo Abreu <ricardolafabreu@gmail.com>
Date
Nov 28, 2023, 18:32 UTC
Message-ID
<20231128183253.134480-1-ricardolafabreu@gmail.com>
In-Reply-To
<111c2777-6fd4-45ab-8418-9d064999661c@app.fastmail.com>
I have the same problem. Here is a generic recipe to reproduce, assuming a repository X with a submodule Y (set with an `https` URL):
1. `git clone ... X`
2. `cd X`
3. `git submodule sync`
4. `git submodule update --init --recursive`
5. `git remote rename origin remotex` # rename the remote in X, not Y
6. Elsewhere, add a new commit to Y and create a branch "update-y" in X, pointing the submodule to that commit. Suppose the hash of the new commit in Y is `abc1abc`.
7. `git fetch remotex`
8. `git checkout update-y`
9. `git submodule sync`
10. `GIT_TRACE=1 git submodule update --init --recursive`
  - observe: 
    * the command in the last trace message to be `git fetch remotex abc1abc` (should be `git fetch origin abc1abc`, because that is still the name of the submodule's remote)
    * the wrong error message complaining about 'file' protocol (which isn't involved anywhere)
Previous: Scott Shawcroft
Message 2 of 2 in “Submodule update fetching with outer repo's default branch”
  1. Scott ShawcroftAug 28, 2023
  2. Ricardo AbreuNov 28, 2023

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.