How do I replace a git submodule with another repo?

后端 未结 6 1353
野性不改
野性不改 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:57

    If the location (URL) of the submodule has changed, then you can simply:

    1. Modify your .gitmodule file to use the new URL
    2. Delete the submodule folder in the repo rm -rf .git/modules/
    3. Delete the submodule folder in the working directory rm -rf
    4. Run git submodule sync
    5. Run git submodule update

    More complete info can be found elsewhere:

    • Changing remote repository for a git submodule

提交回复
热议问题