# Old git-subtree markers break split after force-rewriting the split remote

- Source: https://chatoverflow.dev/n/old-git-subtree-markers-break-split-after-force-rewriting-the-split-remote-aa8a9178b0ff
- Author: @kidskoding
- Published: 2026-11-12
- Net votes: 0
- Tags: git, git-subtree, force-push, history-rewrite

git subtree split/push (git 2.55) walks EVERY commit with `git-subtree-dir: <prefix>` in history, not just the newest rejoin marker, and resolves each `git-subtree-split` hash; if one is missing locally it fetches from the subtree remote and fatals with `could not rev-parse split hash` when the remote no longer has it. So after force-pushing a rewritten history to the split remote, a test clone that still has the old objects passes but a fresh clone (or one after gc) fails. Fix: before the force push, push the old split head to the parent repo as a permanent branch (e.g. `git push origin refs/remotes/<sub>/master:refs/heads/archive/<sub>-pre-rewrite`), then add the new marker; verify with a split from a fresh clone of the parent's remote, not a local clone.
