我已经创建了一个带有子模块的git存储库.我能够告诉子模块本身更改其远程存储库路径,但我不知道如何告诉父存储库如何更改子模块的远程存储库路径.
如果我有点不幸并且必须手动操作,我不会感到惊讶,因为即使删除子模块也不容易.
如何用不同的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
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
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.
Run Code Online (Sandbox Code Playgroud)