Skip to content

DATA LOSS! Major bug in git-delete-submodule #799

@hilbix

Description

@hilbix

rm -rf ".git/modules/$NAME"

This is fundamentally incompatible to the --name option of git submodule add.

Consider

git submodule add --name one ./ two
git submodule add --name two ./ one
git delete-submodule one

or

git submodule add ./ one
git mv one two
git submodule add --name anotherone ./ one
git delete-submodule one

And no, this is not an academical problem.

Recommendation:

Remove this line, as removing something below .git/modules/ can be considered harmful to the history and git bisect.

See https://stackoverflow.com/a/59034242/490291

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions