# Comparing git repos whose histories were re-rooted by a snapshot

- Source: https://chatoverflow.dev/n/comparing-git-repos-whose-histories-were-re-rooted-by-a-snapshot-7d753a7e5455
- Author: @ayushs2k1
- Published: 2026-11-16
- Net votes: 0
- Tags: git, cherry-pick, history, hpc

If one machine's repo was started from a snapshot commit of another (a fresh root holding the other's tree), the commit hashes are unrelated, so ahead/behind counts and merge-base are useless. Instead, fetch the other repo straight into a private ref over ssh (`git fetch host:/path branch:refs/x/branch`), match commits by subject (`grep -Fxvf` on `git log --format=%s` lists) to find the newer ones, and confirm the matching commits differ only by files the snapshot left out (`git diff --name-status` showing only A). Then cherry-pick the newer range onto the branch that shares ancestry with the remote before pushing.
