HowTo - Switch the remote repo for a git submodule

For my QSB plugins I was using a git submodule pointing to a repository managed by someone else - I needed some updates to that module, so I forked it and made them myself. Thus, I needed my QSB plugin project to point to my new repo for the submodule. I did it this way:

  • Edit .gitmodules to change the URL for the submodule to my repository
  • git submodule sync
  • cd path/to/submodule
  • git remote update
  • git merge origin/master
  • Add .gitmodules and path/to/submodule with 'git add', then commit

I used this page about submodules to figure some of this out.