如何在不破坏提交历史的情况下更改 git 子模块的远程 url?目前,如果我检查旧提交,我的子模块似乎不再存在旧的远程 url 女巫。
我的工作流程:
- 使用提交 A,B 克隆 repo
- git子模块更新--init
- 更改子模块 url
将 .gitmodules 推送到远程(提交 C)
使用提交 A、B、C 克隆 repo
- 切换到提交 A
- git submodule update --init -> 失败
-> 还想要新的子模块远程 URL,但仍然是 .gitmodules 中的旧 url
似乎git submodule update --init
仍在尝试使用旧的远程 url
如果按照建议也尝试使用 git submodule update
,但我也收到错误:
The Git repository with name or identifier OLD_REPO_NAME does not exist or you do not have permissions for the operation you are attempting.