Repolode
satococoa

satococoa/wtp

A Git worktree CLI that auto-generates worktree paths from branch names, runs setup hooks, and removes worktrees together with their branches.

Stars
636
Forks
25
Open issues
27
Last commit
4 days ago

What is it?

wtp (Worktree Plus) is a command-line tool that wraps git worktree with conveniences for managing multiple branches checked out side by side. Running wtp add feature/auth creates a worktree at a path derived from the branch name, so developers don't have to type long relative paths by hand. It can also check out remote-only branches automatically and shows an error when a branch exists in several remotes.

The tool adds project-level configuration through a .wtp.yml file. Post-create hooks can copy gitignored files such as .env from the main worktree, symlink shared directories like .bin, and run setup commands such as npm ci or database migrations. wtp remove --with-branch deletes a worktree and its branch in one step, and wtp cd jumps to a worktree by name with tab completion for Bash, Zsh and Fish.

wtp is written in Go and distributed through Homebrew, go install and prebuilt binaries for Linux and macOS. It requires Git 2.17 or later.

Key features

  • 01Generates worktree paths automatically from branch names.
  • 02Removes a worktree and its branch together with wtp remove --with-branch.
  • 03Runs post-create hooks to copy files, create symlinks and execute setup commands.
  • 04Tracks remote branches automatically when no local branch exists.
  • 05Provides wtp cd with tab completion for Bash, Zsh and Fish.

Use cases

  • Working on several feature branches at once without stashing changes.
  • Bootstrapping new worktrees with .env files and dependency installs in microservice or monorepo projects.
  • Cleaning up finished feature branches along with their worktrees.

Quick start

  1. 1

    Install with Homebrew (macOS/Linux)

    brew install satococoa/tap/wtp
  2. 2

    Or install with Go

    go install github.com/satococoa/wtp/v2/cmd/wtp@latest
  3. 3

    Create a worktree with a new branch

    wtp add -b feature/new-feature

Things to know

  • Requires Git 2.17 or later.
  • Prebuilt binaries are only listed for macOS Apple Silicon and Linux, not Intel Macs or Windows.

In collections

Topics

FAQ

What is wtp?
A Git worktree CLI that auto-generates worktree paths from branch names, runs setup hooks, and removes worktrees together with their branches. wtp (Worktree Plus) is a command-line tool that wraps git worktree with conveniences for managing multiple branches checked out side by side. Running wtp add feature/auth creates a worktree at a path derived from the branch name, so developers don't have to type long relative paths by hand. It can also check out remote-only branches automatically and shows an error when a branch exists in several remotes.
Is wtp free to use? What license does it have?
wtp is open source under the MIT license. Check the license terms before using it in commercial products.
Is wtp still maintained?
Actively maintained. The last commit to wtp was on Nov 3, 2026.
What can I use wtp for?
Working on several feature branches at once without stashing changes. Bootstrapping new worktrees with .env files and dependency installs in microservice or monorepo projects. Cleaning up finished feature branches along with their worktrees.
How do I install wtp?
Install with Homebrew (macOS/Linux): brew install satococoa/tap/wtp Or install with Go: go install github.com/satococoa/wtp/v2/cmd/wtp@latest Create a worktree with a new branch: wtp add -b feature/new-feature
Where can I get wtp?
The source code and installation instructions are on GitHub: https://github.com/satococoa/wtp

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects