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

Re: Possible bug in Git submodule update --inti

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 19, 2024, 00:32 UTC
Message-ID
<xmqqldxghxml.fsf@gitster.g>
In-Reply-To
<8db6eba3-a151-3819-159b-921a6c3f3242@gmail.com>
Philippe Blain <levraiphilippeblain@gmail.com> writes:
Show 18 quoted lines
> Hi Søren,
> ...
> in the doc for 'git submodule init' [3]. Note that this is _not_ 
> the exact command that you ran according to the trace output below, which is:
> ...
> I think what you'd want to do is simply:
>
> git submodule set-url -- <path-to-submodule> <new-url> 
> git submodule update --init --remote
>
> This will fetch the new URL and checkout the tip commit of its HEAD branch.
> You will still have all the objects from the old URL locally though. If you want
> to avoid that, you should completely remove the Git repository of the submodule:
>
> git submodule set-url -- <path-to-submodule> <new-url> 
> git submodule deinit -f <path-to-submodule>
> rm -rf $(git rev-parse --git-dir)/modules/Submodules/Lodam.Standard
> git submodule update --init --remote

Thanks for a pleasant exchange, RFH with sufficient information necessary to help, with a detailed diagnosis and an alternative offered.

Previous: Philippe Blain
Message 3 of 3 in “Possible bug in Git submodule update --inti”
  1. bechNov 18, 2024
  2. Philippe BlainNov 18, 2024
  3. Junio C HamanoNov 19, 2024

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.