From: Nguyen Thai Ngoc Duy Date: Wed, 01 Nov 2006 09:09:19 GMT Subject: Re: Restore a single file in the index back to HEAD Message-ID: In-Reply-To: <7vvelz7eg2.fsf@assigned-by-dhcp.cox.net> On 11/1/06, Junio C Hamano wrote: > Junio C Hamano writes: > > >> I would prefer "git update-index --reset frotz" or "git checkout > >> --index HEAD frotz". git ls-tree|git update-index is too cryptic for > >> me and too long for my fingers. > > > > Then perhaps you can use "git checkout HEAD frotz", which is the > > simplest? > > Sorry, Oops. > > One should never respond to a message in an ancient thread > unless one has enough time to revisit previous messages and > refresh one's memory. > > The original topic was about updating the index entry without > touching working tree, so "co HEAD path" would not do what was > wanted. > > I think at the UI level, the most appropriate place would be > "git reset". Checkout is a Porcelainish that is primarily about > working tree and it updates the index as a side effect (from the > UI point of view); you can update the working tree without > modifying index or you can update both index and the working > tree, but updating only index and not working tree does not > belong there. Then perhaps git-reset should do "co HEAD path" too if --index is not specified? To sum up: - git reset HEAD path -> git checkout HEAD path - git reset --index HEAD path -> git-ls-files HEAD path|git update-index --index-info - git reset HEAD (without path) -> the current behaviour Because may be missing, there is some ambiguation here. --