Re: several quick questions
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Feb 14, 2006, 19:00 UTC
- Message-ID
- <Pine.LNX.4.64.0602141056170.3691@g5.osdl.org>
- In-Reply-To
- <87irrhvkyl.wl%cworth@cworth.org>
On Tue, 14 Feb 2006, Carl Worth wrote:
Show 8 quoted lines
> > Oh, I'm blind. I didn't see git-checkout-index, (thanks Kenneth for > mentioning it elsewhere in the thread). So now I've at least got the > recipe I was after: > > git-read-tree <revision> > git-update-index --replace > git-checkout-index -a -f -u
This is very very inefficient, because it will replace the old index without using the (valid) information that is there from before. Resulting in a lot of unnecessary IO..
You may not care for a small project, but for bigger stuff, you're better off using more subtle approaches.
Explore using "git-read-tree --reset <revision>" or, perhaps even more interesting is "git-read-tree -u -m <oldrev> <newrev>"
> And I think that would make for a dandy command to have in git. Any > suggestions for a name?
I'd suggest "git reset" as a cool way to say that it "resets" the tree to another version ;)
Linus