# Branch Configuration

You can use branch patterns to ensure builds are only triggered when necessary. This guide shows you how to setup branch patterns for whole projects and individual build steps.

<%= toc %>

## Project branch filtering

By default a project will trigger builds for all branches (`*` or simply left blank). In your project settings you can set specific branch patterns for the entire project. If a commit doesn't match the branch pattern, no build will be created.

<%= image "project-branches.png" %>

## Build step branch filtering

Similarly to project settings, you can set branch patterns on individual build steps. If the commit doesn't match the branch pattern then the build step will be skipped.

<%= image "job-branches.png" %>

Note that the build will still continue onto the next steps (even if there's a wait step afterwards).

## Branch pattern examples

The following are examples of patterns, and what branches they would match:

* `master production` will match master and production only
* `master features/*` will match master and any branch that starts with `features/`
* `*/release-123` will match any branch that ends with `/release-123` such as `feature-123/release-123`
* `v*.0` will match branch that begins with a `v` and ends with a `.0`, such as `v1.0`
* `!production` will match any branch that's not `production`

# Branch Configuration

You can use branch patterns to ensure builds are only triggered when necessary. This guide shows you how to setup branch patterns for whole projects and individual build steps.

<%= toc %>

## Project branch filtering

By default a project will trigger builds for all branches (`*` or simply left blank). In your project settings you can set specific branch patterns for the entire project. If a commit doesn't match the branch pattern, no build will be created.

## Build step branch filtering

Similarly to project settings, you can set branch patterns on individual build steps. If the commit doesn't match the branch pattern then the build step will be skipped.

<%= image "job-branches.png" %>

Note that the build will still continue onto the next steps (even if there's a wait step afterwards).

## Branch pattern examples

The following are examples of patterns, and what branches they would match:

* `master production` will match master and production only
* `master features/*` will match master and any branch that starts with `features/`
* `*/release-123` will match any branch that ends with `/release-123` such as `feature-123/release-123`
* `v*.0` will match branch that begins with a `v` and ends with a `.0`, such as `v1.0`
* `!production` will match any branch that's not `production`

Remove old project branches screenshot
Remove old project branches screenshot
