Thomas Mccaffery
Thomas Mccaffery

Reputation: 385

how to update one submodule git?

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.

Upvotes: 21

Views: 22341

Answers (1)

VonC
VonC

Reputation: 1323115

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:

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.

Upvotes: 28

Related Questions