Skip to content
Download

DOCS / GIT

Branches

All branch operations in one place: creating branches (always with a worktree), the merge and rebase dialogs with their options, revert, cherry-pick, rename and delete, and comparing any two branches. Workspace branches are ordinary branches — this page also explains how Birch names them and what deleting a workspace does to its branch.

In Birch a branch is always checked out somewhere, so creating one creates a worktree. Press ⌘⇧N / Ctrl+Shift+N to open the Create Worktree dialog:

  • Worktree path — where the new checkout goes (with a Browse… picker).
  • Create new branch — type the branch name (e.g. feature/my-feature), or
  • Checkout existing branch — pick a branch that isn’t checked out elsewhere.
  • Ticket reference (optional) — e.g. AB-1234 or #42; the dialog previews the branch name it derives from it.

New worktrees also receive your repo’s git-ignored local files (.env and friends) from the source checkout — see .worktreeinclude.

The CLI equivalent is birch worktree new — see the worktree commands.

Every agent workspace gets a fresh branch named birch/terminal/<id> (e.g. birch/terminal/0317168d), created off the base branch you pick in the create-workspace dialog (the repository’s default branch by default). It behaves like any other branch: it shows up in the history view’s ref chips, you can push and publish it, and its PR is created from it.

Deleting a workspace deletes its branch. Right-click the workspace in the sidebar and choose Delete workspace… — Birch removes the worktree and the local branch after a confirmation that always warns that the branch’s commits will be lost (“They will be lost.”) and additionally warns when the worktree has uncommitted changes (“They will be permanently deleted.”). The CLI is more conservative: birch worktree rm <name> removes only the worktree and keeps the branch unless you pass --delete-branch.

The actions below — merge, rebase, revert, cherry-pick-from-branch, rename, delete, and compare — are hosted by the branch picker’s context menu and gear menu of a legacy screen.

Two of them have live equivalents today: cherry-picking single commits works from the History tab, and workspace branches are deleted from the sidebar as described above.

The merge dialog (Merge into current branch) takes a Source branch and one of four modes:

ModeBehavior
Default (fast-forward when possible)Plain merge — fast-forwards when it can
Fast-forward only (abort on divergence)Never creates a merge commit; fails instead
No fast-forward (always create merge commit)Forces a merge commit even when a fast-forward was possible
Squash (single commit, no merge commit)Collapses the source branch into one commit on the current branch

A Merge commit message (optional) field appears for the No fast-forward and Squash modes.

The rebase dialog (Rebase current branch) rebases the current branch onto a chosen Onto branch, with two options:

  • Autosquash (apply fixup! / squash! commits automatically)
  • Autostash (stash dirty work tree before rebasing)

For reordering, squashing, or dropping individual commits, see Interactive rebase.

The revert dialog (Revert commits) lists the branch’s commits with checkboxes — tick any set to revert. Stage only (do not create commit) applies the inverse changes to your working copy without committing, so you can adjust before committing yourself.

Cherry-pick from this branch… picks commits from another branch onto the current one. The live path for cherry-picking today is the History tab: right-click a commit → Cherry-pick to…, or copy/paste a SHA between worktrees — see History.

  • Rename branch… renames a local branch.
  • Delete branch… removes the branch’s worktree and deletes the local branch. The confirmation warns about unmerged commits and uncommitted changes, and notes that it cannot be undone.

The compare dialog takes a Base and a Head branch and shows their merge base SHA, the commits unique to the head, and the changed files — selecting a file opens its full diff in the diff viewer, side-by-side toggle included.

Merge, rebase, cherry-pick, and revert can all hit conflicting changes. When they do, Birch detects it and opens the conflict resolver automatically; a banner over the Git view tracks the in-progress operation until you finish or abort it.