mirror of
https://github.com/mike-rambil/Advanced-Git.git
synced 2026-05-12 10:20:43 -05:00
836 B
836 B
⬅️ Back to How to Use git worktree Safely
⬆️ Previous Step: Create a New Worktree
Remove a 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
- 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