The following situation is something that happens every once in a while when I am working with Git. I start with a linear history, with two branches. The master currently points at C. Branch A is a branch that I am asking my colleagues to merge into master and branch B has unfinished work that I haven't made public yet.
C
\
A - B
During the code review, my colleague notices that there is a typo in the last commit in branch A. Instead of creating a new commit just to fix the typo, I amend the offending commit and we merge that into master. Master now points to A', which is the commit that corrected the typo.
C - A'
\
A - B
The next step is to rebase the unfinished work. I want the final result to look like this:
C - A'
\
B
However, by default Git assumes that A and A' are completely unrelated commits and it tries to do this instead:
C - A'
\
A - B
Which finally brings us to my question:
Is there a way to ask git to figure out by itself that we don't need to include A in the rebase because A' is already there? Or is this one of those situations that always requires human intervention to remove the duplicate commit?