home > developer > TortoiseHgUsageIntroduction.txt

Wednesday, February 10th, 2010

TortoiseHg Usage Introduction (Mercurial on Windows)

I wanted to share a quick introduction to using a Mercurial repository on Windows with TortoiseHg. This assumes someone has already setup the repository on a shared network drive (we’ll call \\Shared\Repo\Project44) and you want to keep up do date with the changes directly in Windows Explorer.

Initial Checkout

  1. Download and install the latest TortoiseHg at http://bitbucket.org/tortoisehg/stable/downloads/.
  2. After rebooting, Right-click -> TortoiseHG -> Settings -> Global -> Commit, and set your Username to something. I’m using “Alan Brooks”.
  3. Right-click -> TortoiseHG -> Clone a Repository.
  4. Put your \\Shared\Repo\Project44 in “Source Path”.
  5. Click “clone” in the upper left.
  6. The folder “Project44” on your hard drive is a working copy of all the latest files and also a complete copy of the entire history of the project (a.k.a. the repository in the “.hg” folder). I’ll call this folder your “local repo” for short.

Example Workflow

  1. Edit some code or files until you get to a point where you’d like to record a small incremental change in your local repo.
  2. Notice that the files/folders you’ve changed all have little red marks in Windows Explorer.
  3. Commit to your local repo. Right-click -> HG Commit …, select files to commit, write a checkin comment, then click Commit. This commit will be an atomic action for all the files as a group.
  4. Sync with the remote repo. Right-click -> TortoiseHG -> Synchronize…, click Pull to get anyone else’s changes. If there are changes, they may need merged before you push. If no changes, click Push to publish your changes to the repo.
  5. Look at the history. Right-click -> TortoiseHG -> View Changelog.

References

A couple of good things to read to get started with Mercurial are:

/developer   〆   permalink