Re: Git reset --hard with staged changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 31, 2016 at 8:02 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>
> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]