summaryrefslogtreecommitdiff
path: root/Documentation/git-cherry-pick.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-10-23 13:33:26 -0700
committerJunio C Hamano <gitster@pobox.com>2007-10-26 23:28:28 -0700
commit7791ecbc62b792b3eaa6d722b6dadcea4d0f322d (patch)
tree08ff76b3a227d4bc0395473ad103e82a00355ea3 /Documentation/git-cherry-pick.txt
parent85b00455057c19a993eeaee2606af550b8d4de10 (diff)
downloadgit-7791ecbc62b792b3eaa6d722b6dadcea4d0f322d.tar.gz
revert/cherry-pick: work on merge commits as well
Usually you cannot revert a merge because you do not know which side of the merge should be considered the mainline (iow, what change to reverse). With this patch, cherry-pick and revert learn -m (--mainline) option that lets you specify the parent number (starting from 1) of the mainline, so that you can: git revert -m 1 $merge to reverse the changes introduced by the $merge commit relative to its first parent, and: git cherry-pick -m 2 $merge to replay the changes introduced by the $merge commit relative to its second parent. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-cherry-pick.txt')
-rw-r--r--Documentation/git-cherry-pick.txt9
1 files changed, 8 insertions, 1 deletions
diff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt
index 76a2edfd9b..937c4a7926 100644
--- a/Documentation/git-cherry-pick.txt
+++ b/Documentation/git-cherry-pick.txt
@@ -7,7 +7,7 @@ git-cherry-pick - Apply the change introduced by an existing commit
SYNOPSIS
--------
-'git-cherry-pick' [--edit] [-n] [-x] <commit>
+'git-cherry-pick' [--edit] [-n] [-m parent-number] [-x] <commit>
DESCRIPTION
-----------
@@ -44,6 +44,13 @@ OPTIONS
described above, and `-r` was to disable it. Now the
default is not to do `-x` so this option is a no-op.
+-m parent-number|--mainline parent-number::
+ Usually you cannot revert a merge because you do not know which
+ side of the merge should be considered the mainline. This
+ option specifies the parent number (starting from 1) of
+ the mainline and allows cherry-pick to replay the change
+ relative to the specified parent.
+
-n|--no-commit::
Usually the command automatically creates a commit with
a commit log message stating which commit was