From: eschvoca Date: Fri, 21 Oct 2005 20:16:21 GMT Subject: Re: How do I clear the directory cache Message-ID: <2b05065b0510211316j632c461apbb6f2f162e5fc7ef@mail.gmail.com> In-Reply-To: <7vmzl34ikl.fsf@assigned-by-dhcp.cox.net> On 10/21/05, Junio C Hamano wrote: > eschvoca writes: > > > Yes, ... is what I want (how do I do this with pure git?). > > How do you do *what* with pure git is something not clear to me, > so let me try to rephrase you and see if I understood what you > want correctly, in pure git terms: > > 0. Your last commit (.git/HEAD), your index file (.git/index) > and the files in your working tree are in sync to begin > with. > > 1. Then you do random changes in the working tree (add, modify, > remove) and do git-update-index on them without making a > commit. If your index file is fully in sync with your > working tree, git-diff-files would say nothing after this. > If you did git-update-index on some but not all, then > git-diff-files would report unrecorded changes. > > 2. But you want to revert these changes to the index file. By > "clearing the directory cache", you mean you want the index > file to have what it had in step 0, but you want to keep > what is on the filesystem intact. > > 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. > would reset the index to the tree recorded in your last commit. > You can see that > > $ git diff --name-status --cached HEAD > > does not report any difference between HEAD and your index, while > > $ git diff --name-status > > shows the differences between your index and your working tree. > > HOWEVER, the index file does not record "intent to add", so you > would not see files you added in step 1. mentioned in the output > of the last command. > > > >