.\" Man page generated from reStructuredText. . .TH HG 1 "" "" "Mercurial Manual" .SH NAME hg \- Mercurial source code management system . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .SH SYNOPSIS .sp \fBhg\fP \fIcommand\fP [\fIoption\fP]... [\fIargument\fP]... .SH DESCRIPTION .sp The \fBhg\fP command provides a command line interface to the Mercurial system. .SH COMMAND ELEMENTS .INDENT 0.0 .TP .B files... . indicates one or more filename or relative path filenames; see \%File Name Patterns\: for information on pattern matching .TP .B path . indicates a path on the local machine .TP .B revision . indicates a changeset which can be specified as a changeset revision number, a tag, or a unique substring of the changeset hash value .TP .B repository path . either the pathname of a local repository or the URI of a remote repository. .UNINDENT .SH OPTIONS .INDENT 0.0 .TP .BI \-R, \-\-repository \ . repository root directory or name of overlay bundle file .TP .BI \-\-cwd \ . change working directory .TP .B \-y, \-\-noninteractive . do not prompt, automatically pick the first choice for all prompts .TP .B \-q, \-\-quiet . suppress output .TP .B \-v, \-\-verbose . enable additional output .TP .BI \-\-color \ . when to colorize (boolean, always, auto, never, or debug) .TP .BI \-\-config \ . set/override config option (use \(aqsection.name=value\(aq) .TP .B \-\-debug . enable debugging output .TP .B \-\-debugger . start debugger .TP .BI \-\-encoding \ . set the charset encoding (default: UTF\-8) .TP .BI \-\-encodingmode \ . set the charset encoding mode (default: strict) .TP .B \-\-traceback . always print a traceback on exception .TP .B \-\-time . time how long the command takes .TP .B \-\-profile . print command execution profile .TP .B \-\-version . output version information and exit .TP .B \-h, \-\-help . display help and exit .TP .B \-\-hidden . consider hidden changesets .TP .BI \-\-pager \ . when to paginate (boolean, always, auto, or never) (default: auto) .UNINDENT .sp [+] marked option can be specified multiple times .SH COMMANDS .SS Repository creation .SS clone .sp make a copy of an existing repository: .sp .nf .ft C hg clone [OPTION]... SOURCE [DEST] .ft P .fi .sp Create a copy of an existing repository in a new directory. .sp If no destination directory name is specified, it defaults to the basename of the source. .sp The location of the source is added to the new repository\(aqs \fB.hg/hgrc\fP file, as the default to be used for future pulls. .sp Only local paths and \fBssh://\fP URLs are supported as destinations. For \fBssh://\fP destinations, no working directory or \fB.hg/hgrc\fP will be created on the remote side. .sp If the source repository has a bookmark called \(aq@\(aq set, that revision will be checked out in the new repository by default. .sp To check out a particular version, use \-u/\-\-update, or \-U/\-\-noupdate to create a clone with no working directory. .sp To pull only a subset of changesets, specify one or more revisions identifiers with \-r/\-\-rev or branches with \-b/\-\-branch. The resulting clone will contain only the specified changesets and their ancestors. These options (or \(aqclone src#rev dest\(aq) imply \-\-pull, even for local source repositories. .sp In normal clone mode, the remote normalizes repository data into a common exchange format and the receiving end translates this data into its local storage format. \-\-stream activates a different clone mode that essentially copies repository files from the remote with minimal data processing. This significantly reduces the CPU cost of a clone both remotely and locally. However, it often increases the transferred data size by 30\-40%. This can result in substantially faster clones where I/O throughput is plentiful, especially for larger repositories. A side\-effect of \-\-stream clones is that storage settings and requirements on the remote are applied locally: a modern client may inherit legacy or inefficient storage used by the remote or a legacy Mercurial client may not be able to clone from a modern Mercurial remote. .IP Note . Specifying a tag will include the tagged changeset but not the changeset containing the tag. .RE .sp For efficiency, hardlinks are used for cloning whenever the source and destination are on the same filesystem (note this applies only to the repository data, not to the working directory). Some filesystems, such as AFS, implement hardlinking incorrectly, but do not report errors. In these cases, use the \-\-pull option to avoid hardlinking. .sp Mercurial will update the working directory to the first applicable revision from this list: .INDENT 0.0 .IP a. 3 . null if \-U or the source repository has no changesets .IP b. 3 . if \-u . and the source repository is local, the first parent of the source repository\(aqs working directory .IP c. 3 . the changeset specified with \-u (if a branch name, this means the latest head of that branch) .IP d. 3 . the changeset specified with \-r .IP e. 3 . the tipmost head specified with \-b .IP f. 3 . the tipmost head specified with the url#branch source syntax .IP g. 3 . the revision marked with the \(aq@\(aq bookmark, if present .IP h. 3 . the tipmost head of the default branch .IP i. 3 . tip .UNINDENT .sp When cloning from servers that support it, Mercurial may fetch pre\-generated data from a server\-advertised URL or inline from the same stream. When this is done, hooks operating on incoming changesets and changegroups may fire more than once, once for each pre\-generated bundle and as well as for any additional remaining data. In addition, if an error occurs, the repository may be rolled back to a partial clone. This behavior may change in future releases. See \%\fBhg help \-e clonebundles\fP\: for more. .sp Examples: .INDENT 0.0 .IP \(bu 2 . clone a remote repository to a new directory named hg/: .sp .nf .ft C hg clone https://www.mercurial\-scm.org/repo/hg/ .ft P .fi .IP \(bu 2 . create a lightweight local clone: .sp .nf .ft C hg clone project/ project\-feature/ .ft P .fi .IP \(bu 2 . clone from an absolute path on an ssh server (note double\-slash): .sp .nf .ft C hg clone ssh://user@server//home/projects/alpha/ .ft P .fi .IP \(bu 2 . do a streaming clone while checking out a specified version: .sp .nf .ft C hg clone \-\-stream http://server/repo \-u 1.5 .ft P .fi .IP \(bu 2 . create a repository without changesets after a particular revision: .sp .nf .ft C hg clone \-r 04e544 experimental/ good/ .ft P .fi .IP \(bu 2 . clone (and track) a particular named branch: .sp .nf .ft C hg clone https://www.mercurial\-scm.org/repo/hg/#stable .ft P .fi .UNINDENT .sp See \%\fBhg help urls\fP\: for details on specifying URLs. .sp Returns 0 on success. .sp Options: .INDENT 0.0 .TP .B \-U, \-\-noupdate . the clone will include an empty working directory (only a repository) .TP .BI \-u, \-\-updaterev \ . revision, tag, or branch to check out .TP .BI \-r, \-\-rev \ . do not clone everything, but include this changeset and its ancestors .TP .BI \-b, \-\-branch \ . do not clone everything, but include this branch\(aqs changesets and their ancestors .TP .B \-\-pull . use pull protocol to copy metadata .TP .B \-\-uncompressed . an alias to \-\-stream (DEPRECATED) .TP .B \-\-stream . clone with minimal data processing .TP .BI \-e, \-\-ssh \ . specify ssh command to use .TP .BI \-\-remotecmd \ . specify hg command to run on the remote side .TP .B \-\-insecure . do not verify server certificate (ignoring web.cacerts config) .UNINDENT .sp [+] marked option can be specified multiple times .SS init .sp create a new repository in the given directory: .sp .nf .ft C hg init [\-e CMD] [\-\-remotecmd CMD] [DEST] .ft P .fi .sp Initialize a new repository in the given directory. If the given directory does not exist, it will be created. .sp If no directory is given, the current directory is used. .sp It is possible to specify an \fBssh://\fP URL as the destination. See \%\fBhg help urls\fP\: for more information. .sp Returns 0 on success. .sp Options: .INDENT 0.0 .TP .BI \-e, \-\-ssh \ . specify ssh command to use .TP .BI \-\-remotecmd \ . specify hg command to run on the remote side .TP .B \-\-insecure . do not verify server certificate (ignoring web.cacerts config) .UNINDENT .SS Remote repository management .SS incoming .sp show new changesets found in source: .sp .nf .ft C hg incoming [\-p] [\-n] [\-M] [\-f] [\-r REV]... [\-\-bundle FILENAME] [SOURCE] .ft P .fi .sp Show new changesets found in the specified path/URL or the default pull location. These are the changesets that would have been pulled by \%\fBhg pull\fP\: at the time you issued this command. .sp See pull for valid source format details. .sp With \-B/\-\-bookmarks, the result of bookmark comparison between local and remote repositories is displayed. With \-v/\-\-verbose, status is also displayed for each bookmark like below: .sp .nf .ft C BM1 01234567890a added BM2 1234567890ab advanced BM3 234567890abc diverged BM4 34567890abcd changed .ft P .fi .sp The action taken locally when pulling depends on the status of each bookmark: .INDENT 0.0 .TP .B \fBadded\fP .sp pull will create it .TP .B \fBadvanced\fP .sp pull will update it .TP .B \fBdiverged\fP .sp pull will create a divergent bookmark .TP .B \fBchanged\fP .sp result depends on remote changesets .UNINDENT .sp From the point of view of pulling behavior, bookmark existing only in the remote repository are treated as \fBadded\fP, even if it is in fact locally deleted. .sp For remote repository, using \-\-bundle avoids downloading the changesets twice if the incoming is followed by a pull. .sp Examples: .INDENT 0.0 .IP \(bu 2 . show incoming changes with patches and full description: .sp .nf .ft C hg incoming \-vp .ft P .fi .IP \(bu 2 . show incoming changes excluding merges, store a bundle: .sp .nf .ft C hg in \-vpM \-\-bundle incoming.hg hg pull incoming.hg .ft P .fi .IP \(bu 2 . briefly list changes inside a bundle: .sp .nf .ft C hg in changes.hg \-T "{desc|firstline}\en" .ft P .fi .UNINDENT .sp Returns 0 if there are incoming changes, 1 otherwise. .sp Options: .INDENT 0.0 .TP .B \-f, \-\-force . run even if remote repository is unrelated .TP .B \-n, \-\-newest\-first . show newest record first .TP .BI \-\-bundle \ . file to store the bundles into .TP .BI \-r, \-\-rev \ . a remote changeset intended to be added .TP .B \-B, \-\-bookmarks . compare bookmarks .TP .BI \-b, \-\-branch \ . a specific branch you would like to pull .TP .B \-p, \-\-patch . show patch .TP .B \-g, \-\-git . use git extended diff format .TP .BI \-l, \-\-limit \ . limit number of changes displayed .TP .B \-M, \-\-no\-merges . do not show merges .TP .B \-\-stat . output diffstat\-style summary of changes .TP .B \-G, \-\-graph . show the revision DAG .TP .BI \-\-style \