Host your project in a public repository

As a part of my SoK project. I have had to host my project in a public repository. I went through several tutorials and Wiki pages, but i was not able to get a complete, compact and precise solution to start off. Bit-bucket is a web-based hosting service for projects that use the Mercurial revision control system. Mercurials major design goals include high performance and scalability, decentralized, fully distributed collaborative development, robust handling of both plan text and binary files, and advanced branching and merging capabilities, while remaining conceptually simple. I’ve used Debian based operating system – Kubuntu. The first step is to install Mercurial. This can be achieved by:

sudo apt-get install mercurial

Your next step is to get a Bit-bucket account. In order to add a repository you have to click to the + sign or you can add from + Create Repository, under the ‘Repository’ menu.

Using vim/gedit/kate or any other text editor. Open a file ~/.hgrc

vim ~/.hgrc

Add these line into .hgrc which is ‘newly’ created.

Mercurial is built with the intent that you will share your work with others, and as you create new branches it adds comments and your name and email to each change. If you don’t specify this information, it will use the login account name and your computer’s DNS name to auto-generate an email address which will likely be wrong.

Make sure that the email address you use is the same one that you configure for your public Bit-bucket account.

Specifying your name and email is done by adding these lines to the file named “.hgrc” in your home directory:

; editor used to enter commit logs, etc. Most text editors will work.
username = Firstname Lastname

An Example:

; editor used to enter commit logs, etc. Most text editors will work.
editor = vim
username = seshagiri prabhu

I prefer vim. You can give any other text editor.

Using your basic UNIX skills reach at your project’s root folder in your local machine and clone your Bit-bucket repository.

hg clone

For example:

hg clone

Add files to the repository using hg add YOUR_FILENAME

When you add a file will open up in your preferred text editor. Then save it, each time when you do hg add

Commit the changes to your local machine using

hg commit -m "YOUR MESSAGE"

Unless you specify a message in the commit you may not be able to push it to your Bitbucket repository.
The last step is to push it to YOUR_REPOSITORY in Bitbucket using this command.

hg push

Each time when you push/pull, the system will ask you Bit-Bucket password.


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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