Subject: Re: git submodule ignores --git-dir

From: Filip Gospodinov <[email-masked]>
Date: Mon, 14 Sep 2015 15:25:46 +0200

On 11.09.2015 17:15, Jens Lehmann wrote:
> Unfortunately trying to show git the right work tree:
>
> $ git --git-dir=$PWD/repo2/.git --work-tree=$PWD/repo2 submodule update --init
>
> Didn't work as I expected it to either:
>
> fatal: /home/Sledge/libexec/git-core/git-submodule cannot be used without a
> working tree.

Yes, that's confusing. I'm not sure how other commands use the --work-tree flag
and if having the git-submodule script `cd` into the work tree would be
acceptable. What do you think?

On 11.09.2015 17:28, John Keeping wrote:
> There's also "git -C /path/to/repo" which avoids the need for a separate
> "cd".
> 

Thank you, that works!