如何用不同的 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.