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
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.
This section explains how to use the lakeFS UI to manage rules. You can also use the command line.
- On lakeFS, navigate to the main page of the repository.
- Click on the Settings tab.
- In the left menu, click Branches.
To add a new rule, click the Add button. In the dialog, enter the branch name pattern and then click Create.
To delete a rule, click the Delete button next to it.