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
39
votes
4 answers

Does Mercurial have an equivalent to git clean?

hg clean does not seem to exist, which kinda bothers me. Is this a feature that Mercurial doesn't have or did they just name it differently?
Erik B
  • 40,889
  • 25
  • 119
  • 135
39
votes
3 answers

Why do I need hg update after hg pull while in git I'm doing only git pull

In git to pull and use the latest changes to my local repository I'm using git pull. In hg, I also use hg pull but it prints then run 'hg update' to get a working copy I do run hg update but I wonder why is this difference from git?
Alexander Kulyakhtin
  • 47,782
  • 38
  • 107
  • 158
38
votes
1 answer

hg force update to new files

I am using hg version 1.9.1. Problem is whenever I use hg update, I get an option of updating changed files. Do we have an option for forcefully updating all files to their new versions in the latest commit. Sorry but i did not find any useful…
prathmesh.kallurkar
  • 5,468
  • 8
  • 39
  • 50
38
votes
5 answers

Can Mercurial use .hgignore to forget files?

I forget to place the correct .hgignore into my project and am now confronted with many useless files in my repository. As these files are already under source control .hgignore will not pick em up. Is there a way for hg to forget all files matched…
OliverS
  • 1,251
  • 12
  • 17
38
votes
3 answers

Mercurial: Creating a diff of two commits

Is there a way to get the changes of two commits with mercurial? The second commit is not directly after the first one, there are some other ones between them. I tried hg diff [some params] --change xxxxx --change yyyyy > file.patch but that only…
DerKuchen
  • 1,840
  • 1
  • 15
  • 15
37
votes
4 answers

What's the difference between update and pull?

Can someone clarify what's the exact difference between update and pull commands? Thanks.
emurad
  • 3,448
  • 10
  • 40
  • 47
37
votes
6 answers

How to use p4merge as the merge/diff tool for Mercurial?

Does anyone know how to setup Mercurial to use p4merge as the merge/diff tool on OS X 10.5?
Jay Stramel
  • 3,241
  • 4
  • 28
  • 25
37
votes
3 answers

Counting changed lines of code over time in a repository

Is there a way to obtain the number of changed lines of code over a certain time period in a mercurial repository? Something along the lines of what statsvn does would be great, but anything counting the number of changed lines of code within 6…
37
votes
2 answers

How to turn on Mercurial in existing Eclipse project?

I've installed the HgEclipse plugin for Mercurial integration in Eclipse. I have an existing (Java) project in Eclipse, but I can't figure out how to turn on mercurial change tracking for this existing project. It seems I can do an import of a…
Rabarberski
  • 23,854
  • 21
  • 74
  • 96
37
votes
6 answers

Can I commit only parts of my code using SVN or Mercurial?

I use Tortoise SVN usuallly, but I have been looking into Mercurial since it is a distributed revision control system. What I am looking for, in both systems, is a tool that let me pick only parts of a file and commit them. If I want to do this…
RobbieGee
  • 1,581
  • 4
  • 15
  • 17
37
votes
2 answers

Mercurial .hgignore for Visual Studio 2012 projects

I currently use the answer to a similar question for Visual Studio 2010 as my go to hgignore file. Are there any notable additions to include with VS2012? Below is a compiled list from many different sources. Gist here. I have found that projects…
TheGwa
  • 1,919
  • 27
  • 44
36
votes
3 answers

Mercurial Version Control show error in push

I am using Mercurial version control for my project. Everything like push,pull,update is doing okay but one thing is going wrong: when I am using push it is showing something like this warning: bitbucket.org certificate with fingerprint…
NewUser
  • 12,713
  • 39
  • 142
  • 236
36
votes
3 answers

How to resolve merging conflicts in Mercurial (v1.0.2)?

I have a merging conflict, using Mercurial 1.0.2: merging test.h warning: conflicts during merge. merging test.h failed! 6 files updated, 0 files merged, 0 files removed, 1 files unresolved There are unresolved merges, you can redo the full merge…
lajos
  • 25,525
  • 19
  • 65
  • 75
36
votes
2 answers

How to merge two branches in Mercurial when there is nothing to merge

I'm new to mercurial and I'm trying to do something really simple but can't figure out how to. I created a branch to do some experimentation without disturbing the main branch. trunk A -- B -- C \ experiment …
Danish
  • 3,708
  • 5
  • 29
  • 48
36
votes
5 answers

Mercurial - How to remove a file from version control?

So I accidentally included a config file (different for each machine) into our mercurial repositories. How can I get Mercurial to not include it in version control? I don't want to delete the file since I still want it. And I don't want to cause…
Greg
  • 45,306
  • 89
  • 231
  • 297