autowt: a better git worktree experience¶
Consider what it takes to set up a fresh worktree in a typical workflow:
- Make a decision about where to put the worktree
git worktree add <worktree_path> -b <branch>- Open a new terminal tab
cd <worktree path>uv syncornpm installor whatever your dependency setup iscp <repo_dir>/.env .to copy secrets
Congrats, you're done! Type type type, open a PR, and merge it. Now you need to clean up:
git worktree rm .- Close the tab
Of course, you might close the tab and forget to clean up the worktree, and your set of worktrees will grow.
On the other hand, with autowt, it looks like this:
And deleting branches that have been merged or are associated with closed PRs looks like this:
A lot nicer, right?
Type less
The built-in worktree commands are verbose. autowt makes them shorter, and adds automation hooks.
Terminal program automation
If you like to keep multiple tabs open, autowt can create tabs for new worktrees, and switch to the correct tab for a worktree if you already have it open.
Getting started¶
You'll need Python 3.10+ and a version of git released less than ten years ago (2.5+).
First, install autowt:
Then, make a new worktree for a new or existing branch in your current repo:
Watch as autowt creates a new worktree and opens it in a new terminal tab or window.