I would like to run a submodule update from outside my git project. For most commands (e.g. git status
), I can give git --git-dir
and --work-tree
arguments, like so:
git --git-dir=/path/to/root/.git --work-tree=/path/to/root status
However, running git --git-dir=/path/to/root/.git --work-tree=/path/to/root submodule update
gives the result: fatal: $program_name cannot be used without a working tree.
I am aware that I can change into the /path/to/root
directory, however I would like to know if git has the ability to update submodules from outside of the git project.