Re: [PATCH 2/6] git-reset.txt: reset does not change files in target
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:32
Michael J Gruber [off-list ref] writes:
quoted hunk
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).