Skip to content

feat: git worktree support + branch creation #22

Description

@JanSmrcka

Summary

Add worktree picker mode (w key) and branch creation (n in branch picker) to differ's TUI.

Worktree support

  • w opens worktree picker (list, switch, create, remove)
  • Switching replaces internal Repo pointer → all ops auto-target new worktree
  • New worktrees created at .worktrees/{branch} (configurable via worktree_dir config)
  • Remove requires double-press d, errors on dirty worktrees (no --force)

Branch creation

  • n in branch picker opens text input for new branch name
  • Creates branch via git branch <name>, refreshes list

Keybindings

Worktree picker: j/k nav, Enter switch, n new, d remove, esc cancel
Branch picker: n create new branch

Technical approach

  • New git methods: ListWorktrees, AddWorktree, AddWorktreeNewBranch, RemoveWorktree, CreateBranch
  • New modeWorktreePicker following branch picker pattern
  • WorktreeDir config field (default .worktrees/{branch})
  • Closes feat: branch creation from within differ #20

Plan

See .claude/plans/moonlit-leaping-tower.md for detailed implementation plan.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions