How can I remove a Git submodule from all history?

122 Views Asked by At

In my project I need to remove link to the submodule from all history of the project.

If it was a simple file than that could've been done with git-filter-repo.

If it was just removing submodule than that could've done with the following

# Remove the submodule entry from .git/config
git submodule deinit -f path/to/submodule

# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/path/to/submodule

# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
git rm -f path/to/submodule

But what I can't figure out is how to apply such changes to ALL history of repository. Do I miss something obvious?

0

There are 0 best solutions below