eclipsegitmavenegitgit-worktree

How to use Git worktrees with Eclipse IDE?


I am moving a large application from SVN to Git while only having read "pro Git" and some worktree details online and played around with Git.

I created a single repository that manages the code of my application. My application consits of a lot of different Eclipse projects that are of Maven nature and are released separately. I created a remote branch for every Eclipse project, as suggested. Now I want to checkout some of those Eclipse projects in parallel, at newly created individual feature branches, to implement a new application feature that affects more than one Eclipse project.

Here, on 28.08.2019, Andre Bossert stated that Eclipse is able to detect and support Git worktree directories. But I just fail to hit the right button in Eclipse, it seems. Can anybody point to a documentation of Eclipse egit where I can find further information, please? I also failed to find this information by myself.


Solution

  • tl;dr For a long time, the Eclipse IDE did not support Git worktrees. Worktree support was added in Eclipse IDE 2025-03.


    Longer answer:

    For a long time, the Eclipse IDE as shipped by the Eclipse foundation did not support the worktrees created by git-worktree.

    There is a bug for this - Bug 477475 - git 2.5 worktree support, reported in 2015.

    Eclipse uses JGit for Git operations, so worktree support had to be implemented in JGit. In July 2024, the JGit Gerrit change 1194900 was submitted, adding support for worktress to JGit. This was included in JGit release 7.0.0, in September 2024.

    JGIt 7.0.0 is included in Eclipse 2025-03 (possibly already in Eclipse 2024-12, did not check).