Git worktree management plugin for pik CLI
npm install @lsst/pik-plugin-worktreeGit worktree management plugin for pik - easily create, list, and remove git worktrees.
This plugin is included with @lsst/pik by default.
``bash`
npm install -g @lsst/pik
`bashInteractive create (default)
pik worktree
Configuration
Add to your
pik.config.ts:`typescript
import { defineConfig } from '@lsst/pik';export default defineConfig({
worktree: {
// Directory where worktrees are created (relative to repo root)
baseDir: '../',
// Files to copy to new worktrees
copyFiles: ['.env.local', '.env.development'],
// Command to run after creating worktree
postCreate: 'npm install',
},
});
`Commands
| Command | Alias | Description |
|---------|-------|-------------|
|
pik worktree | wt | Interactive worktree creation |
| pik worktree create [name] | add | Create a new worktree |
| pik worktree list | ls | List all worktrees |
| pik worktree remove [path] | rm | Remove a worktree |$3
| Option | Description |
|--------|-------------|
|
-b, --branch | Branch to checkout or create |
| -n, --new | Create a new branch |$3
| Option | Description |
|--------|-------------|
|
-f, --force | Force removal even if dirty |
| -D, --delete-branch` | Also delete the branch |MIT