A note on git submodules

Git submodules confused me initially. Here are a few notes to clarify things:

You need to pull changes to the submodules manually and commit, if you want to update them:

cd mysubmodule
git pull
cd ..
git commit -m 'Updated submodule'

If you have a clone that you then want to bring up to date, you can run git submodule update.

I got confused into thinking that git submodule update would pull the latest changes but, when you think about it, it makes sense that the two workflows are separate.

Comments