path: root/Documentation/git-reset.txt
diff options
authorChristian Couder <>2010-01-19 04:26:01 (GMT)
committerJunio C Hamano <>2010-03-07 04:06:50 (GMT)
commit812d2a3d61b1bbb1931aff2ed6d2a17e939f5bf2 (patch)
tree8a4b55f654c0b5f9fe4a4ebfd226e79b949df17d /Documentation/git-reset.txt
parentab892a19e83edd1cf9a767bc09d3239f72469d05 (diff)
reset: disallow using --keep when there are unmerged entries
The use case for --keep option is to remove previous commits unrelated to the current changes in the working tree. So in this use case we are not supposed to have unmerged entries. This is why it seems safer to just disallow using --keep when there are unmerged entries. And this patch changes the error message when --keep was disallowed and there were some unmerged entries from: error: Entry 'file1' would be overwritten by merge. Cannot merge. fatal: Could not reset index file to revision 'HEAD^'. to: fatal: Cannot do a keep reset in the middle of a merge. which is nicer. Signed-off-by: Christian Couder <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/git-reset.txt')
1 files changed, 3 insertions, 2 deletions
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index 1e9ae0a..58d9b4c 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -155,7 +155,8 @@ 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. To be safe, it is also disallowed when there are unmerged
The following tables show what happens when there are unmerged
@@ -174,7 +175,7 @@ entries:
--mixed X A A
--hard A A A
--merge A A A
- --keep X A A
+ --keep (disallowed)
X means any state and U means an unmerged index.