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 notifications
When history is rewritten, an email is sent to the
Administrator group members in
Gerrit.
Gerrit web interface
Every 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 .
- Restore history by clicking Resurrect and providing a name for
the new branch.
- Permanently remove a branch by clicking Delete Permanently.
Git command line
You can use a standard
Git
client and run
git fetch && git ls-remote for information on
rewritten and deleted branches.
You 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.
Audit log entries
The 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.