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.

Michael is a Software Engineer working in the North West of England. Michael spends his days building hand-crafted PHP applications. Rumours of his super-hero status are currently unconfirmed. He savours his victories when solving difficult programming challenges; occasionally writing about them here, on his personal blog.