# Branches

Source: https://athas.dev/docs/git-branches

Create, switch, merge, and delete Git branches while protecting local changes.

Athas provides a visual branch manager.

## Current Branch

The current branch is displayed in the status bar. Click it to quickly switch branches.

## Creating Branches

1. Open the branch manager
2. Click "New Branch"
3. Enter the branch name
4. Choose whether to checkout immediately

## Switching Branches

1. Open the branch manager
2. Click on any branch to switch to it
3. Or use the status bar branch selector

## Merging Branches

1. Checkout the target branch (e.g., `main`)
2. Open the branch manager
3. Right-click the branch you want to merge
4. Select "Merge into current branch"

## Deleting Branches

1. Open the branch manager
2. Right-click the branch to delete
3. Select "Delete Branch"
4. Confirm the deletion

Note: You cannot delete the currently checked out branch.

## Remote Branches

Remote branches are shown under "Remote Branches". You can checkout, fetch, or delete them.

## Protect local changes

Inspect status and save your work before switching, merging or deleting branches. Git may reject a switch that would overwrite changes. Commit or stash them deliberately, or use a separate [worktree](https://athas.dev/docs/git-worktrees). Review conflicts and the final [diff](https://athas.dev/docs/git-diff) after a merge.
