5 ms·
The central repository is the only point that knows (with 100% certainty) which ref the branch was set to before the force push. Each distributed node only kno
by cjh_ 13y ago
The central repository is the only point that knows (with 100% certainty) which ref the branch was set to before the force push.
Each distributed node only knows the ref the branch was pointing at the last time they fetched, so their certainty on what the branch looked like before the force push is much lower.
- hrjet 13y agoIn that case, such a service could/should be automated?
- deathanatos 13y ago> 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.
- ricket 13y agoLuca details the three things that led to this mass force push in his message here: https://groups.google.com/d/msg/jenkinsci-dev/-myjRIPcVwU/v8PWC60lNEIJ https://groups.google.com/d/msg/jenkinsci-dev/-myjRIPcVwU/v8...
- chatman 13y agoIf losing this output is such a problem and force pushing is so rare, then Github could email this output with the two hashes to every developer on every force push.
- swift 13y agoThis seems like a good idea. (With a setting to turn it off, of course.) Ideally git itself should record this information somewhere, though.
- cjh_ 13y agoI was assuming after the fact as that information is not saved anywhere client side. Also I am not sure what he did to push to 150 remotes, and in that case this output would be much more tedious to piece together (and that is assuming he was able to capture all of it). However I disagree that force pushing is rare, I find it is a (sharp) tool I use most days (more often on private repos or branches). I do like the idea of github providing some kind of web interface to view the reflog and reset branches to various points within it.