⬅️ Back to How to Use git worktree Safely
⬆️ Previous Step: Create a New Worktree
git worktree remove <worktree-path>- Detach a worktree without deleting the files.
git worktree remove ../feature-branch - Remove a hotfix worktree.
git worktree remove ../hotfix - Detach a worktree without deleting the files.
⚠️ Make sure you have committed all changes before removing a worktree.
➡️ See the Next Step: Switch Between Worktrees
Author: mike-rambil • Updated: 2024-06-10 • Tags: worktree, remove