From: Philippe Blain Date: Wed, 08 Jul 2020 23:03:44 GMT Subject: rebase - "fixup!" conflict applied at the wrong code location, why ? Message-ID: <7A30EA48-72E3-47E1-9792-136D7B96DC84@gmail.com> Hello, I've been working on a branch for a while. I've been using `git commit --fixup` and `git commit --squash` when I noticed that I had forgotten to add something to a previous commit. Today I did `git rebase --autosquash` to clean up my history, and the rebase failed at the first 'fixup!' commit with a conflict. However, the conflict is not located at the right place in the code (it's not in the right subroutine!). This is very surprising to me, and I would like to understand why it happens. Steps to reproduce: git clone -b branch-to-be-rebased https://github.com/phil-blain/CICE.git cice cd cice git rebase -i --autosquash my-first-commit # save the todo list without modifications Auto-merging CONFLICT (content): Merge conflict in error: could not apply e8bfa55... fixup! # the rebase stops at f4e1ae6 git diff # tangential question : for some reason the hunk header does not appear here, I don't know why... git diff -2 # but it appears here git grep -p -e '<<<<<<< HEAD' -e '>>>>>>> e8bfa55...' # or here # ok, the conflict appears in subroutine 'picard_solver' git show REBASE_HEAD -U5 # but the original "fixup!" commit only modifies the subroutine 'anderson_solver' !! I would have expected that the conflict be created around lines 1118-1132 (line numbers in f4e1ae6), in the 'anderson_solver' subroutine. I don't know if this plays a part here, but commit f4e1ae6 (where the rebase stops) is the commit where the 'anderson_solver' subroutine is added to the code... Thanks, Philippe.