A growing collection of shell utilities for common git workflows.
Create git worktrees for one or more features and open each in a new VS Code window.
./worktree-helper.sh <feature1> [feature2 ...]What it does:
- Creates a branch
feat/<sanitized-name>from a base branch (default:main) - Adds a git worktree at
<repo-parent>/<repo-name>-<sanitized-name>(sibling of your repo, never inside it) - Opens the worktree in a new VS Code window
Feature names are sanitized automatically: lowercased, non-alphanumeric characters collapsed to -, leading/trailing dashes stripped.
Options:
| Flag | Description |
|---|---|
--base <branch> |
Branch to create from (default: main) |
--no-open |
Skip opening VS Code windows |
-h, --help |
Show usage info |
Examples:
# Single worktree from main
./worktree-helper.sh user-auth
# Multiple worktrees at once
./worktree-helper.sh user-auth payment-integration
# From a different base branch
./worktree-helper.sh --base develop hotfix-login
# Create without opening VS Code
./worktree-helper.sh --no-open refactor-apiRequirements: git, bash. VS Code opening uses code -n with a macOS fallback to open -a "Visual Studio Code".