How do I replace a git submodule with another repo?

后端 未结 6 1341
野性不改
野性不改 2020-11-28 02:12

How do I replace a git submodule with a different git repo?

Specifically, I have a submodule:

  • located at ./ExternalFrameworks/TestFramework
6条回答
  •  粉色の甜心
    2020-11-28 02:51

    The easiest way that I found is this:

    git rm -rf [submodule_dir]
    git submodule add --name new_[submodule_name] [new_submodule_url] [submodule_dir]
    

    I didn't like the idea to modify my .gitmodules manually. I also wrote a little blogpost about it.

提交回复
热议问题