Re: Git reset --hard with staged changes
- From
Christian Couder <christian.couder@gmail.com>
- Date
- May 31, 2016, 06:41 UTC
- Message-ID
- <CAP8UFD18mbT12+9P0vqNWAnNirCD0oRz1O-ajFmm5y1BNTdVFA@mail.gmail.com>
- In-Reply-To
- <xmqqvb1u7okk.fsf@gitster.mtv.corp.google.com>
On Tue, May 31, 2016 at 8:02 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 19 quoted lines
> > diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt > index 25432d9..c4cc035 100644 > --- a/Documentation/git-reset.txt > +++ b/Documentation/git-reset.txt > @@ -65,8 +65,14 @@ If `-N` is specified, removed paths are marked as intent-to-add (see > linkgit:git-add[1]). > > --hard:: > - Resets the index and working tree. Any changes to tracked files in the > - working tree since <commit> are discarded. > + Reset the index and the working tree to be identical to the > + tree of the given <commit> (defaults to HEAD) by discarding > + the changes made to them relative to <commit>. Paths > + modified in the index and in the working tree are reset to > + what is recorded in <commit>. Paths removed in the working > + tree and in the index are resurrected from <commit>. Paths > + added to the index and the working tree since <commit> are > + removed.
This is a great improvement.
I am not sure that it will be enough to make people use `git stash` and `git reset --keep` more though. But maybe that can wait until the next time someone complain.
Thanks, Christian.