| 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 purge</title> |
| 8 |
<link rel="stylesheet" href="../style.css" type="text/css" /> |
| 9 |
</head> |
| 10 |
<body> |
| 11 |
<div class="document" id="hg-purge"> |
| 12 |
<span id="hg-purge-1"></span> |
| 13 |
<h1 class="title">hg purge</h1> |
| 14 |
<h2 class="subtitle" id="removes-files-not-tracked-by-mercurial">removes files not tracked by Mercurial</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 purge [OPTION]... [DIR]... |
| 29 |
</pre> |
| 30 |
</div> |
| 31 |
<div class="section" id="description"> |
| 32 |
<h1><a class="toc-backref" href="#contents">Description</a></h1> |
| 33 |
<p>Delete files not known to Mercurial. This is useful to test local |
| 34 |
and uncommitted changes in an otherwise-clean source tree.</p> |
| 35 |
<p>This means that purge will delete the following by default:</p> |
| 36 |
<ul class="simple"> |
| 37 |
<li>Unknown files: files marked with "?" by <a class="reference external" href="hg-status.html"><tt class="docutils literal">hg status</tt></a></li> |
| 38 |
<li>Empty directories: in fact Mercurial ignores directories unless |
| 39 |
they contain files under source control management</li> |
| 40 |
</ul> |
| 41 |
<p>But it will leave untouched:</p> |
| 42 |
<ul class="simple"> |
| 43 |
<li>Modified and unmodified tracked files</li> |
| 44 |
<li>Ignored files (unless -i or --all is specified)</li> |
| 45 |
<li>New files added to the repository (with <a class="reference external" href="hg-add.html"><tt class="docutils literal">hg add</tt></a>)</li> |
| 46 |
</ul> |
| 47 |
<p>The --files and --dirs options can be used to direct purge to delete |
| 48 |
only files, only directories, or both. If neither option is given, |
| 49 |
both will be deleted.</p> |
| 50 |
<p>If directories are given on the command line, only files in these |
| 51 |
directories are considered.</p> |
| 52 |
<p>Be careful with purge, as you could irreversibly delete some files |
| 53 |
you forgot to add to the repository. If you only want to print the |
| 54 |
list of files that this program would delete, use the --print |
| 55 |
option.</p> |
| 56 |
</div> |
| 57 |
<div class="section" id="options"> |
| 58 |
<h1><a class="toc-backref" href="#contents">Options</a></h1> |
| 59 |
<table class="docutils option-list" frame="void" rules="none"> |
| 60 |
<col class="option" /> |
| 61 |
<col class="description" /> |
| 62 |
<tbody valign="top"> |
| 63 |
<tr><td class="option-group" colspan="2"> |
| 64 |
<kbd><span class="option">-a</span>, <span class="option">--abort-on-err</span></kbd></td> |
| 65 |
</tr> |
| 66 |
<tr><td> </td><td>abort if an error occurs</td></tr> |
| 67 |
<tr><td class="option-group"> |
| 68 |
<kbd><span class="option">--all</span></kbd></td> |
| 69 |
<td>purge ignored files too</td></tr> |
| 70 |
<tr><td class="option-group"> |
| 71 |
<kbd><span class="option">-i</span>, <span class="option">--ignored</span></kbd></td> |
| 72 |
<td>purge only ignored files</td></tr> |
| 73 |
<tr><td class="option-group"> |
| 74 |
<kbd><span class="option">--dirs</span></kbd></td> |
| 75 |
<td>purge empty directories</td></tr> |
| 76 |
<tr><td class="option-group"> |
| 77 |
<kbd><span class="option">--files</span></kbd></td> |
| 78 |
<td>purge files</td></tr> |
| 79 |
<tr><td class="option-group"> |
| 80 |
<kbd><span class="option">-p</span>, <span class="option">--print</span></kbd></td> |
| 81 |
<td>print filenames instead of deleting them</td></tr> |
| 82 |
<tr><td class="option-group"> |
| 83 |
<kbd><span class="option">-0</span>, <span class="option">--print0</span></kbd></td> |
| 84 |
<td>end filenames with NUL, for use with xargs (implies -p/--print)</td></tr> |
| 85 |
<tr><td class="option-group"> |
| 86 |
<kbd><span class="option">--confirm</span></kbd></td> |
| 87 |
<td>ask before permanently deleting files</td></tr> |
| 88 |
<tr><td class="option-group" colspan="2"> |
| 89 |
<kbd><span class="option">-I</span>, <span class="option">--include <var><PATTERN[+]></var></span></kbd></td> |
| 90 |
</tr> |
| 91 |
<tr><td> </td><td>include names matching the given patterns</td></tr> |
| 92 |
<tr><td class="option-group" colspan="2"> |
| 93 |
<kbd><span class="option">-X</span>, <span class="option">--exclude <var><PATTERN[+]></var></span></kbd></td> |
| 94 |
</tr> |
| 95 |
<tr><td> </td><td>exclude names matching the given patterns</td></tr> |
| 96 |
</tbody> |
| 97 |
</table> |
| 98 |
<p>[+] marked option can be specified multiple times</p> |
| 99 |
</div> |
| 100 |
<div class="section" id="aliases"> |
| 101 |
<h1><a class="toc-backref" href="#contents">Aliases</a></h1> |
| 102 |
<pre class="literal-block"> |
| 103 |
clean |
| 104 |
</pre> |
| 105 |
</div> |
| 106 |
</div> |
| 107 |
</body> |
| 108 |
</html> |