← ClaudeAtlas

squash-merge-absorbs-unpushed-base-commitslisted

A squash merge silently relabels commits that were never yours to squash, when the branch was cut from a local base that sat ahead of its remote. Use when: (1) a PR's commit list shows commits you did not write on that branch — a release commit, a session close, a colleague's merge — alongside your own; (2) `git log` on the default branch no longer shows a commit you know landed, though its content is present; (3) a tag, a changelog entry, a state file or a handoff references a SHA that is no longer reachable from the default branch; (4) you are about to cut a feature branch and `git status` says "Your branch is ahead of 'origin/main' by N commits"; (5) a workflow commits to the default branch locally without pushing (a close ritual, a version bump, a generated-artifact commit) and later work branches off it. The content always survives; the absorbed commits' messages, SHAs and authorship do not.
MrBinnacle/skills · ★ 0 · Code & Development · score 68
Install: claude install-skill MrBinnacle/skills
# A Squash Merge Absorbs Commits From an Unpushed Base ## Problem You cut a feature branch, open a PR, squash-merge it. The default branch afterwards is missing commits that had nothing to do with your feature — their content is there, but their messages, SHAs and authorship are gone, folded into your feature's commit. Nothing failed. No warning appeared. Both behaviours that produced it are correct. ## Context / Trigger Conditions The composition needs three things, and each is individually unremarkable: 1. **A commit lands on the default branch locally and is not pushed.** Any workflow that commits without pushing does this: a session-close ritual, a `version` bump before a release, a script that commits generated artifacts, or simply forgetting. 2. **A feature branch is cut from that local default branch.** The normal move. 3. **The PR is squash-merged.** The default on many repositories, and often enforced. Symptoms, in the order you are likely to meet them: - The PR's **Commits** tab lists commits you did not write on this branch. - After the merge, `git log --oneline main` no longer shows a commit you remember landing. - `git rev-list --left-right --count origin/main...main` reports both sides non-zero, and a `git merge --ff-only` refuses with "Diverging branches can't be fast-forwarded". - A file, ticket, tag or handoff cites a SHA that `git branch --contains <sha>` says is on no branch. ## Mechanism GitHub computes a PR's commit list as the commits