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

Re: How do I clear the directory cache

From
Linus Torvalds <torvalds@osdl.org>
Date
Oct 21, 2005, 21:00 UTC
Message-ID
<Pine.LNX.4.64.0510211354440.10477@g5.osdl.org>
In-Reply-To
<2b05065b0510211316j632c461apbb6f2f162e5fc7ef@mail.gmail.com>
On Fri, 21 Oct 2005, eschvoca wrote:
Show 8 quoted lines
> >
> > If that is what you want, then:
> >
> >         $ git-read-tree HEAD
> >         $ git-update-index --refresh >/dev/null
> 
> 
> Yes, this does exaclty what I want.  Thankyou.

Btw, if this ends up being something you do often (or more than once), it's best to use the "--reset" flag to git-read-tree.

That will cause git-read-tree to still try to use any old usable entries in the old index, which most of the time means that 99% of the index will be up-to-date, and that in turn makes the index refresh _much_ faster.

For small projects it doesn't matter, of course.
In fact, those two lines can also be written simply as
	git reset

which will do this, and more (in particular, it will also remove any sign of a partial merge-head).

			Linus
Previous: eschvocaNext: Petr Baudis
Message 6 of 11 in “How do I clear the directory cache”
  1. eschvocaOct 17, 2005
  2. Petr BaudisOct 20, 2005
  3. eschvocaOct 21, 2005
  4. Junio C HamanoOct 21, 2005
  5. eschvocaOct 21, 2005
  6. Linus TorvaldsOct 21, 2005
  7. Petr BaudisOct 21, 2005
  8. eschvocaOct 21, 2005
  9. Petr BaudisOct 21, 2005
  10. eschvocaOct 22, 2005
  11. Petr BaudisOct 22, 2005

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.