Version Control System Tutorial – Mercurial

HISTORY OF VERSION CONTROL SYSTEM:

The first version control system introduced to the world was Concurrent Version System(CVS). It is a centralized version system.

TYPES OF VERSION CONTROL SYSTEMS:

  1. Centralized Version Control System
  2. Distributed Version Control System

CENTRALIZED VERSION CONTROL SYSTEM:

Centralized Version Control

Example:

  1. Concurrent Version System(CVS)
  2. SubVersion

DISTRIBUTED VERSION CONTROL SYSTEM :

Distributed Version Control

EXAMPLES:

  1. Git Hub
  2. Mercurial

Mercurial Version Control:

TERMINOLOGIES USED:

  • changeset 

               A snapshot(copy) of the working directory is refered to as changeset.  Each changeset is identified by the changeset_id and local revision number.

Change set

Change set

  • Working Directory

The working Directory is the current directory you are working.

  • Tip(the newest head)

The changeset with the highest revision number.

  • Head

Changesets with no children.

head

head,tip,working directory

  • Branch Name
  • Tag

MERCURIAL(Hg) BASIC COMMANDS :

The basic commands of mercurial are :

  1. hg init
  2. hg clone
  3. hg push
  4. hg pull
  • HG INIT :

The command creates a new repository in the current directory.

cmd: hg init repository_name

  • HG CLONE :

cmd: hg clone source dest

hg clone command copies the source and the changesets to the destination.

  • HG COMMIT :

cmd: hg commit -m “Message”

hg commit command takes a snapshot of the repository and stores as changeset in the local repository.

  • HG PUSH :

cmd: hg push 

hg push command pushes the changeset in local repository to the central repository.

  • HG PULL :

cmd: hg pull

hg pull command pulls the changeset from central repository to the local repository.

 

Advertisements