When we use git cherry-pick -x <commit>
, it records the source commit in the commit message as follows (cherry picked from commit 5f2662a29efaa91af6b356df2d5d1df69017cac1)
I have a bunch of commits which I need to keep migrating from one base branch to the next. If I use cherry-pick -x, it keeps adding the latest source commit to the message.
Suppose I have used cherry-pick -x to migrate the commit twice, my commit message looks like below:
commit fb3bead084edc27267219d9a8e088ac613159f69 (my-new-branch)
Author: ----
Date: Thu Feb 17 15:29:15 2022 +0530
Test commit 1
(cherry picked from commit 5f2662a29efaa91af6b356df2d5d1df69017cac1)
(cherry picked from commit 11c6ca55b06cbf333fff9a3cfd50c6617adc2e77)
Is there way make cherry-pick -x overwrite the 'cherry picked from' message if there is already one? I want to record only the most recent source commit.