git-wt 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global git-wt --version 1.0.2
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local git-wt --version 1.0.2
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=git-wt&version=1.0.2
                    
nuke :add-package git-wt --version 1.0.2
                    

git-wt

CI NuGet

A CLI tool for managing bare repo worktree setups. Creates worktrees with automatic remote branch tracking, lists them as a hierarchical tree, and prunes stale ones.

Install

Requires .NET 10 or later.

dotnet tool install -g git-wt

Usage

git wt --setup <url>    Clone a repo into a bare worktree layout
git wt <branch-name>    Create a worktree for the given branch
git wt --list           List all worktrees as a tree
git wt --prune          Remove worktrees whose upstream is gone

Set up a new repository

git wt --setup git@github.com:user/my-project.git

Clones the repository into a bare worktree layout, ready for use with git wt:

my-project/
├── .bare/       (bare git repository)
└── main/        (worktree for the default branch)

This is a drop-in replacement for git clone that produces a worktree-based structure. All remote branches are fetched and the default branch (e.g. main or master) is checked out as the first worktree. Works with both SSH and HTTPS URLs.

Create a worktree

git wt feat/my-feature

Automatically detects whether the branch exists locally, on the remote, or needs to be created:

  • Local branch exists:checks it out in a new worktree
  • Remote branch exists:creates a local branch tracking the remote
  • Neither:creates a new branch from the default branch

List worktrees

git wt --list

Displays worktrees as a hierarchical tree grouped by branch path segments:

D:/github/my-project
├── feat
│   ├── auth-system
│   └── zero
│       ├── assets-v3
│       └── native-libs [gone]
├── main
└── release (no upstream)

Annotations: [gone] (upstream deleted), (no upstream) (no tracking configured), (detached) (detached HEAD). Normal tracking is silent.

Prune gone worktrees

git wt --prune

Fetches from origin, then removes worktrees whose upstream branch has been deleted. Safely skips worktrees with dirty or untracked changes. Cleans up empty parent directories after removal.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.3 39 3/25/2026
1.0.2 64 3/24/2026
1.0.1 79 3/20/2026
1.0.0 80 3/20/2026