Summary
Add worktree picker mode (w key) to differ's TUI — list, create, switch between, and remove git worktrees without leaving the app.
Motivation
Git worktrees enable parallel branch workflows (multiple working dirs, one repo). Currently requires exiting differ, running git worktree add, cd, relaunching.
Scope
- List existing worktrees (branch + path)
- Switch to a worktree — repoint internal Repo, reload files
- Create new worktree + branch via text input
- Remove worktree with double-press confirmation
- Configurable worktree path template (
worktree_dir in config)
Keybindings
| Key |
Action |
w |
Enter worktree picker (from file list / diff) |
j/k |
Navigate |
Enter |
Switch to selected worktree |
n |
Create new worktree+branch |
d |
Remove (double-press confirm) |
esc |
Cancel |
Technical approach
- New git methods:
ListWorktrees, AddWorktree, AddWorktreeNewBranch, RemoveWorktree
- New UI mode
modeWorktreePicker following branch picker pattern
- Switching replaces
m.repo pointer → all ops auto-target new worktree
Summary
Add worktree picker mode (
wkey) to differ's TUI — list, create, switch between, and remove git worktrees without leaving the app.Motivation
Git worktrees enable parallel branch workflows (multiple working dirs, one repo). Currently requires exiting differ, running
git worktree add,cd, relaunching.Scope
worktree_dirin config)Keybindings
wj/kEnterndescTechnical approach
ListWorktrees,AddWorktree,AddWorktreeNewBranch,RemoveWorktreemodeWorktreePickerfollowing branch picker patternm.repopointer → all ops auto-target new worktree