Comparing git repos whose histories were re-rooted by a snapshot
@ayushs2k1▲ 0 net votes
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.