Questions tagged [mercurial]

Mercurial is a fast, open-source DVCS (Distributed Version Control System).

Mercurial is a distributed version control system, . It is dedicated to speed and efficiency with a sane user interface. The main part of the code is written in , with a small part in . The project is open-source, distributed under the GPL.

External Links ==============

Please report bugs to the bug tracker instead of posting them here on Stack Overflow. Otherwise the Mercurial team may not see them, and you will become frustrated from the lack of response.

Internal Links ==============

This is a compilation of information on using Mercurial for beginners for practical use.

Beginner - a programmer who has touched source control without understanding it very well.

Practical - covering situations that the majority of users often encounter - creating a repository, branching, merging, pulling/pushing from/to a remote repository, etc.

Notes:

  • Explain how to get something done rather than how something is implemented.
  • Deal with one question per answer.
  • Answer clearly and as concisely as possible.
  • Edit/extend an existing answer rather than create a new answer on the same topic.
  • Please provide a link to the Mercurial wiki or the HG Book for people who want to learn more.

Questions =========

Installation/Setup

Working with the code

Tagging, branching, releases, baselines

Other

8242 questions
60
votes
11 answers

How do I correctly install dulwich to get hg-git working on Windows?

I'm trying to use the hg-git Mercurial extension on Windows (Windows 7 64-bit, to be specific). I have Mercurial and Git installed. I have Python 2.5 (32-bit) installed. I followed the instructions on http://hg-git.github.com/ to install the…
Joshua Flanagan
  • 8,527
  • 2
  • 31
  • 40
59
votes
7 answers

Mercurial: multiline commit message on the command line?

How can I specify a multiline commit message for mercurial on the command line? hg commit -m "* add foo\n* fix bar" does not work. The log shows: changeset: 13:f2c6526e5911 tag: tip date: Fri Jan 23 23:22:36 2009 +0100 files: …
Martin
  • 12,408
  • 6
  • 34
  • 30
59
votes
4 answers

How to move some changeset to a new branch in mercurial

I want to move a changeset from one branch to another. Basically, I currently have: A -> B -> C -> D # default branch And I want: A # default branch \-> B -> C -> D # some_new_branch Where some_new_branch does not exist yet. I am used to git, so…
David Cournapeau
  • 78,318
  • 8
  • 63
  • 70
58
votes
2 answers

Open two GIT branches in two separate IDE instances?

We are migrating from Mercurial to GIT. With Mercurial we have separate repositories compared to one repo with separate branches in GIT. Thus with Mercurial it's straightforward to open two separate repos in two separate instances of your IDE. …
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
58
votes
12 answers

How to automatically remove all .orig files in Mercurial working tree?

During merges mercurial leaves .orig file for any unresolved file. But after manually resolving problems and marking a file correct it does not delete the .orig file. Can it be automatically removed by some command? I work on a Mac so I can use…
rkj
  • 8,787
  • 2
  • 29
  • 35
57
votes
4 answers

git equivalent to hg mq?

I just started using Git alongside Mercurial to familiarize myself with Git. I use the mq extension in Mercurial extensively to manage local patches, and I'm looking for a Git equivalent. Should I just use Git branch? Or are there better ways to…
John Weldon
  • 39,849
  • 11
  • 94
  • 127
57
votes
3 answers

Mercurial moving commits in another branch

My coworker accidentally made two commits in the default branch instead of creating new his own development branch. How can I change this situation and moves these two commits to a new branch?
void
  • 1,347
  • 2
  • 13
  • 25
57
votes
9 answers

How do you delete a commit in Mercurial?

I want to completely delete a Mercurial commit as if it was never entered in the repository and move back to my prior commit. Is this possible?
mdp
  • 571
  • 1
  • 4
  • 3
56
votes
3 answers

How to only push to one branch in Hg?

I have a Hg repo with 3 branches in it, but two of them are inactive (since I have already merged them into my default branch). hg heads shows 3 heads, one for each branch, even though hg branches shows 2 of those branches as 'inactive'. When I try…
simon
  • 3,380
  • 2
  • 22
  • 23
56
votes
7 answers

Mirroring a HG project from Bitbucket to Github

Is there an efficient workflow to mirror a project that is mainly hosted on bitbucket using Hg, to github?
Santa
  • 11,381
  • 8
  • 51
  • 64
55
votes
5 answers

Mercurial clone from a branch

We have a repository with three named branches, I wanted to clone one of the branches. Is there a mercurial command to do that? If I provide the path (of branch) with hg clone I get 404 error.
Abidi
  • 7,846
  • 14
  • 43
  • 65
55
votes
2 answers

How to let TortoiseHg (Mercurial) on Windows use the Private Key file generated (by Puttygen)?

I have used Puttygen to create a public and a private key, and then is ready to let TortoiseHg on Windows 7 do a clone by going to ssh://somebody@code.somewhere.com/somecode but there seems to be no where to add the private key to TortoiseHg? (or…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
55
votes
3 answers

Can I split a Mercurial repository?

I have a largish Mercurial repository that I've decided would be better as several smaller repositories. Is there a way that I can split the repository and have each piece retain its revision history?
James Sulak
  • 31,389
  • 11
  • 53
  • 57
55
votes
7 answers

Embedding mercurial revision information in Visual Studio c# projects automatically

Original Problem In building our projects, I want the mercurial id of each repository to be embedded within the product(s) of that repository (the library, application or test application). I find it makes it so much easier to debug an application…
Mark Booth
  • 7,605
  • 2
  • 68
  • 92
55
votes
2 answers

Mercurial / hg - abort: outstanding uncommitted merges

I have a master repo on host1 and made an update to a repo on host2. I hg pushed the changes from host2 to host1 with [mpenning@host2 login]$ hg push ssh://host1//opt/python/login However, when I try to update or merge, I get [mpenning@host1…
Mike Pennington
  • 41,899
  • 19
  • 136
  • 174