Question
Given that I have a commit like the following:
A - B - C - D - G - H
\ /
- E - F -
How do I get a perfectly linear history following only the first parents?
Eg, I want to get:
A - B - C - D - G'- H'
It is expected that the sha1's of G and H will change, as noted above. (For obvious reasons). If the sha1's for A, B, C, and D change as well, then I want to know why.
Background
The intention is to avoid potential merge commits that would arise when doing a naive git rebase -i.
The real point is to hopefully gain additional insight in order to determine which commits are in a particular branch, eg, if we have the following graph:
I - J - K - L - M
\ / / /
- N - O - P -
Where N was merged into K, but O was merged with --strategy=ours into L, and P was merged into M.
I want to be able to linearlize my history so that such problematic commits can be identified, and inspected. I want to have a tree where can identify that O was not put into the upstream branch, even if I potentially identify N and P as being potentially missing from the upstream branch as well, by using git cherry, however any suggestions here would be appreciated.