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

What are the differences in the VisualStudio Add-ins for Mercurial?

I'm evaluating Visual Studio Add-ins for Mercurial. Currently, I've identified 3 potential candidates : VisualHg http://visualhg.codeplex.com Mercurial Toolbar : http://mercurialtoolbar.codeplex.com HgSccPackage :…
Symbiosoft
  • 4,681
  • 6
  • 32
  • 46
54
votes
4 answers

Mercurial: diffs in a particular changeset?

This is almost exactly a duplicate of Examining a single changeset in Mercurial, and without doubt a duplicate of another question I can't find on SO through Google alone. I'm looking back through a Mercurial repo, and I want to see what exactly…
AP257
  • 89,519
  • 86
  • 202
  • 261
54
votes
3 answers

View differences between two changesets on one file

I have a file tracked in Mercurial. I can see its history with hg log. How can I see the diffs between its most recent version, and the last checked-in changeset?
AP257
  • 89,519
  • 86
  • 202
  • 261
54
votes
6 answers

How can I back out a merge in Mercurial and later remerge with that branch?

I have two branches, default and branch1. By mistake one person in our team merged branch1 with default. The content in branch1 is not yet ready to merge with default (it contains a major rework of the build & deploy environment). We did an…
Peter Moberg
  • 3,098
  • 4
  • 29
  • 35
54
votes
4 answers

Remove all deleted files in next commit with Mercurial

Let's say I have the current status: M File1.cs M File2.cs M File3.cs ! File4.cs ! File5.cs ! File6.cs How do I bulk remove files 4, 5, 6 (!) from the next commit? At the moment, I am just removing them manually before committing, like such: hg…
Andreas Grech
  • 105,982
  • 98
  • 297
  • 360
54
votes
2 answers

Remove file from a commit in Mercurial

I have a commit onto which I have amended some files. Some of these files that were part of the amend I do not want in this commit. Is there a way in Mercurial to remove certain files from the commit without losing the changes I have made to them?…
Dragster
  • 587
  • 1
  • 4
  • 6
54
votes
2 answers

Mercurial (hg) equivalent of git reset (--mixed or --soft)

what would be an equivalent mercurial command (or workflow) for git reset --mixed HEAD^ or git reset --soft HEAD^ i.e. I want leave the working tree intact but get the repository back into the state it was before the last commit. Surprisingly I…
Perseids
  • 12,584
  • 5
  • 40
  • 64
54
votes
5 answers

Mercurial: Merging one file between branches in one repo

When I have two branches in Hg repo, how to merge only one file with another branch, without having all other files from changeset merged? Is it possible to merge only certain files, instead of whole changeset?
Jox
  • 7,132
  • 14
  • 49
  • 63
53
votes
6 answers

Force a push with SourceTree

I started using SourceTree a few days ago to manage Mercurial repositories with my Mac. Now I ran into the problem when pushing to my remote repository creates a new head on a new branch and I would like to force it. However, I am not able to find…
Michael Rose
  • 7,770
  • 3
  • 22
  • 26
53
votes
1 answer

What is the difference between rollback, backout and strip in the Mercurial Eclipse plugin?

What is the difference between the menu items rollback, backout and strip in the Mercurial Eclipse plugin? Can I delete the commit in the local repository without modify the files in my workspace with one of this 3 commands? Or is there another…
Horcrux7
  • 23,758
  • 21
  • 98
  • 156
53
votes
4 answers

How to remove certain changesets from a specific Mercurial clone?

I have a clone of a central repo at rev 2048. I want to remove the last 10 changesets on my local repo as if I was back in time two weeks ago. I suppose I could delete my local repo and do "hg clone -rev 2038" but that would be long (cloning the…
Sylvain
  • 19,099
  • 23
  • 96
  • 145
53
votes
8 answers

Mercurial: How to ignore changes to a tracked file

I have a file with database settings in my project which I have set to some defaults. The file is tracked by Mercurial and checked in. Since this file will be edited with different values various developer machines, is there a way I can tell…
Svish
  • 152,914
  • 173
  • 462
  • 620
53
votes
2 answers

Mercurial Remove History

Is there a way in mercurial to remove old changesets from a database? I have a repository that is 60GB and that makes it pretty painful to do a clone. I would like to trim off everything before a certain date and put the huge database away to…
Jake Pearson
  • 27,069
  • 12
  • 75
  • 95
53
votes
1 answer

Difference between Revert and Update in Mercurial

I'm just getting started with Mercurial, and I've come across something which I don't understand. I made changes to several files, and now I want to undo all the changes I made to one of them (i.e. go back to my last commit for one specific…
Edan Maor
  • 9,772
  • 17
  • 62
  • 92
52
votes
9 answers

Distributed Version Control Systems and the Enterprise - a Good mix?

I can see why distributed source control systems (DVCS - like Mercurial) make sense for open source projects. But do they make sense for an enterprise? (over a centralized Source Control System such as TFS) What features of a DVCS make it better or…
Raj Rao
  • 8,872
  • 12
  • 69
  • 83