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
123
votes
2 answers

Generating a list of which files changed between hg versions

I want to generate a list of which files changed between two revisions in a given directory in Mercurial. In particular, I am not interested in what changed, but which files changed in that directory. E.g., supposing that between then and otherthen,…
Paul Nathan
  • 39,638
  • 28
  • 112
  • 212
121
votes
1 answer

How do I update my forked repo using SourceTree?

I am using SourceTree (with BitBucket) to manage my code. I have forked a repo, and the parent repo has been updated. How do I use SourceTree to merge the upstream code into my forked repo?
Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
120
votes
9 answers

How to migrate/convert from SVN to Mercurial (hg) on windows

I'm looking for a tool to migrate a couple of SVN repositories to Mercurial, with history, labels and so on. I'm using TortoiseHg (Windows x32), so ConvertExtensions are discarded. There's some info on how to do this process on a Linux box (hgsvn),…
David Lay
  • 2,956
  • 4
  • 27
  • 48
119
votes
2 answers

Mercurial .hgignore for Visual Studio 2010 projects

Not to be confused with Mercurial .hgignore for Visual Studio 2008 projects I was asking whether if that same file can be reused for Visual Studio 2010, or some other extensions, etc should be added to it, & why?
Shady M. Najib
  • 2,151
  • 2
  • 19
  • 30
119
votes
7 answers

Finding the author of a line of code in Mercurial

How do I find out who is responsible for a specific line of code? I know the linenumber and the filename but I would like Mercurial to tell me the author(s) of that specific line of code. Is there a command for that?
Daniel O
  • 4,607
  • 6
  • 44
  • 52
117
votes
10 answers

Mercurial error: abort no username supplied

Problem on WindowsXP (likely will happen on all Win installs), first time using Mercurial. I found the answer in an inobvious place so I'm asking/answering the question myself so others don't have to search like I did. First time using Mercurial on…
Kevin Won
  • 7,156
  • 5
  • 36
  • 54
117
votes
8 answers

Can I squash commits in Mercurial?

I have a pair of commits that should really be just one. If I was using git, I would use: git rebase -i and then squash them. Can I do that in mercurial? If so, how?
R. Martinho Fernandes
  • 228,013
  • 71
  • 433
  • 510
113
votes
1 answer

How set the default repository

How can I set default remote repository for mercurial local repository?
ceth
  • 44,198
  • 62
  • 180
  • 289
112
votes
4 answers

How to view revision history for Mercurial file?

For a given file in a Mercurial repository, how can you see the revision history? And how can you diff two revisions of the file? Ideally doing all this with visual tools (we use ExamDiff to do some other diffs). I'd say this is basic source…
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
109
votes
2 answers

Closing Hg Branches

When using hg branch FeatureBranchName and publishing it to a central repo that is shared amongst developers, is there a way to eventually close the FeatureBranchName when its development has officially been merged with the default branch? It would…
Nate
  • 18,892
  • 27
  • 70
  • 93
107
votes
9 answers

How do I convert a git repository to mercurial?

I've been developing a java application using git as source code repository. I'd like to share the project with other java developers and hg seems to be most used by them. My question is how do I convert a git repository to hg? If I tried googling…
Spoike
  • 119,724
  • 44
  • 140
  • 158
107
votes
2 answers

Resolving conflicts: how to accept "their" changes automatically?

When merging conflicting changes using hg merge, Mercurial inserts a set of markers into the files to be merged in my working copy like this: <<<<<<< local version = 0.2 ======= version = 0.1 >>>>>>> other Then I manually edit all files marked…
psihodelia
  • 29,566
  • 35
  • 108
  • 157
107
votes
4 answers

TortoiseHg Apply a Patch

TortoiseHg allows you to email a patch file of your changes to someone, but does it support applying patches? If so, how do you apply a patch using TortoiseHg?
Michael La Voie
  • 27,772
  • 14
  • 72
  • 92
106
votes
4 answers

How can I add remote repositories in Mercurial?

I am working with Git repositories in the following way: I have the master repository and several remotes on the different production machines. I am pushing the production code to the remotes and restart the services for the changes to take…
topless
  • 8,069
  • 11
  • 57
  • 86
106
votes
9 answers

How can I recover a removed file in Mercurial (if at all)?

Accidentally, by using a GUI as opposed to CLI, I removed every file in a Mercurial project. I recovered with Revert ok and lost some work, which as I have time machine I could easily get back. But is there a way of un-remove/undelete such files?…
PurplePilot
  • 6,652
  • 7
  • 36
  • 42