Skip to content

Commit e29678b

Browse files
phil-blaingitster
authored andcommitted
git-cherry-pick.txt: do not use 'ORIG_HEAD' in example
Commit 67ac1e1 (cherry-pick/revert: add support for -X/--strategy-option, 2010-12-10) added an example to the documentation of 'git cherry-pick'. This example mentions how to abort a failed cherry-pick and retry with an additional merge strategy option. The command used in the example to abort the cherry-pick is 'git reset --merge ORIG_HEAD', but cherry-pick does not write 'ORIG_HEAD' before starting its operation. So this command would checkout a commit unrelated to what was at HEAD when the user invoked cherry-pick. Use 'git cherry-pick --abort' instead. Signed-off-by: Philippe Blain <[email protected]> Acked-by: Phillip Wood <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c48035d commit e29678b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Documentation/git-cherry-pick.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ again, this time exercising more care about matching up context lines.
219219
------------
220220
$ git cherry-pick topic^ <1>
221221
$ git diff <2>
222-
$ git reset --merge ORIG_HEAD <3>
222+
$ git cherry-pick --abort <3>
223223
$ git cherry-pick -Xpatience topic^ <4>
224224
------------
225225
<1> apply the change that would be shown by `git show topic^`.

0 commit comments

Comments
 (0)