Why does git submodule update not work!!

eye-catch Other techs

The following command didn’t update the submodule. Huh?

git submodule update

Neither of the following ones updated it.

git submodule update --init --recursive
git submodule update --remote

Hmm…

I changed the current directory to the submodule module and executed the following command.

git submodule update --remote

It was updated…

Assume that the following structure.

top
|
|--submodule
|
|--dir1

Then, I did the following.

$ cd top/submodule
$ git submodule update --remote

I executed those commands under top directory. It worked for a project but not another project… I did the following for the not-working project.

$ cd top
$ git fetch --all
$ git submodule update --remote

Then, the commit number was updated.

I forget how to update submodules every time I need it.

It always makes me confused…

Comments

Copied title and URL