History protection reports History protection reportsYou can view entries in refs/rewrite (for non-fast forward pushes) and refs/delete using the Git ls-remote command only if read access is granted to refs/*. Gerrit will prevent any other action such as delete/force-update on those special refs for all users including administrators.
Once history protection is turned on, any non-fast forward push to a remote repository or deletion of a branch or tag on a remote repository is recorded and reported.
Email notificationsWhen history is rewritten, an email is sent to the Administrator group members in Gerrit.
Gerrit web interfaceEvery history rewrite event is logged and stored in the Gerrit database and visible in the Gerrit web interface. As Gerrit Administrator, you can -
- See rewritten history from
> Rewritten History
- Restore history by clicking Resurrect and providing a name for
the new branch.
- Permanently remove a branch by clicking Delete Permanently.
Git command lineYou can use a standard Git client and run git fetch && git ls-remote for information on rewritten and deleted branches.
Audit log entriesThe following events are logged in /opt/collabnet/gerrit/logs/gerrit.audit.log:
- Remote branches are deleted
- History is rewritten (non-fast forward push)
- Backup branches are resurrected
- Backup branches are permanently deleted
- History Protection is turned on or off