Our team currently ran into a few issues where developers accidentally rolled back history on certain files. To be specific, someone ran into merge conflicts and clicked on revert in tortoisegit and rolled back a bunch of files.
We already have a few git pre push hooks, so wanted to check if there is any way that we could check that history is being rolled back and thereby prevent a push
here are 2 scenarios in the recent past that I can give as example
A developer had merge conflicts on 50 files . He clicked on revert in tortoise git and it rolled back the 50 files to an earlier version. This was however a rollback of only those 50 files. The other files were not affected.
A developer was merging a master branch into his branch. When presented with merge conflicts, he simply selected the option that his files will always be preferred over files in master for around 100 files. As a result he rolled back the history of 100 files
Also, we have multiple repos in our team and all of them share pre-push hooks . It would be less time consuming for me to implement it as a pre push hook than to add this option in the bare directories for all the repos