In git, i have 2 commit and a branch merge that have been rebased to look like this
7
6_
5
4
3_|
2
1
the merge was done with no-ff.
my client doens’t want to roll out commits 1 and 2, so im trying to rebase it to look like this
1
2
7
6_
5
4
3_|
This is desirable because then i can branch off of commit 7 and that is my production release.
rebase -i XXXX
flattens the whole thing and has a huge number of conflicts. since im trying to prepare a production rollout, i don’t want to have conflicts because the code will have to go back to testing.
when i do this
rebase -i -p XXXXXX
it moves the commits 1 and 2 correctly, but it deletes the merge and the 4 weeks of work associated with it. how in the world do i do this?
Create a patch from the two commits and apply them in reverse mode to head.
Pro:
Con:
Another hack would be to checkout without the last 7 revisions. Then create patches for the revisions 3-7 and apply those. Should give you the same result and a clean commit history.
But in both cases, I’m wary because you got a lot of conflicts during the rebase.