‘git submodule update –init –recursive’ VS ‘git submodule foreach –recursive git submodule update –init’

git submodule update --init --recursive

The submodule update command will recurse into the registered submodules, update and init (if required) them and any nested submodules within.

git submodule foreach --recursive git submodule update --init

foreach will evaluate the command in each checked out submodule. So it will update and init (if required) each submodule and any nested submodules within due to --recursive.

So in the end, both commands will achieve the same thing.
Simply the execution differs, the first command won’t step into each directory to execute the command.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)