Skip to Content
Managing Git WorktreesNaming Patterns

Git Worktree Naming Patterns

When creating a new worktree, WorktreeWise maintains a clean separation between two identifiers:

  • Worktree Name: Displayed in the application UI, matching the Git branch or reference name.
  • Worktree Folder Name: The physical directory created on disk, formatted according to your configured naming template.

This separation ensures that worktrees remain easily identifiable in both the WorktreeWise interface and your local filesystem.


Supported Placeholders

You can use the following placeholders when constructing naming patterns:

PlaceholderReplaced WithExample Output
{repo}Primary repository namemy-project
{branch}Sanitized branch or tag namefeature-auth

Built-In Pattern Presets

WorktreeWise provides four preconfigured naming templates:

Pattern TemplateGenerated Folder ExampleBest Used For
{repo}__wt__{branch} (Default)my-project__wt__feature-authClear visual separation between project root, worktree marker (wt), and branch.
{repo}__{branch}my-project__feature-authShorter directory paths while retaining project affiliation.
{repo}-wt-{branch}my-project-wt-feature-authSingle-hyphen naming conventions.
wt__{repo}__{branch}wt__my-project__feature-authClusters all worktrees together alphabetically in the parent directory.

Configure the Default Naming Pattern

To change the default pattern applied to all newly created worktrees:

  1. Open Settings (Shift + S) and select the Worktrees tab.
  2. Select an existing preset from the dropdown, or enter a custom pattern using {repo} and {branch} placeholders.
  3. Select + (Add) to save a custom pattern to your presets.
  4. The active pattern is saved automatically.

Naming pattern presets and custom pattern editor

If no custom pattern is selected, WorktreeWise defaults to {repo}__wt__{branch}.


Update the Naming Pattern for an Existing Worktree

To re-evaluate and rename the filesystem folder of an existing worktree:

  1. In the Worktrees sidebar, locate the worktree.
  2. Open the three-dot Actions menu and select Change Naming Pattern.
  3. Select or enter the updated pattern in the modal dialog.
  4. Select Apply to rename the directory on disk and update Git administrative pointers.

Change Naming Pattern

Changing the naming pattern of an existing worktree renames its physical directory on disk. Close any running terminals, dev servers, or open editors pointing to the old path before applying changes.