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

[PATCH] Documentation/git-update-index.txt: add an example of use

From
Matěj Cepl <mcepl@cepl.eu>
Date
Dec 1, 2024, 22:25 UTC
Message-ID
<20241201222531.1478338-1-mcepl@cepl.eu>
I met this command in the wild and I spent a lot of time to
understand what it is good for.
---
 Documentation/git-update-index.txt | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 7128aed540..da11cbc418 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -399,6 +399,15 @@ M foo.c
 <8> you can tell about the change after the fact.
 <9> now it checks with lstat(2) and finds it has been changed.
 
+To speed up other Git commands that rely on the index, such as git status
+or git commit, user can refresh the index and avoid having to re-check
+the status of every file in the working directory. This command
+doesn't modify any committed data in your repository.
++
+----------------
+$ git update-index -q --refresh || true
+----------------
+
 
 SKIP-WORKTREE BIT
 -----------------
-- 
2.47.1
Next: Junio C Hamano
Message 1 of 3 in “Documentation/git-update-index.txt: add an example of use”
  1. Documentation/git-update-index.txt: add an example of useMatěj Cepl, Dec 1, 2024
  2. Junio C HamanoDec 2, 2024
  3. Matěj CeplDec 2, 2024

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.