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

--work-tree does not work for git-stash

From
ALAllen Li <vianchielfaura@gmail.com>
Date
Sep 11, 2017, 18:32 UTC
Message-ID
<CAJr1M6eS0jY22=0nvV41uDybcHUdjBv8CgRhHmBNFM=Z0J9YCA@mail.gmail.com>

$ git --version git version 2.14.1.581

This does not work:

$ git --git-dir ~/foo/.git --work-tree ~/foo stash create fatal: /usr/lib/git-core/git-stash cannot be used without a working tree.

This does:
$ git --git-dir ~/foo/.git --work-tree ~/foo -C ~/foo stash create
I found a description of the bug here:
https://stackoverflow.com/a/5863555
Next: Allen Li
Message 1 of 2 in “--work-tree does not work for git-stash”
  1. Allen LiSep 11, 2017
  2. Allen LiSep 11, 2017

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.