##// END OF EJS Templates
api: pull-requests, fixed invocation of merge as another user.
api: pull-requests, fixed invocation of merge as another user.

File last commit:

r1:854a839a default
r3481:b5202911 default
Show More
151 lines | 4.1 KiB | text/x-rst | RstLexer

|hg| Getting Started

To work locally with |hg| |repos|, use the following configuration examples and command line instructions.

Configure the .hgrc file

The :file:`~/.hgrc` file is a configuration file which control how |hg| interacts between the server and your local setup.

For |hg| usage, you can configure this in your home directory and it will apply to all |repos|. Use the following example configuration, and put your own information into the relevant sections.

For more detailed information, and a full rundown of all configuration options, see the Mercurial .hgrc config documentation.

username = username <user@mail.com>
password = password-here

commit = -v

rcdev.prefix = code.server.com
rcdev.username = username
rcdev.password = set-pw

meld3.executable = /usr/local/bin/meld

git = 1
showfunc = 1
unified = 8

cherry-pick = graft
pull = pull --rebase
push-all = push
push = push --rev .
amend = commit --amend

progress =
mq =
purge =
bookmarks =
hgext.churn =
largefiles =
rebase =
crecord = /Users/brian/crecord/crecord

patterns = re:.*\.(png|bmp|jpg|zip|tar|tar.gz|rar)$
minsize = 10

delay = 1.5

track.current = True

status.modified = green
status.removed = red bold
status.added = cyan bold
status.unknown = white bold
custom.rev = yellow
custom.author = bold
custom.book = green
custom.branch = red bold underline
custom.date = underline
changeset.draft = yellow
changeset.public = green

pager = LESS='FSRX' less

Configure the .hgignore file

The :file:`{~path}/{to}/{repo}/.hgignore` file is a configuration file that instructs |hg| to ignore certain files and not commit them to the |repo|. Files such as build files, or editor tracking files are usually not committed to a |repo|.

Create the .hgignore file in your |repo|, and configure it using the following example to ignore the files you do not wish to be added to version control. For more information, see the hgignore documentation

syntax: glob

Using basic |hg| commands

The following commands will get you through the basics of using |hg| on the command line. For a full run through of all |hg| commands and options, see the Mercurial Command Line Reference Guide

  • hg init - Create a |hg| |repo|.
  • hg clone URI - Clone a |repo| to your local machine.
  • hg status - Display the status of a |repo|.
  • hg commit -m “xx” - Commit changes with an 'xx' commit message.
  • hg pull - Pull changes on server into the local |repo|.
  • hg push - Push your local changes to the server.
  • hg outgoing - Display commits in your next push.
  • hg incoming - Display commits being pulled locally on the next pull.
  • hg heads - Display |repo| versions, when multiple heads get created you need to merge them.
  • hg update -r REV - Revert to specified revision.
  • hg update -C - Disregards any uncommited changes.
  • hg merge -r tip - Merge changes with tip.
  • hg log - Show the |repo| history.
  • hg rollback - Rollback certain revisions.
  • hg diff - Show file diffs on your terminal.