So, updating all my submodules is done by running
git submodule foreach 'git pull origin master'
How do I update a specific submodule, located in say bundle/syntastic
, without updating any other submodules?
By adding the submodule. <name>. update config setting, you ensure that the selective clone of the submodule will be followed by an update, only for that submodule.
Use the git submodule update command to set the submodules to the commit specified by the main repository. This means that if you pull in new changes into the submodules, you need to create a new commit in your main repository in order to track the updates of the nested submodules.
If you set ignore = all, to get sane behavior with git commit -a, it will ALSO ignore the submodule in git show/diff when you EXPLICITLY add them. The only way to work-around the latter is using the command line option --ignore-submodule=none.
The submodule is just a separate repository. If you want to make changes to it, you should make the changes in its repository and push them like in a regular Git repository (just execute the git commands in the submodule's directory).
I end up there by searching how to update specific submodule only, which means for me, updating a submodule to the ref pointed by its super-repo. Which is not the question nor the answer but only the title.
So in a hope of helping some others like me the answer to the question title is :
git submodule update <specific path to submodule>
which will put this submodule in the state of the ref commited in the super-repo.
Actually the proper syntax is:
$ git clone <remote.git> $ cd <remote> $ git submodule update --init -- <specific relative path to submodule>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With