Re: [PATCH 2/6] git-reset.txt: reset does not change files in target

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

 



Michael J Gruber <git@xxxxxxxxxxxxxxxxxxxx> writes:

> git-reset obviously cannot change files in an existing commit. Make it
> not sound as if it could: reset can change HEAD and, in that sense, can
> change which state a file in HEAD is in.
> ...
> diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
> index 7d68b4c..8fb871c 100644
> --- a/Documentation/git-reset.txt
> +++ b/Documentation/git-reset.txt
> @@ -295,7 +295,7 @@ file. For example, the first line of the first table means that if a
>  file is in state A in the working tree, in state B in the index, in
>  state C in HEAD and in state D in the target, then "git reset --soft
>  target" will put the file in state A in the working tree, in state B
> -in the index and in state D in HEAD.
> +in the index and set HEAD to target (which has the file in state D).

I would further suggest to make it clear that soft reset does not touch
either the index nor the working tree, e.g.:

    "git reset --soft target" will leave the file in the working tree in
    state A and the index in state B.  It moves the HEAD (i.e. the tip of
    the current branch, if you are on one) to "target" (which has the file
    in state D).
--
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]