> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gorules.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Branches

> Create isolated workspaces for developing and testing rule changes.

Branches let you work on changes in isolation before merging them into the main branch. This Git-like workflow enables safe experimentation and team collaboration.

## Branch list

The Branches page shows all project branches:

| Column         | Description                 |
| -------------- | --------------------------- |
| Name           | Branch identifier           |
| Author         | Who created the branch      |
| Change Request | Associated CR if one exists |
| Actions        | Edit, view commits, delete  |

## Creating a branch

1. Click "Create branch"
2. Enter a descriptive name (e.g., `feature/pricing-update`, `fix/discount-bug`)
3. Click Create

New branches are created from the current state of the main branch.

### Naming conventions

Use prefixes to indicate branch purpose:

* `feature/` - New functionality
* `fix/` - Bug fixes
* `refactor/` - Code improvements
* `test/` - Experimental changes

## Working on a branch

After creating a branch, click the edit button to open the editor. You can:

* Add, modify, or delete files
* Commit changes with descriptive messages
* Test rules using the simulator

### Committing changes

1. Make your changes in the editor
2. Click "Commit changes"
3. Review the list of changed files
4. Enter a commit message
5. Click Commit

Optionally check "Commit to a new branch" to create a branch from uncommitted changes.

## Branch actions

| Action  | Description                            |
| ------- | -------------------------------------- |
| Edit    | Open the branch in the editor          |
| Commits | View commit history for this branch    |
| Delete  | Remove the branch (cannot delete main) |

## Merging branches

When ready to merge changes into main:

1. Open the branch in the editor
2. Click "Merge"
3. Review the changes
4. Enter a merge commit message
5. Optionally check "Open change request" for review workflow
6. Click Merge or Open change request

### Direct merge vs change request

| Approach       | When to use                                               |
| -------------- | --------------------------------------------------------- |
| Direct merge   | Branch protection is "None", no review needed             |
| Change request | Branch protection requires review, or you want visibility |

## Viewing commit history

Click the commits link on any branch to see its history:

* Chronological list of commits
* Click any commit to view details and changed files
* See author and timestamp for each commit
