13 February 2011 ~ 4 Comments

Configuring Bit-Bucket with Eclipse.

This guide will assume that you are fairly comfortable with the Eclipse IDE and that you have zero experience with subversion, bit-bucket or mercurial. Enjoy.

1. Head on over to http://bit-bucket.org and click on the giant yellow “Sign up free” button.

2. Fill out the sign up form.

3. At the top of the Bit Bucket page find the Repositories tab and mouse over it.

4. Select “Create new repository.”

5. Create your repository.  (Note: Don’t forget to select “private” if you need a private repository.)

6.  Select “Repositories” again from the top menu and click on the name of your newly created repository.

7. This will load a details page and you will see the url that you need to copy for interaction with this repository.

In my example it appears as “hg clone http://…

You will only need the http://…

8. Fire up eclipse.

9. Find the “Help” menu on the far right of.

10. If you have never installed an Eclipse plugin this part may seem a little ugly, but after you do it once you get the hang of it.

Select “Install New Software…”

11. The following software install menu should pop up.

Select “Add” on the far right.

12. On the next screen you need to enter a URL for where the plugin can be found.

The mercurial plugin for eclipse is located here:

http://cbes.javaforge.com/update
After that select the plugin and accept the terms.

13. Now I’m going to go ahead and assume that someone has already created a repository and you are importing a project.  If not than you can skip a few steps and just commit and push your repository.

In Eclipse select “File” > “Import”

14. Select the “Mercurial” folder and then “Clone Existing Mercurial Repository”

15. Enter the repository url, your username and password.

16. Go ahead and code away. Make sure to (right click and) commit any new files and folders that you create. And if you’re attempting to be professional make sure to include decent comments on all changes.

17. Once you’re ready to push your committed changes go ahead and (right click) and push.  Then simply follow the directions. If you have any trouble you may need to “Force Push” your changes.

Happy coding!

Scott Krieder

Author:
  • CM

    You should never, ever force push your changes onto a repository. If Mercurial doesn’t like what you’re doing, it’s because you’re doing something wrong.

  • http://profiles.google.com/pedromagnus pedro mourelle

    So happy to find a tutorial to make it work. A little problem with my just installed eclipse helios: the ‘next’ button after accepting the terms for installing the plugin NEVER GETS ENABLED. A whole day trying to make work svn on eclipse, totally wasted. I’ll just delete all about eclipse in my mac and start all over again.

  • http://scottkrieder.com Skrieder

    I just wanted to follow up, did removing eclipse and reinstalling fix your issue?

  • Anonymous

    In my case, using the “Clone Existing Mercurial Repository” did not recognize the project as a valid Java project (and I did not have all the Eclipse Java tools enabled).
    So I cloned the repository with the command-line and created a new Java project (instead of importing a Mercurial one) that points to new command-line cloned directory.
    The Mercurial settings are automatically detected by Eclipse and you have a “real” Java project with Mercurial feature.