I work on a branch (with others) from the master.
A - B - C - F - G (master) \ D - E (branch-a)
We periodically merge master into a branch to minimize conflicts later.
A - B - C - F - G (master) \ \ D - E - H (branch-a)
In the end, we will want to unite.
A - B - C - F - G - I - K - M - N (master) \ \ \ / D - E - H - J - L - O (branch-a)
What is the cleanest way to merge with a master?
- I want to keep separate commits (i.e. no squash)
- I will no longer use
branch-a , so hash commits can change. - I would like to not include merge commits (e.g.
H , L ) for merge without conflicts, if possible.
Ideally, it would look like this (if there are no conflicts):
A - B - C - F - G - I - K - M - N (master) \ / D - E - J - O
Any ideas on how to do this?
(FYI, this is a question about my workflow. If I had done something even earlier, this is also a legitimate answer.)
UPDATE:
Thinking about it more, I realized that this is often impossible.
For example, if J changed the line that G changed, there would be no way to get this story.
The next best option would be to have this story:
A - B - C - F - G - I - K - M - D - E - J - O (master)
Essentially, this is a rebase, but the omission of an unnecessary merger ends.