Re: Forcing rewrite of files in working tree
- From
- Andy Parkins <andyparkins@gmail.com>
- Date
- Aug 3, 2007, 13:39 UTC
- Message-ID
- <200708031439.29721.andyparkins@gmail.com>
- In-Reply-To
- <46B3268C.7060707@dawes.za.net>
On Friday 2007 August 03, Rogan Dawes wrote:
Show 7 quoted lines
> > The only method I've found is to delete the file in the work tree then do > > git-checkout again. Even with -f, if the file is not changed git doesn't > > perform a checkout again, so git-checkout -f is not sufficient. I assume > > I can do what I want with some clever plumbing, but I don't know any > > plumbing. :-) > > $ git reset --hard
I think that that suffers the same as "git-checkout -f"; if it doesn't see changes then it doesn't reread. Also, it's not possible to do per-file:
$ git reset --hard HEAD somefile.txt Cannot do partial --hard reset.
Which is a necessity really; I don't want to accidentally overwrite work that's not yet checked in in the rest of the tree.
Is git-checkout-index the thing I'm looking for? I'm wondering if the "-n" switch is the trick?
Andy
-- Dr Andy Parkins, M Eng (hons), MIET andyparkins@gmail.com