mirror of
https://github.com/mike-rambil/Advanced-Git.git
synced 2026-01-06 09:29:30 -06:00
735 B
735 B
⬅️ Back to How to Use git worktree Safely
⬆️ Previous Step: Check Existing Worktrees
Create a New Worktree
Command
git worktree add <path> <branch>
Examples
- Create a new worktree for the feature branch.
git worktree add ../feature-branch feature
Steps
- Create a worktree linked to a specific branch.
Prerequisites
- The target path must not already be a git repository.
➡️ See the Next Step: Remove a Worktree
Author: mike-rambil • Updated: 2024-06-10 • Tags: worktree, add