Skip to main content

Git worktree workflow

This setup uses ,w to make branch isolation, PR checkout, issue work, and tmux session switching cheap.

SurfaceSource
CLI entryhome/exact_bin/executable_,w
Helpershome/exact_lib/exact_,w/ and home/exact_lib/exact_shared/
GitHub wrapperhome/exact_bin/executable_,gh-worktree
Visual pickerSession picker and GitHub picker

Mental modelโ€‹

TaskUse
Create an isolated branch checkout,w add
Check out PRs locally,w prs or the GitHub picker
Start work from an issue,w issue or ,gh-worktree issue
Focus a worktree's tmux session,w switch / ,w open
Rename/move branch + worktree,w mv
Remove finished work,w remove
Clean stale metadata,w prune
Check dependencies/state,w doctor

Preconditionsโ€‹

  • You are inside a git repository.
  • ,w is installed and on PATH.
  • For GitHub-backed flows, gh is authenticated.

Fast pathโ€‹

,w add feat/my-change main
,w prs 12345 --focus
,w issue --branch chore/fix-widget 12345 --focus
,w switch
,w remove
,w doctor

Detailsโ€‹

  • Worktree subcommands โ€” exact flags and behavior for add, prs, issue, ls, switch, open, mv, remove, prune, and doctor.
  • GitHub worktree integration โ€” how ,gh-worktree, the GitHub picker, repo bootstrap, Octo review, PR/issue metadata, and tmux sessions fit together.

Verificationโ€‹

,w ls
,w doctor

Confirm the expected worktree exists and tmux session switching works.

Rollback / undoโ€‹

,w remove
,w prune --apply