Skip to content

Repository files navigation

Worktree Lens

Worktree Lens logo

View and commit changes from every linked Git worktree in one IDEA window.

Changes from multiple Git worktrees in the IntelliJ IDEA Commit tool 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.

What It Does

  • 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

From JetBrains Marketplace

Install Worktree Lens from JetBrains Marketplace, then restart IntelliJ IDEA if prompted.

From Disk

Build the plugin ZIP:

./gradlew buildPlugin

The ZIP is generated in build/distributions/. In IntelliJ IDEA, open Settings | Plugins, choose Install Plugin from Disk, and select the ZIP.

Use

  1. Open the primary worktree as an IntelliJ IDEA project.

  2. Create a linked worktree with your usual Git workflow:

    git worktree add ../my-feature feature-branch
  3. 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.

Requirements

  • IntelliJ IDEA 2022.3 or later (build 223+)
  • Git with worktree support
  • The bundled IntelliJ IDEA Git plugin (Git4Idea)

Scope

  • 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.

Development

./gradlew test verifyPlugin buildPlugin --no-daemon
./gradlew runIde

Releases

Packages

Contributors

Languages