Work with branches and stashes
The branch widget in the main toolbar shows where you are and opens every branch operation. Local changes that would be overwritten by a switch go into a stash and come back afterwards. Branches, stash and cherry-pick: Works.
Open the branch popup
Section titled “Open the branch popup”Click the branch name in the main toolbar, or choose Git › Branches…. The widget shows the
branch with how far it is ahead of and behind its upstream (↑2 ↓1), or, while an operation waits
for you, “Rebasing main”, “Merging main” or “Cherry-picking” with a warning sign.
The popup lists, with an empty filter:
- at the top: Update Project…, Commit…, Push…, New Branch… and Checkout Tag or Revision…;
- Recent (up to five, the current branch first), Local, Remote (one folder per
remote) and Tags, which starts closed. Names with
/are grouped into folders.
Type to filter the list. The footer names the keys: ↩ checkout, → more actions, ⌥↩ rebase onto, ⌘↩ merge into current.
Create and switch branches
Section titled “Create and switch branches”- New branch: New Branch… in the popup, or ⌥⌘N (CtrlAltN). It starts at the current commit. New Branch from ‘feature’… in a branch’s submenu starts it there.
- Switch: select a branch and press ↩. Only the files that differ between the two branches change; unrelated local changes stay.
- A remote branch: checking out
origin/featurecreates a localfeature. It is not set to trackorigin/feature; set the upstream withgit branch -uin the terminal or on the first push. - A tag or a commit: Checkout Tag or Revision… puts you on a detached HEAD.
Switch with local changes in the way
Section titled “Switch with local changes in the way”When a checkout or merge would overwrite local changes, a popup names the files (“Local changes would be overwritten: …”) and offers Smart Checkout (stash, check out, unstash) (or Smart Merge) and Cancel.
Smart Checkout puts your changes, untracked files included, into a real Git stash named “Ferris IDEA smart checkout: main → feature”, switches, and applies the stash again. If applying conflicts, the conflicts view opens and the stash stays in the list, so nothing is lost.
Rename, delete and mark branches
Section titled “Rename, delete and mark branches”Press → on a local branch for its submenu:
- Checkout, New Branch from ‘…’…
- Checkout and Rebase onto ‘main’, Rebase ‘main’ onto ‘…’, Merge ‘…’ into ‘main’
- Compare with ‘main’, Show Diff with Working Tree
- Push…, Rename… (F2), Delete
- Mark as Favorite / Unmark as Favorite
Delete removes only branches that are merged, never the current branch and never by force. After you merge a branch from the popup, a question offers Delete branch ‘…’ or Keep ‘…’.
Favourites are listed first. Click the star on a row or press Space. main and
master and their remote versions start as favourites; the list is kept in
.ferris-idea/branch-favorites.toml.
Set work aside in a stash
Section titled “Set work aside in a stash”- Choose Git › Stash Changes….
- Type a message (↑ brings back earlier ones). Tick Keep index (⌥K) to leave staged changes in place, or Include untracked files (⌥U).
- Confirm. Your working tree is clean.
To bring it back, choose Git › Unstash Changes…. The list shows your stashes, newest selected:
- ↩ applies the stash and keeps it, ⇧↩ applies and drops it (pop), Delete drops it.
- ⌘D shows what the stash contains, Base against Stash.
A stash that conflicts with your files opens the conflicts view: Merge, rebase and resolve conflicts.
Stashing single files, applying single files of a stash, and the shelf are not available.
When it does not work
Section titled “When it does not work”- “Local changes would be overwritten”: choose Smart Checkout, or commit or stash first.
- Delete is refused: the branch is not merged into the current one. Merge it first, or delete
it with
git branch -Din the terminal if you are sure. - A new local branch does not show ahead/behind counts: it has no upstream yet; push it once.
| Action | Shortcut |
|---|---|
| BranchGit.Rename.Local.Branch | F2 or ⇧F6F2 or ShiftF6 |
| Git › New Branch | ⌥⌘NCtrlAltN |
For agents
Section titled “For agents”Reading branches needs no right; creating, switching, merging, deleting branches and stashing need
the right vcs-write.
git_branch_actionBranch operations of the branch popup:delete(merged local branches only, never the current one, never forced),rename,checkout_revision(detached HEAD; refused when local changes would be overwritten),checkout_and_rebase(stops on conflicts for git_rebase continue/abort),is_merged,compare(ahead/behindcommits) ordiff-worktree.git_branch_favoriteMarks (favorite: true), unmarks (false) or toggles (left out) a favourite branch, as the star of the branch popup and of the Git log's branches pane do.git_branchesLocal and remote-tracking branches with target commit; the current branch first and marked; reports a detached HEAD.git_create_branchCreate a local branch at a start revision (default HEAD) without switching to it.git_stashGit stashes:listthem (newest first, also reports a stopped rebase, cherry-pick or merge),pushthe local changes (optionally with untracked files, a message and keep_index to leave the staged changes in the index),applyorpopa stash (pop drops it when it applied without conflicts) ordropit, orshowthe files a stash changes with their text before and in the stash.git_switch_branchSwitch to a local branch: updates the files that differ between HEAD and the branch, keeps unrelated local changes and refuses (listing the paths) when local changes would be overwritten.
No tool matches. Try fewer words, or .