如何用不同的 git repo 替换 git 子模块?
具体来说,我有一个子模块:
- 位于
./ExternalFrameworks/TestFramework
那个指向 git repogit@github.com:userA/TestFramework.git
- 我希望它现在指向
git@github.com:userB/TestFramework.git
.
问题是当我使用此处描述的方法删除子模块时,然后使用命令重新添加它
git submodule add git@github.com:userB/TestFramework.git
我收到此错误:
A git directory for 'ExternalFrameworks/TestFramework' is found locally with remote(s):
origin git@github.com:userA/TestFramework.git
If you want to reuse this local git directory instead of cloning again from
git@github.com:userB/TestFramework.git
use the '--force' option. If the local git directory is not the correct repo
or you are unsure what this means choose another name with the '--name' option.