Jump to content


Recommended Posts

I just set up a simple little version control system with my favorite IDE, netbeans. Why I Chose BitBucket/Mercurial I chose BitBucket for my current development project because it offered free private repositories, unlike Github. Github does have some cool features that BitBucket lacks, like the Network Graph, so I'll probably use it if I ever start a public open-source project. Preliminary Setup These were the main things I did to before I set up the main VCS:

  • Installed Netbeans IDE
  • Signed up on BitBucket
  • Installed Tortoisehg (Tortoisehg is a Mercurial package for Windows that includes integration into the system's context menus e.g. you can right-click and select TortoiseHG > Create Repo Here; That easy!)

Main Setup After the installation you have to look for mercurial.ini at the following location:

  • UNIX-based systems: ~/.hgrc
  • Windows XP: C:\Documents and Settings\MY_NAME\mercurial.ini
  • Windows 7: C:\Users\MY_NAME\mercurial.ini

On Windows, I had to create the file with this info:

[ui]; editor used to enter commit logs, etc.  Most text editors will work.editor = notepadusername = MY_FIRST_NAME MY_LAST_NAME <MY_NAME@example.com>

The email address should stay enclosed in the less-than/greater-than symbols. Next, I created a new project in Netbeans. When I create the project to be used with a VCS, I like to keep the Netbeans Metadata in a separate directory as it is irrelevant to potential collaborators. My structure may look like this:

- /project_dir  | - /nbproject (netbeans metedata files)  | - /source_files (project source files)

When I sync a folder to my remote BB repo, I just sync the source files folder. Before I initialize the project, I create the repo on BB. After that is done, I initialize the project in netbeans. Initializing the Project After you create the repository on BB, you will see a command to clone your repo. Instead of copying the entire command ($ hg clone https://me@bitbucket.org/my/repo), just grab the HTTPS url. Back to Netbeans. I locate the sources folder in the project I just created. I right-click on that and go to Mercurial > Properties.... Then I paste the url into the "default-push" and "default-pull" fields. The Mercurial username should already have been pulled from the mercurial.ini file. If it isn't there, enter MY_FIRST_NAME MY_LAST_NAME <MY_NAME@example.com> as the value for username. Now I can do the commits and pushes right through Netbeans, never touching the command line. I still want to familiarize myself with hg (the chemical symbol for mercury) commands. I believe the syntax is similar to git, so it would essentially be killing two birds with one stone if I learned the Mercurial commands. You probably noticed this uses HTTPS instead of SSH. Although I haven't tried setting up SSH yet, I think it would be pretty easy. I'd be happy to hear your input on my configuration.

Link to comment
Share on other sites

I FINALLY figured out how to implement SSH with Mercurial, Netbeans, and BitBucket instead of HTTPS. It was a lot tougher than I had anticipated and it actually ended up taking me a few hours to figure out. It was mostly just because I had a hard time finding resources. I really like how well Netbeans integrates version control. It works very well and was well worth the effort I put into setting it up. It's worth noting that Netbeans does not fully integrate Git as of yet. The plugin is a work in progress, as you can see here. So if you want to use Netbeans VCS integration, that's another reason you may want to use Mercurial.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...