I added a submodule to my git repo like this:
$ git submodule add git://github.com/user/some-library some-library
I’ve decided I want to create a fork of that library to do some adjustments. How can i swap that submodule so that it points to my own github fork instead?
The submodules are stored in
.gitmodules:If you edit the
urlwith a text editor, you need to run the following:This updates
.git/configwhich contains a copy of this submodule list (you could also just edit the relevant[submodule]section of.git/configmanually)There might be a way to do it with only
gitcommands, although thesubmodulesystem seems a bit incomplete (e.g see the instructions to remove a submodule)