Rename a Git Worktree
Renaming a worktree in WorktreeWise updates the filesystem directory name and runs git branch -m to keep your Git branch name and directory structure synchronized.
Rename a Worktree
- In the Worktrees panel, locate the worktree you want to rename.
- Select the three-dot Actions menu and choose Rename.
- In the dialog, enter the new name for the worktree and branch (e.g.
feature-payment-v2). - Select Rename.

Automatic Branch Synchronization
In standard Git CLI, renaming a worktree folder does not rename the branch, and running git branch -m does not rename the folder on disk. This often leads to discrepancies where a directory named feature-v1 is checked out to feature-v2.
WorktreeWise performs both updates atomically:
- Branch Renamed: Executes
git branch -m <old-name> <new-name>, preserving all commit history and reflog records. - Directory Renamed: Renames the worktree directory on disk to match your configured naming template.
- Pointers Re-anchored: Updates Git’s administrative link files (
.gitin the worktree andgitdirin the main repository).
Renaming updates your local Git branch. If you have already pushed the old branch to a remote repository, push the newly renamed branch and delete the old remote branch if needed:
git push origin -u <new-branch>
git push origin --delete <old-branch>Validation & Restrictions
WorktreeWise validates the new name before executing the rename operation:
| Rule | Requirement |
|---|---|
| Git Ref Syntax | Must adhere to standard Git branch naming rules (no whitespace, control characters, tildes ~, colons :, carets ^, or consecutive periods ..). |
| Collision Prevention | The new name must not conflict with an existing local branch or existing directory. |
| Primary Worktree Immunity | The primary repository worktree cannot be renamed from this menu. |
| Lock Protection | Locked worktrees cannot be renamed until explicitly unlocked. |
Related Pages
- Move a Git Worktree: Relocate a worktree to a different disk path without renaming its branch.
- Lock a Git Worktree: Safeguard worktrees against accidental rename or deletion.
- Git Worktree Naming Patterns: Configure directory naming conventions.