Bitbucket setup on OSX Lion using Mercurial

by ingvar 12. februar 2012 08:05

Here is a fast guide to getting Mercurial and bitbucket working from the terminal in OSX Lion, enjoy :)

1. Download and install Mercurial

Download binaries from http://mercurial.selenic.com/ and install.

2. Creating Mercurial configuration

Create a .hgrc filer in your home folder: ~/.hcrg and add the following lines. Change the name and email to your name and email used ont butbucket.

[ui]
username = Jon Doe <jon@doe.com>
ssh = ssh -C

3. Configure SSH 

3.1: Set up your default identity by issuing the following command and entering a proper password

ssh-keygen

3.2: Copy the public key to your clipboard using the following command

cat ~/.ssh/id_rsa.pub | pbcopy

3.3 Add public key to bitbucket by browsing to Account -> SSH Keys and past the public key in the textbox left to the 'Add key' button. Then click the 'Add key' button.

4. All done!

Rember to use the SSH URL when cloning the repository and not the HTTPS url.

Tags:

About the author

Martin Ingvar Kofoed Jensen

Architect and Senior Developer at Composite on the open source project Composite C1 - C#/4.0, LINQ, Azure, Parallel and much more!

Follow me on Twitter

Read more about me here.

Read press and buzz about my work and me here.

Stack Overflow

Month List