DVCS -> install Git/EGit and MercurialEclipse

preliminary remark: this is no blog about Git against Mercurial or EGit against HgEclipse. While preparing to publish sourcecode of redView and red-open, we decided to switch to a DistributedVersionControlSystem (DVCS). The main question for me: which plugin is easiest to use. now. I’m not an expert of DVCS yet, because I’m just starting to use them. This blog series reflects my experiences. Please add your comments where I’m wrong.

updated 2010-02-22

updated 2010-11-20 (more info at the bottom)

At first I read some blogs about Git and Mercurial and the use of DVCS. I can recommend to read:

I decided to test Mercurial and Git together with Eclipse Plugins HgEclipse and EGit. I’m doing my daily work using Eclipse, so for me the most important thing is how useful and easy is the Eclipse integration of a DVCS. I don’t want to compare each detail and functionality of Git or Mercurial – I’m only looking for a tool to make this easy for me:

  • working in a small team on different locations (per ex. me in Rosenheim and Flo in Vienna)
  • working on laptops while traveling without access to servers
  • working under OSX, Windows 7, Windows XP, Windows Vista, Ubuntu (redView has to run under these OS)
  • easy branching
  • easy pushing to Sourceforge, GitHub, Bitbucket

At the end of the blog series we’ll see how it works using EGit or HgEclipse. My evaluation was done at first under OSX.

Part 1: Install Git, EGit, Mercurial and HgEclipse

To understand Git and Mercurial, here are some useful Links:

To get some info about the Eclipse Plugins, here are also some links:

Since some time EGit is an Eclipse Project:  http://eclipse.org/egit/, also JGit – Git implemented in Java: http://eclipse.org/jgit/. EGit is an Eclipse Team Provider to Git using JGit. In my tests I’m using the nightly builds updatesite.

HgEclipse is a fork of MercurialEclipse to force development of Eclipse integration. In my tests I’m using the 1.6.0 snapshots updatesite.

Besides the Eclipse Team Provider Plugins we also have to install Git and Mercurial, because (as of today) some tasks can only be done from the commandline.

Install Git

recently added a more detailed step-by-step-installation-guide for Git and also how to configure ssh.

For OSX there’s an easy to use Installer: http://code.google.com/p/git-osx-installer/ – simply follow the instructions and you’re done.

To install Git under Windows here’s a good Guide to follow: http://github.com/guides/using-git-and-github-for-the-windows-for-newbies.
Under Ubuntu simply type this:

sudo apt-get install git-core.

As next we have to tell Git your user informations:

git config --global user.name "ekke"
git config --global user.email "ekke@ekkes-corner.org"

Install EGit

Easiest way is to use an UpdateSite – in my tests I used the nightly builds: http://download.eclipse.org/egit/updates-nightly.

Please select EGit and JGit to be installed. That’s all – you’re ready to use EGit.

Please take a look at the Preferences…

…to see if the defaults fit your needs.

Install Mercurial

recently added a more detailed step-by-step-installation-guide for Mercurial on OSX, Ubuntu and Windows and also how to configure ssh.

Same as using Git we have to tell Mercurial some user informations. Mercurial searches for user data in a file named “hgrc“:

username = ekke <ekke@ekkes-corner.org>

I place this file in my  repositories directly below .hg:

(Unix, Windows) yourRepository/.hg/hgrc

more informations about global locations of hgrc see here.

Install HgMercurial

There are also UpdateSites available for HgEclipse – I used the Snapshot Updatesite: http://hge.javaforge.com/mercurialeclipse-snapshots.

You should use MercurialEclipse 1.7.0 or later – there were huge performance improvements from 1.6.x to 1.7.0.

Unfortunately Intland changed the behaviour of the Updatesite


– now you need an Account and Password from JavaForge 😦

From my POV an Updatesite for Open Source Software (EPL) should always be free from registrations – and luckily Andrei Loskutov provides the release and snapshots at EclipseLabs free from password or account 🙂

This is the easy-without-password-to-use Updatesite for MercurialEclipse 1.7.0 release


and this is the Updatesite for the snapshots of upcoming 1.8.x:


Please select “MercurialEclipse” on all platforms.

As next step please open Eclipse Preferences:

There are two important properties you should fill out:

  • Mercurial Executable -> pointing to hg executable
  • Mercurial Username -> username and email address

Apply changes and you’re done with Installation of Mercurial and HgEclipse.

Summary part 1: its nearly the same work to install Git + EGit or Mercurial + HgEclipse. Only under Windows the Mercurial + HgEclipse – Installation is a one-step-process through HgEclipse UpdateSite – unfortunately this comfort isn’t available under OSX and Ubuntu. EGit also includes JGit – but we’ll see later that in some cases we still need Git itself also to be installed.

Update 2010-02-22: HgMercurial UpdateSite for Snapshots changed to: http://hge.javaforge.com/mercurialeclipse-snapshots, also added info about step-by-step-install-git, step-by-step-install-mercurial and step-by-step-configure-ssh. Added Link to Martin Fowlers article about VersionControlTools.

Update 2010-11-20: MercurialEclipse Version 1.7.0 was released, unfortunately the Updatesites now needs an account and password from JavaForge, to avoid this please use Updatesites from EclipseLabs for the stable release 1.7.0 and this site for the 1.8.x snapshots. Update to 1.7.0 is really recommended

The overview of this blog series can be found here: https://ekkescorner.wordpress.com/blog-series/git-mercurial/. The next part will tell you how to initialize local repositories using Egit and HgEclipse.

18 responses

  1. Welcome in the world of DVCS. I currently use EGit and I’m happy to read a comparison to Mercurial. I love the DVCS feature that I can easily branch and switch between branches. The speed of using EGit is also mind-blowing.

  2. Pingback: Using Git SCM « Lubos Programming Weblog

  3. Pingback: DVCS: MercurialEclipse Release 1.7.0 – great release with Updatesite trouble « ekkes-corner: eclipse | osgi | mdsd | erp | mobile

  4. Furthermore, when MercurialEclipse is installed, it does not appear in the eclipse prefferences nor anywhere else… *lost*

    • I have the same problem as Jure Sah, followed the step-to-step guide to install MercurialEclipse plugin for FlexBuilder3 and it does not show up either in Eclipse Preferences, nor in view,creating new file or importing.

      Strange as it may be, when i hit Window->Software Updates->Manage configuration , mercurial plugin DOES appear to be correctly installed. Any hint about how to solve this?

    • I too am having this same problem. I do have Flash Builder 4.6 and the latest plugin is working great there, but i do have some older development projects that I still have to use Flex Builder 3. I know big sad face. In FB3 i’m having the same issue. It shows as installed, but nothing in the IDE is visible. Nothing in the Team tree in the Preferences window and i can’t get to the Mercurial view.

  5. hey, thank you very much for that awesome introduction! 🙂
    i’m a web/java developer from germany. i work with mercurial and eclipse since a couple of years. i got a question in the collaboration between my dev-systems…i got a windows 7 pc where i’ve installed my eclipse environment. on this win7 machine i got virtualbox with a debian system and a apache and mysql on it for testing my webstuff. on that debian machine i’ve also installed mercurial. now i wanna install the MercurialEclipse plugin on eclipse on my win7 machine. but the mercurial client is running on the debian virtualbox. i can fully access the debian machine via ssh. is it possible to send the mercurial commands from the MercurialEclipse plugin, which runs on the Win7 machine to my virtual debian machine (e.g. through ssh)? i know this is quite confusing, but to let you know, i’m kinda minimalist 😀 and i hate running the same services on several systems and only use the half capacity of them than to bundle it to one system and to use the full capacity, if you know what i mean 🙂
    thanks for your support!!!

    • so you want to re-use the Mercurial CLIENT from debian on W7 … never done this – don’t know if there’s a way.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: