Branches

The Branches section is the control center for everything branch-related: listing local and remote branches, creating new ones, switching between them, merging, renaming, deleting, and jumping into the Branch Compare view. Branch Compare is involved enough that it has its own sub-section next — this card covers the list and its actions.

Layout

Selecting Branches fills the right side of the panel with a header bar on top and two scrollable lists underneath:

  • Header bar: a New Branch button on the left and a live filter input on the right. Typing in the filter narrows both the Local and Remote lists at once — matching is case-insensitive and substring-based.
  • Local list: every local branch the repository has, each shown as a single row. If the filter hides every local branch, the list shows "No local branches".
  • Remote list: every remote-tracking branch the repository knows about, with the same row layout as local branches. If there are none (or the filter hides them all), the list shows "No remote branches".

Anatomy of a Branch Row

Each row in the Local and Remote lists shows the same set of elements, laid out from left to right:

  • Gear button: opens the branch context menu (covered below). The context menu also opens on right-click anywhere in the row, so you can pick whichever you prefer.
  • HEAD dot: a small dot that is filled when this branch is the currently checked-out branch (HEAD) and an outlined circle otherwise. The filled state is visually distinct from the rest of the row so you can find HEAD at a glance.
  • Branch name: truncated if it overflows. If this is HEAD, the name is followed by a small (HEAD) suffix so there is no ambiguity.
  • Ahead / Behind arrows: for local branches only, shown when either count is non-zero. The up arrow reports how many commits this branch has that its upstream does not; the down arrow reports the opposite.
  • Sync label: also local-only. It reads "synced" when ahead and behind are both zero, or "N ahead, M behind" (either part omitted if zero) when the branch is out of sync with its upstream.

Clicking anywhere on a non-HEAD local branch row performs a checkout (subject to the guard described below). Remote branch rows and the current HEAD row are not clickable — to act on them you use the context menu.

Creating a New Branch

The New Branch button at the top of the section opens a small modal dialog titled New Branch. It has two inputs:

  • Branch name: a text field auto-focused when the dialog opens. The placeholder hints at a conventional layout (feature/my-feature) but any valid Git branch name is accepted.
  • Start point: a dropdown with the full list of local branches plus a HEAD (current) entry, which is the default. The new branch is created from whichever entry you pick.

Pressing Enter inside the name field submits the form; Escape cancels it. If the create operation fails — invalid name, branch already exists — the error is rendered as a short red line below the start-point field, and nothing is created on disk. Successful creation closes the dialog and refreshes the Local list so the new branch is immediately visible. Creating a branch does not switch to it; use Checkout if you want to move there.

The Uncommitted-Changes Checkout Guard

If you try to switch to another branch while your working tree has staged or unstaged changes, Tigrister does not let the checkout silently throw them away. It intercepts the action and shows a dialog titled Uncommitted Changes with the message "You have staged or unstaged changes. Please commit or stash them before switching to <branch>." The dialog has three buttons:

  • Go to Commit: closes the dialog and enters Commit Mode, where you can pick files, write a message, and commit them before switching.
  • Go to Stash: closes the dialog and jumps to the Stashes section, so you can park the current work-in-progress on a stash entry and come back to it later.
  • Cancel: dismisses the dialog and leaves you on the current branch. Nothing is committed, stashed, or switched.

This guard applies to both list clicks and the Checkout entry in the context menu. There is no "force checkout" shortcut — the explicit Commit or Stash path is the only way through, which is deliberate.

The Branch Context Menu

The context menu is where every non-checkout action lives. It is opened by right-clicking a branch row or by clicking the gear icon at the left edge of the row. The items shown depend on whether the branch is local, remote, or HEAD — irrelevant actions are simply hidden so the menu never offers something that would not make sense.

  • Checkout: switches to this branch. Shown for every branch except the current HEAD. Triggers the uncommitted-changes guard if needed.
  • Merge into current: merges this branch into the currently checked-out branch. Shown for local branches other than HEAD. If the merge creates conflicts, the panel opens the conflict resolver (covered in Merge & Conflict Resolution).
  • Rename: replaces the menu with an inline input pre-filled with the current name. Press Enter to save, Escape to cancel. Shown for local branches only; disabled on HEAD because renaming the branch you are on is intentionally blocked here.
  • Compare with current: opens the Branch Compare view between this branch and the currently checked-out branch. Shown for every branch except HEAD — local and remote.
  • Delete: removes the branch from the repository. Shown only for local branches other than HEAD, and styled as a destructive action so it cannot be confused with the other items.
  • Copy branch name: copies the branch name to the clipboard. Shown for every branch — useful when you need to paste the name into a script, a commit message, or another tool.

The menu positions itself intelligently: if it would overflow the right or bottom edge of the window, it flips to the other side of the click point so it is always fully visible.