I have a couple of submodules and I only want to update one of them.
I think this command updates all of them in .gitmodules
git submodule update --init --recursive --remote
I just want one of the modules updated though.
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.
If you already cloned the project and forgot --recurse-submodules , you can combine the git submodule init and git submodule update steps by running git submodule update --init . To also initialize, fetch and checkout any nested submodules, you can use the foolproof git submodule update --init --recursive .
If you want to make a change within a submodule, you should first check out a branch, make your changes, publish the change within the submodule, and then update the superproject to reference the new commit.
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.
The git submodule update
command takes a path as a parameter.
Use the path of the submodule you want to update, as said path is recorded in your .gitmodules
.
git submodule update --init --remote a/submodule/path
Make sure your submodule follows a branch first.
For a manual update, you also can go into the submodule folder, and do a git checkout aBranch/git pull
yourself. Then go back to the parent repo, add and commit the new gitlink SHA1 for that 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