After a merge, a colleague's change is silently missing and nobody saw a conflict.
AdvancedTroubleshootingMerge and Rebase Problems
Answer
Likely causes → A bad hand-resolution kept only one side; -X ours or -s ours was used; an earlier reverted merge masks commits (Git thinks they are already in); or the commit was dropped during a rebase or squash.
Diagnose →
git log --full-history --oneline -S'missing_function' -- path/to/file
git show --cc <merge-sha>
git merge-base --is-ancestor <lost-commit> HEAD && echo "ancestor, so content was lost in a resolution"
git log --merges --grep='Revert' --oneline
Fix → Re-apply the lost change with git cherry-pick <lost-commit> (or revert the earlier revert-of-merge). Add a regression test.
Prevent → Review merge commits with --cc, avoid blanket -X strategies, and require passing CI on the merged result.
More on Merge and Rebase Problems
Production failed to start, and the file contains `<<<<<<< HEAD` lines that were committed.Beginner`error: you need to resolve your current index first`Beginner`fatal: You have not concluded your merge (MERGE_HEAD exists).`BeginnerRebase stops: `error: could not apply 1a2b3c4... Add retry` and later `No changes - did you forget to use 'git add'?`Intermediate`fatal: It seems that there is already a rebase-merge directory, and I wonder if you are in the middle of another rebase.`Intermediate`CONFLICT (modify/delete): config/old.yml deleted in HEAD and modified in feature.`Intermediate