Search code examples
gitgitlabgit-submodulesatlassian-sourcetree

Git: How to remove submodule reference without removing the submodule repository


As the title says I want to remove just a reference to other repository from my main repository without removing the files from that repository. As I can see all commands from git removes the repository files and I do not want to do this.


Solution

  • You should try with:

    git submodule deinit {{SUBMODULE_PATH}}
    rm -rf .git/modules/{{SUBMODULE_PATH}}