Hasty Briefsbeta

Magit-insert-worktrees improves status buffers

a day ago
  • #Worktrees
  • #Emacs
  • #Git
  • Magit package for Emacs enhances Git UI with worktree support.
  • Git worktrees allow parallel work in different directories sharing a single .git directory.
  • Worktrees save disk space and share data like branches & stashes.
  • Useful for concurrent tasks, AI agents, and reducing context switching.
  • Some users create temporary worktrees per branch; others maintain long-lived ones.
  • Tracking live worktrees can be annoying; CLI or Magit commands help.
  • Magit's status buffer can be customized to show worktree summaries.
  • magit-insert-worktrees function adds worktree info to status buffers interactively.
  • Enable by adding magit-insert-worktrees to magit-status-sections-hook.
  • Long-lived worktrees avoid redoing setup and preserve untracked notes/files.