Getting Started
worktree streamlines common Git worktree tasks into a repeatable workflow.
Install
Install globally:
npm
npm install -g @northguild/worktreeOr run directly without global install:
npm
npx @northguild/worktree —helpInitial Configuration
Run once inside your repository:
worktree configCommon values:
defaultSourceBranch: usuallyorigin/maincodeEditor: usuallycode
First Workflow
Create your first branch worktree:
worktree branch feature/improve-readmeThis command will:
- Branch from your configured source branch.
- Create a worktree under
<repo>.worktrees/feature/improve-readme. - Copy
.envand.env.localfrom your main repository. - Open the new worktree in your configured editor.
Requirements
- Git available on your
PATH - Node.js installed
- Existing Git repository
If you use automatic editor opening, ensure your editor command is available in your shell (for example, code).
Next
Last updated on