osmianski / worktree-manager
Need to maintain multiple working branches simultaneously - whether for long-term parallel development or running AI agents in separate worktrees? Setting up each environment is tedious. This tool creates worktrees with fully working environments in seconds.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/osmianski/worktree-manager
Requires
- php: ^8.1
- ext-sockets: *
- symfony/console: ^6.0|^7.0
- symfony/process: ^6.0|^7.0
- symfony/yaml: ^6.0|^7.0
README
Need to maintain multiple working branches simultaneously - whether for long-term parallel development or running AI agents in separate worktrees? Setting up each environment is tedious.
This tool automates it: create worktrees with fully working environments in seconds, automatically allocate ports, install dependencies, create Docker containers and migrate data.
Installation
Requirements: PHP 8.1 or higher
-
Install globally via Composer:
composer global require osmianski/worktree-manager
-
Make sure Composer's global
bindirectory is in your PATH. The location varies by system:# Most Linux systems export PATH="$HOME/.config/composer/vendor/bin:$PATH" # Or on some systems export PATH="$HOME/.composer/vendor/bin:$PATH"
Add the appropriate line to your
~/.bashrcor~/.zshrc. -
Verify the installation:
worktree --version
Usage
Navigate to your Git repository and create a new worktree:
cd /path/to/your/project
worktree new
For contributors
To contribute to a project clone it locally:
cd ~ git clone git@github.com:osmianski/worktree-manager.git cd worktree-manager composer install
To run the dev version in a terminal session, run the following command:
export PATH="$HOME/worktree-manager/bin:$PATH"
Now if you run worktree, it should show the branch name instead of the version number:
Worktree Manager dev-main
License
This project is licensed under the MIT License. See the LICENSE file for details.