Branches, Tags & Protected Branches

Branches and tags are managed per repository. Protection rules and merge requirements are configured in the repository's settings.

Branches

Open a repository and go to Branches (the URL is /namespace/repo/-/branches). The list shows the default branch first, followed by every other branch with its last-updated time, author, and how many commits it is ahead of or behind the default branch.

  • Use the Filter branches… box to search by name.
  • Click a branch name to browse its file tree.
  • Use the pull-request icon next to a branch to open New pull request with that branch preselected as the source.

Creating a branch

Branches are created by pushing them. Create the branch locally and push it, and it appears in the list automatically:

git checkout -b my-feature
git push -u origin my-feature

Deleting a branch

If you have permission, a trash icon appears next to deletable branches. Click it and confirm to delete. Branch deletion requires that you are a site admin, the repository owner, or a collaborator with the developer, maintainer, or owner role. You cannot delete:

  • the default branch, or
  • any branch matched by a protected branch rule.

The default branch

The default branch is labelled default in the branch list and is always treated as protected against deletion. It is the branch checked out on clone and the default target for new pull requests.

Tags

Go to Tags (/namespace/repo/-/tags) to view all tags. Each tag shows its name, annotation message (for annotated tags), and timestamp. Click a tag name to browse the repository at that tag, and use the Filter tags… box to search. Create tags by pushing them with git push --tags.

Protected Branches

Protected branches restrict who can push and merge, and prevent force-pushes. Configure them under the repository's Settings (/namespace/repo/-/settings) in the Protected branches section.

Enter a branch name or a wildcard pattern using * (for example release-* matches every branch starting with release-). Then choose:

Setting Options
Allowed to push No one, Maintainers (default), Developers + Maintainers, or Admins only
Allowed to merge Maintainers (default), Developers + Maintainers, or Admins only
Force push Disabled by default; tick Allow to permit force-pushes

Click Protect to save. Protected branches are listed below the form with their push, merge, and force-push settings; click the remove icon to unprotect a branch.

How protection is enforced

  • Access levels are ranked: guest < reporter < developer < maintainer < owner < admin. A user meets a requirement if their role ranks at or above the selected level.
  • No one blocks all pushes to a matching branch (use it to force changes through pull requests only).
  • Unless Force push is allowed, force-pushes to a matching branch are rejected.
  • Branches matched by a protection rule cannot be deleted from the Branches page.

Branch Rules (Merge Requirements)

Branch rules define what must be satisfied before a pull request targeting a branch can be merged. Configure them in Settings under the Branch rules section. As with protected branches, the Branch pattern accepts * as a wildcard.

  • Min approvals — minimum number of approvals required (default 0).
  • Require approval rules to pass — enforce the repository's approval rules.
  • Require CI to pass — the latest pipeline must succeed before merging.
  • Require no conflicts — the source branch must merge cleanly into the target (enabled by default).

Click Add rule to save. Existing rules are listed with badges summarising their requirements; use the remove icon to delete one. With no branch rules configured, pull requests can be merged without any checks.

Protected branches and branch rules are independent: protection controls who can push and merge, while branch rules control what conditions a pull request must meet.