An IntelliJ IDEA plugin that provides ergonomic support for working with multiple Git worktrees in a single project.
- Displays the current worktree name in the status bar
- Click to see a popup menu with all available worktrees
- Quick access to worktree operations
- Create New Worktree: Create a new worktree with a custom branch
- Visual folder browser for selecting worktree location
- Auto-suggests path as
../[project-name]-[branch-name] - Input validation for branch name and path
- Switch Worktree: Switch to a different worktree (opens in new window)
- Delete Worktree: Safely delete a worktree with confirmation
- Rename Worktree: Move a worktree to a new directory with validation
- Compare Worktrees: Generate a Git diff between any two worktrees
- Merge Worktrees: Merge one worktree into another (fast-forward by default)
- Manage Worktrees: View all worktrees in a table with detailed information
- Table view showing name, branch, path, commit, and status
- Open, delete, and refresh operations
- Visual indication of current worktree
Ctrl+Alt+W, C- Create New WorktreeCtrl+Alt+W, S- Switch WorktreeCtrl+Alt+W, D- Delete WorktreeCtrl+Alt+W, R- Rename WorktreeCtrl+Alt+W, P- Compare WorktreesCtrl+Alt+W, G- Merge WorktreeCtrl+Alt+W, M- Manage Worktrees
- Detailed error messages from Git operations
- Clear success/failure feedback
- Handles edge cases like repositories with no commits
- Automatically offers to create an initial commit (with user consent) when needed for new worktrees
Git worktrees allow you to check out multiple branches simultaneously in different directories. This is useful when you need to:
- Work on multiple features or bug fixes without switching branches
- Review code in one branch while working on another
- Run tests on one branch while developing on another
- Maintain multiple versions of your codebase simultaneously
- Go to VCS > Git Worktrees > Create New Worktree... or press
Ctrl+Alt+W, C - Enter the branch name for the new worktree
- Choose the worktree path using the folder browser (defaults to
../[project-name]-[branch-name]) - Click OK to create the worktree
- Optionally open the new worktree in a new window
- Click on the worktree name in the status bar, or
- Go to VCS > Git Worktrees > Switch Worktree... or press
Ctrl+Alt+W, S - Select the worktree you want to switch to
- The plugin will open the worktree in a new window
- Go to VCS > Git Worktrees > Delete Worktree... or press
Ctrl+Alt+W, D - Select the worktree you want to delete
- Confirm the deletion
- The plugin will remove the worktree directory and clean up Git metadata
- Go to VCS > Git Worktrees > Show All Worktrees or press
Ctrl+Alt+W, M - A table will show all worktrees with detailed information:
- Name (with asterisk marking current worktree)
- Branch
- Path
- Commit hash
- Status (MAIN, LOCKED, PRUNABLE)
- Use the buttons to:
- Open: Open the selected worktree in a new window
- Delete: Delete the selected worktree
- Refresh: Reload the worktree list
- IntelliJ IDEA 2025.1.4.1 or later (or compatible JetBrains IDE)
- Git must be installed and available in your system PATH
- Your project must be a Git repository
- Clone this repository
- Run
./gradlew buildPlugin - Install the plugin from disk in IntelliJ IDEA:
- Go to Settings > Plugins > ⚙️ > Install Plugin from Disk...
- Select the generated ZIP file from
build/distributions/
./gradlew build./gradlew test./gradlew runIde- Language: Kotlin
- Build System: Gradle with IntelliJ Platform Gradle Plugin
- Target Platform: IntelliJ Platform 2025.1.4.1
- Java Version: 21
- GitWorktreeService: Core service for Git worktree operations
- WorktreeStatusBarWidget: Status bar widget for displaying current worktree
- Actions: Individual actions for worktree operations (create, switch, delete, manage)
- ✅ Use folder browser for worktree path input, default to "../[project name]-[branch name]"
- ✅ Detect failures and show proper error messages
- ✅ Improve manage worktrees to list worktrees in a table/list view with buttons
- ✅ Add keyboard shortcuts for common actions
- Use IntelliJ VCS APIs instead of
GeneralCommandLinefor Git operations - Integrate with IntelliJ's VCS compare view for worktree comparisons
- Add full test coverage
- Add worktree pruning action
- Add support for worktree locking/unlocking
- Add worktree actions to standard Git/VCS context menu
- Prompt user if they want to Force Delete "dirty" worktrees instead of erroring with: "Failed to delete worktree - Details: fatal: '/Users/jessup/IdeaProjects/test' contains modified or untracked files, use --force to delete it"
- Creating new worktree with the same name as an existing one is not detected or handled gracefully
- Creating new worktree from another worktree formats default folder name as
[current-worktree-name]-[new-worktree-name]instead of[project name]-[new-worktree-name] - Rename allows user to attempt to rename main worktree, then errors with "Failed to move worktree. Details: fatal: '[worktree-path]' is a main working tree"
- Compare does not attempt to handle or warn about uncommitted changes
- Compare shows a text-based diff output from CLI instead of using IntelliJ's VCS compare view
Contributions are welcome! Please feel free to submit issues or pull requests.
[Add your license here]
Developed by Adobe