At some point it may seem like an interesting idea to move one of the submodules in your Git repository to an entirely different URL with completely different commit hashes and history. Here’s how it goes.
- Change the submodule URL in your
.gitmodules
file - Type
git submodule sync
to sync your repo to the new URL - Type
git submodule foreach git pull origin master
to pull down new history for all of your submodules - Watch as a complete mess unfolds when it runs into conflicts
- Delete the
.git/modules/submodule_repo
directory and try again - Watch as a complete mess unfolds when it runs into conflicts
- Throw your hands up
- Remove the submodule completely. See: “Remove a Submodule within git“
- Add a new submodule in the same location.
Or just start with steps 8 and 9 next time.
Responses and reactions
Replies
Lol. I started following the steps before reading the whole article. That's what I get for doing that.
The only requirement for your mention to be recognized is a link to this post in your post's content. You can update or delete your post and then re-submit the URL in the form to update or remove your response from this page.
Learn more about Webmentions.