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

Re: git submodule delete?

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
May 10, 2012, 16:53 UTC
Message-ID
<20120510165311.GB76400@book.hvoigt.net>
In-Reply-To
<4FAB0D32.3000503@palm.com>
On Wed, May 09, 2012 at 05:34:58PM -0700, Rich Pixley wrote:
> Put another way, I've made a commit pointing to a nonexistent submodule  
> commit.  And the submodule commit is now lost.  Can I manually force the  
> submodule commit to the previous value?  Or can I remove the submodule  
> and re-add it with an existing value?

If want to create a new commit with a valid submodule sha1 then you can simply checkout the submodule at the desired commit and commit that change in the superproject.

As far as changing the existing commit is concerned. That is not possible wihout rewriting history. If your commit is on a branch which nobody else is using you can use rebase to modify that commit.

If it is on a shared branch its not easy since everybody will notice and would have to reset to the new history which will be a hassle.

Cheers Heiko
Previous: Thomas Hager
Message 3 of 3 in “git submodule delete?”
  1. Rich PixleyMay 10, 2012
  2. Thomas HagerMay 10, 2012
  3. Heiko VoigtMay 10, 2012

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.