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
225
votes
10 answers

Is there any way to delete local commits in Mercurial?

So I keep making a silly mistake in Mercurial. Often times, I'll start work without doing an "hg pull" and an "hg update." When I try to push my changes, I get an error. Is there any way to delete my local commits so I can avoid creating multiple…
user191535
  • 2,271
  • 2
  • 14
  • 4
224
votes
8 answers

Mercurial: how to amend the last commit?

I'm looking for a counter-part of git commit --amend in Mercurial, i.e. a way to modify the commit which my working copy is linked to. I'm only interested in the last commit, not an arbitrary earlier commit. The requirements for this amend-procedure…
mstrap
  • 16,808
  • 10
  • 56
  • 86
223
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
  • 9,291
  • 3
  • 26
  • 41
213
votes
5 answers

Mercurial: Can I rename a branch?

We now have a "stiging" branch, where "staging" seems to be a far better semantic fit. What's a good strategy for handling this?
KevDog
  • 5,763
  • 9
  • 42
  • 73
211
votes
5 answers

Hg: How to do a rebase like git's rebase

In Git I can do this: 1. Start working on new feature: $ git co -b newfeature-123 # (a local feature development branch) do a few commits (M, N, O) master A---B---C \ newfeature-123 M---N---O 2. Pull new changes from upstream…
jpswain
  • 14,642
  • 8
  • 58
  • 63
205
votes
11 answers

Git interoperability with a Mercurial Repository

I use GIT on a Mac. Enough said. I have the tools, I have the experience. And I want to continue to use it. No wars here... The problem is always with interoperability. Most people use SVN, which is great for me. Git SVN works out of the box, and is…
Hugo Sereno Ferreira
  • 8,600
  • 7
  • 46
  • 92
204
votes
7 answers

Store password in TortoiseHg

Is there a way to configure TortoiseHg to store my password? I have a project hosted on Google Code that I access using TortoiseHg. Whenever I want to push changes to Google Code TortoiseHg prompts me for a username and password. Google Code…
sourcenouveau
  • 29,356
  • 35
  • 146
  • 243
190
votes
5 answers

Mercurial Eclipse Plugin

Where can I find a good Eclipse Mercurial Plugin?
zotherstupidguy
  • 2,976
  • 10
  • 39
  • 59
182
votes
9 answers

Abandoning changes without deleting from history

There is a commit that just didn't work, so I want to abandon it without deleting it from history. I have updated from an earlier revision and committed, thus creating a new head. I don't have branches, I don't want branches, I just want to simply…
o0'.
  • 11,739
  • 19
  • 60
  • 87
174
votes
5 answers

Discard all and get clean copy of latest revision?

I'm moving a build process to use mercurial and want to get the working directory back to the state of the tip revision. Earlier runs of the build process will have modified some files and added some files that I don't want to commit, so I have…
Rory
  • 40,559
  • 52
  • 175
  • 261
168
votes
6 answers

abort: no username supplied (see "hg help config")

I have added repository and at the time of commit I get error as error: abort: no username supplied (see "hg help config") I am not getting Mercurial.ini file on my local as well. Does anyone know how I can resolve this error on Fedora?
Snehal
  • 1,681
  • 2
  • 10
  • 3
166
votes
7 answers

Mercurial .hgignore for Visual Studio 2008 projects

What is a good setup for .hgignore file when working with Visual Studio 2008? I mostly develop on my own, only occasionly I clone the repository for somebody else to work on it. I'm thinking about obj folders, .suo, .sln, .user files etc.. Can they…
Johannes
  • 3,002
  • 4
  • 33
  • 36
163
votes
13 answers

rsync exclude according to .gitignore & .hgignore & svn:ignore like --filter=:C

Rsync includes a nifty option --cvs-exclude to “ignore files in the same way CVS does”, but CVS has been obsolete for years. Is there any way to make it also exclude files which would be ignored by modern version control systems (Git, Mercurial,…
Jesse Glick
  • 24,539
  • 10
  • 90
  • 112
159
votes
11 answers

Using Git how do I find changes between local and remote

Here are two different questions but I think they are related. When using Git, how do I find which changes I have committed locally, but haven't yet pushed to a remote branch? I'm looking for something similar to the Mercurial command hg…
ejunker
  • 10,816
  • 11
  • 41
  • 41
154
votes
6 answers

How can I ignore everything under a folder in Mercurial

I am looking for an expression for the .hgignore file, to ignore all files beneath a specified folder. eg: I would like to ignore all files and folders beneath bin Actually any advice on how the expressions are formed would be great
Xian
  • 76,121
  • 12
  • 43
  • 49