Comment

Comment by semiquaver

You don’t even need the pushes API to see commits that were force pushed away. You can get the head of any branch at a given time using `gitrevisions` [1] syntax any place that you would normally put a branch or commit.

e.g to see the state of the cpython main branch on January 1 we can ask for `main@{2024-01-01}`:

https://github.com/python/cpython/tree/main@{2024-01-01}

This does not walk the commit history, but instead the server-side reflog, so it’s immune to force pushing and can only be avoided by GC of the reflog or repo. Definitely contact GH support if you pushed something you shouldn’t have.

[1] https://git-scm.com/docs/gitrevisions

parent semiquaver 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton