In article <ron1-A99355.16145629012010@xxxxxxxxxxxxxx>, Ron Garret <ron1@xxxxxxxxxxx> wrote: > In article <bd7fb2a884e55e176eea3002fd0c68dd@xxxxxxxxxxxxxx>, > Julian Phillips <julian@xxxxxxxxxxxxxxxxx> wrote: > > > On Fri, 29 Jan 2010 14:47:49 -0800, Ron Garret <ron1@xxxxxxxxxxx> wrote: > > > My actual use case is very complicated, but here's a simplified version: > > > > > > Suppose I'm using git as a back-end for a wiki. I want to look at the > > > state of the entire wiki as it was in some point in the past, and I also > > > > > want to be able to look at the diffs between individual pages as they > > > were then and as they are now. The most straightforward way I can think > > > > > of to do that is to simply copy an old commit into my working tree > > > without changing anything else. Then I can look at the old version by > > > simply looking at the files, and I can get the diffs by simply doing a > > > git diff. > > > > > > If I do a git reset --hard then I get the old version, but I lose my > > > HEAD pointer so that git diff doesn't give me what I want any more. > > > > > > BTW, it turns out that git checkout [commit] . doesn't do the right > > > thing either. Apparently, it still updates my index, so git diff still > > > doesn't do the right thing. > > > > If I understand what you want correctly, then: > > > > git diff --cached -R [path] > > > > should be the appropriate command after the "git checkout <commit> .". > > Yep, that works. Alternatively, is there a way to clear the index? > Seems like that would be better. Well, whaddyaknow: git reset without any arguments has a use after all :-) rg -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html