Getting Started with Git and Mercurial

Whether your software project has one or 100 developers contributing code, tracking and storing its version history is imperative. Distributed Version Control (DVCS) is the latest stage in the evolution of Version Control, enabling faster and more agile code iterations.

This guide introduces the basic concepts of version control and compares the advantages of the two most popular DVCS solutions, Git and Mercurial.

Why You Should be Using Version Control

The code programmers write changes often. Bugs need to be fixed, features need to be added, and content needs to be changed.

Most code is stored as plain old text files, and the code is changed by editing these files. Every time a change is saved, the old version of the file is overwritten with a new one.

Unfortunately, no programmer is perfect, and sometimes, mistakes are made. If you make a change to a file, save it, compile it, and find out that something went wrong, it's often helpful to be able to go back to the old version or to get a report of what was actually changed, in order to focus on what may have gone wrong.

That's where Version Control Systems come in.

Read More About Version Control Basics

Distributed vs Centralized Version Control

There are many version control systems out there. Often they are divided into two groups: "centralized" and "distributed".

Centralized version control systems are based on the idea that there is a single "central" copy of your project somewhere (probably on a server), and programmers will "commit" their changes to this central copy.

Recently a new breed of tools has appeared: so-called "distributed" version control systems (DVCS for short). The three most popular of these are Mercurial, Git and Bazaar. These systems do not necessarily rely on a central server to store all the versions of a project's files. Instead, every developer "clones" a copy of a repository and has the full history of the project on their own hard drive. This copy (or "clone") has all of the metadata of the original.

This method may sound wasteful, but in practice, it's not a problem.

Read More About Distributed vs Centralized

Get started with DVCS by using these Atlassian products:

Unlimited DVCS Code Hosting

Unlimited Git and Mercurial code hosting, with free private repos.

Learn More

Free Git & Mercurial Client

A Mercurial and Git client for Windows or Mac with an intuitive GUI.

Learn More

Enterprise Git Management

Create and manage Git repositories behind the firewall.

Learn More

Continuous Integration

Build, test and deploy Git and Mercurial source.

Learn More