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
44
votes
1 answer

How to catch-up named mercurial branch from default branch without merging the two into one?

I have two branches in mercurial.. default named |r1 |r2 |r3 -------- named branch created here. | |r4 | |r5 | r6 | | |r7 | | -----------> | r8 How do I achieve this catch-up? | …
Dynite
  • 2,313
  • 5
  • 30
  • 38
44
votes
1 answer

mercurial automatic push on every commit

Being very familiar with the subversion workflow and that fact that 99.9% of the time my computer is connected to the internet, I don't like doing 'hg ci' and 'hg push' separately. I remember bzr had a 'checkout' command that would bind subsequent…
Sridhar Ratnakumar
  • 81,433
  • 63
  • 146
  • 187
43
votes
2 answers

Show progress of Mercurial push/pull

Is it possible to get Mercurial to show progress of long-running push or pull operation? Google tells me basically "no", but does somebody know better? I was expecting something like hg pull -v...
mmiika
  • 9,970
  • 5
  • 28
  • 34
43
votes
3 answers

hgignore: help ignoring all files but certain ones

I need an .hgdontignore file :-) to include certain files and exclude everything else in a directory. Basically I want to include only the .jar files in a particular directory and nothing else. How can I do this? I'm not that skilled in regular…
Jason S
  • 184,598
  • 164
  • 608
  • 970
42
votes
1 answer

Interconversion of gitignore and hgignore?

I'm just starting to use hg-git to push some mercurial repositories to github, and I'm realizing that if people check them out using git, they'll need a .gitignore file in the repository. Is there any automated way to convert hgignore to gitignore…
Ryan C. Thompson
  • 40,856
  • 28
  • 97
  • 159
42
votes
5 answers

What of Eclipse project .metadata can I safely ignore in Git/Mercurial?

We have the code for an Eclipse RCP application in an Eclipse workspace containing multiple Java projects. We are using Mercurial with a simple .hgignore just *.class (but the same issue would pertain to Git). Even a small change to the code can…
Irish Buffer
  • 852
  • 1
  • 8
  • 11
42
votes
4 answers

How do I unadd a not yet committed file I have added?

I typed in hg add and I am brand new to mercurial and the result of this was a bunch of dll's exe's pdb's etc all got added Nothing's been committed yet and I basically want to undo the add. the documentation for hg forget is not very clear not…
Rahul
  • 2,194
  • 4
  • 31
  • 46
42
votes
8 answers

Undo a remove action in Mercurial

Suppose that I have made some changes in the working directory and accidentally marked several files (that include some of the modified ones) for removal. How do I unmark the files for removal without losing the changes I have made?
Kostas
  • 1,292
  • 1
  • 13
  • 20
42
votes
6 answers

Why Kiln is based on Mercurial, and not other (D)VCS

What were the reason for chosing Mercurial as a basis of FogCreek Kiln, a source control management system with tightly integrated code review, and FogBugz integration? Why Mercurial, and not other (distributed) version control system, like Bazaar,…
Jakub Narębski
  • 309,089
  • 65
  • 217
  • 230
41
votes
3 answers

hg local ignore

I could have sworn there was a way to keep a local ignore file in an hg repo, i.e. a file similar in function to .hgignore, but not checked into the repo. This could be used to ignore changes to an IDE project file if different IDEs are being used,…
fakeleft
  • 2,830
  • 2
  • 30
  • 32
41
votes
3 answers

Refetching a locally deleted file from Mercurial

I deleted one of the files that was in my repository locally (just at the file system level, not using hg remove). I now want to get that file back from the repository to my local directory. When I do hg status, it knows that the file is locally…
ScrollerBlaster
  • 1,578
  • 2
  • 17
  • 21
41
votes
2 answers

How do I search historic mercurial file content?

I've found an issue in my code where something used to be specified, but is no longer, so I want to search for a particular string through the history of the repository. Is there a way to do this in TortoiseHg? I know it would take a while, but it'd…
Stephen
  • 19,488
  • 10
  • 62
  • 83
41
votes
1 answer

How can you clone a Mercurial repository as of a specific changeset?

How can you clone a Mercurial repository as of a specific changeset? Ie: If the master repo has changesets 1-10, how can get a copy of the source as it existed in changeset #7?
Marcus Leon
  • 55,199
  • 118
  • 297
  • 429
41
votes
1 answer

Switching between Mercurial branches

If I look at Mercurial's site, it seems to tell me to use update -C to switch between branches. Another Stack Overflow answer says to use checkout instead. What are the differences? It seems to me that checkout updates the files in the working…
wrongusername
  • 18,564
  • 40
  • 130
  • 214
41
votes
4 answers

Undo an hg push (backout?)

I made a big oops, and could use some help undoing it. We have two repositories-a fairly stable repository, and a repository we're working on changes in. I just made a defect fix in our stable repository, and was moving it up to the working…
Neil
  • 858
  • 1
  • 8
  • 13