1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
|
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.21.2: https://docutils.sourceforge.io/" />
<title>hg commit</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<body>
<div class="document" id="hg-commit">
<span id="hg-commit-1"></span>
<h1 class="title">hg commit</h1>
<h2 class="subtitle" id="commit-the-specified-files-or-all-outstanding-changes">commit the specified files or all outstanding changes</h2>
<div class="contents htmlonly topic" id="contents">
<p class="topic-title"><a class="reference internal" href="#top">Contents</a></p>
<ul class="simple">
<li><a class="reference internal" href="#synopsis" id="toc-entry-1">Synopsis</a></li>
<li><a class="reference internal" href="#description" id="toc-entry-2">Description</a></li>
<li><a class="reference internal" href="#options" id="toc-entry-3">Options</a></li>
<li><a class="reference internal" href="#aliases" id="toc-entry-4">Aliases</a></li>
</ul>
</div>
<div class="section" id="synopsis">
<h1><a class="toc-backref" href="#contents">Synopsis</a></h1>
<pre class="literal-block">
hg commit [OPTION]... [FILE]...
</pre>
</div>
<div class="section" id="description">
<h1><a class="toc-backref" href="#contents">Description</a></h1>
<p>Commit changes to the given files into the repository. Unlike a
centralized SCM, this operation is a local operation. See
<a class="reference external" href="hg-push.html"><tt class="docutils literal">hg push</tt></a> for a way to actively distribute your changes.</p>
<p>If a list of files is omitted, all changes reported by <a class="reference external" href="hg-status.html"><tt class="docutils literal">hg status</tt></a>
will be committed.</p>
<p>If you are committing the result of a merge, do not provide any
filenames or -I/-X filters.</p>
<p>If no commit message is specified, Mercurial starts your
configured editor where you can enter a message. In case your
commit fails, you will find a backup of your message in
<tt class="docutils literal"><span class="pre">.hg/last-message.txt</span></tt>.</p>
<p>The --close-branch flag can be used to mark the current branch
head closed. When all heads of a branch are closed, the branch
will be considered closed and no longer listed.</p>
<p>The --amend flag can be used to amend the parent of the
working directory with a new commit that contains the changes
in the parent in addition to those currently reported by <a class="reference external" href="hg-status.html"><tt class="docutils literal">hg status</tt></a>,
if there are any. The old commit is stored in a backup bundle in
<tt class="docutils literal"><span class="pre">.hg/strip-backup</span></tt> (see <a class="reference external" href="hg-bundle.html"><tt class="docutils literal">hg help bundle</tt></a> and <a class="reference external" href="hg-unbundle.html"><tt class="docutils literal">hg help unbundle</tt></a>
on how to restore it).</p>
<p>Message, user and date are taken from the amended commit unless
specified. When a message isn't specified on the command line,
the editor will open with the message of the amended commit.</p>
<p>It is not possible to amend public changesets (see <a class="reference external" href="topic-phases.html"><tt class="docutils literal">hg help phases</tt></a>)
or changesets that have children.</p>
<p>See <a class="reference external" href="topic-dates.html"><tt class="docutils literal">hg help dates</tt></a> for a list of formats valid for -d/--date.</p>
<p>Returns 0 on success, 1 if nothing changed.</p>
<div class="verbose docutils container">
<p>Examples:</p>
<ul>
<li><p class="first">commit all files ending in .py:</p>
<pre class="literal-block">
hg commit --include "set:**.py"
</pre>
</li>
<li><p class="first">commit all non-binary files:</p>
<pre class="literal-block">
hg commit --exclude "set:binary()"
</pre>
</li>
<li><p class="first">amend the current commit and set the date to now:</p>
<pre class="literal-block">
hg commit --amend --date now
</pre>
</li>
</ul>
</div>
</div>
<div class="section" id="options">
<h1><a class="toc-backref" href="#contents">Options</a></h1>
<table class="docutils option-list" frame="void" rules="none">
<col class="option" />
<col class="description" />
<tbody valign="top">
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-A</span>, <span class="option">--addremove</span></kbd></td>
</tr>
<tr><td> </td><td>mark new/missing files as added/removed before committing</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--close-branch</span></kbd></td>
<td>mark a branch head as closed</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--amend</span></kbd></td>
<td>amend the parent of the working directory</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-s</span>, <span class="option">--secret</span></kbd></td>
<td>use the secret phase for committing</td></tr>
<tr><td class="option-group">
<kbd><span class="option">--draft</span></kbd></td>
<td>use the draft phase for committing</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-e</span>, <span class="option">--edit</span></kbd></td>
<td>invoke editor on commit messages</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">--force-close-branch</span></kbd></td>
</tr>
<tr><td> </td><td>forcibly close branch from a non-head changeset (ADVANCED)</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-i</span>, <span class="option">--interactive</span></kbd></td>
</tr>
<tr><td> </td><td>use interactive mode</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>include names matching the given patterns</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td>
</tr>
<tr><td> </td><td>exclude names matching the given patterns</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-m</span>, <span class="option">--message <var><TEXT></var></span></kbd></td>
</tr>
<tr><td> </td><td>use text as commit message</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-l</span>, <span class="option">--logfile <var><FILE></var></span></kbd></td>
</tr>
<tr><td> </td><td>read commit message from file</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-d</span>, <span class="option">--date <var><DATE></var></span></kbd></td>
</tr>
<tr><td> </td><td>record the specified date as commit date</td></tr>
<tr><td class="option-group" colspan="2">
<kbd><span class="option">-u</span>, <span class="option">--user <var><USER></var></span></kbd></td>
</tr>
<tr><td> </td><td>record the specified user as committer</td></tr>
<tr><td class="option-group">
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td>
<td>recurse into subrepositories</td></tr>
</tbody>
</table>
<p>[+] marked option can be specified multiple times</p>
</div>
<div class="section" id="aliases">
<h1><a class="toc-backref" href="#contents">Aliases</a></h1>
<pre class="literal-block">
ci
</pre>
</div>
</div>
</body>
</html>
|