The newest version of IntelliJ says it has support for git worktrees, but I can't seem to find anywhere that says how to use it. I was expecting to see an entry in the Git Branches popup in the lower right, but I don't see it there.
I also don't see any descriptions in:
Blog post announcing the feature
What's new video
IntelliJ help and googling were also unhelpful
I'm using Git version 2.7.2.0, worktrees were introduced in 2.5
Open the project that you want to put under Git. Press Alt+` to open the VCS Operations Popup and select Enable Version Control Integration. Alternatively, from the main menu, select VCS | Enable Version Control Integration. Choose Git as the version control system and click OK.
VCS - > Git - > Remotes Popup will open with all repository URLs configured, you can simply edit them or add new one. Save this answer.
Do one of the following: To push changes from the current branch press Ctrl+Shift+K or choose Git | Push from the main menu. To push changes from any local branch that has a remote, select this branch in the Branches popup and choose Push from the list of actions.
As far as I can tell, "support" means that when you open a worktree in IntelliJ, all the VCS functions work properly. Based on the comments in the Youtrack link provided by max630, you could not view diffs, view history, or commit changes before 2016.1.
With 2016.1, however, you can open the worktree as a new project and perform all VCS operations via IntelliJ.
It would be nice to have project settings shared for those of us that .gitignore
them, but that does not appear to be supported currently.
I have been using the following workflow recently with success:
git worktree add ../hotfix hotfix/1.2.3
File -> Open
in IntelliJ.idea
directory (if necessary)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With