Skip to main content

Customizable git worktree manager

Project description

autowt: a better git worktree experience

Full documentation

This README is generated from the index page of the docs. There are many more pages of docs at the link.

What are worktrees?

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.

How autowt simplifies common workflows

While worktrees are powerful, the built-in tooling is minimalistic. Consider what it takes to set up a fresh worktree in a typical workflow:

  1. Make a decision about where to put the worktree
  2. git worktree add <worktree_path> -b <branch>
  3. Open a new terminal tab
  4. cd <worktree path>
  5. uv sync or npm install or whatever your dependency setup is
  6. cp <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:

  1. git worktree rm .
  2. 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 cleanup

A 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 whatever

[!NOTE]

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.

What autowt can do for 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.toml to 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 config gives you an easy way to edit global settings. autowt switch lets you review your worktrees and pick which one to navigate to.

Getting started

You'll need Python 3.10+ and a version of git released less than ten years ago (2.5+).

First, install autowt:

pip install autowt

Then, make a new worktree for a new or existing branch in your current repo:

autowt my-new-feature

Watch as autowt creates a new worktree and opens it in a new terminal tab or window.

Continue to full documentation

Contributing

PRs, GitHub issues, discussion topics, bring 'em on!

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autowt-0.5.9.dev1.tar.gz (191.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autowt-0.5.9.dev1-py3-none-any.whl (68.9 kB view details)

Uploaded Python 3

File details

Details for the file autowt-0.5.9.dev1.tar.gz.

File metadata

  • Download URL: autowt-0.5.9.dev1.tar.gz
  • Upload date:
  • Size: 191.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for autowt-0.5.9.dev1.tar.gz
Algorithm Hash digest
SHA256 229d215aed910829ad1307f13af4975a9f34ae530a2fc04fd8e0d3cbde93a274
MD5 73a2e35e8cfafd01c3e8b05c442bffe5
BLAKE2b-256 f6d0de15ac71d2df463fa310247d123f7550b46c06ed97e9380e7e428472f37b

See more details on using hashes here.

Provenance

The following attestation bundles were made for autowt-0.5.9.dev1.tar.gz:

Publisher: pypi.yml on irskep/autowt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autowt-0.5.9.dev1-py3-none-any.whl.

File metadata

  • Download URL: autowt-0.5.9.dev1-py3-none-any.whl
  • Upload date:
  • Size: 68.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for autowt-0.5.9.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 12ae7ab71a0b9d056574e08e051dc41363808704e6fb4cebb0df8040e1780038
MD5 7e82675c0bf2fba352d3ce5fcf9ed24e
BLAKE2b-256 4524a17d1fb02b59e3dc7504cc27d09e12bc2b036cda10833dd1cabc4f8ffca4

See more details on using hashes here.

Provenance

The following attestation bundles were made for autowt-0.5.9.dev1-py3-none-any.whl:

Publisher: pypi.yml on irskep/autowt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page