git-worktrees
Installation
SKILL.md
Git Worktrees
A worktree gives a branch its own working directory, so you can develop a feature without stashing or switching the main checkout. Treat them as short-lived: create one for a task, work in it, merge, remove it.
Default: a normal worktree
This is the recommended path for almost everything. It works in any regular clone (.git is a directory) with no special setup.
Branch or worktree?
- Branch — quick, in-place work you will finish before touching anything else.
git checkout -b feature/my-thing main. - Worktree — isolate the work in its own directory so the main checkout stays clean and usable in parallel. Prefer this when the work is non-trivial or you may need to jump back to
main.
Create one
Raw git (portable, no setup):