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:
- 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:
- Git
- Git Home: http://git-scm.com/
- Git Tutorial
- ProGit Book: http://progit.org/
- Lars Vogel: Version Control with Git
- Mercurial
- Mercurial Home: http://mercurial.selenic.com/
- Mercurial Tutorial
- Guide about Workflows How to use Mercurial
- Book: The Definitive Guide to Mercurial
To get some info about the Eclipse Plugins, here are also some links:
- EGit
- EGit Home: http://eclipse.org/egit/
- EGit User Guide
- Lars Vogel: Git with EGit Tutorial
- Updatesite: http://download.eclipse.org/egit/updates
- Nightly Builds Update Site: http://download.eclipse.org/egit/updates-nightly
- HgEclipse
- HgEclipse Home: http://javaforge.com/project/HGE
- Installation and Configuration (HgEclipse is a fork of MercurialEclipse)
- Updatesite:
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.
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“:
[ui] 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
http://cbes.javaforge.com/update
– 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
http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/stable
and this is the Updatesite for the snapshots of upcoming 1.8.x:
http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/snapshots
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.
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.
BTW: I entered a CRQ at HgEclipse to provide binaries for Ubuntu and OSX:
http://www.javaforge.com/issue/10958
unfortunately I couldn’t help how to create a self-contained package of hg on linux.
entered an Issue at HgEclipse: http://www.javaforge.com/issue/10960
if you open Eclipse Preferences for Mercurial first time,
(on OSX) there’s hg as default instead of /usr/local/bin/hg
and an error was reported.
simply browse to your executable or change the value and all works as expected
ekke
I have added step-by-step instructions how to install Git and Mercurial on OSX, Windows and Ubuntu.
see at the blog series overview:
HTH
ekke
Hi,
we’ve changed the HgEclipse snapshots update site to this url:
http://hge.javaforge.com/mercurialeclipse-snapshots
Can you please update blog?
Regards,
Andrei
thx for the info – I’ll change my blogs tomorrow – there are some places refering to the beta updatesite.
ekke
Pingback: Using Git SCM « Lubos Programming Weblog
Pingback: DVCS: MercurialEclipse Release 1.7.0 – great release with Updatesite trouble « ekkes-corner: eclipse | osgi | mdsd | erp | mobile
For all those as lost as I was about this whole thing:
http://code.google.com/a/eclipselabs.org/p/mercurialeclipse
…contains working links unlike everything else.
Furthermore, when MercurialEclipse is installed, it does not appear in the eclipse prefferences nor anywhere else… *lost*
don’t understand your problems … works for me
but this week I have no time to look at any problems – sorry
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?
sorry – till now I never had this problem.
perhaps ask at the forums of MercurialEclipse http://www.javaforge.com/project/HGE
It seems it is due to the eclipse version Flex Builder 3 is using. I installed Eclipse Helios 3.6 with Flash Builder plugin, and mercurial works fine.
good to hear 🙂
I never used Flex Builder so I have no experiences…
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.
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.