中文文档 | English
A Git Worktree management plugin for IntelliJ IDEA that provides a visual interface to manage Git worktrees.
- Adds a "Worktree" tab in the Version Control tool window
- Displays detailed information for all worktrees:
- Path
- Branch name
- Commit hash (first 8 characters)
- Status (normal/locked)
- Manual refresh support
- Double-click any table row to open the corresponding worktree directory in IDEA
- Smart detection: if the project is already open, automatically switches to the corresponding window
- Prevents duplicate project openings
- "Create Worktree" button in the toolbar
- Branch Selection Dialog:
- Displays all available branches
- Real-time search filtering (case-insensitive)
- Keyboard navigation support (arrow keys)
- Double-click for quick selection
- Defaults to current branch
- Supports entering new branch names
- Path Input Dialog:
- Auto-suggests default path (project directory sibling + branch name)
- Supports custom paths
- Auto-refresh list after creation
- Two deletion methods:
- "Delete Worktree" button in the toolbar
- Right-click context menu "Delete Worktree" option
- Confirmation dialog before deletion
- Displays path and branch information to be deleted
- Uses
--forceoption to handle uncommitted changes - Auto-refresh list after deletion
- Right-click table rows to show context menu
- Menu Options:
- Open Directory: Opens the worktree in IDEA
- Delete Worktree: Deletes the selected worktree
- Open IntelliJ IDEA
- Go to File → Settings → Plugins (or IntelliJ IDEA → Preferences → Plugins on macOS)
- Click Marketplace tab
- Search for "Another Git Worktree"
- Click Install and restart IDEA
- Go to Releases
- Download the latest
another_gitworktree-*.zipfile - Install the plugin:
- Open IntelliJ IDEA
- Go to File → Settings → Plugins (or IntelliJ IDEA → Preferences → Plugins on macOS)
- Click the ⚙️ icon → Install Plugin from Disk...
- Select the downloaded zip file
- Click OK and restart IDEA
- Clone the repository:
git clone https://github.com/n-wen/another_gitworktree.git
cd another_gitworktree- Build the plugin:
./gradlew buildPlugin- Install the plugin:
- Open IntelliJ IDEA
- Go to File → Settings → Plugins → ⚙️ → Install Plugin from Disk...
- Select
build/distributions/another_gitworktree-*.zip
- Open the Version Control tool window (Alt+9 or View → Tool Windows → Version Control)
- Switch to the "Worktree" tab
- View detailed information for all worktrees
Note: The Worktree tab is non-closeable, ensuring you can always access it.
- Click the "Create Worktree" button in the toolbar
- In the branch selection dialog:
- Enter a branch name in the search box to filter
- Select a branch from the list, or enter a new branch name
- Double-click a list item or click OK to confirm
- Enter the worktree directory path (or use the default path)
- Confirm creation
- Double-click a table row to open the corresponding worktree directory in IDEA
- Right-click a row and select "Open Directory"
- Method 1: Select a table row and click the "Delete Worktree" button in the toolbar
- Method 2: Right-click a table row and select "Delete Worktree"
- Review the information in the confirmation dialog before confirming
- Click the "Refresh" button in the toolbar to manually refresh the worktree list
- List automatically refreshes after creating or deleting a worktree
- Thread Safety: File system operations execute on background threads, UI operations on EDT
- Error Handling: Comprehensive error handling and user notifications
- User Experience:
- Table editing disabled to prevent accidental modifications
- Smart path suggestions
- Confirmation dialogs to prevent accidental deletions
- Real-time search filtering
- Git Integration: Uses Git4Idea plugin API
./gradlew runIde./gradlew buildPlugin./gradlew compileKotlin- IntelliJ IDEA 2023.3+ or other IntelliJ Platform IDEs
- Git 2.15+ (supports
git worktreecommand)
- Kotlin
- IntelliJ Platform SDK
- Git4Idea Plugin
Issues and Pull Requests are welcome!
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- ✨ Extended compatibility to IDEA 2023.3+ (no upper limit)
- 🛡️ Fixed: Main worktree can no longer be deleted (button disabled, menu item disabled)
- 🔄 Improved: Auto-close open projects before deleting their worktree
- 📁 Enhanced: Better handling of locked directories during deletion
⚠️ Better: More informative error messages for worktree operations- 🎯 Fixed: Worktree list now loads automatically on first open (no manual refresh needed)
- ✨ Fixed: Changed all UI text to English for international users
- 🌐 Improved: Standardized language across the entire interface
- ✨ Initial release
- ✨ Worktree list display
- ✨ Double-click to open worktree directory
- ✨ Create worktree functionality
- ✨ Delete worktree functionality
- ✨ Context menu support
- ✨ Branch search filtering
- 🐛 Fixed EDT slow operation warnings
- 🎨 Optimized UI and interaction experience
A: In IDEA, open Help → Show Log in Explorer and check the idea.log file.
A: Ensure your project is a Git repository and the Git plugin is enabled.
A: git worktree remove removes the Git association of the worktree. Whether files are deleted depends on Git's behavior. It's recommended to backup important data before deletion.
A: Yes, enter the full remote branch name in the branch selection dialog (e.g., origin/feature-branch).
For questions or suggestions:
- Submit an Issue
- Email: n-wen@outlook.com
Thanks to JetBrains for providing the powerful IntelliJ Platform SDK!


