Debian Codegraph @

doc/html/hg-update.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 update</title>
8 <link rel="stylesheet" href="../style.css" type="text/css" />
9 </head>
10 <body>
11 <div class="document" id="hg-update">
12 <span id="hg-update-1"></span>
13 <h1 class="title">hg update</h1>
14 <h2 class="subtitle" id="update-working-directory-or-switch-revisions">update working directory (or switch revisions)</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 update [-C|-c|-m] [-d DATE] [[-r] REV]
29 </pre>
30 </div>
31 <div class="section" id="description">
32 <h1><a class="toc-backref" href="#contents">Description</a></h1>
33 <p>Update the repository's working directory to the specified
34 changeset. If no changeset is specified, update to the tip of the
35 current named branch and move the active bookmark (see <a class="reference external" href="hg-bookmarks.html"><tt class="docutils literal">hg help
36 bookmarks</tt></a>).</p>
37 <p>Update sets the working directory's parent revision to the specified
38 changeset (see <a class="reference external" href="hg-parents.html"><tt class="docutils literal">hg help parents</tt></a>).</p>
39 <p>If the changeset is not a descendant or ancestor of the working
40 directory's parent and there are uncommitted changes, the update is
41 aborted. With the -c/--check option, the working directory is checked
42 for uncommitted changes; if none are found, the working directory is
43 updated to the specified changeset.</p>
44 <div class="verbose docutils container">
45 <p>The -C/--clean, -c/--check, and -m/--merge options control what
46 happens if the working directory contains uncommitted changes.
47 At most of one of them can be specified.</p>
48 <ol class="arabic simple">
49 <li>If no option is specified, and if
50 the requested changeset is an ancestor or descendant of
51 the working directory's parent, the uncommitted changes
52 are merged into the requested changeset and the merged
53 result is left uncommitted. If the requested changeset is
54 not an ancestor or descendant (that is, it is on another
55 branch), the update is aborted and the uncommitted changes
56 are preserved.</li>
57 <li>With the -m/--merge option, the update is allowed even if the
58 requested changeset is not an ancestor or descendant of
59 the working directory's parent.</li>
60 <li>With the -c/--check option, the update is aborted and the
61 uncommitted changes are preserved.</li>
62 <li>With the -C/--clean option, uncommitted changes are discarded and
63 the working directory is updated to the requested changeset.</li>
64 </ol>
65 </div>
66 <p>To cancel an uncommitted merge (and lose your changes), use
67 <a class="reference external" href="hg-merge.html"><tt class="docutils literal">hg merge <span class="pre">--abort</span></tt></a>.</p>
68 <p>Use null as the changeset to remove the working directory (like
69 <a class="reference external" href="hg-clone.html"><tt class="docutils literal">hg clone <span class="pre">-U</span></tt></a>).</p>
70 <p>If you want to revert just one file to an older revision, use
71 <a class="reference external" href="hg-revert.html"><tt class="docutils literal">hg revert <span class="pre">[-r</span> REV] NAME</tt></a>.</p>
72 <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>
73 <p>Returns 0 on success, 1 if there are unresolved files.</p>
74 </div>
75 <div class="section" id="options">
76 <h1><a class="toc-backref" href="#contents">Options</a></h1>
77 <table class="docutils option-list" frame="void" rules="none">
78 <col class="option" />
79 <col class="description" />
80 <tbody valign="top">
81 <tr><td class="option-group">
82 <kbd><span class="option">-C</span>, <span class="option">--clean</span></kbd></td>
83 <td>discard uncommitted changes (no backup)</td></tr>
84 <tr><td class="option-group">
85 <kbd><span class="option">-c</span>, <span class="option">--check</span></kbd></td>
86 <td>require clean working directory</td></tr>
87 <tr><td class="option-group">
88 <kbd><span class="option">-m</span>, <span class="option">--merge</span></kbd></td>
89 <td>merge uncommitted changes</td></tr>
90 <tr><td class="option-group" colspan="2">
91 <kbd><span class="option">-d</span>, <span class="option">--date <var>&lt;DATE&gt;</var></span></kbd></td>
92 </tr>
93 <tr><td>&nbsp;</td><td>tipmost revision matching date</td></tr>
94 <tr><td class="option-group" colspan="2">
95 <kbd><span class="option">-r</span>, <span class="option">--rev <var>&lt;REV&gt;</var></span></kbd></td>
96 </tr>
97 <tr><td>&nbsp;</td><td>revision</td></tr>
98 <tr><td class="option-group" colspan="2">
99 <kbd><span class="option">-t</span>, <span class="option">--tool <var>&lt;TOOL&gt;</var></span></kbd></td>
100 </tr>
101 <tr><td>&nbsp;</td><td>specify merge tool</td></tr>
102 </tbody>
103 </table>
104 </div>
105 <div class="section" id="aliases">
106 <h1><a class="toc-backref" href="#contents">Aliases</a></h1>
107 <pre class="literal-block">
108 up, checkout, co
109 </pre>
110 </div>
111 </div>
112 </body>
113 </html>