Branch Protection Rules
Define branch protection rules to prevent direct changes and commits to specific branches. Only merges are allowed into protected branches. Together with the power of pre-merge hooks, you can run validations on your data before it reaches your important branches and is exposed to consumers.
You can create rules for a specific branch or any branch that matches a name pattern you specify with glob syntax (supporting ?
and *
wildcards).
How it works
When at least one protection rule applies to a branch, the branch is protected. The following operations will fail on protected branches:
- Object write operations: upload and delete objects.
- Branch operations: commit and reset uncommitted changes.
To operate on a protected branch, merge commits from other branches into it. Use pre-merge hooks to validate the changes before they are merged.
Reverting a previous commit using lakectl branch revert
is allowed on a protected branch.
Managing branch protection rules
This section explains how to use the lakeFS UI to manage rules. You can also use the command line and API.
Reaching the branch protection rules page
- On lakeFS, navigate to the main page of the repository.
- Click on the Settings tab.
- In the left menu, click Branches.
Adding a rule
To add a new rule, click the Add button. In the dialog, enter the branch name pattern and then click Create.
Deleting a rule
To delete a rule, click the Delete button next to it.