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

git-reset does not seem to respect GIT_WORK_TREE

From
Patrick Palka <patrick@parcs.ath.cx>
Date
Feb 14, 2014, 18:57 UTC
Message-ID
<CA+C-WL_x=+OPn4Ec-6Y13w1+dd5G5v8W6=i15WH47pyP3ggjuw@mail.gmail.com>
Hi everyone,

I noticed that git-reset does not seem to respect GIT_WORK_TREE. Here is a simplified test case:

$ mkdir src_dir && cd src_dir $ git init $ touch A && git add A && git commit -m "Dummy commit." $ mkdir ../build_dir && cd ../build_dir $ export GIT_WORK_TREE=../src_dir $ export GIT_DIR=../src_dir/.git $ git reset Unstaged changes after reset: D A

The final command "git reset" erroneously suggests that the file "A" does not exist in the working tree. Does anybody know why git-reset behaves this way?

Thanks, Patrick

Next: Nguyễn Thái Ngọc Duy
Message 1 of 6 in “git-reset does not seem to respect GIT_WORK_TREE”
  1. Patrick PalkaFeb 14, 2014
  2. reset: setup worktree on --mixedNguyễn Thái Ngọc Duy, Feb 15, 2014
  3. Duy NguyenFeb 15, 2014
  4. reset: optionally setup worktree and refresh index on --mixedNguyễn Thái Ngọc Duy, Feb 16, 2014
  5. Eric SunshineFeb 16, 2014
  6. Patrick PalkaFeb 16, 2014

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.