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

git submodule remove?

From
Tim Henigan <tim.henigan@gmail.com>
Date
Jul 8, 2009, 19:41 UTC
Message-ID
<32c343770907081241h5925545ah1cb551b31e45ddc0@mail.gmail.com>
Hello,

I recently encountered a situation where a user wanted to remove a submodule from a repository. Searching the mail archive, I found this thread [1], but it does not appear that it was ever followed up.

The Git Submodule Tutorial [2] has instructions for removing submodules, but it seems natural to teach git how to "submodule rm".

This change would require git-submodule.sh to:
    1. Modify the .gitmodules file (remove the entry for the submodule).
    2. Modify the .git/config file (remove the entry for the submodule).
    3. Delete the newly untracked files.

Another option to consider would be a "submodule rm --cached" option which would keep the newly untracked files. However, with this option, I believe it should still descend into the submodule directory to remove the leftover submodule ".git" folder.

Is there another way of doing this? If not, does this sound like a reasonable change?

Thanks, Tim Henigan

[1] http://article.gmane.org/gmane.comp.version-control.git/101610/match=submodule+remove [2] http://git.or.cz/gitwiki/GitSubmoduleTutorial

Next: Raman Gupta
Message 1 of 3 in “git submodule remove?”
  1. Tim HeniganJul 8, 2009
  2. Raman GuptaJul 8, 2009
  3. Tim HarperJul 11, 2009

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.