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
85
votes
8 answers

Diffing between two entire directories/projects in hg or git?

I inherited a project originally stored in CVS with all the revisions. I made quite a few edits, and I'm trying to compare all the changes I made in the original directory, in regards to new files added versus the old ones. Is there some sort of…
meder omuraliev
  • 183,342
  • 71
  • 393
  • 434
85
votes
2 answers

hg strip vs hg backout and hg revert

What is the difference between the mercurial commands, hg strip hg backout hg revert All these commands basically are used to revert/undo the effects of an earlier changeset.
Gopinagh.R
  • 4,826
  • 4
  • 44
  • 60
84
votes
3 answers

How to combine two projects in Mercurial?

I have two separate mercurial repositories. At this point it makes sense that they "become one" because I want to work on the two projects simultaneously. I'd really like the two projects to each be a subdirectory in the new repository. How do I…
jm.
  • 23,422
  • 22
  • 79
  • 93
82
votes
5 answers

How do I git reset --hard HEAD on Mercurial?

I'm a Git user trying to use Mercurial. Here's what happened: I did a hg backout on a changeset I wanted to revert. That created a new head, so hg instructed me to merge (back to "default", I assume). After the merge, it told me I still had to…
agentofuser
  • 8,987
  • 11
  • 54
  • 85
80
votes
2 answers

How to remove changes in a file in hg

Can you please tell me how can I remove change I made locally? In git , I can do git checkout -- aFile.cpp, how can I do the same thing with hg?
michael
  • 106,540
  • 116
  • 246
  • 346
78
votes
4 answers

Ignoring folder meta files on version control

Unity creates and deletes meta files for folders inside the Asset folder. That can create an annoying situation when using version control (that you can skip and go to the questions): someone creates a folder of files that will be ignored but forget…
Roberto
  • 11,557
  • 16
  • 54
  • 68
77
votes
5 answers

Backing Out a backwards merge on Mercurial

How do you reverse the effect of a merge on polarised branches without dying of agony? This problem has been plaguing me for months and I have finally given up. You have 1 Repository, with 2 Named Branches. A and B. Changes that occur to A will…
Kent Fredric
  • 56,416
  • 14
  • 107
  • 150
76
votes
2 answers

hg log - How to get the last 5 log entries?

I have a Mercurial project that has hundreds of commits. When I want to look at the most recent entries I type hg log and then wait for everything to print out and then scroll back to the top. How do I print out just the 5 most-recent entries?
Hubert Brethwaite
  • 769
  • 1
  • 5
  • 3
76
votes
5 answers

How to list all files in a repository in Mercurial (hg)?

Is there a command in mercurial that will list all files currently under source control? I can do a dir /s to list all files in my folder and subfolders, but I have no idea which have been added to my repository. I have a variety of excluded file…
JamesWampler
  • 962
  • 1
  • 8
  • 12
76
votes
7 answers

Git as mercurial client? Why no git-hg?

This is a question that's been bothering me for a while. I've done my homework and checked stackoverflow and found at least these two topics about my question: Git for Mercurial like git-svn and Git interoperability with a Mercurial repository I've…
Kai Inkinen
  • 2,581
  • 2
  • 21
  • 21
76
votes
5 answers

What are the best and must-have hg / mercurial extensions?

I've been dabbling with hg / mercurial lately, namely in conjunction with Fogcreek's Kiln, and I'm trying to figure out what the must-have extensions are. Its a little tricky sifting through their extension list because I'm not interested in…
JJ Rohrer
  • 2,671
  • 5
  • 29
  • 37
75
votes
14 answers

Mercurial "server"

I've been using Mercurial for a little while, but mainly for my own use. Now though, I have a project I'm working on where two of us are building the same project, and we will probably be modifiying each other's files. I would like to setup a…
user85116
  • 4,422
  • 7
  • 35
  • 33
75
votes
7 answers

Partial clone with Git and Mercurial

Is it possible to clone only one branch (or from a given commit) in Git and Mercurial? I mean, I want to clone a central repo but since it's huge I'd like to only get part of it and still be able to contribute back my changes. Is it possible? Like,…
pablo
  • 6,392
  • 4
  • 42
  • 62
75
votes
5 answers

Push creates new remote heads! (did you forget to merge? use push -f to force)

Ok I've had a little google and can't find a solution as i've stumbled across the same message but different ways in which people have got it. I'm new to mecurial and want to make sure i'm doing this correctly. So i'm getting the error message as…
JDavies
  • 2,730
  • 7
  • 34
  • 54
74
votes
4 answers

Can I change the username on a mercurial changeset?

I didn't set the username on my development computer and made a few commits. Can I retroactively change the username so it's clear who committed these changesets?
Dan Goldstein
  • 23,436
  • 10
  • 47
  • 51