相关疑难解决方法(0)

如何更改git子模块的远程存储库?

我已经创建了一个带有子模块的git存储库.我能够告诉子模块本身更改其远程存储库路径,但我不知道如何告诉父存储库如何更改子模块的远程存储库路径.

如果我有点不幸并且必须手动操作,我不会感到惊讶,因为即使删除子模块也不容易.

git git-submodules

667
推荐指数
6
解决办法
23万
查看次数

如何用另一个repo替换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)

git git-submodules

87
推荐指数
4
解决办法
4万
查看次数

标签 统计

git ×2

git-submodules ×2