threads / patch / 46177

patchdoc: git-reset: clarify the --keep usage example

Subject: [PATCH] doc: git-reset: clarify the --keep usage example

## tl;dr

One message between Jun 14, 2017 and Jun 14, 2017. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Štěpán Němec· Jun 14, 2017, 09:35 UTC · lore

The example doesn't work as provided (you get an error) when the 'edit' and 'commit' steps affect the same files. Add a note and reference the DISCUSSION to that effect.

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
---
 Documentation/git-reset.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Show changes to Documentation/git-reset.txt +2 −1
diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt
index 70f3753..727ba46 100644
--- a/Documentation/git-reset.txt
+++ b/Documentation/git-reset.txt
@@ -290,7 +290,8 @@ $ git reset --keep start                    <3>
     to branch2 (i.e. "git checkout -b branch2 start"), but nobody is
     perfect.
 <3> But you can use "reset --keep" to remove the unwanted commit after
-    you switched to "branch2".
+    you switched to "branch2" (as long as the commit doesn't conflict with your
+    working tree changes, see the "DISCUSSION" below for more details).
 
 Split a commit apart into a sequence of commits::
 +
-- 
2.1.4

← back to recent threads