Assume I have the following history in my repository:
E--F
/
A--B--C---D
And I want to modify it to be this:
E--F
/ \
A--B--C---D
I don't want to modify file content of revisions, I just want to "draw a merge arrow". How can I do this?
I tried to do this by the following commands:
git checkout D
git merge F -s ours --no-ff --no-commit
git commit --amend
But I got the following error message:
fatal: You are in the middle of a merge -- cannot amend.
I want to leave the commit information unchanged (author, date, message). The only thing I want to change is to add pseudo merge-info to the commit.
This worked for me:
git checkout D~1
git merge F -s ours --no-ff --no-commit
git cherry-pick D -n
git commit -C D
git branch -f D
git checkout D
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With