Git Worktree in IntelliJ & JetBrains IDEs
JetBrains IDEs like IntelliJ IDEA, PyCharm, WebStorm, and PhpStorm have deep Git integration, but their worktree support is indirect. Rather than providing a dedicated worktree UI, these IDEs work with worktrees by opening each one as a separate project. This guide covers how to set up and use git worktree effectively across the JetBrains ecosystem.
Native Worktree Support Status
As of 2025, JetBrains IDEs do not have a built-in worktree management UI. There is no menu item for creating or listing worktrees, and the Git tool window does not show linked worktrees. However, the underlying Git integration fully understands worktrees: when you open a worktree directory as a project, the IDE correctly detects the repository, shows the branch, and handles all Git operations normally.
JetBrains has a long-standing feature request for native worktree support (IDEA-200662). Until it ships, the recommended workflow is to manage worktrees from the terminal and open them as projects.
# Create a worktree from IntelliJ's terminal (Alt+F12)
git worktree add ../feature-auth feature/auth
# List all worktrees
git worktree listUsing Worktrees with IntelliJ
The most reliable way to work with git worktrees in IntelliJ is to open each worktree as a separate project. Here is the recommended workflow:
Step 1: Create the Worktree
# From your main project directory
git worktree add ../my-project-feature feature/new-featureStep 2: Open as a Separate Project
In IntelliJ, go to File > Open and navigate to the worktree directory. Choose New Window when prompted. This gives the worktree its own full IDE instance with independent run configurations, debugger, and file tree.
Step 3: Verify Git Recognition
Check the bottom-right corner of the IDE — it should show the branch name of your worktree. Open Git > Log to confirm the full history is available. If the IDE does not detect the repository, go to Settings > Version Control > Directory Mappings and add the worktree root as a Git root.
# From the IntelliJ terminal, open a worktree in a new IDE window
# Using the JetBrains CLI launcher:
idea ../my-project-feature
# PyCharm
pycharm ../my-project-feature
# WebStorm
webstorm ../my-project-featurePlugin Options
A few community plugins aim to bring worktree management into the JetBrains UI:
- Git Worktree plugin— Adds a tool window that lists worktrees and provides create/remove actions. Available on the JetBrains Marketplace. Search for "Git Worktree" in
Settings > Plugins > Marketplace. - External Tools integration — You can add worktree commands as external tools (
Settings > Tools > External Tools) and bind them to keyboard shortcuts. This is a lightweight alternative to installing a plugin.
# External Tool configuration example:
# Program: git
# Arguments: worktree add $Prompt$ $Prompt$
# Working directory: $ProjectFileDir$PyCharm, WebStorm & PhpStorm Compatibility
All JetBrains IDEs share the same Git integration layer, so worktrees work identically across the entire product line:
- PyCharm — Worktrees work with virtual environments. Each worktree can use the same or a different
.venv. Configure the Python interpreter per project inSettings > Project > Python Interpreter. - WebStorm — Each worktree needs its own
node_modules. Runnpm installafter creating the worktree so WebStorm's code completion and linting work correctly. - PhpStorm — Composer dependencies (
vendor/) are per-worktree. Runcomposer installin each new worktree. - GoLand, Rider, RubyMine — Same pattern. Open the worktree directory as a new project and install any language-specific dependencies.
Project Configuration Tips
Share Run Configurations
Store run configurations in .run/ (committed to Git) rather than .idea/runConfigurations/ (which is often gitignored). This way, every worktree gets the same run/debug configurations automatically.
Handle the .idea Directory
The .idea/ directory contains project-specific settings. If you commit shareable parts of it (like code style, inspections), they will be available in all worktrees. The .idea/workspace.xml file should always be gitignored as it contains machine-specific state.
Avoid Index Conflicts
Never open the same worktree directory in two IntelliJ windows simultaneously. The IDE writes index files and caches that can conflict. Use one IDE window per worktree.