Documentation: reset: describe new "--keep" option
and give an example to show how it can be used.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Christian Couder15 years agocommitted byJunio C Hamano
@ -128,6 +138,7 @@ in the index and in state D in HEAD.
@@ -128,6 +138,7 @@ in the index and in state D in HEAD.
--mixed B C C
--hard C C C
--merge B C C
--keep B C C
"reset --merge" is meant to be used when resetting out of a conflicted
merge. Any mergy operation guarantees that the work tree file that is
@ -138,6 +149,14 @@ between the index and the work tree, then it means that we are not
@@ -138,6 +149,14 @@ between the index and the work tree, then it means that we are not
resetting out from a state that a mergy operation left after failing
with a conflict. That is why we disallow --merge option in this case.
"reset --keep" is meant to be used when removing some of the last
commits in the current branch while keeping changes in the working
tree. If there could be conflicts between the changes in the commit we
want to remove and the changes in the working tree we want to keep,
the reset is disallowed. That's why it is disallowed if there are both
changes between the working tree and HEAD, and between HEAD and the
target.
The following tables show what happens when there are unmerged