Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 1019 Bytes

File metadata and controls

40 lines (24 loc) · 1019 Bytes

⬅️ 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 
  • Remove a hotfix worktree.
git worktree remove ../hotfix 

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