Tutorials Courses Interview Prep (100 Q&A) AI Tools (50) Developer Tools (50) Tracks Pricing Plans Blog & Articles Contact Us
Advanced Git Internals & Multi-Repo Workflows 16 mins read Free Lesson

Git Worktrees: Instant Multitasking Without Stashing

Check out multiple branches simultaneously in separate directory folders without stashing or switching.

Git Worktrees in Practice

# Create a new working tree in a sibling folder on a hotfix branch
git worktree add ../project-hotfix hotfix/auth-bug

# Work on hotfix in parallel without touching current workspace!
cd ../project-hotfix
git commit -am "fix: patch auth token expiration"

# Clean up worktree when done
git worktree remove ../project-hotfix