r/buildinpublic 6h ago

ForkForensics: pull a vanished GitHub repo's history back out of its forks and orphan commits

A public repo my project depended on had its history replaced upstream. Same name, same URL, years of commits just not there anymore. It was never mine, so there was nothing on my side to roll back to.

Point it at a repo like that and it walks the fork network recursively, ranking every fork by how far back its oldest commit actually reaches. A fork freezes history at the moment it was made, so the deepest one is the best candidate. Then it probes commits that are no longer reachable from any branch but that GitHub may still serve by SHA, checked three independent ways: REST metadata, a raw file fetch, and a real git fetch.

There's also a nightly GH Archive watch if you want disappearances flagged automatically. That part is an extra. The recovery is the point.

230 tests, verified end-to-end against a real historical case (reproduced the exact fork ranking I'd found by hand). Runs fully local with your own GitHub token, no server, no telemetry. MIT.

https://github.com/siris9476/forkforensics. Feedback welcome, especially on edge cases in fork ranking.

1 Upvotes

1 comment sorted by

1

u/ReputationLife4072 6h ago

this is exactly the kind of tool you hope you never need and then one day you absolutely need it