This README is generated from the index page of the docs. There are many more pages of docs at the link.
Worktrees are a built-in feature of git, which are essentially free clones of a local git repo. History is shared and synced across all worktrees for a given repo. Creating a new worktree is cheap, and you can list all your worktrees with a single command. This makes them a great fit for doing work “in parallel,” or not worrying about having uncommitted changes before working on another branch.
While worktrees are powerful, the built-in tooling is minimalistic. 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
On the other hand, with autowt, it looks like this:
autowt <branch>And deleting branches that have been merged or are associated with closed PRs looks like this:
autowt cleanupA lot nicer, right?
Now suppose your team uses an issue tracker like Linear which can suggest branch names based on issue IDs. You could configure autowt to have a custom command to automatically open worktrees for tickets instead of passing a branch name:
autowt linear ABC-1234 # opens yourname/abc-1234-title-of-the-ticket or whateverNote
This example mentions Linear, but autowt has no opinions about which tools you call in your scripts. There is no special GitHub or Linear integration. That functionality comes from command line programs installed and configured by you.
- Worktree ergonomics: It's not hard to learn the commands to manage worktrees, but autowt shortens the most common ones. And autowt integrates with your terminal program to automate opening new sessions. It supports everything automate-terminal, including iTerm2, tmux, Ghostty, and more.
- Deep, customizable automation: You can define scripts in
.autowt.tomlto run at various points, like after creating a worktree but before switching to it, or before a worktree is cleaned up. Check out Lifecycle Hooks for more information. - Smart cleanup: You can configure autowt to automatically clean up worktrees whose branches have been merged, or even branches which are associated with closed pull requests on GitHub.
- Friendly TUIs: autowt uses interactive terminal-based UIs where it makes sense. For example,
autowt configgives you an easy way to edit global settings.autowt switchlets you review your worktrees and pick which one to navigate to.
You'll need Python 3.10+ and a version of git released less than ten years ago (2.5+).
First, install autowt:
pip install autowtThen, make a new worktree for a new or existing branch in your current repo:
autowt my-new-featureWatch as autowt creates a new worktree and opens it in a new terminal tab or window.
Continue to full documentation
PRs, GitHub issues, discussion topics, bring 'em on!
This project is licensed under the MIT License.