Changing git submodule repo after you started editing it

I had to make some changes to a repo to dockerize it. Initially the submodule pointed at the original repo, so I went back and switched it to a fork and branch, so I could make pull requests as necessary.

bash-4.4$ git config --file=.gitmodules -l
git config --file=.gitmodules -l
submodule.indieauth.com.path=indieauth/indieauth.com
submodule.indieauth.com.url=https://github.com/aaronpk/IndieAuth.com.git

bash-4.4$ git config --file=.gitmodules submodule.indieauth.com.url https://github.com/dougbeal/IndieAuth.com.git
git config --file=.gitmodules submodule.indieauth.com.url https://github.com/dougbeal/IndieAuth.com.git
bash-4.4$ git config --file=.gitmodules submodule.indieauth.com.branch docker-fixes
git config --file=.gitmodules submodule.indieauth.com.branch docker-fixes

bash-4.4$ git submodule sync
git submodule sync
Synchronizing submodule url for 'indieauth/indieauth.com'

bash-4.4$ git submodule update --init --recursive --remote
git submodule update --init --recursive --remote
From https://github.com/dougbeal/IndieAuth.com
 * [new branch]      docker-fixes -> origin/docker-fixes
bash-4.4$ git config --file=.gitmodules -l
git config --file=.gitmodules -l
submodule.indieauth.com.path=indieauth/indieauth.com
submodule.indieauth.com.url=https://github.com/dougbeal/IndieAuth.com.git
submodule.indieauth.com.branch=docker-fixes

bash-4.4$ 

Leave a Reply