Quantcast
Viewing all articles
Browse latest Browse all 20

Getting started with Mercurial for a small team series - Installing and basic configuration of Mercurial

This is the second post in the Getting Started with Mercurial for a small team.

This post is going to cover Installing and basic configuration to get started using Mercurial on Windows.

Installing Mercurial on Windows

I've installed Mercurial two ways and have found both very easy to use.

With TortoiseHg (all in one download)
and…
Using Chocolatey (package manager for your applications on the PC, think NuGet for your PC apps!)

Mercurial Settings

There's several settings you can set per repo and/or globally on the machine.  The first of these to set is your username.

To set this at the computer level on a windows machine, find the mercurial.ini file in the Windows System UserProfile folder.

Add the following:

[ui]
username = Your Name <your_email_address>

You can also set it per the project by editing the hrgc file in the .hg directory for your repository.

Ignore File

The ignore file (.hgignore) tells Mercurial what files to not source control by default.  You can add anything manually in the list yourself but Mercurial won't automatically look for the patterns in this file.  There are several examples out there.  Below is the sample I am using at the moment and have found it to work well.

# Ignore file for Visual Studio 2010
# use glob syntax
syntax: glob
# Ignore Visual Studio 2010 files
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.lib
*.sbr
*.scc
[Bb]in
[Dd]ebug*/
obj/
[Rr]elease*/
_ReSharper*/
[Tt]humbs.db
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml
*.resharper
packages #be sure to manually add nuget.exe in the .nuget folder

The two resharper entries aren’t needed if you don’t have Resharper. The last entry we’ll explain in a later section.
 
Mercurial Basics

There are a lot of great resources on the internet for this.  Here's a recommended list that I found invaluable in getting me started.

http://hginit.com/

http://hgbook.red-bean.com/read/a-tour-of-mercurial-the-basics.html (the whole book is good)

http://mercurial.selenic.com/quickstart/

http://tekpub.com/view/dotnet-oss/7 (Free video on Mercurial with CodePlex)

Command cheatsheets

http://devcheatsheet.com/tag/mercurial/

http://www.sadev.co.za/files/Mercurial-Cheat-Sheet.png

http://mercurial.selenic.com/wiki/QuickReferenceCardsAndCheatSheets

Bitbucket Basics

Bitbucket also has a nice tutorial of their product at http://confluence.atlassian.com/display/BITBUCKET/bitbucket+101.

Play around, run through the samples in the resources above.  Getting the absolute basics down will help you for the next in the series, Workflow Basics.

Happy Coding! Image may be NSFW.
Clik here to view.
Smile

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 20

Trending Articles