Files
Advanced-Git/contents/remove-a-worktree.md
T
2025-07-11 01:17:06 +00:00

756 B

⬅️ Back to How to Use git worktree Safely

⬆️ Previous Step: Create a New Worktree

Remove a Worktree

Category: Worktree

Command

git worktree remove <worktree-path>

Examples

  • Detach a worktree without deleting the files.
git worktree remove ../feature-branch

Steps

  1. Detach a worktree without deleting the files.

Warnings

  • ⚠️ 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