git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Submodule not working with specified work-tree

From
JZJimmy Zelinskie <jimmy.zelinskie@coreos.com>
Date
Mar 18, 2015, 15:31 UTC
Message-ID
<CACPE2UYkPc3nHM7g1MJt8u57P4TukuBo7Qbjn=f+axH81nvdWQ@mail.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

Message 1 of 1 in “Submodule not working with specified work-tree”
  1. Jimmy ZelinskieMar 18, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.