but worktree
Manage worktrees.
Without a subcommand, lists the worktrees.
Usage: but worktree <COMMAND>
Subcommands
but worktree list
List worktrees, most recently updated first.
By default this lists every active worktree and the three most recently updated archived ones. A worktree is shown by its name, followed by the branch it has checked out when that differs from the name, and its path.
Usage: but worktree list [OPTIONS]
Options:
--archived— List all archived worktrees--active— List all active worktrees
but worktree new
Create a worktree on a new branch at the workspace base or above a commit, or on an existing branch that isn't in the workspace.
By default, a new branch starts at the child-most commit any applied stack rests on, and is
checked out under ~/.gitbutler-worktrees/<repo-dir-basename>/ in a directory
named by a slug of the branch name (or wt if the slug is empty). If that
directory is taken, retries up to five times with a random ASCII suffix.
Worktree creation supports simple .worktreeinclude files with paths to files or
directories. Untracked files are copied if any prefix of their path is in the
.worktreeinclude file and they are also gitignored.
Usage: but worktree new [NAME] [OPTIONS]
Arguments:
<NAME>— The branch to check out, created if it doesn't exist, or a generated one
Options:
-A,--above<BRANCH_OR_COMMIT>— Start the new branch at BRANCH_OR_COMMIT instead of the workspace base.
Accepts a branch by name or CLI ID, a commit by SHA or CLI ID, or any Git revision like origin/main. Conflicted commits and the GitButler workspace commit are refused.
but worktree recycle
Reuse an archived worktree on a new branch at the local target branch, or create one there.
Picks the most recently updated archived worktree whose branch is already in the
target, isn't in the workspace, and that has no uncommitted changes and no Git
operation in progress. It is shown in the workspace again on a new branch with a
generated name, so the files Git doesn't track, such as build output and installed
dependencies, are kept. Its old branch stays as it was, with its upstream. Without
such a worktree, creates a new one there, like but worktree new. The local target
branch, such as main, is used even when its upstream has newer commits.
Usage: but worktree recycle
but worktree archive
Hide a worktree from the workspace until but runs inside it again
Usage: but worktree archive <WORKTREE>
Arguments:
<WORKTREE>— The worktree, by CLI ID (see but wt list), name, or path (required)
but worktree unarchive
Show an archived worktree in the workspace again
Usage: but worktree unarchive <WORKTREE>
Arguments:
<WORKTREE>— The worktree, by CLI ID (see but wt list), name, or path (required)
but worktree remove
Remove a worktree from disk, like git worktree remove.
This works on archived and locked worktrees too, and keeps the branch the worktree had checked out.
Usage: but worktree remove <WORKTREE> [OPTIONS]
Arguments:
<WORKTREE>— The worktree, by CLI ID (see but wt list), name, or path (required)
Options:
-f,--force— Remove the worktree even if it has uncommitted changes
Last updated on