Skip to content
Home Tutorials Roadmaps Courses Classroom Training Blog
Log in Join free
Git Beginner Free

Git Worktrees

Lesson 16 of 17 · Git Worktrees 94%
1. Getting Started
What is Git?
2. Branching & Merging
Branches & Merging
3. Stashing & Undoing
Git Stash Undoing Changes
5. Tags & Releases
Git Tags
6. Git Hooks & Config
Git Hooks Git Configuration
9. Submodules & Subtree
Git Submodules
10. GitHub Actions
GitHub Actions CI/CD
11. Git Worktrees
Git Worktrees

Worktrees let you check out multiple branches simultaneously in separate directories.

Syntax

GIT
git worktree add ../branch-name feature
git worktree list
git worktree remove ../branch-name
git worktree prune
Git Worktrees
BASH
# Create worktree
git worktree add ../feature-branch feature/login

# List worktrees
git worktree list

# Work in the worktree directory
cd ../feature-branch

# Remove worktree
git worktree remove ../feature-branch

Up next

Git LFS (Large Files)

Lesson 17 of 17 · Git LFS