R's Workshop

Update Git Submodule without Checkout

Update a git submodule without checking out the submodule in advance.

Command

git update-index --add --cacheinfo 160000,SUBMODULE_SHA1,SUBMODULE_PATH

– 160000 is mode of a git directoy – SUBMODULE_SHA1 is the commit of submodule we want update to – SUBMODULE_PATH is the path to submodule in the git repository

Reference

Git