Le Li
Le Li

Reputation: 142

How to update submodule url with git mirror

I migrated my repo via use command git clone --mirror myrepo.git

My repo have a git submodule, the submodule url has changed.

How do I update submodule url in mirror folder?

enter image description here

Upvotes: 0

Views: 585

Answers (1)

torek
torek

Reputation: 489083

It's not possible1 to do any work in a mirror clone.

Instead of a mirror clone, make a regular (non-mirror) clone. Work in that. The URL is in the .gitmodules file, which you can open, edit, git add, and git commit as usual.

Use a non-recursive clone so that git clone does not try to create the submodule using the old URL.


1Technically, it is possible, but it's not a good idea.

Upvotes: 1

Related Questions