| 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 add</title> |
| 8 |
<link rel="stylesheet" href="../style.css" type="text/css" /> |
| 9 |
</head> |
| 10 |
<body> |
| 11 |
<div class="document" id="hg-add"> |
| 12 |
<span id="hg-add-1"></span> |
| 13 |
<h1 class="title">hg add</h1> |
| 14 |
<h2 class="subtitle" id="add-the-specified-files-on-the-next-commit">add the specified files on the next commit</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 |
</ul> |
| 23 |
</div> |
| 24 |
<div class="section" id="synopsis"> |
| 25 |
<h1><a class="toc-backref" href="#contents">Synopsis</a></h1> |
| 26 |
<pre class="literal-block"> |
| 27 |
hg add [OPTION]... [FILE]... |
| 28 |
</pre> |
| 29 |
</div> |
| 30 |
<div class="section" id="description"> |
| 31 |
<h1><a class="toc-backref" href="#contents">Description</a></h1> |
| 32 |
<p>Schedule files to be version controlled and added to the |
| 33 |
repository.</p> |
| 34 |
<p>The files will be added to the repository at the next commit. To |
| 35 |
undo an add before that, see <a class="reference external" href="hg-forget.html"><tt class="docutils literal">hg forget</tt></a>.</p> |
| 36 |
<p>If no names are given, add all files to the repository (except |
| 37 |
files matching <tt class="docutils literal">.hgignore</tt>).</p> |
| 38 |
<div class="verbose docutils container"> |
| 39 |
<p>Examples:</p> |
| 40 |
<blockquote> |
| 41 |
<ul> |
| 42 |
<li><p class="first">New (unknown) files are added |
| 43 |
automatically by <a class="reference external" href="hg-add.html"><tt class="docutils literal">hg add</tt></a>:</p> |
| 44 |
<pre class="literal-block"> |
| 45 |
$ ls |
| 46 |
foo.c |
| 47 |
$ hg status |
| 48 |
? foo.c |
| 49 |
$ hg add |
| 50 |
adding foo.c |
| 51 |
$ hg status |
| 52 |
A foo.c |
| 53 |
</pre> |
| 54 |
</li> |
| 55 |
<li><p class="first">Specific files to be added can be specified:</p> |
| 56 |
<pre class="literal-block"> |
| 57 |
$ ls |
| 58 |
bar.c foo.c |
| 59 |
$ hg status |
| 60 |
? bar.c |
| 61 |
? foo.c |
| 62 |
$ hg add bar.c |
| 63 |
$ hg status |
| 64 |
A bar.c |
| 65 |
? foo.c |
| 66 |
</pre> |
| 67 |
</li> |
| 68 |
</ul> |
| 69 |
</blockquote> |
| 70 |
</div> |
| 71 |
<p>Returns 0 if all files are successfully added.</p> |
| 72 |
</div> |
| 73 |
<div class="section" id="options"> |
| 74 |
<h1><a class="toc-backref" href="#contents">Options</a></h1> |
| 75 |
<table class="docutils option-list" frame="void" rules="none"> |
| 76 |
<col class="option" /> |
| 77 |
<col class="description" /> |
| 78 |
<tbody valign="top"> |
| 79 |
<tr><td class="option-group" colspan="2"> |
| 80 |
<kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td> |
| 81 |
</tr> |
| 82 |
<tr><td> </td><td>include names matching the given patterns</td></tr> |
| 83 |
<tr><td class="option-group" colspan="2"> |
| 84 |
<kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td> |
| 85 |
</tr> |
| 86 |
<tr><td> </td><td>exclude names matching the given patterns</td></tr> |
| 87 |
<tr><td class="option-group"> |
| 88 |
<kbd><span class="option">-S</span>, <span class="option">--subrepos</span></kbd></td> |
| 89 |
<td>recurse into subrepositories</td></tr> |
| 90 |
<tr><td class="option-group"> |
| 91 |
<kbd><span class="option">-n</span>, <span class="option">--dry-run</span></kbd></td> |
| 92 |
<td>do not perform actions, just print output</td></tr> |
| 93 |
</tbody> |
| 94 |
</table> |
| 95 |
<p>[+] marked option can be specified multiple times</p> |
| 96 |
</div> |
| 97 |
</div> |
| 98 |
</body> |
| 99 |
</html> |