如何使用不同的git仓库替换git子模块?
具体来说,我有一个子模块:
- 位于
./ExternalFrameworks/TestFramework
,指向git仓库git@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.