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

Re: BUG: "--work-tree blah" does not imply "--git-dir blah/.git" or fix misleading error message

From
Carlos Martín Nieto <carlos@cmartin.tk>
Date
Nov 30, 2011, 19:42 UTC
Message-ID
<20111130194233.GD12096@centaur.lab.cmartin.tk>
In-Reply-To
<7vaa7dquva.fsf@alter.siamese.dyndns.org>
On Wed, Nov 30, 2011 at 11:21:29AM -0800, Junio C Hamano wrote:
Show 8 quoted lines
> subdirectory "blah/.git"), but I do not think this is likely to change, as
> I suspect that people and scripts are relying on the current behaviour to
> be able to do something like this:
> 
>     cd /pub/scm/git/git.git ;# this is a bare repository
>     mkdir /var/tmp/git
>     git --work-tree=/var/tmp/git checkout
> 

This is in fact the way that many (or from what I can see the most popular) tutorials for abusing git as a deployment system tell you to run it (though more often than not setting GIT_WORKTREE in the environment).

   cmn
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 7 in “BUG: "--work-tree blah" does not imply "--git-dir blah/.git" or fix misleading error message”
  1. John TwilleyNov 30, 2011
  2. Carlos Martín NietoNov 30, 2011
  3. John TwilleyNov 30, 2011
  4. Carlos Martín NietoDec 1, 2011
  5. Junio C HamanoNov 30, 2011
  6. Carlos Martín NietoNov 30, 2011
  7. Junio C HamanoNov 30, 2011

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.