A Custom Function To Rebase All Worktrees in Magit

I've been using Git worktrees for quite a while during agentic coding, and it's been largely successful with my current workflow. One hassle to perform inside of Emacs after some changes in worktrees is that I have to go to the worktrees and rebase them to the main branch one by one. In Magit, this is relatively easy when performed individually. But when I have more than one worktrees need rebasing, it quickly become a repetitive chore. ...

July 13, 2026 · Walden Cui

Direnv is All You Need to Parallelize Agentic Programming with Git Worktrees

I've known for months that Git worktrees are essential for running AI coding agents like Claude Code and Codex in parallel. However, my early attempts to integrate them into my workflow failed multiple times. The problem wasn't Git itself-creating a worktree and a new branch via the CLI or Magit is trivial. The real obstacle lies in the .gitignore'd parts of your project. Things like .env files containing environment variables, or your Python .venv directory, don't carry over to new directories. Naively creating a Git worktree results in an incomplete environment, causing agentic tools to fail when trying to run standard development commands like linting, compiling, or testing. ...

March 13, 2026 · Walden Cui