Debian Codegraph @

doc/html/hg-commit.html

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