What is the current way to remove a git submodule?

前端 未结 3 1184
野性不改
野性不改 2020-12-04 05:41

as of git version 1.9.3 (Apple Git-50) on mac how do i remove a git submodule? I am reading alot of outdated information with many developers telling me they wont work. Wh

3条回答
  •  执笔经年
    2020-12-04 06:03

    You have the git submodule deinit

    git submodule deinit     
    git rm 
    # Note: asubmodule (no trailing slash)
    # or, if you want to leave it in your working tree
    git rm --cached 
    rm -rf .git/modules/
    

    deinit

    Un-register the given submodules, i.e. remove the whole submodule.$name
    section from .git/config together with their work tree.

    Further calls to git submodule update, git submodule foreach and git submodule sync will skip any unregistered submodules until they are initialized again, so use this command if you don’t want to have a local checkout of the submodule in your work tree anymore.

    If you really want to remove a submodule from the repository and commit that use git rm instead.

    If --force is specified, the submodule’s work tree will be removed even if it contains local modifications.

提交回复
热议问题