Re: Proposal: create meaningful aliases for git reset's hard/soft/mixed
- From
Martin von Zweigbergk <martinvonz@gmail.com>
- Date
- Dec 18, 2012, 06:24 UTC
- Message-ID
- <CANiSa6ioKVo5VHht_5R4YwQOoWK8rXPLVFTqMq8J-jBEe2OaRA@mail.gmail.com>
- In-Reply-To
- <vpq4nxvusty.fsf@bauges.imag.fr>
On Wed, Nov 23, 2011 at 12:49 AM, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 6 quoted lines
> Philippe Vaucher <philippe.vaucher@gmail.com> writes: > >> Optional: a new mode would be introduced for consistency: >> --worktree (or maybe --tree): only updates the worktree but not the index > > That would be an alias for "git checkout <rev> -- path", right?
Not quite, in two ways, I think. First, it _would_ update the index, wouldn't it? Second, "git checkout <rev> -- path" doesn't delete files that are deleted in <rev> as compared to head.
I'm considering implementing support for an operation that would do what I expected "git checkout <rev> -- <path>" and "git reset --hard <rev> -- <path>" to do. I'm currently planning for it to be exactly "git reset --hard <rev> -- <path>" (which is currently simply not allowed), but perhaps it would be more natural as an option to checkout (--also-deleted or something)?