Link Search Menu Expand Document

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:

  1. Object write operations: upload and delete objects.
  2. 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.

Reaching the branch protection rules page

  1. On lakeFS, navigate to the main page of the repository.
  2. Click on the Settings tab.
  3. 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.

Adding a branch protection rule

Deleting a rule

To delete a rule, click the Delete button next to it.

Deleting a branch protection rule