Using git v1.7.1 I am trying to reinstall with both --preserve-merges and with --onto at the same time. The final results do not seem to have commits, so they seem linear. I would prefer to keep merge commits for the same reason that people often used --preserve-merges (it would be easier to see a group of commits, which was a logically separate function and was developed in its own branch).
My main branch (destination for reinstallation) is boring:
ABC
The function branch that I want to use has a child branch that has been merged with it. How:
X - Y / \ VW ------ Z
Where Z is the merge commit, which is the head of the feature branch, and X and Y are in the auxiliary function branches.
I use: git rebase --preserve-merges --onto CVZ
I would like to end up with:
X - Y / \ ABCW ------ Z
But instead, I get:
ABCWXY
Since Z is a messy merger, the final state of the code is correct, but the story is not as expressive as we would like.
Is there any way to get what I want?
change @Bombe address : I wrote a bash script to build my example. On my system (RHEL 6.2 with git 1.7.1) this demonstrates my problem.
#! /bin/bash
Before reinstalling, I get:
XY / \ VW-----Z-postZ / ABC
After reinstalling, I get:
XY / \ VW-----Z-postZ / ABC-W'-X'-Y'-postZ'
Note the absence of Z 'between Y' and postZ '.
git rebase
RaveTheTadpole
source share