如何使用git mirror更新子模块URL

问题描述

我通过使用命令git clone --mirror myrepo.git迁移了我的仓库

我的仓库有一个git子模块,该子模块的网址已更改。

如何更新镜像文件夹中的子模块URL?

enter image description here

解决方法

1 不可能在镜像克隆中进行任何工作。

创建常规(非镜像)克隆,而不是镜像克隆。在那工作。该URL位于.gitmodules文件中,您可以照常打开,编辑git addgit commit

使用非递归克隆,这样git clone不会尝试使用旧的URL创建子模块。


1 从技术上讲,这是可能的,但不是个好主意。