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

8137 questions
727
votes
25 answers

What is the Difference Between Mercurial and Git?

I've been using git for some time now on Windows (with msysGit) and I like the idea of distributed source control. Just recently I've been looking at Mercurial (hg) and it looks interesting. However, I can't wrap my head around the differences…
Spoike
  • 112,352
  • 42
  • 133
  • 155
522
votes
11 answers

Git and Mercurial - Compare and Contrast

For a while now I've been using subversion for my personal projects. More and more I keep hearing great things about Git and Mercurial, and DVCS in general. I'd like to give the whole DVCS thing a whirl, but I'm not too familiar with either…
TM.
  • 94,986
  • 30
  • 119
  • 125
405
votes
7 answers

How and/or why is merging in Git better than in SVN?

I've heard in a few places that one of the main reasons why distributed version control systems shine, is much better merging than in traditional tools like SVN. Is this actually due to inherent differences in how the two systems work, or do…
Mr. Boy
  • 52,885
  • 84
  • 282
  • 517
354
votes
11 answers

Mercurial stuck "waiting for lock"

Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now get this message for almost all hg commands: c:\src\>hg commit waiting for lock on repository c:\src\McVrsServer held by…
jm.
  • 22,356
  • 20
  • 72
  • 91
336
votes
12 answers

How to edit incorrect commit message in Mercurial?

I am currently using TortoiseHg (Mercurial) and accidentally committed an incorrect commit message. How do I go about editing this commit message in the repository?
315
votes
5 answers

What is the difference between hg forget and hg remove?

I want mercurial to remove several files from the current state of the repository. However, I want the files to exist in prior history. How do forget and remove differ, and can they do what I want?
Paul Nathan
  • 37,919
  • 28
  • 110
  • 204
295
votes
10 answers

How to search through all Git and Mercurial commits in the repository for a certain string?

I have a Git repository with few branches and dangling commits. I would like to search all such commits in repository for a specific string. I know how to get a log of all commits in history, but these don't include branches or dangling blobs, just…
Josip
  • 6,197
  • 6
  • 24
  • 27
289
votes
8 answers

Convert Mercurial project to Git

I need to convert a mercurial project to a git project, but I would like to keep the commit history intact. My current solution was to just remove hg related files and then git init && add manually the files I needed, but that would not keep the…
gandolf
  • 3,314
  • 3
  • 18
  • 19
273
votes
8 answers

How to save username and password with Mercurial?

I used Mercurial in a personal project, and I have been typing my username and password every time I want to push something to the server. I tried adding the following to the .hgrc file in my home directory, but it seems to be completely…
satoru
  • 27,201
  • 27
  • 83
  • 126
249
votes
7 answers

Mercurial — revert back to old version and continue from there

I'm using Mercurial locally for a project (it's the only repo there's no pushing/pulling to/from anywhere else). To date it's got a linear history. However, the current thing I'm working on I've now realized is a terrible approach and I want to go…
Paolo
  • 20,855
  • 6
  • 38
  • 47
240
votes
4 answers

How to correctly close a feature branch in Mercurial?

I've finished working on a feature branch feature-x. I want to merge results back to the default branch and close feature-x in order to get rid of it in the output of hg branches. I came up with the following scenario, but it has some issues: $ hg…
Andrey Vlasovskikh
  • 15,474
  • 6
  • 38
  • 59
237
votes
22 answers

Mercurial for Beginners: The Definitive Practical Guide

Inspired by Git for beginners: The definitive practical guide. 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…
Laz
  • 3,392
  • 8
  • 30
  • 44
226
votes
13 answers

"ERROR:root:code for hash md5 was not found" when using any hg mercurial commands

When trying to use any hg Mercurial commands on the console, I keep getting this error. I installed Python using Homebrew and I am running Mac OS Catalina v. 10.15.1. Any reference would be appreciated. Here is the error I'm getting: hg commit…
poca
  • 3,468
  • 2
  • 7
  • 15
226
votes
4 answers

How to do Mercurial's 'hg remove' for all missing files?

I use this to remove a file from the repo: hg remove What command can you use to do an hg remove on all files that have been deleted locally? By deleted locally, I mean those showing up with an ! when you do hg status. For…
Marcus Leon
  • 50,921
  • 112
  • 279
  • 413
220
votes
5 answers

How to branch with TortoiseHG

I downloaded TortoiseHg 1.0 for evaluation. For the life of me I can't figure out how to make a branch. It seems to understand branches (e.g. in its repository browser) but I just can't seem to find a way to make a branch. This seems like such a…
Michael Tiller
  • 8,946
  • 3
  • 23
  • 38
1
2 3
99 100