Comment

Comment by deathanatos

> The central repository is the only point that knows (with 100% certainty) which ref the branch was set to before the force push.

git reports it to you when you do the force push:

  % git push github master --force
  …
  Total 0 (delta 0), reused 0 (delta 0)
  To https://github.com/foo/repo.git
   + 4d44b63...ad5b147 master -> master (forced update)
       ^          ^
     previous    what you've forced it to
Of course, if you lose the output, then yes, the reflog is the only thing that has it. But force pushing is so rare, and something that (should) is done with care, I'm puzzled as to how someone "accidentally" >150 repos.
parent deathanatos 13 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton