Technically Feasible

Disconnecting EGit from a Project in Eclipse

Likeness of Michael Oldroyd
Michael Oldroyd
⚠️ This content was imported from a previous incarnation of this blog, and may contain formatting errors

Eclipse LogoI have been using Git a lot more recently. Eclipse PDT is my editor of choice, and EGit has eased the transition to a version control centric workflow. Some of my project development environments are accessed via a Samba network share; unfortunately Git over Samba is sub-optimal at best. For a larger project I have been working on, a full repository refresh could take up to 30 minutes. This is obviously unacceptable, especially if you hope to commit often or create / switch feature branches.

Disconnect Eclipse Team Providers #

The problem I was having is that EGit detects and refreshes the repository from the project at import time, and each time Eclipse started up. It is possible to fix the problem without losing the Git functionality of the IDE completely, as it can be helpful. The EGit functionality is provided by the Git Team Provider. This can be disconnected on a project basis by right-clicking the project, in the team section labelled "Disconnect". After doing this we now have to manage this repository directly within the development environment (i.e. via SSH). Alternately you could operate the Git command line using the Samba network mount, but the same problems will occur without any benefit (just not causing issues in the IDE).

Disable Automatic Registration of the Team Provider #

Additionally, you can configure Eclipse to not register new projects with the team provider. This means that you won't have to waste time waiting for EGit to initialise itself just to disconnect the functionality afterwards. This can be toggled in Preferences > Team > Git > Projects, by un-checking "Auto share projects located in a git repository". Now for any project where you wish to use EGit, you have to right-click, under the team section labelled "Share Project" and follow the Share Project wizard.

Image of me

Michael Oldroyd

Michael is a Software Engineer working in the North West of England.