Mercurial is a DVCS that transfers code between your local system and Bitbucket Cloud. Follow the instructions on this page to install and set up Mercurial. If you write or deploy code to a remote machine, you may also need Mercurial on that machine as well.
Step 1. Install Mercurial
If you already have Mercurial installed, make sure you have version 1.7 or later. To check, enter hg --version
at the command line.
Depending on your operating system:
- For Windows: Download the Mercurial installer. To open a command window, search for the Command Prompt.
- For Mac: Download the Mercurial installer. To open a command window, search for the Terminal.
For Linux:
Enter
cat /etc/apt/sources.list
at the command line to see the contents of the file.If any of the lines are commented (have a
#
prefix), then edit the file and remove all # from the comments.Make sure you have an updated package list by entering
sudo apt-get update
at the command line.To install Mercurial, enter
sudo apt-get install mercurial
. Verify the installation was successful by typingwhich hg
at the command line.
Step 2: Update your configuration file
When you install Mercurial, it comes with a configuration file that you update with your personal settings from a command window.
- Determine if you already have a
.hgrc
file in your user directory with following command:- For Windows:
ls .hgrc
- For Mac and Linux:
ls ~/.hgrc
- For Windows:
If you don't have the
.hgrc
file, create one using the touch command:$ touch ~/.hgrc
Open the
.hgrc
file, and add ausername
value to the configuration, making it look similar to the following:[ui] # Name data to appear in commits username = Emma Paris <eparis@atlassian.com>
Files that start with a . (period) are hidden files in Mac OSX. By default, the Finder does not show these files. To reveal hidden files, enter the following command into the terminal:
$ defaults write com.apple.finder AppleShowAllFiles YES
To hide the files once again, enter the following command:
$ defaults write com.apple.finder AppleShowAllFiles NO