Mercurial is a distributed version control system. It was initiated by Matt Mackall.
The hgrc
file contains various settings. There is stuff that I just can't seem to remember...
$HOME/.hgrc
on Unix systems and at %USERPROFILE%\.hgrc
or %USERPROFILE%\Mercurial.ini
on Windows systems.
/path/to/repo/.hg/hgrc
. This file is not version controlled. I.e. it will not be clone
d, push
ed or pull
ed.
My per-user hgrc file usually looks like this (well, with my real contact data of course):
[ui] ignore = ~/.hgignore username = John Doe <jdoe@example.org> [diff] git = True [extensions] hgext.mq = hgext.convert =
The hgignore
file contains a list of file name patterns that you do not want to be version controlled, e.g. backup files of your editor or compiler output. This file must be located in the project root directory, i.e. /path/to/repo/.hgignore
. Additionally, sticking to the .hgrc
file above, per-user ignore patterns (used across all projects) could go into $HOME/.hgignore
.
The following is a copy & paste template for a new .hgignore
file:
syntax: glob # ignore temporary and/or backup files of various ediors *~ *.bak *.swp # ignore IDE specific stuff (Netbeans) nbproject # ignore IDE specific stuff (Eclipse) .classpath .project .settings
Starting from here, add your language and project specific details. E.g. for a C project you might want to ignore object files *.o
, while for a Java project you'd want to ignore *.class
files instead and for Python you'd rather ignore *.pyc
and so on and so forth...