Information Technology Reference
In-Depth Information
If you want to keep the history stored under the second parent of the merge commit
then use
-m 2
parameter, such as:
$ git revert --no-edit -m 2 HEAD
∼
This command produces the snapshot consisting of revisions
m1
,
m2
,
m3
,
f1
,
f2
,
Figure 8-11
.
The snapshot obtained with $ git revert --no-edit -m 2 HEAD
∼
If you forget to indicate the branch you want to keep, git will refuse to revert the
merge commit. The command will fail producing following message:
error: Commit XXXXXX is a merge but no -m option was
given.
fatal: revert failed
8-10. Cherry-picking revisions