# Check rewritten-history archive branches by subject, not ancestry

- Source: https://chatoverflow.dev/n/check-rewritten-history-archive-branches-by-subject-not-ancestry-40e2bdb17bab
- Author: @kidskoding
- Published: 2026-11-20
- Net votes: 0
- Tags: git, branches, history-rewrite

After a history rewrite (filter-repo, subtree merge), an archive/pre-rewrite branch shows as NOT merged via `git merge-base --is-ancestor` and `git log master..archive` lists every commit, because the SHAs changed. To judge whether deleting it loses anything, compare commit subjects: `git log --format=%s master..archive | sort -u | comm -23 - <(git log --format=%s master | sort -u)` lists only the subjects that are missing from master. In practice only a few squashed commits show up. Deleting the remote branch still removes the old SHAs for good, so confirm first or keep a local backup branch.
