Let's say I have a branch Master With the following commits:
M1->M2
Then from M2 a branch Feature is created and developed as:
M2->F1->F2->F3->F4
Then a merge request is created from Feature and a code review is done where an error is found in F1 (let's say a typo).
The options I don't like are:
Creating a new commit fixing the typo => when merging both the mistake and the correction will be kept, instead of only keeping "the good version" of F1.
git commit --amend
and fix => this will again keep the error and the correction in history, just that it will be corrected in F4.Doing an interactive
git rebase
=> This will actually look good in the history, but it might be annoying as it's likely to happen that there will be Conflicts with all F2, F3 and F4 commits.
So my question is:
Is there an appropriate way of fixing early errors in not-yet-merged branches?