INTRODUCING MERCURIAL

INTRODUCTION

I came across one more version control system when I started contributing to Mozilla Firefox.Mercurial is a cross-platform, distributed revision control tool for software developers. It is mainly implemented using the Python programming language, but includes a binary diff implementation written in C. It is supported on Windows and Unix-like systems, such as FreeBSD, Mac OS X and Linux. Mercurial is primarily a command line program but graphical user interface extensions are available.

INSTALLING MERCURIAL IN LINUX

$ sudo apt-get install mercurial

BASICS

CREATING A REPOSITORY

$ mkdir hg1
$ cd hg1
$ hg init

ADDING FILE

$ hg add <file-name>

REMOVING FILE

$ hg rm <file-name>

The following command removes the added file

$ hg addremove <file-name>

RENAMING FILE/DIRECTORY

$ hg rename <file/directory>

SHOW STATUS

$ hg status

SHOW REVISION HISTORY

$ hg log

CLONING A REPOSITORY

For example for cloning a small “hello, world” repository hosted at testingmercurial.com:

$ hg clone http://www.testingmercurial.com/repo/hello my-hello

MERGING

$ hg merge <url of repo>

COMMIT

$ hg commit -m “commit-message”

PUSHING YOUR BRANCH TO ANOTHER REPOSITORY

$ hg push <url of the repo>

PULLING CHANGES FORM A REPOSITORY

$ hg pull <url of the repo>

If you are satisfied with the changes you pull then merge it using

$ hg merge

$ hg commit -m “merged”

This is just the basics of mercurial for more information I would suggest to read some mercurial tutorials.One you can find here http://mercurial.selenic.com/wiki/Tutorial also many good books are available just  google it!So go ahead enjoy playing with mercurial.Cheers  🙂

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s