create-git-worktree
git worktree를 활용해 분리된 작업 환경을 자동으로 구축한다. 기본 브랜치에서 최신 코드를 가져와 `.git-worktrees/` 디렉터리에 새로운 worktree를 생성하고, `.env`, Serena memories, npm 의존성을 자동으로 설정한다. 브랜치명에 포함된 `/`는 자동으로 `-`로 변환된다. 이미 존재하는 worktree가 있을 경우 재사용한다.
When & Why to Use This Skill
This Claude skill automates the creation of isolated development environments using Git worktrees. It streamlines the developer workflow by fetching the latest code from the base branch, setting up environment variables (.env), managing npm dependencies, and handling branch naming conventions automatically. By creating dedicated workspaces in the .git-worktrees/ directory, it allows for seamless context switching without the need to stash or commit unfinished work.
Use Cases
- Parallel Feature Development: Quickly spin up a separate, fully-configured environment to work on a new feature or urgent bug fix without disturbing your current workspace.
- Efficient Code Reviews: Create a dedicated worktree to pull and test a colleague's branch locally, complete with all necessary dependencies and environment settings pre-configured.
- Automated Environment Setup: Standardize the initialization of new branches by automatically syncing .env files and running npm installs, reducing manual setup errors.
- Context Switching: Maintain multiple active task environments simultaneously, allowing you to switch between different branches and their respective build states instantly.
| name | create-git-worktree |
|---|---|
| description | git worktree를 활용해 분리된 작업 환경을 자동으로 구축한다. 기본 브랜치에서 최신 코드를 가져와 `.git-worktrees/` 디렉터리에 새로운 worktree를 생성하고, `.env`, Serena memories, npm 의존성을 자동으로 설정한다. 브랜치명에 포함된 `/`는 자동으로 `-`로 변환된다. 이미 존재하는 worktree가 있을 경우 재사용한다. |
Create Git Worktree and Setup Environment
Instructions
아래 명령어를 실행해 git worktree를 생성하고 환경 설정을 수행한다.
인자에는 git worktree로 만들 브랜치 이름을 지정한다.
bash scripts/create-worktree.sh [브랜치명]