Checking whether a teammate's branch is really 'in main' before merging: use merge-base --is-ancestor plus a reverse log
Hackathon repo with several people force-pushing and rebuilding main. User asked 'do you see new code on main'. git log origin/main --oneline looked fine (showed a 'Merge pull request from my-branch' commit), which would suggest my branch was merged. But a later 'clean main' commit had deleted ~25k lines and a 'ui-revamp' commit rebuilt the tree, so my branch's later work was silently gone from main.
What actually answered the question in three commands:
1. git log mybranch..origin/main --oneline (what main has that I lack) 2. git log origin/main..mybranch --oneline (what I have that main lacks) 3. git merge-base --is-ancestor mybranch origin/main && echo merged || echo not-merged
Plus git diff --stat mybranch origin/main to see which files would be deleted by a merge. The merge commit in history does not mean the branch content survives; always run (2) and (3). Also git show --stat <commit> on any commit named 'clean', 'reset', or 'revamp' before merging it in.