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

Add all not tracked files at once

$ hg status M ... M ... M ... ? ... ? ... ? ... I need to add all not tracked (? marked) files. Is it possible? I can do "hg add *" but I will get many messages unwanted 'file already tracked'.
ceth
  • 44,198
  • 62
  • 180
  • 289
51
votes
5 answers

Get certificate fingerprint of HTTPS server from command line?

Recently Mercurial has added certificate validation when connecting to HTTPS servers. I'm trying to clone the wiki repository for a googlecode project at https://wiki.pydlnadms.googlecode.com/hg/, but the certificate is for *.googlecode.com. I was…
Matt Joiner
  • 112,946
  • 110
  • 377
  • 526
51
votes
3 answers

how to view previous version of a file in Mercurial

I am using mercurial for version control of a few files in a directory. Suppose I have 10 commits (10 changesets or revisions). I want to just view how a particular file, say thisFile.py, looked in its 7th revision. I don't want to revert back to…
Curious2learn
  • 31,692
  • 43
  • 108
  • 125
51
votes
2 answers

Describe your workflow of using version control (VCS or DVCS)

I'd like to learn other people workflow when using either vcs or dvcs. Please describe your strategy to handle the following tasks: Implement a feature Fixing bugs (during development and deployed app) Code Review Refactoring code (post…
edwin.nathaniel
  • 1,002
  • 1
  • 10
  • 16
51
votes
3 answers

git equivalent of 'hg serve'?

Is there some sort of addon you can use to have a git equivalent of the Mercurial hg serve ('hg serve' starts a local web-server which allows you to browse the repository history/branches etc)
glaucon
  • 8,112
  • 9
  • 41
  • 63
51
votes
5 answers

Is there a way to remove the history for a single file in Mercurial?

I think I already know the answer to this but thought I would ask anyway: We have a file that got added to a Mercurial repository with sensitive information in it. Is there any way to remove that file along with its change history without removing…
Matt Spradley
  • 7,854
  • 9
  • 31
  • 40
50
votes
4 answers

Not trusting file .hg/hgrc from untrusted user root, group dev

The repository is owned by user root, and group dev Another user is running hg update on the repository and getting the following messages: Not trusting file /dev/.hg/hgrc from untrusted user root, group dev Not trusting file .hg/hgrc from untrusted…
HyderA
  • 20,651
  • 42
  • 112
  • 180
50
votes
2 answers

Mercurial: copying ONE file and its history to another repository

I'm wondering if I can copy one file and its history from one repository to another, without having to import the whole other repository.
o0'.
  • 11,739
  • 19
  • 60
  • 87
50
votes
4 answers

Mercurial <--> git cheat sheet?

Is there a cheat sheet or wiki page out there which relates hg commands to git commands, and vise-versa? I'd like to know for two reasons: first, I'd like to be able to translate git-speak1 into Mercurial, and second I'd like to be aware of the…
David Wolever
  • 148,955
  • 89
  • 346
  • 502
50
votes
3 answers

Git vs Mercurial vs SVN

Possible Duplicates: For home projects, can Mercurial or Git (or other DVCS) provide more advantages over Subversion? What are the relative strengths and weaknesses of Git, Mercurial, and Bazaar? What are some of the differences between these…
Yaso
  • 633
  • 1
  • 6
  • 10
50
votes
4 answers

Mercurial: how to undo last unpushed commit?

I have accidentally made a commit to my local repository. To be more specific, I committed changes to lots of files all at once, when I meant to commit them one at a time. How do I undo this commit and get my working copy back to the state it was…
crobar
  • 2,810
  • 4
  • 28
  • 46
50
votes
2 answers

"Not a head revision!" in Mercurial Hg

I am working in a small organisation, only two developers and we use Mercurial version control tortoisehg-2.2.2-hg-2.0.2-x86. I am new to mercurial. Consider programmerA, programmerB. In programerA machine I created a repository and a client with…
Uthay
  • 505
  • 1
  • 4
  • 7
49
votes
3 answers

Why can't I push this change to my 'main' mercurial repository?

I am trying to grok Mercurial and hope I am just getting confused here! I have a repository ('main') that I have cloned ('clone'), , both on my own machine. Both were completely in sync with each other. I decided to play with named branches so the…
Neil Trodden
  • 4,724
  • 6
  • 35
  • 55
49
votes
4 answers

Hg: How to move files (to subfolder) without losing history?

How to move files (to subfolder) without losing their history? In my Mercurial repository (I mean the folder with the .hg in it) I have MyProject/ folder with all project files. Now I need to create src/ folder inside and move all files to it (from…
Alex P.
  • 3,697
  • 9
  • 45
  • 110
48
votes
8 answers

Mercurial push, abort: authorization failed

I'm having problems with pushing to mercurial repository: $ hg push pushing to https://user:***@hg.domain.com/X_repo searching for changes abort: authorization failed The same URL (with the same credentials) is accessible through the web browser.…
Piotr Byzia
  • 3,363
  • 7
  • 42
  • 62