# Submodule not working with specified work-tree

1 messages from 2015-03-18 to 2015-03-18. Participants: Jimmy Zelinskie.
Thread: https://gitlist.dev/t/38847

## Jimmy Zelinskie, 2015-03-18 15:31

Subject: Submodule not working with specified work-tree
Message-ID: <CACPE2UYkPc3nHM7g1MJt8u57P4TukuBo7Qbjn=f+axH81nvdWQ@mail.gmail.com>
URL: https://gitlist.dev/e/CACPE2UYkPc3nHM7g1MJt8u57P4TukuBo7Qbjn%3Df%2BaxH81nvdWQ%40mail.gmail.com

```
It seems like submodule isn't picking up on the work tree that I'm
specifying. In the scenario that I'm working with, I'd prefer to not
have to "cd" into a directory to update the submodules. All the other
git subcommands that I'm executing work fine with specifying the git
dir and work tree via envvars or parameters. I'm not sure if this is a
bug or not.

$ git --git-dir $HOME/testrepo/.git --work-tree $HOME/testrepo
submodule update --init --recursive
fatal: /usr/local/Cellar/git/2.3.0/libexec/git-core/git-submodule
cannot be used without a working tree.

$ GIT_WORK_TREE=$HOME/testrepo GIT_DIR=$HOME/testrepo/.git git
submodule update --init --recursive
fatal: /usr/local/Cellar/git/2.3.0/libexec/git-core/git-submodule
cannot be used without a working tree.

$ git version
git version 2.3.0

$ uname -a
Darwin hanazawa.local 14.1.0 Darwin Kernel Version 14.1.0: Mon Dec 22
23:10:38 PST 2014; root:xnu-2782.10.72~2/RELEASE_X86_64 x86_64

```
