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-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:
- Martin Fowler – VersionControlTools
- Andrei Loskutov – “What is a good VCS“
- Al Blue – “Git for Eclipse Users” my breakthrough to understand how DVCS work
- Patrick Thomson – “Git vs. Mercurial“
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:
- HgEclipse Home: http://javaforge.com/project/HGE
- Installation and Configuration (HgEclipse is a fork of MercurialEclipse)
http://hge.javaforge.com/hgeclipseplease use http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/stable
- snapshots Updatesite:
http://hge.javaforge.com/mercurialeclipse-snapshotsplease use http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/snapshots
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.
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.
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 "firstname.lastname@example.org"
Easiest way is to use an UpdateSite – in my tests I used the nightly builds: http://download.eclipse.org/egit/updates-nightly.
Please take a look at the Preferences…
…to see if the defaults fit your needs.
Same as using Git we have to tell Mercurial some user informations. Mercurial searches for user data in a file named “hgrc“:
[ui] username = ekke <email@example.com>
I place this file in my repositories directly below .hg:
(Unix, Windows) yourRepository/.hg/hgrc
more informations about global locations of hgrc see here.
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.