How do I replace a git submodule with another repo?

后端 未结 6 1340
野性不改
野性不改 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 03:00

    If you want to change the remote URL only for this clone:

    git config submodule."$submodule_name".url "$new_url"
    

    This won't affect the .gitmodules file in the parent project, so it won't be propagated to other developers.

    This is described as "user specific record changes" here.

    Do not run git submodule sync as that will reset to the default URL again.

提交回复
热议问题