View and commit changes from every linked Git worktree in one IDEA window.
English | 简体中文
Worktree Lens keeps IntelliJ IDEA's Git directory mappings in sync with linked Git worktrees. Open one project and review or commit changes from every linked worktree in the built-in Commit tool window.
- Discovers linked worktrees already associated with the Git repositories IDEA knows about.
- Adds new linked worktrees to IDEA automatically and removes mappings for worktrees that no longer exist.
- Supports projects containing multiple repositories.
- Leaves Git actions to IntelliJ IDEA and Git. The plugin only manages directory mappings.
Install Worktree Lens from JetBrains Marketplace, then restart IntelliJ IDEA if prompted.
Build the plugin ZIP:
./gradlew buildPluginThe ZIP is generated in build/distributions/. In IntelliJ IDEA, open Settings | Plugins, choose Install Plugin from Disk, and select the ZIP.
-
Open the primary worktree as an IntelliJ IDEA project.
-
Create a linked worktree with your usual Git workflow:
git worktree add ../my-feature feature-branch
-
Open IDEA's built-in Commit tool window. Changes from the linked worktree appear there as an additional Git root.
Creating or removing a linked worktree triggers synchronization automatically. Restarting IDEA is not required.
- IntelliJ IDEA 2022.3 or later (build 223+)
- Git with worktree support
- The bundled IntelliJ IDEA Git plugin (
Git4Idea)
- Worktree Lens synchronizes linked worktrees reported by Git. It does not create, delete, switch, or otherwise operate on worktrees.
- Existing primary-worktree, submodule, non-Git, and user-configured directory mappings remain under IDEA's control.
./gradlew test verifyPlugin buildPlugin --no-daemon
./gradlew runIde