threads / discuss / 39044

Suggestion: git submodule remove

Subject: Suggestion: git submodule remove

## tl;dr

2 messages between Apr 10, 2015 and Apr 11, 2015.

replies: 1people: 2as markdown or json

Konrád Lőrinczi· Apr 10, 2015, 11:33 UTC · lore
Hi GIT devs,
I really miss the
  git submodule remove
command.
This should be handle all the tasks what are needed to remove a submodule.
    - Delete the relevant line from the .gitmodules file.
    - Delete the relevant section from .git/config.
    - Run git rm --cached path_to_submodule (no trailing slash).
    - Delete the now untracked submodule files.

These tasks should be handled automatically. Currently you can only remove a submodule manually, no way to do it automatically with one command. "Removing submodules" and "unsubmodule a submodule" are still a pain to do in GIT, even in v2.3.5.

Please consider implementing the "git submodule remove" command.

Thanks, Konrad Lorinczi

Jens Lehmann· Apr 11, 2015, 12:15 UTC · re: Konrád Lőrinczi · lore

Re: Suggestion: git submodule remove

Am 10.04.2015 um 13:33 schrieb Konrád Lőrinczi:
Show 15 quoted lines
> I really miss the
>    git submodule remove
> command.
>
> This should be handle all the tasks what are needed to remove a submodule.
>      - Delete the relevant line from the .gitmodules file.
>      - Delete the relevant section from .git/config.
>      - Run git rm --cached path_to_submodule (no trailing slash).
>      - Delete the now untracked submodule files.
>
> These tasks should be handled automatically.
> Currently you can only remove a submodule manually, no way to do it
> automatically with one command.
> "Removing submodules" and "unsubmodule a submodule" are still a pain
> to do in GIT, even in v2.3.5.

"git rm <submodule-path>" will remove a submodule from .gitmodules, the index and the work tree (but not from .git/config, that's what "git submodule deinit" is for).

← back to recent threads