Change URL of submodules using git-filter-repo #245
Unanswered
RSmith6055
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Can git-filter-repo be used to change the URL history of a submodule.
I have a repository used as a submodule in a top level repository, and I need to move them both to new locations (and then delete the originals), in the top module I want to be able to change all of the history of the submodule URL to the new one. Can this be done?
I originally posted a question on stackoverflow before I was aware of git-filter-repo. The answer I've received suggests that git-filter-repo is the way to go.
I'm using Windows, and .bat files to do my conversion.
To move the submodule from server1 to server2 and change the name from sub_old to sub_new I clone the original (bare) into a folder on my C: drive, change the URL and then push up to the new server:
then delete sub_old from server1.
Now when I want to move a top level repo, which uses the sub_old repo as a submodule, to the new server:
then delete top_old from server1.
At the point where I want to change all of the URL references to the submodule, it's been suggested that using
git filter-repo
may be the best way to go. I've installed it on my PC OK, but so far I've not managed to figure out how to globally change the URLs to the submodule throughout the top level repository.Could anyone help please?
Thanks and Regards,
Roger
Beta Was this translation helpful? Give feedback.
All reactions