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

[PATCH] doc: fix location of index in worktree scenatio

From
Andreas Heiduk <asheiduk@gmail.com>
Date
Jun 10, 2017, 09:07 UTC
Message-ID
<20170610090719.8429-1-asheiduk@gmail.com>

When setting `.gitattributes` in a second worktree, a plain `rm .git/index` does not actually delete the index.

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
---
 Documentation/gitattributes.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 473648386..4c6b74fa6 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -229,7 +229,7 @@ From a clean working directory:
 
 -------------------------------------------------
 $ echo "* text=auto" >.gitattributes
-$ rm .git/index     # Remove the index to re-scan the working directory
+$ rm "$(git rev-parse --git-path index)"  # Remove the index to re-scan the working directory
 $ git add .
 $ git status        # Show files that will be normalized
 $ git commit -m "Introduce end-of-line normalization"
-- 
2.13.0
Next: Junio C Hamano
Message 1 of 12 in “doc: fix location of index in worktree scenatio”
  1. doc: fix location of index in worktree scenatioAndreas Heiduk, Jun 10, 2017
  2. Junio C HamanoJun 10, 2017
  3. Andreas HeidukJun 10, 2017
  4. doc: fix location of index in worktree scenatioAndreas Heiduk, Jun 10, 2017
  5. Torsten BögershausenJun 12, 2017
  6. Andreas HeidukJun 12, 2017
  7. Junio C HamanoJun 12, 2017
  8. Torsten BögershausenJun 13, 2017
  9. Junio C HamanoJun 13, 2017
  10. doc: do not use `rm .git/index` when normalizing line endingsAndreas Heiduk, Jun 13, 2017
  11. Torsten BögershausenJun 14, 2017
  12. doc: do not use `rm .git/index` when normalizing line endingsAndreas Heiduk, Jun 14, 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.