Effortless multi-branch development—automate your worktree setup and get coding instantly!
Managing multiple feature branches or environments in a single Git repository can quickly become messy and repetitive. While git worktree
helps by allowing you to check out multiple branches at once, it still requires manual setup for each worktree—copying config files, installing dependencies, and starting development environments.
This repository solves that pain point.
- No more manual setup: Stop repeating the same steps for every new branch.
- Consistent environments: Ensure every worktree has the right configs and dependencies.
- Customizable: Easily extend the script to fit your workflow.
This project provides a simple Bash script (worktree.sh
) that extends the functionality of git worktree
. With a single command, you can:
- Create a new worktree for any branch (existing or new)
- Automatically copy essential configuration files (like
.env
) - Install dependencies using
pnpm
(or fallback topkgx
) - Spin up your development environment instantly using Docker Compose
Simple copy-paste this file into your repository at the root.
./worktree.sh <branch-name>
You can modify the script to copy other files, run additional setup commands, or integrate with other tools as needed.
**Stop wasting time on repetitive setup. Let this script handle your worktree environments, so you can focus