Blame


1 8797b228 2019-08-04 stsp <!DOCTYPE html>
2 8797b228 2019-08-04 stsp <html>
3 8797b228 2019-08-04 stsp <!-- This is an automatically generated file. Do not edit.
4 8797b228 2019-08-04 stsp Copyright (c) 2017 Martin Pieuchot
5 8797b228 2019-08-04 stsp Copyright (c) 2018, 2019 Stefan Sperling
6 8797b228 2019-08-04 stsp
7 8797b228 2019-08-04 stsp Permission to use, copy, modify, and distribute this software for any
8 8797b228 2019-08-04 stsp purpose with or without fee is hereby granted, provided that the above
9 8797b228 2019-08-04 stsp copyright notice and this permission notice appear in all copies.
10 8797b228 2019-08-04 stsp
11 8797b228 2019-08-04 stsp THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 8797b228 2019-08-04 stsp WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 8797b228 2019-08-04 stsp MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 8797b228 2019-08-04 stsp ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 8797b228 2019-08-04 stsp WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 8797b228 2019-08-04 stsp ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 8797b228 2019-08-04 stsp OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 8797b228 2019-08-04 stsp -->
19 8797b228 2019-08-04 stsp <head>
20 8797b228 2019-08-04 stsp <meta charset="utf-8"/>
21 8797b228 2019-08-04 stsp <style>
22 8797b228 2019-08-04 stsp table.head, table.foot { width: 100%; }
23 8797b228 2019-08-04 stsp td.head-rtitle, td.foot-os { text-align: right; }
24 8797b228 2019-08-04 stsp td.head-vol { text-align: center; }
25 8797b228 2019-08-04 stsp div.Pp { margin: 1ex 0ex; }
26 8797b228 2019-08-04 stsp div.Nd, div.Bf, div.Op { display: inline; }
27 8797b228 2019-08-04 stsp span.Pa, span.Ad { font-style: italic; }
28 8797b228 2019-08-04 stsp span.Ms { font-weight: bold; }
29 8797b228 2019-08-04 stsp dl.Bl-diag > dt { font-weight: bold; }
30 8797b228 2019-08-04 stsp code.Nm, code.Fl, code.Cm, code.Ic, code.In, code.Fd, code.Fn,
31 8797b228 2019-08-04 stsp code.Cd { font-weight: bold; font-family: inherit; }
32 8797b228 2019-08-04 stsp </style>
33 8797b228 2019-08-04 stsp <title>GOT(1)</title>
34 8797b228 2019-08-04 stsp </head>
35 8797b228 2019-08-04 stsp <body>
36 8797b228 2019-08-04 stsp <table class="head">
37 8797b228 2019-08-04 stsp <tr>
38 8797b228 2019-08-04 stsp <td class="head-ltitle">GOT(1)</td>
39 8797b228 2019-08-04 stsp <td class="head-vol">General Commands Manual</td>
40 8797b228 2019-08-04 stsp <td class="head-rtitle">GOT(1)</td>
41 8797b228 2019-08-04 stsp </tr>
42 8797b228 2019-08-04 stsp </table>
43 8797b228 2019-08-04 stsp <div class="manual-text">
44 8797b228 2019-08-04 stsp <section class="Sh">
45 8797b228 2019-08-04 stsp <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
46 8797b228 2019-08-04 stsp <code class="Nm">got</code> &#x2014;
47 ae520cae 2019-08-05 stsp <div class="Nd">Game of Trees</div>
48 8797b228 2019-08-04 stsp </section>
49 8797b228 2019-08-04 stsp <section class="Sh">
50 8797b228 2019-08-04 stsp <h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
51 8797b228 2019-08-04 stsp <table class="Nm">
52 8797b228 2019-08-04 stsp <tr>
53 8797b228 2019-08-04 stsp <td><code class="Nm">got</code></td>
54 8797b228 2019-08-04 stsp <td><var class="Ar">command</var> [<code class="Fl">-h</code>]
55 8797b228 2019-08-04 stsp [<var class="Ar">arg ...</var>]</td>
56 8797b228 2019-08-04 stsp </tr>
57 8797b228 2019-08-04 stsp </table>
58 8797b228 2019-08-04 stsp </section>
59 8797b228 2019-08-04 stsp <section class="Sh">
60 8797b228 2019-08-04 stsp <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
61 8797b228 2019-08-04 stsp <code class="Nm">got</code> is a version control system which stores the history
62 8797b228 2019-08-04 stsp of tracked files in a Git repository, as used by the Git version control
63 8797b228 2019-08-04 stsp system. This repository format is described in
64 8797b228 2019-08-04 stsp <a class="Xr">git-repository(5)</a>.
65 8797b228 2019-08-04 stsp <p class="Pp"><code class="Nm">got</code> is a &#x201C;distributed&#x201D;
66 8797b228 2019-08-04 stsp version control system because every copy of a repository is writeable.
67 8797b228 2019-08-04 stsp Modifications made to files can be synchronized between repositories at any
68 8797b228 2019-08-04 stsp time.</p>
69 8797b228 2019-08-04 stsp <p class="Pp">Files managed by <code class="Nm">got</code> must be checked out
70 8797b228 2019-08-04 stsp from the repository for modification. Checked out files are stored in a
71 8797b228 2019-08-04 stsp <i class="Em">work tree</i> which can be placed at an arbitrary directory in
72 8797b228 2019-08-04 stsp the filesystem hierarchy. The on-disk format of this work tree is described
73 8797b228 2019-08-04 stsp in <a class="Xr">got-worktree(5)</a>.</p>
74 8797b228 2019-08-04 stsp <p class="Pp"><code class="Nm">got</code> provides global and command-specific
75 8797b228 2019-08-04 stsp options. Global options must preceed the command name, and are as
76 8797b228 2019-08-04 stsp follows:</p>
77 8797b228 2019-08-04 stsp <dl class="Bl-tag">
78 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#h"><code class="Fl" id="h">-h</code></a></dt>
79 ae520cae 2019-08-05 stsp <dd>Display usage information and exit immediately.</dd>
80 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></dt>
81 8797b228 2019-08-04 stsp <dd>Display program version and exit immediately.</dd>
82 8797b228 2019-08-04 stsp </dl>
83 8797b228 2019-08-04 stsp <p class="Pp">The commands for <code class="Nm">got</code> are as follows:</p>
84 8797b228 2019-08-04 stsp <dl class="Bl-tag">
85 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#init"><code class="Cm" id="init">init</code></a>
86 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
87 8797b228 2019-08-04 stsp <dd>Create a new empty repository at the specified
88 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var>.
89 8797b228 2019-08-04 stsp <p class="Pp">After <code class="Cm">got init</code>, the
90 8797b228 2019-08-04 stsp <code class="Cm">got import</code> command must be used to populate the
91 8797b228 2019-08-04 stsp empty repository before <code class="Cm">got checkout</code> can be
92 8797b228 2019-08-04 stsp used.</p>
93 8797b228 2019-08-04 stsp </dd>
94 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#in"><code class="Cm" id="in">in</code></a></dt>
95 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">init</code>.</dd>
96 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#import"><code class="Cm" id="import">import</code></a>
97 8797b228 2019-08-04 stsp [<code class="Fl">-b</code> <var class="Ar">branch</var>]
98 8797b228 2019-08-04 stsp [<code class="Fl">-m</code> <var class="Ar">message</var>]
99 8797b228 2019-08-04 stsp [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
100 8797b228 2019-08-04 stsp [<code class="Fl">-I</code> <var class="Ar">pattern</var>]
101 8797b228 2019-08-04 stsp <var class="Ar">directory</var></dt>
102 8797b228 2019-08-04 stsp <dd>Create an initial commit in a repository from the file hierarchy within
103 8797b228 2019-08-04 stsp the specified <var class="Ar">directory</var>. The created commit will not
104 8797b228 2019-08-04 stsp have any parent commits, i.e. it will be a root commit. Also create a new
105 8797b228 2019-08-04 stsp reference which provides a branch name for the newly created commit. Show
106 8797b228 2019-08-04 stsp the path of each imported file to indicate progress.
107 8797b228 2019-08-04 stsp <p class="Pp">The <code class="Cm">got import</code> command requires the
108 8797b228 2019-08-04 stsp <code class="Ev">GOT_AUTHOR</code> environment variable to be set.</p>
109 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got import</code> are as
110 8797b228 2019-08-04 stsp follows:</p>
111 8797b228 2019-08-04 stsp <dl class="Bl-tag">
112 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#b"><code class="Fl" id="b">-b</code></a>
113 8797b228 2019-08-04 stsp <var class="Ar">branch</var></dt>
114 8797b228 2019-08-04 stsp <dd>Create the specified <var class="Ar">branch</var> instead of creating
115 8797b228 2019-08-04 stsp the default branch &#x201C;master&#x201D;. Use of this option is
116 8797b228 2019-08-04 stsp required if the &#x201C;master&#x201D; branch already exists.</dd>
117 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a>
118 8797b228 2019-08-04 stsp <var class="Ar">message</var></dt>
119 8797b228 2019-08-04 stsp <dd>Use the specified log message when creating the new commit. Without
120 8797b228 2019-08-04 stsp the <code class="Fl">-m</code> option, <code class="Cm">got
121 8797b228 2019-08-04 stsp import</code> opens a temporary file in an editor where a log message
122 8797b228 2019-08-04 stsp can be written.</dd>
123 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#r"><code class="Fl" id="r">-r</code></a>
124 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
125 8797b228 2019-08-04 stsp <dd>Use the repository at the specified path. If not specified, assume the
126 8797b228 2019-08-04 stsp repository is located at or above the current working directory.</dd>
127 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#I"><code class="Fl" id="I">-I</code></a>
128 8797b228 2019-08-04 stsp <var class="Ar">pattern</var></dt>
129 8797b228 2019-08-04 stsp <dd>Ignore files or directories with a name which matches the specified
130 8797b228 2019-08-04 stsp <var class="Ar">pattern</var>. This option may be specified multiple
131 8797b228 2019-08-04 stsp times to build a list of ignore patterns. The
132 8797b228 2019-08-04 stsp <var class="Ar">pattern</var> follows the globbing rules documented in
133 8797b228 2019-08-04 stsp <a class="Xr">glob(7)</a>.</dd>
134 8797b228 2019-08-04 stsp </dl>
135 8797b228 2019-08-04 stsp </dd>
136 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#im"><code class="Cm" id="im">im</code></a></dt>
137 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">import</code>.</dd>
138 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#checkout"><code class="Cm" id="checkout">checkout</code></a>
139 8797b228 2019-08-04 stsp [<code class="Fl">-b</code> <var class="Ar">branch</var>]
140 8797b228 2019-08-04 stsp [<code class="Fl">-c</code> <var class="Ar">commit</var>]
141 8797b228 2019-08-04 stsp [<code class="Fl">-p</code> <var class="Ar">path-prefix</var>]
142 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var>
143 8797b228 2019-08-04 stsp [<var class="Ar">work-tree-path</var>]</dt>
144 8797b228 2019-08-04 stsp <dd>Copy files from a repository into a new work tree. If the
145 8797b228 2019-08-04 stsp <var class="Ar">work tree path</var> is not specified, either use the last
146 8797b228 2019-08-04 stsp component of <var class="Ar">repository path</var>, or if a
147 8797b228 2019-08-04 stsp <var class="Ar">path prefix</var> was specified use the last component of
148 8797b228 2019-08-04 stsp <var class="Ar">path prefix</var>.
149 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got checkout</code> are as
150 8797b228 2019-08-04 stsp follows:</p>
151 8797b228 2019-08-04 stsp <dl class="Bl-tag">
152 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#b_2"><code class="Fl" id="b_2">-b</code></a>
153 8797b228 2019-08-04 stsp <var class="Ar">branch</var></dt>
154 8797b228 2019-08-04 stsp <dd>Check out files from a commit on the specified
155 8797b228 2019-08-04 stsp <var class="Ar">branch</var>. If this option is not specified, a
156 8797b228 2019-08-04 stsp branch resolved via the repository's HEAD reference will be used.</dd>
157 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#c"><code class="Fl" id="c">-c</code></a>
158 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
159 8797b228 2019-08-04 stsp <dd>Check out files from the specified <var class="Ar">commit</var> on the
160 8797b228 2019-08-04 stsp selected branch. The expected argument is a commit ID SHA1 hash or an
161 97e00196 2019-08-09 stsp existing reference or tag name which will be resolved to a commit ID.
162 97e00196 2019-08-09 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
163 8797b228 2019-08-04 stsp automatically, provided the abbreviation is unique. If this option is
164 8797b228 2019-08-04 stsp not specified, the most recent commit on the selected branch will be
165 8797b228 2019-08-04 stsp used.</dd>
166 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
167 8797b228 2019-08-04 stsp <var class="Ar">path-prefix</var></dt>
168 8797b228 2019-08-04 stsp <dd>Restrict the work tree to a subset of the repository's tree hierarchy.
169 8797b228 2019-08-04 stsp Only files beneath the specified <var class="Ar">path-prefix</var>
170 8797b228 2019-08-04 stsp will be checked out.</dd>
171 8797b228 2019-08-04 stsp </dl>
172 8797b228 2019-08-04 stsp </dd>
173 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#co"><code class="Cm" id="co">co</code></a></dt>
174 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">checkout</code>.</dd>
175 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#update"><code class="Cm" id="update">update</code></a>
176 8797b228 2019-08-04 stsp [<code class="Fl">-b</code> <var class="Ar">branch</var>]
177 8797b228 2019-08-04 stsp [<code class="Fl">-c</code> <var class="Ar">commit</var>]
178 8797b228 2019-08-04 stsp [<var class="Ar">path ...</var>]</dt>
179 8797b228 2019-08-04 stsp <dd>Update an existing work tree to a different commit. Show the status of
180 8797b228 2019-08-04 stsp each affected file, using the following status codes:
181 8797b228 2019-08-04 stsp <table class="Bl-column">
182 8797b228 2019-08-04 stsp <tr>
183 8797b228 2019-08-04 stsp <td>U</td>
184 8797b228 2019-08-04 stsp <td>file was updated and contained no local changes</td>
185 8797b228 2019-08-04 stsp </tr>
186 8797b228 2019-08-04 stsp <tr>
187 8797b228 2019-08-04 stsp <td>G</td>
188 8797b228 2019-08-04 stsp <td>file was updated and local changes were merged cleanly</td>
189 8797b228 2019-08-04 stsp </tr>
190 8797b228 2019-08-04 stsp <tr>
191 8797b228 2019-08-04 stsp <td>C</td>
192 8797b228 2019-08-04 stsp <td>file was updated and conflicts occurred during merge</td>
193 8797b228 2019-08-04 stsp </tr>
194 8797b228 2019-08-04 stsp <tr>
195 8797b228 2019-08-04 stsp <td>D</td>
196 8797b228 2019-08-04 stsp <td>file was deleted</td>
197 8797b228 2019-08-04 stsp </tr>
198 8797b228 2019-08-04 stsp <tr>
199 8797b228 2019-08-04 stsp <td>A</td>
200 8797b228 2019-08-04 stsp <td>new file was added</td>
201 8797b228 2019-08-04 stsp </tr>
202 8797b228 2019-08-04 stsp <tr>
203 8797b228 2019-08-04 stsp <td>~</td>
204 8797b228 2019-08-04 stsp <td>versioned file is obstructed by a non-regular file</td>
205 8797b228 2019-08-04 stsp </tr>
206 8797b228 2019-08-04 stsp <tr>
207 8797b228 2019-08-04 stsp <td>!</td>
208 8797b228 2019-08-04 stsp <td>a missing versioned file was restored</td>
209 8797b228 2019-08-04 stsp </tr>
210 8797b228 2019-08-04 stsp </table>
211 8797b228 2019-08-04 stsp <p class="Pp">If no <var class="Ar">path</var> is specified, update the
212 8797b228 2019-08-04 stsp entire work tree. Otherwise, restrict the update operation to files at
213 8797b228 2019-08-04 stsp or within the specified paths. Each path is required to exist in the
214 8797b228 2019-08-04 stsp update operation's target commit. Files in the work tree outside
215 8797b228 2019-08-04 stsp specified paths will remain unchanged and will retain their previously
216 8797b228 2019-08-04 stsp recorded base commit. Some <code class="Nm">got</code> commands may
217 8797b228 2019-08-04 stsp refuse to run while the work tree contains files from multiple base
218 8797b228 2019-08-04 stsp commits. The base commit of such a work tree can be made consistent by
219 8797b228 2019-08-04 stsp running <code class="Cm">got update</code> across the entire work tree.
220 8797b228 2019-08-04 stsp Specifying a <var class="Ar">path</var> is incompatible with the
221 8797b228 2019-08-04 stsp <code class="Fl">-b</code> option.</p>
222 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got update</code> cannot update paths with
223 8797b228 2019-08-04 stsp staged changes. If changes have been staged with <code class="Cm">got
224 8797b228 2019-08-04 stsp stage</code>, these changes must first be comitted with
225 8797b228 2019-08-04 stsp <code class="Cm">got commit</code> or unstaged with <code class="Cm">got
226 8797b228 2019-08-04 stsp unstage</code>.</p>
227 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got update</code> are as
228 8797b228 2019-08-04 stsp follows:</p>
229 8797b228 2019-08-04 stsp <dl class="Bl-tag">
230 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#b_3"><code class="Fl" id="b_3">-b</code></a>
231 8797b228 2019-08-04 stsp <var class="Ar">branch</var></dt>
232 8797b228 2019-08-04 stsp <dd>Switch the work tree's branch reference to the specified
233 8797b228 2019-08-04 stsp <var class="Ar">branch</var> before updating the work tree. This
234 8797b228 2019-08-04 stsp option requires that all paths in the work tree are updated.</dd>
235 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#c_2"><code class="Fl" id="c_2">-c</code></a>
236 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
237 8797b228 2019-08-04 stsp <dd>Update the work tree to the specified <var class="Ar">commit</var>.
238 8797b228 2019-08-04 stsp The expected argument is a commit ID SHA1 hash or an existing
239 97e00196 2019-08-09 stsp reference or tag name which will be resolved to a commit ID. An
240 97e00196 2019-08-09 stsp abbreviated hash argument will be expanded to a full SHA1 hash
241 97e00196 2019-08-09 stsp automatically, provided the abbreviation is unique. If this option is
242 97e00196 2019-08-09 stsp not specified, the most recent commit on the work tree's branch will
243 97e00196 2019-08-09 stsp be used.</dd>
244 8797b228 2019-08-04 stsp </dl>
245 8797b228 2019-08-04 stsp </dd>
246 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#up"><code class="Cm" id="up">up</code></a></dt>
247 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">update</code>.</dd>
248 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#status"><code class="Cm" id="status">status</code></a>
249 8797b228 2019-08-04 stsp [<var class="Ar">path ...</var>]</dt>
250 8797b228 2019-08-04 stsp <dd>Show the current modification status of files in a work tree, using the
251 8797b228 2019-08-04 stsp following status codes:
252 8797b228 2019-08-04 stsp <table class="Bl-column">
253 8797b228 2019-08-04 stsp <tr>
254 8797b228 2019-08-04 stsp <td>M</td>
255 8797b228 2019-08-04 stsp <td>modified file</td>
256 8797b228 2019-08-04 stsp </tr>
257 8797b228 2019-08-04 stsp <tr>
258 8797b228 2019-08-04 stsp <td>A</td>
259 8797b228 2019-08-04 stsp <td>file scheduled for addition in next commit</td>
260 8797b228 2019-08-04 stsp </tr>
261 8797b228 2019-08-04 stsp <tr>
262 8797b228 2019-08-04 stsp <td>D</td>
263 8797b228 2019-08-04 stsp <td>file scheduled for deletion in next commit</td>
264 8797b228 2019-08-04 stsp </tr>
265 8797b228 2019-08-04 stsp <tr>
266 8797b228 2019-08-04 stsp <td>C</td>
267 8797b228 2019-08-04 stsp <td>modified or added file which contains merge conflicts</td>
268 8797b228 2019-08-04 stsp </tr>
269 8797b228 2019-08-04 stsp <tr>
270 8797b228 2019-08-04 stsp <td>!</td>
271 8797b228 2019-08-04 stsp <td>versioned file was expected on disk but is missing</td>
272 8797b228 2019-08-04 stsp </tr>
273 8797b228 2019-08-04 stsp <tr>
274 8797b228 2019-08-04 stsp <td>~</td>
275 8797b228 2019-08-04 stsp <td>versioned file is obstructed by a non-regular file</td>
276 8797b228 2019-08-04 stsp </tr>
277 8797b228 2019-08-04 stsp <tr>
278 8797b228 2019-08-04 stsp <td>?</td>
279 8797b228 2019-08-04 stsp <td>unversioned item not tracked by <code class="Nm">got</code></td>
280 8797b228 2019-08-04 stsp </tr>
281 8797b228 2019-08-04 stsp </table>
282 8797b228 2019-08-04 stsp <p class="Pp">If no <var class="Ar">path</var> is specified, show
283 8797b228 2019-08-04 stsp modifications in the entire work tree. Otherwise, show modifications at
284 8797b228 2019-08-04 stsp or within the specified paths.</p>
285 8797b228 2019-08-04 stsp <p class="Pp">If changes have been staged with <code class="Cm">got
286 8797b228 2019-08-04 stsp stage</code>, staged changes are shown in the second output column,
287 8797b228 2019-08-04 stsp using the following status codes:</p>
288 8797b228 2019-08-04 stsp <table class="Bl-column">
289 8797b228 2019-08-04 stsp <tr>
290 8797b228 2019-08-04 stsp <td>M</td>
291 8797b228 2019-08-04 stsp <td>file modification is staged</td>
292 8797b228 2019-08-04 stsp </tr>
293 8797b228 2019-08-04 stsp <tr>
294 8797b228 2019-08-04 stsp <td>A</td>
295 8797b228 2019-08-04 stsp <td>file addition is staged</td>
296 8797b228 2019-08-04 stsp </tr>
297 8797b228 2019-08-04 stsp <tr>
298 8797b228 2019-08-04 stsp <td>D</td>
299 8797b228 2019-08-04 stsp <td>file deletion is staged</td>
300 8797b228 2019-08-04 stsp </tr>
301 8797b228 2019-08-04 stsp </table>
302 fc62dacd 2019-08-08 stsp <p class="Pp">Changes created on top of staged changes are indicated in the
303 fc62dacd 2019-08-08 stsp first column:</p>
304 8797b228 2019-08-04 stsp <table class="Bl-column">
305 8797b228 2019-08-04 stsp <tr>
306 8797b228 2019-08-04 stsp <td>MM</td>
307 fc62dacd 2019-08-08 stsp <td>file was modified after earlier changes have been staged</td>
308 8797b228 2019-08-04 stsp </tr>
309 8797b228 2019-08-04 stsp <tr>
310 8797b228 2019-08-04 stsp <td>MA</td>
311 fc62dacd 2019-08-08 stsp <td>file was modified after having been staged for addition</td>
312 8797b228 2019-08-04 stsp </tr>
313 8797b228 2019-08-04 stsp </table>
314 1ff80c7c 2019-08-08 stsp <p class="Pp">For compatibility with <a class="Xr">cvs(1)</a>,
315 1ff80c7c 2019-08-08 stsp <code class="Cm">got status</code> parses
316 1ff80c7c 2019-08-08 stsp <span class="Pa">.cvsignore</span> files in each traversed directory and
317 1ff80c7c 2019-08-08 stsp will not display unversioned files which match <a class="Xr">glob(7)</a>
318 1ff80c7c 2019-08-08 stsp ignore patterns contained in <span class="Pa">.cvsignore</span> files.
319 1ff80c7c 2019-08-08 stsp Unlike <a class="Xr">cvs(1)</a>, <code class="Cm">got status</code> only
320 1ff80c7c 2019-08-08 stsp supports a single ignore pattern per line.</p>
321 8797b228 2019-08-04 stsp </dd>
322 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#st"><code class="Cm" id="st">st</code></a></dt>
323 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">status</code>.</dd>
324 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#log"><code class="Cm" id="log">log</code></a>
325 8797b228 2019-08-04 stsp [<code class="Fl">-c</code> <var class="Ar">commit</var>]
326 8797b228 2019-08-04 stsp [<code class="Fl">-C</code> <var class="Ar">number</var>]
327 8797b228 2019-08-04 stsp [<code class="Fl">-f</code>] [<code class="Fl">-l</code>
328 8797b228 2019-08-04 stsp <var class="Ar">N</var>] [<code class="Fl">-p</code>]
329 8797b228 2019-08-04 stsp [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
330 8797b228 2019-08-04 stsp [<var class="Ar">path</var>]</dt>
331 8797b228 2019-08-04 stsp <dd>Display history of a repository. If a <var class="Ar">path</var> is
332 8797b228 2019-08-04 stsp specified, show only commits which modified this path.
333 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got log</code> are as
334 8797b228 2019-08-04 stsp follows:</p>
335 8797b228 2019-08-04 stsp <dl class="Bl-tag">
336 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#c_3"><code class="Fl" id="c_3">-c</code></a>
337 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
338 8797b228 2019-08-04 stsp <dd>Start traversing history at the specified
339 8797b228 2019-08-04 stsp <var class="Ar">commit</var>. The expected argument is a commit ID
340 97e00196 2019-08-09 stsp SHA1 hash or an existing reference or tag name which will be resolved
341 97e00196 2019-08-09 stsp to a commit ID. An abbreviated hash argument will be expanded to a
342 97e00196 2019-08-09 stsp full SHA1 hash automatically, provided the abbreviation is unique. If
343 97e00196 2019-08-09 stsp this option is not specified, default to the work tree's current
344 97e00196 2019-08-09 stsp branch if invoked in a work tree, or to the repository's HEAD
345 97e00196 2019-08-09 stsp reference.</dd>
346 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#C"><code class="Fl" id="C">-C</code></a>
347 8797b228 2019-08-04 stsp <var class="Ar">number</var></dt>
348 8797b228 2019-08-04 stsp <dd>Set the number of context lines shown in diffs with
349 8797b228 2019-08-04 stsp <code class="Fl">-p</code>. By default, 3 lines of context are
350 8797b228 2019-08-04 stsp shown.</dd>
351 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#f"><code class="Fl" id="f">-f</code></a></dt>
352 8797b228 2019-08-04 stsp <dd>Restrict history traversal to the first parent of each commit. This
353 8797b228 2019-08-04 stsp shows the linear history of the current branch only. Merge commits
354 8797b228 2019-08-04 stsp which affected the current branch will be shown but individual commits
355 8797b228 2019-08-04 stsp which originated on other branches will be omitted.</dd>
356 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#l"><code class="Fl" id="l">-l</code></a>
357 8797b228 2019-08-04 stsp <var class="Ar">N</var></dt>
358 8797b228 2019-08-04 stsp <dd>Limit history traversal to a given number of commits.</dd>
359 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#p_2"><code class="Fl" id="p_2">-p</code></a></dt>
360 8797b228 2019-08-04 stsp <dd>Display the patch of modifications made in each commit.</dd>
361 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#r_2"><code class="Fl" id="r_2">-r</code></a>
362 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
363 8797b228 2019-08-04 stsp <dd>Use the repository at the specified path. If not specified, assume the
364 8797b228 2019-08-04 stsp repository is located at or above the current working directory. If
365 8797b228 2019-08-04 stsp this directory is a <code class="Nm">got</code> work tree, use the
366 8797b228 2019-08-04 stsp repository path associated with this work tree.</dd>
367 8797b228 2019-08-04 stsp </dl>
368 8797b228 2019-08-04 stsp </dd>
369 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#diff"><code class="Cm" id="diff">diff</code></a>
370 8797b228 2019-08-04 stsp [<code class="Fl">-C</code> <var class="Ar">number</var>]
371 8797b228 2019-08-04 stsp [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
372 8797b228 2019-08-04 stsp [<code class="Fl">-s</code>] [<var class="Ar">object1</var>
373 8797b228 2019-08-04 stsp <var class="Ar">object2</var> | <var class="Ar">path</var>]</dt>
374 8797b228 2019-08-04 stsp <dd>When invoked within a work tree with less than two arguments, display
375 8797b228 2019-08-04 stsp uncommitted changes in the work tree. If a <var class="Ar">path</var> is
376 8797b228 2019-08-04 stsp specified, only show changes within this path.
377 8797b228 2019-08-04 stsp <p class="Pp">If two arguments are provided, treat each argument as a
378 7fe2a942 2019-08-11 stsp reference, a tag name, or an object ID SHA1 hash, and display
379 7fe2a942 2019-08-11 stsp differences between the corresponding objects. Both objects must be of
380 7fe2a942 2019-08-11 stsp the same type (blobs, trees, or commits). An abbreviated hash argument
381 7fe2a942 2019-08-11 stsp will be expanded to a full SHA1 hash automatically, provided the
382 7fe2a942 2019-08-11 stsp abbreviation is unique.</p>
383 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got diff</code> are as
384 8797b228 2019-08-04 stsp follows:</p>
385 8797b228 2019-08-04 stsp <dl class="Bl-tag">
386 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#C_2"><code class="Fl" id="C_2">-C</code></a>
387 8797b228 2019-08-04 stsp <var class="Ar">number</var></dt>
388 8797b228 2019-08-04 stsp <dd>Set the number of context lines shown in the diff. By default, 3 lines
389 8797b228 2019-08-04 stsp of context are shown.</dd>
390 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#r_3"><code class="Fl" id="r_3">-r</code></a>
391 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
392 8797b228 2019-08-04 stsp <dd>Use the repository at the specified path. If not specified, assume the
393 8797b228 2019-08-04 stsp repository is located at or above the current working directory. If
394 8797b228 2019-08-04 stsp this directory is a <code class="Nm">got</code> work tree, use the
395 8797b228 2019-08-04 stsp repository path associated with this work tree.</dd>
396 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#s"><code class="Fl" id="s">-s</code></a></dt>
397 8797b228 2019-08-04 stsp <dd>Show changes staged with <code class="Cm">got stage</code> instead of
398 8797b228 2019-08-04 stsp showing local changes. This option is only valid when
399 8797b228 2019-08-04 stsp <code class="Cm">got diff</code> is invoked in a work tree.</dd>
400 8797b228 2019-08-04 stsp </dl>
401 8797b228 2019-08-04 stsp </dd>
402 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#di"><code class="Cm" id="di">di</code></a></dt>
403 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">diff</code>.</dd>
404 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#blame"><code class="Cm" id="blame">blame</code></a>
405 8797b228 2019-08-04 stsp [<code class="Fl">-c</code> <var class="Ar">commit</var>]
406 8797b228 2019-08-04 stsp [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
407 8797b228 2019-08-04 stsp <var class="Ar">path</var></dt>
408 8797b228 2019-08-04 stsp <dd>Display line-by-line history of a file at the specified path.
409 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got blame</code> are as
410 8797b228 2019-08-04 stsp follows:</p>
411 8797b228 2019-08-04 stsp <dl class="Bl-tag">
412 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#c_4"><code class="Fl" id="c_4">-c</code></a>
413 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
414 8797b228 2019-08-04 stsp <dd>Start traversing history at the specified
415 8797b228 2019-08-04 stsp <var class="Ar">commit</var>. The expected argument is a commit ID
416 97e00196 2019-08-09 stsp SHA1 hash or an existing reference or tag name which will be resolved
417 97e00196 2019-08-09 stsp to a commit ID. An abbreviated hash argument will be expanded to a
418 97e00196 2019-08-09 stsp full SHA1 hash automatically, provided the abbreviation is
419 97e00196 2019-08-09 stsp unique.</dd>
420 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#r_4"><code class="Fl" id="r_4">-r</code></a>
421 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
422 8797b228 2019-08-04 stsp <dd>Use the repository at the specified path. If not specified, assume the
423 8797b228 2019-08-04 stsp repository is located at or above the current working directory. If
424 8797b228 2019-08-04 stsp this directory is a <code class="Nm">got</code> work tree, use the
425 8797b228 2019-08-04 stsp repository path associated with this work tree.</dd>
426 8797b228 2019-08-04 stsp </dl>
427 8797b228 2019-08-04 stsp </dd>
428 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#bl"><code class="Cm" id="bl">bl</code></a></dt>
429 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">blame</code>.</dd>
430 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#tree"><code class="Cm" id="tree">tree</code></a>
431 8797b228 2019-08-04 stsp [<code class="Fl">-c</code> <var class="Ar">commit</var>]
432 8797b228 2019-08-04 stsp [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
433 27b5d592 2019-08-11 stsp [<code class="Fl">-i</code>] [<code class="Fl">-R</code>]
434 8797b228 2019-08-04 stsp [<var class="Ar">path</var>]</dt>
435 8797b228 2019-08-04 stsp <dd>Display a listing of files and directories at the specified directory path
436 8797b228 2019-08-04 stsp in the repository. Entries shown in this listing may carry one of the
437 8797b228 2019-08-04 stsp following trailing annotations:
438 8797b228 2019-08-04 stsp <table class="Bl-column">
439 e8022e04 2019-08-13 stsp <tr>
440 e8022e04 2019-08-13 stsp <td>@</td>
441 e8022e04 2019-08-13 stsp <td>entry is a symbolic link</td>
442 e8022e04 2019-08-13 stsp </tr>
443 8797b228 2019-08-04 stsp <tr>
444 8797b228 2019-08-04 stsp <td>/</td>
445 8797b228 2019-08-04 stsp <td>entry is a directory</td>
446 8797b228 2019-08-04 stsp </tr>
447 8797b228 2019-08-04 stsp <tr>
448 8797b228 2019-08-04 stsp <td>*</td>
449 8797b228 2019-08-04 stsp <td>entry is an executable file</td>
450 8797b228 2019-08-04 stsp </tr>
451 8797b228 2019-08-04 stsp </table>
452 8797b228 2019-08-04 stsp <p class="Pp">If no <var class="Ar">path</var> is specified, list the
453 8797b228 2019-08-04 stsp repository path corresponding to the current directory of the work tree,
454 8797b228 2019-08-04 stsp or the root directory of the repository if there is no work tree.</p>
455 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got tree</code> are as
456 8797b228 2019-08-04 stsp follows:</p>
457 8797b228 2019-08-04 stsp <dl class="Bl-tag">
458 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#c_5"><code class="Fl" id="c_5">-c</code></a>
459 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
460 8797b228 2019-08-04 stsp <dd>List files and directories as they appear in the specified
461 8797b228 2019-08-04 stsp <var class="Ar">commit</var>. The expected argument is a commit ID
462 97e00196 2019-08-09 stsp SHA1 hash or an existing reference or tag name which will be resolved
463 97e00196 2019-08-09 stsp to a commit ID. An abbreviated hash argument will be expanded to a
464 97e00196 2019-08-09 stsp full SHA1 hash automatically, provided the abbreviation is
465 97e00196 2019-08-09 stsp unique.</dd>
466 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#r_5"><code class="Fl" id="r_5">-r</code></a>
467 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
468 8797b228 2019-08-04 stsp <dd>Use the repository at the specified path. If not specified, assume the
469 8797b228 2019-08-04 stsp repository is located at or above the current working directory. If
470 8797b228 2019-08-04 stsp this directory is a <code class="Nm">got</code> work tree, use the
471 8797b228 2019-08-04 stsp repository path associated with this work tree.</dd>
472 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#i"><code class="Fl" id="i">-i</code></a></dt>
473 8797b228 2019-08-04 stsp <dd>Show object IDs of files (blob objects) and directories (tree
474 8797b228 2019-08-04 stsp objects).</dd>
475 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#R"><code class="Fl" id="R">-R</code></a></dt>
476 8797b228 2019-08-04 stsp <dd>Recurse into sub-directories in the repository.</dd>
477 8797b228 2019-08-04 stsp </dl>
478 8797b228 2019-08-04 stsp </dd>
479 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#tr"><code class="Cm" id="tr">tr</code></a></dt>
480 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">tree</code>.</dd>
481 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#ref"><code class="Cm" id="ref">ref</code></a>
482 8797b228 2019-08-04 stsp [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
483 8797b228 2019-08-04 stsp [<code class="Fl">-l</code>] [<code class="Fl">-d</code>
484 e8022e04 2019-08-13 stsp <var class="Ar">name</var>] [<code class="Fl">-s</code>]
485 e8022e04 2019-08-13 stsp [<var class="Ar">name</var> <var class="Ar">target</var>]</dt>
486 8797b228 2019-08-04 stsp <dd>Manage references in a repository.
487 8797b228 2019-08-04 stsp <p class="Pp">If no options are passed, expect two arguments and attempt to
488 8797b228 2019-08-04 stsp create, or update, the reference with the given
489 8797b228 2019-08-04 stsp <var class="Ar">name</var>, and make it point at the given
490 8797b228 2019-08-04 stsp <var class="Ar">target</var>. The target may be an object ID SHA1 hash
491 8797b228 2019-08-04 stsp or an existing reference which will be resolved to an object ID. An
492 8797b228 2019-08-04 stsp abbreviated hash argument will be expanded to a full SHA1 hash
493 8797b228 2019-08-04 stsp automatically, provided the abbreviation is unique.</p>
494 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got ref</code> are as
495 8797b228 2019-08-04 stsp follows:</p>
496 8797b228 2019-08-04 stsp <dl class="Bl-tag">
497 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#r_6"><code class="Fl" id="r_6">-r</code></a>
498 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
499 8797b228 2019-08-04 stsp <dd>Use the repository at the specified path. If not specified, assume the
500 8797b228 2019-08-04 stsp repository is located at or above the current working directory. If
501 8797b228 2019-08-04 stsp this directory is a <code class="Nm">got</code> work tree, use the
502 8797b228 2019-08-04 stsp repository path associated with this work tree.</dd>
503 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#l_2"><code class="Fl" id="l_2">-l</code></a></dt>
504 8797b228 2019-08-04 stsp <dd>List all existing references in the repository.</dd>
505 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a>
506 8797b228 2019-08-04 stsp <var class="Ar">name</var></dt>
507 8797b228 2019-08-04 stsp <dd>Delete the reference with the specified name from the repository.</dd>
508 e8022e04 2019-08-13 stsp <dt><a class="permalink" href="#s_2"><code class="Fl" id="s_2">-s</code></a></dt>
509 e8022e04 2019-08-13 stsp <dd>Create a symbolic reference pointing at the specified
510 e8022e04 2019-08-13 stsp <var class="Ar">target</var>, which must be an existing reference.
511 e8022e04 2019-08-13 stsp Care should be taken not to create loops between references when this
512 e8022e04 2019-08-13 stsp option is used.</dd>
513 8797b228 2019-08-04 stsp </dl>
514 8797b228 2019-08-04 stsp </dd>
515 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#branch"><code class="Cm" id="branch">branch</code></a>
516 8797b228 2019-08-04 stsp [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
517 8797b228 2019-08-04 stsp [<code class="Fl">-l</code>] [<code class="Fl">-d</code>
518 8797b228 2019-08-04 stsp <var class="Ar">name</var>] [<var class="Ar">name</var>
519 8797b228 2019-08-04 stsp [<var class="Ar">base-branch</var>]]</dt>
520 8797b228 2019-08-04 stsp <dd>Manage branches in a repository.
521 8797b228 2019-08-04 stsp <p class="Pp">Branches are managed via references which live in the
522 8797b228 2019-08-04 stsp &#x201C;refs/heads/&#x201D; reference namespace. The
523 8797b228 2019-08-04 stsp <code class="Cm">got branch</code> command operates on references in
524 8797b228 2019-08-04 stsp this namespace only.</p>
525 8797b228 2019-08-04 stsp <p class="Pp">If no options are passed, expect one or two arguments and
526 8797b228 2019-08-04 stsp attempt to create a branch with the given <var class="Ar">name</var>,
527 8797b228 2019-08-04 stsp and make it point at the given <var class="Ar">base-branch</var>. If no
528 8797b228 2019-08-04 stsp <var class="Ar">base-branch</var> is specified, default to the work
529 8797b228 2019-08-04 stsp tree's current branch if invoked in a work tree, or to the repository's
530 8797b228 2019-08-04 stsp HEAD reference.</p>
531 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got branch</code> are as
532 8797b228 2019-08-04 stsp follows:</p>
533 8797b228 2019-08-04 stsp <dl class="Bl-tag">
534 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#r_7"><code class="Fl" id="r_7">-r</code></a>
535 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
536 8797b228 2019-08-04 stsp <dd>Use the repository at the specified path. If not specified, assume the
537 8797b228 2019-08-04 stsp repository is located at or above the current working directory. If
538 8797b228 2019-08-04 stsp this directory is a <code class="Nm">got</code> work tree, use the
539 8797b228 2019-08-04 stsp repository path associated with this work tree.</dd>
540 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#l_3"><code class="Fl" id="l_3">-l</code></a></dt>
541 8797b228 2019-08-04 stsp <dd>List all existing branches in the repository. If invoked in a work
542 8797b228 2019-08-04 stsp tree, the work tree's current branch is shown with one the following
543 8797b228 2019-08-04 stsp annotations:
544 8797b228 2019-08-04 stsp <table class="Bl-column">
545 8797b228 2019-08-04 stsp <tr>
546 8797b228 2019-08-04 stsp <td>*</td>
547 8797b228 2019-08-04 stsp <td>work tree's base commit matches the branch tip</td>
548 8797b228 2019-08-04 stsp </tr>
549 8797b228 2019-08-04 stsp <tr>
550 8797b228 2019-08-04 stsp <td>~</td>
551 8797b228 2019-08-04 stsp <td>work tree's base commit is out-of-date</td>
552 8797b228 2019-08-04 stsp </tr>
553 8797b228 2019-08-04 stsp </table>
554 8797b228 2019-08-04 stsp </dd>
555 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#d_2"><code class="Fl" id="d_2">-d</code></a>
556 8797b228 2019-08-04 stsp <var class="Ar">name</var></dt>
557 8797b228 2019-08-04 stsp <dd>Delete the branch with the specified name from the repository. Only
558 8797b228 2019-08-04 stsp the branch reference is deleted. Any commit, tree, and blob objects
559 8797b228 2019-08-04 stsp belonging to the branch remain in the repository and may be removed
560 8797b228 2019-08-04 stsp separately with Git's garbage collector.</dd>
561 8797b228 2019-08-04 stsp </dl>
562 8797b228 2019-08-04 stsp </dd>
563 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#br"><code class="Cm" id="br">br</code></a></dt>
564 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">branch</code>.</dd>
565 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#add"><code class="Cm" id="add">add</code></a>
566 8797b228 2019-08-04 stsp <var class="Ar">file-path ...</var></dt>
567 8797b228 2019-08-04 stsp <dd>Schedule unversioned files in a work tree for addition to the repository
568 8797b228 2019-08-04 stsp in the next commit.</dd>
569 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#remove"><code class="Cm" id="remove">remove</code></a>
570 8797b228 2019-08-04 stsp <var class="Ar">file-path ...</var></dt>
571 8797b228 2019-08-04 stsp <dd>Remove versioned files from a work tree and schedule them for deletion
572 8797b228 2019-08-04 stsp from the repository in the next commit.
573 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got remove</code> are as
574 8797b228 2019-08-04 stsp follows:</p>
575 8797b228 2019-08-04 stsp <dl class="Bl-tag">
576 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#f_2"><code class="Fl" id="f_2">-f</code></a></dt>
577 8797b228 2019-08-04 stsp <dd>Perform the operation even if a file contains uncommitted
578 8797b228 2019-08-04 stsp modifications.</dd>
579 8797b228 2019-08-04 stsp </dl>
580 8797b228 2019-08-04 stsp </dd>
581 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#rm"><code class="Cm" id="rm">rm</code></a></dt>
582 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">remove</code>.</dd>
583 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#revert"><code class="Cm" id="revert">revert</code></a>
584 7da3b7f6 2019-08-08 stsp [<code class="Fl">-p</code>] [<code class="Fl">-F</code>
585 7da3b7f6 2019-08-08 stsp <var class="Ar">response-script</var>] [<code class="Fl">-R</code>]
586 7da3b7f6 2019-08-08 stsp <var class="Ar">path ...</var></dt>
587 8797b228 2019-08-04 stsp <dd>Revert any uncommited changes in files at the specified paths. File
588 8797b228 2019-08-04 stsp contents will be overwritten with those contained in the work tree's base
589 8797b228 2019-08-04 stsp commit. There is no way to bring discarded changes back after
590 8797b228 2019-08-04 stsp <code class="Cm">got revert</code>!
591 8797b228 2019-08-04 stsp <p class="Pp">If a file was added with <code class="Cm">got add</code> it
592 8797b228 2019-08-04 stsp will become an unversioned file again. If a file was deleted with
593 8797b228 2019-08-04 stsp <code class="Cm">got remove</code> it will be restored.</p>
594 7da3b7f6 2019-08-08 stsp <p class="Pp">The options for <code class="Cm">got revert</code> are as
595 7da3b7f6 2019-08-08 stsp follows:</p>
596 7da3b7f6 2019-08-08 stsp <dl class="Bl-tag">
597 7da3b7f6 2019-08-08 stsp <dt><a class="permalink" href="#p_3"><code class="Fl" id="p_3">-p</code></a></dt>
598 7da3b7f6 2019-08-08 stsp <dd>Instead of reverting all changes in files, interactively select or
599 7da3b7f6 2019-08-08 stsp reject changes to revert based on &#x201C;y&#x201D; (revert change),
600 7da3b7f6 2019-08-08 stsp &#x201C;n&#x201D; (keep change), and &#x201C;q&#x201D; (quit reverting
601 7da3b7f6 2019-08-08 stsp this file) responses. If a file is in modified status, individual
602 7da3b7f6 2019-08-08 stsp patches derived from the modified file content can be reverted. Files
603 7da3b7f6 2019-08-08 stsp in added or deleted status may only be reverted in their
604 7da3b7f6 2019-08-08 stsp entirety.</dd>
605 7da3b7f6 2019-08-08 stsp <dt><a class="permalink" href="#F"><code class="Fl" id="F">-F</code></a>
606 7da3b7f6 2019-08-08 stsp <var class="Ar">response-script</var></dt>
607 7da3b7f6 2019-08-08 stsp <dd>With the <code class="Fl">-p</code> option, read &#x201C;y&#x201D;,
608 7da3b7f6 2019-08-08 stsp &#x201C;n&#x201D;, and &#x201C;q&#x201D; responses line-by-line from
609 7da3b7f6 2019-08-08 stsp the specified <var class="Ar">response-script</var> file instead of
610 7da3b7f6 2019-08-08 stsp prompting interactively.</dd>
611 7da3b7f6 2019-08-08 stsp <dt><a class="permalink" href="#R_2"><code class="Fl" id="R_2">-R</code></a></dt>
612 7da3b7f6 2019-08-08 stsp <dd>Permit recursion into directories. If this option is not specified,
613 7da3b7f6 2019-08-08 stsp <code class="Cm">got revert</code> will refuse to run if a specified
614 7da3b7f6 2019-08-08 stsp <var class="Ar">path</var> is a directory.</dd>
615 7da3b7f6 2019-08-08 stsp </dl>
616 8797b228 2019-08-04 stsp </dd>
617 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#rv"><code class="Cm" id="rv">rv</code></a></dt>
618 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">revert</code>.</dd>
619 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#commit"><code class="Cm" id="commit">commit</code></a>
620 8797b228 2019-08-04 stsp [<code class="Fl">-m</code> <var class="Ar">message</var>]
621 8797b228 2019-08-04 stsp [<var class="Ar">path ...</var>]</dt>
622 8797b228 2019-08-04 stsp <dd>Create a new commit in the repository from changes in a work tree and use
623 8797b228 2019-08-04 stsp this commit as the new base commit for the work tree. If no
624 8797b228 2019-08-04 stsp <var class="Ar">path</var> is specified, commit all changes in the work
625 8797b228 2019-08-04 stsp tree. Otherwise, commit changes at or within the specified paths.
626 8797b228 2019-08-04 stsp <p class="Pp">If changes have been explicitly staged for commit with
627 4967d3c2 2019-08-12 stsp <code class="Cm">got stage</code>, only commit staged changes and reject
628 8797b228 2019-08-04 stsp any specified paths which have not been staged.</p>
629 8797b228 2019-08-04 stsp <p class="Pp">Show the status of each affected file, using the following
630 8797b228 2019-08-04 stsp status codes:</p>
631 8797b228 2019-08-04 stsp <table class="Bl-column">
632 8797b228 2019-08-04 stsp <tr>
633 8797b228 2019-08-04 stsp <td>M</td>
634 8797b228 2019-08-04 stsp <td>modified file</td>
635 8797b228 2019-08-04 stsp </tr>
636 8797b228 2019-08-04 stsp <tr>
637 8797b228 2019-08-04 stsp <td>D</td>
638 8797b228 2019-08-04 stsp <td>file was deleted</td>
639 8797b228 2019-08-04 stsp </tr>
640 8797b228 2019-08-04 stsp <tr>
641 8797b228 2019-08-04 stsp <td>A</td>
642 8797b228 2019-08-04 stsp <td>new file was added</td>
643 8797b228 2019-08-04 stsp </tr>
644 8797b228 2019-08-04 stsp </table>
645 ae520cae 2019-08-05 stsp <p class="Pp">Files which are not part of the new commit will retain their
646 ae520cae 2019-08-05 stsp previously recorded base commit. Some <code class="Nm">got</code>
647 ae520cae 2019-08-05 stsp commands may refuse to run while the work tree contains files from
648 ae520cae 2019-08-05 stsp multiple base commits. The base commit of such a work tree can be made
649 ae520cae 2019-08-05 stsp consistent by running <code class="Cm">got update</code> across the
650 ae520cae 2019-08-05 stsp entire work tree.</p>
651 8797b228 2019-08-04 stsp <p class="Pp">The <code class="Cm">got commit</code> command requires the
652 8797b228 2019-08-04 stsp <code class="Ev">GOT_AUTHOR</code> environment variable to be set.</p>
653 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got commit</code> are as
654 8797b228 2019-08-04 stsp follows:</p>
655 8797b228 2019-08-04 stsp <dl class="Bl-tag">
656 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#m_2"><code class="Fl" id="m_2">-m</code></a>
657 8797b228 2019-08-04 stsp <var class="Ar">message</var></dt>
658 8797b228 2019-08-04 stsp <dd>Use the specified log message when creating the new commit. Without
659 8797b228 2019-08-04 stsp the <code class="Fl">-m</code> option, <code class="Cm">got
660 8797b228 2019-08-04 stsp commit</code> opens a temporary file in an editor where a log message
661 8797b228 2019-08-04 stsp can be written.</dd>
662 8797b228 2019-08-04 stsp </dl>
663 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got commit</code> will refuse to run if
664 8797b228 2019-08-04 stsp certain preconditions are not met. If the work tree's current branch is
665 8797b228 2019-08-04 stsp not in the &#x201C;refs/heads/&#x201D; reference namespace, new commits
666 8797b228 2019-08-04 stsp may not be created on this branch. Local changes may only be committed
667 8797b228 2019-08-04 stsp if they are based on file content found in the most recent commit on the
668 8797b228 2019-08-04 stsp work tree's branch. If a path is found to be out of date,
669 8797b228 2019-08-04 stsp <code class="Cm">got update</code> must be used first in order to merge
670 8797b228 2019-08-04 stsp local changes with changes made in the repository.</p>
671 8797b228 2019-08-04 stsp </dd>
672 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#ci"><code class="Cm" id="ci">ci</code></a></dt>
673 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">commit</code>.</dd>
674 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#cherrypick"><code class="Cm" id="cherrypick">cherrypick</code></a>
675 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
676 8797b228 2019-08-04 stsp <dd>Merge changes from a single <var class="Ar">commit</var> into the work
677 8797b228 2019-08-04 stsp tree. The specified <var class="Ar">commit</var> must be on a different
678 8797b228 2019-08-04 stsp branch than the work tree's base commit. The expected argument is a
679 8797b228 2019-08-04 stsp reference or a commit ID SHA1 hash. An abbreviated hash argument will be
680 8797b228 2019-08-04 stsp expanded to a full SHA1 hash automatically, provided the abbreviation is
681 8797b228 2019-08-04 stsp unique.
682 8797b228 2019-08-04 stsp <p class="Pp">Show the status of each affected file, using the following
683 8797b228 2019-08-04 stsp status codes:</p>
684 8797b228 2019-08-04 stsp <table class="Bl-column">
685 8797b228 2019-08-04 stsp <tr>
686 8797b228 2019-08-04 stsp <td>G</td>
687 8797b228 2019-08-04 stsp <td>file was merged</td>
688 8797b228 2019-08-04 stsp </tr>
689 8797b228 2019-08-04 stsp <tr>
690 8797b228 2019-08-04 stsp <td>C</td>
691 8797b228 2019-08-04 stsp <td>file was merged and conflicts occurred during merge</td>
692 8797b228 2019-08-04 stsp </tr>
693 8797b228 2019-08-04 stsp <tr>
694 8797b228 2019-08-04 stsp <td>!</td>
695 8797b228 2019-08-04 stsp <td>changes destined for a missing file were not merged</td>
696 8797b228 2019-08-04 stsp </tr>
697 8797b228 2019-08-04 stsp <tr>
698 8797b228 2019-08-04 stsp <td>D</td>
699 8797b228 2019-08-04 stsp <td>file was deleted</td>
700 8797b228 2019-08-04 stsp </tr>
701 8797b228 2019-08-04 stsp <tr>
702 8797b228 2019-08-04 stsp <td>d</td>
703 8797b228 2019-08-04 stsp <td>file's deletion was obstructed by local modifications</td>
704 8797b228 2019-08-04 stsp </tr>
705 8797b228 2019-08-04 stsp <tr>
706 8797b228 2019-08-04 stsp <td>A</td>
707 8797b228 2019-08-04 stsp <td>new file was added</td>
708 8797b228 2019-08-04 stsp </tr>
709 8797b228 2019-08-04 stsp <tr>
710 8797b228 2019-08-04 stsp <td>~</td>
711 8797b228 2019-08-04 stsp <td>changes destined for a non-regular file were not merged</td>
712 8797b228 2019-08-04 stsp </tr>
713 8797b228 2019-08-04 stsp </table>
714 8797b228 2019-08-04 stsp <p class="Pp">The merged changes will appear as local changes in the work
715 8797b228 2019-08-04 stsp tree, which may be viewed with <code class="Cm">got diff</code>, amended
716 8797b228 2019-08-04 stsp manually or with further <code class="Cm">got cherrypick</code> comands,
717 8797b228 2019-08-04 stsp committed with <code class="Cm">got commit</code>, or discarded again
718 8797b228 2019-08-04 stsp with <code class="Cm">got revert</code>.</p>
719 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got cherrypick</code> will refuse to run if
720 8797b228 2019-08-04 stsp certain preconditions are not met. If the work tree contains multiple
721 8797b228 2019-08-04 stsp base commits it must first be updated to a single base commit with
722 8797b228 2019-08-04 stsp <code class="Cm">got update</code>. If the work tree already contains
723 8797b228 2019-08-04 stsp files with merge conflicts, these conflicts must be resolved first.</p>
724 8797b228 2019-08-04 stsp </dd>
725 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#cy"><code class="Cm" id="cy">cy</code></a></dt>
726 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">cherrypick</code>.</dd>
727 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#backout"><code class="Cm" id="backout">backout</code></a>
728 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
729 8797b228 2019-08-04 stsp <dd>Reverse-merge changes from a single <var class="Ar">commit</var> into the
730 8797b228 2019-08-04 stsp work tree. The specified <var class="Ar">commit</var> must be on the same
731 8797b228 2019-08-04 stsp branch as the work tree's base commit. The expected argument is a
732 8797b228 2019-08-04 stsp reference or a commit ID SHA1 hash. An abbreviated hash argument will be
733 8797b228 2019-08-04 stsp expanded to a full SHA1 hash automatically, provided the abbreviation is
734 8797b228 2019-08-04 stsp unique.
735 8797b228 2019-08-04 stsp <p class="Pp">Show the status of each affected file, using the following
736 8797b228 2019-08-04 stsp status codes:</p>
737 8797b228 2019-08-04 stsp <table class="Bl-column">
738 8797b228 2019-08-04 stsp <tr>
739 8797b228 2019-08-04 stsp <td>G</td>
740 8797b228 2019-08-04 stsp <td>file was merged</td>
741 8797b228 2019-08-04 stsp </tr>
742 8797b228 2019-08-04 stsp <tr>
743 8797b228 2019-08-04 stsp <td>C</td>
744 8797b228 2019-08-04 stsp <td>file was merged and conflicts occurred during merge</td>
745 8797b228 2019-08-04 stsp </tr>
746 8797b228 2019-08-04 stsp <tr>
747 8797b228 2019-08-04 stsp <td>!</td>
748 8797b228 2019-08-04 stsp <td>changes destined for a missing file were not merged</td>
749 8797b228 2019-08-04 stsp </tr>
750 8797b228 2019-08-04 stsp <tr>
751 8797b228 2019-08-04 stsp <td>D</td>
752 8797b228 2019-08-04 stsp <td>file was deleted</td>
753 8797b228 2019-08-04 stsp </tr>
754 8797b228 2019-08-04 stsp <tr>
755 8797b228 2019-08-04 stsp <td>d</td>
756 8797b228 2019-08-04 stsp <td>file's deletion was obstructed by local modifications</td>
757 8797b228 2019-08-04 stsp </tr>
758 8797b228 2019-08-04 stsp <tr>
759 8797b228 2019-08-04 stsp <td>A</td>
760 8797b228 2019-08-04 stsp <td>new file was added</td>
761 8797b228 2019-08-04 stsp </tr>
762 8797b228 2019-08-04 stsp <tr>
763 8797b228 2019-08-04 stsp <td>~</td>
764 8797b228 2019-08-04 stsp <td>changes destined for a non-regular file were not merged</td>
765 8797b228 2019-08-04 stsp </tr>
766 8797b228 2019-08-04 stsp </table>
767 8797b228 2019-08-04 stsp <p class="Pp">The reverse-merged changes will appear as local changes in the
768 8797b228 2019-08-04 stsp work tree, which may be viewed with <code class="Cm">got diff</code>,
769 8797b228 2019-08-04 stsp amended manually or with further <code class="Cm">got backout</code>
770 8797b228 2019-08-04 stsp comands, committed with <code class="Cm">got commit</code>, or discarded
771 8797b228 2019-08-04 stsp again with <code class="Cm">got revert</code>.</p>
772 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got backout</code> will refuse to run if
773 8797b228 2019-08-04 stsp certain preconditions are not met. If the work tree contains multiple
774 8797b228 2019-08-04 stsp base commits it must first be updated to a single base commit with
775 8797b228 2019-08-04 stsp <code class="Cm">got update</code>. If the work tree already contains
776 8797b228 2019-08-04 stsp files with merge conflicts, these conflicts must be resolved first.</p>
777 8797b228 2019-08-04 stsp </dd>
778 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#bo"><code class="Cm" id="bo">bo</code></a></dt>
779 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">backout</code>.</dd>
780 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#rebase"><code class="Cm" id="rebase">rebase</code></a>
781 27b5d592 2019-08-11 stsp [<code class="Fl">-a</code>] [<code class="Fl">-c</code>]
782 8797b228 2019-08-04 stsp [<var class="Ar">branch</var>]</dt>
783 8797b228 2019-08-04 stsp <dd>Rebase commits on the specified <var class="Ar">branch</var> onto the tip
784 8797b228 2019-08-04 stsp of the current branch of the work tree. The <var class="Ar">branch</var>
785 8797b228 2019-08-04 stsp must share common ancestry with the work tree's current branch. Rebasing
786 8797b228 2019-08-04 stsp begins with the first descendent commit of the youngest common ancestor
787 8797b228 2019-08-04 stsp commit shared by the specified <var class="Ar">branch</var> and the work
788 8797b228 2019-08-04 stsp tree's current branch, and stops once the tip commit of the specified
789 8797b228 2019-08-04 stsp <var class="Ar">branch</var> has been rebased.
790 8797b228 2019-08-04 stsp <p class="Pp">Rebased commits are accumulated on a temporary branch which
791 8797b228 2019-08-04 stsp the work tree will remain switched to throughout the entire rebase
792 8797b228 2019-08-04 stsp operation. Commits on this branch represent the same changes with the
793 8797b228 2019-08-04 stsp same log messages as their counterparts on the original
794 8797b228 2019-08-04 stsp <var class="Ar">branch</var>, but with different commit IDs. Once
795 8797b228 2019-08-04 stsp rebasing has completed successfully, the temporary branch becomes the
796 8797b228 2019-08-04 stsp new version of the specified <var class="Ar">branch</var> and the work
797 8797b228 2019-08-04 stsp tree is automatically switched to it.</p>
798 8797b228 2019-08-04 stsp <p class="Pp">While rebasing commits, show the status of each affected file,
799 8797b228 2019-08-04 stsp using the following status codes:</p>
800 8797b228 2019-08-04 stsp <table class="Bl-column">
801 8797b228 2019-08-04 stsp <tr>
802 8797b228 2019-08-04 stsp <td>G</td>
803 8797b228 2019-08-04 stsp <td>file was merged</td>
804 8797b228 2019-08-04 stsp </tr>
805 8797b228 2019-08-04 stsp <tr>
806 8797b228 2019-08-04 stsp <td>C</td>
807 8797b228 2019-08-04 stsp <td>file was merged and conflicts occurred during merge</td>
808 8797b228 2019-08-04 stsp </tr>
809 8797b228 2019-08-04 stsp <tr>
810 8797b228 2019-08-04 stsp <td>!</td>
811 8797b228 2019-08-04 stsp <td>changes destined for a missing file were not merged</td>
812 8797b228 2019-08-04 stsp </tr>
813 8797b228 2019-08-04 stsp <tr>
814 8797b228 2019-08-04 stsp <td>D</td>
815 8797b228 2019-08-04 stsp <td>file was deleted</td>
816 8797b228 2019-08-04 stsp </tr>
817 8797b228 2019-08-04 stsp <tr>
818 8797b228 2019-08-04 stsp <td>d</td>
819 8797b228 2019-08-04 stsp <td>file's deletion was obstructed by local modifications</td>
820 8797b228 2019-08-04 stsp </tr>
821 8797b228 2019-08-04 stsp <tr>
822 8797b228 2019-08-04 stsp <td>A</td>
823 8797b228 2019-08-04 stsp <td>new file was added</td>
824 8797b228 2019-08-04 stsp </tr>
825 8797b228 2019-08-04 stsp <tr>
826 8797b228 2019-08-04 stsp <td>~</td>
827 8797b228 2019-08-04 stsp <td>changes destined for a non-regular file were not merged</td>
828 8797b228 2019-08-04 stsp </tr>
829 8797b228 2019-08-04 stsp </table>
830 8797b228 2019-08-04 stsp <p class="Pp">If merge conflicts occur the rebase operation is interrupted
831 8797b228 2019-08-04 stsp and may be continued once conflicts have been resolved. Alternatively,
832 8797b228 2019-08-04 stsp the rebase operation may be aborted which will leave
833 8797b228 2019-08-04 stsp <var class="Ar">branch</var> unmodified and the work tree switched back
834 8797b228 2019-08-04 stsp to its original branch.</p>
835 8797b228 2019-08-04 stsp <p class="Pp">If a merge conflict is resolved in a way which renders the
836 8797b228 2019-08-04 stsp merged change into a no-op change, the corresponding commit will be
837 8797b228 2019-08-04 stsp elided when the rebase operation continues.</p>
838 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got rebase</code> will refuse to run if
839 8797b228 2019-08-04 stsp certain preconditions are not met. If the work tree contains multiple
840 8797b228 2019-08-04 stsp base commits it must first be updated to a single base commit with
841 8797b228 2019-08-04 stsp <code class="Cm">got update</code>. If changes have been staged with
842 8797b228 2019-08-04 stsp <code class="Cm">got stage</code>, these changes must first be comitted
843 8797b228 2019-08-04 stsp with <code class="Cm">got commit</code> or unstaged with
844 8797b228 2019-08-04 stsp <code class="Cm">got unstage</code>. If the work tree contains local
845 8797b228 2019-08-04 stsp changes, these changes must first be committed with <code class="Cm">got
846 8797b228 2019-08-04 stsp commit</code> or reverted with <code class="Cm">got revert</code>. If
847 8797b228 2019-08-04 stsp the <var class="Ar">branch</var> contains changes to files outside of
848 8797b228 2019-08-04 stsp the work tree's path prefix, the work tree cannot be used to rebase this
849 8797b228 2019-08-04 stsp branch.</p>
850 8797b228 2019-08-04 stsp <p class="Pp">The <code class="Cm">got update</code> and
851 8797b228 2019-08-04 stsp <code class="Cm">got commit</code> commands will refuse to run while a
852 8797b228 2019-08-04 stsp rebase operation is in progress. Other commands which manipulate the
853 8797b228 2019-08-04 stsp work tree may be used for conflict resolution purposes.</p>
854 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got rebase</code> are as
855 8797b228 2019-08-04 stsp follows:</p>
856 8797b228 2019-08-04 stsp <dl class="Bl-tag">
857 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#a"><code class="Fl" id="a">-a</code></a></dt>
858 8797b228 2019-08-04 stsp <dd>Abort an interrupted rebase operation. If this option is used, no
859 9b0c768d 2019-08-08 stsp other command-line arguments are allowed.</dd>
860 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#c_6"><code class="Fl" id="c_6">-c</code></a></dt>
861 8797b228 2019-08-04 stsp <dd>Continue an interrupted rebase operation. If this option is used, no
862 9b0c768d 2019-08-08 stsp other command-line arguments are allowed.</dd>
863 8797b228 2019-08-04 stsp </dl>
864 8797b228 2019-08-04 stsp </dd>
865 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#rb"><code class="Cm" id="rb">rb</code></a></dt>
866 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">rebase</code>.</dd>
867 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#histedit"><code class="Cm" id="histedit">histedit</code></a>
868 27b5d592 2019-08-11 stsp [<code class="Fl">-a</code>] [<code class="Fl">-c</code>]
869 8797b228 2019-08-04 stsp [<code class="Fl">-F</code> <var class="Ar">histedit-script</var>]</dt>
870 8797b228 2019-08-04 stsp <dd>Edit commit history between the work tree's current base commit and the
871 8797b228 2019-08-04 stsp tip commit of the work tree's current branch.
872 8797b228 2019-08-04 stsp <p class="Pp">Editing of commit history is controlled via a
873 8797b228 2019-08-04 stsp <var class="Ar">histedit script</var> which can be edited interactively
874 8797b228 2019-08-04 stsp or passed on the command line. The format of the histedit script is
875 8797b228 2019-08-04 stsp line-based. Each line in the script begins with a command name, followed
876 8797b228 2019-08-04 stsp by whitespace and an argument. For most commands, the expected argument
877 8797b228 2019-08-04 stsp is a commit ID SHA1 hash. Any remaining text on the line is ignored.
878 8797b228 2019-08-04 stsp Lines which begin with the &#x2018;#&#x2019; character are ignored
879 8797b228 2019-08-04 stsp entirely.</p>
880 8797b228 2019-08-04 stsp <p class="Pp">The available commands are as follows:</p>
881 8797b228 2019-08-04 stsp <table class="Bl-column">
882 8797b228 2019-08-04 stsp <tr>
883 8797b228 2019-08-04 stsp <td>pick <var class="Ar">commit</var></td>
884 8797b228 2019-08-04 stsp <td>Use the specified commit as it is.</td>
885 8797b228 2019-08-04 stsp </tr>
886 8797b228 2019-08-04 stsp <tr>
887 8797b228 2019-08-04 stsp <td>edit <var class="Ar">commit</var></td>
888 8797b228 2019-08-04 stsp <td>Use the specified commit but once changes have been merged into the
889 8797b228 2019-08-04 stsp work tree interrupt the histedit operation for amending.</td>
890 8797b228 2019-08-04 stsp </tr>
891 8797b228 2019-08-04 stsp <tr>
892 8797b228 2019-08-04 stsp <td>fold <var class="Ar">commit</var></td>
893 8797b228 2019-08-04 stsp <td>Combine the specified commit with the next commit listed further
894 8797b228 2019-08-04 stsp below that will be used.</td>
895 8797b228 2019-08-04 stsp </tr>
896 8797b228 2019-08-04 stsp <tr>
897 8797b228 2019-08-04 stsp <td>drop <var class="Ar">commit</var></td>
898 8797b228 2019-08-04 stsp <td>Remove this commit from the edited history.</td>
899 8797b228 2019-08-04 stsp </tr>
900 8797b228 2019-08-04 stsp <tr>
901 8797b228 2019-08-04 stsp <td>mesg <var class="Ar">log-message</var></td>
902 8797b228 2019-08-04 stsp <td>Use the specified single-line log message for the commit on the
903 8797b228 2019-08-04 stsp previous line. If the log message argument is left empty, open an
904 8797b228 2019-08-04 stsp editor where a new log message can be written.</td>
905 8797b228 2019-08-04 stsp </tr>
906 8797b228 2019-08-04 stsp </table>
907 8797b228 2019-08-04 stsp <p class="Pp">Every commit in the history being edited must be mentioned in
908 8797b228 2019-08-04 stsp the script. Lines may be re-ordered to change the order of commits in
909 8797b228 2019-08-04 stsp the edited history.</p>
910 8797b228 2019-08-04 stsp <p class="Pp">Edited commits are accumulated on a temporary branch which the
911 8797b228 2019-08-04 stsp work tree will remain switched to throughout the entire histedit
912 8797b228 2019-08-04 stsp operation. Once history editing has completed successfully, the
913 8797b228 2019-08-04 stsp temporary branch becomes the new version of the work tree's branch and
914 8797b228 2019-08-04 stsp the work tree is automatically switched to it.</p>
915 8797b228 2019-08-04 stsp <p class="Pp">While merging commits, show the status of each affected file,
916 8797b228 2019-08-04 stsp using the following status codes:</p>
917 8797b228 2019-08-04 stsp <table class="Bl-column">
918 8797b228 2019-08-04 stsp <tr>
919 8797b228 2019-08-04 stsp <td>G</td>
920 8797b228 2019-08-04 stsp <td>file was merged</td>
921 8797b228 2019-08-04 stsp </tr>
922 8797b228 2019-08-04 stsp <tr>
923 8797b228 2019-08-04 stsp <td>C</td>
924 8797b228 2019-08-04 stsp <td>file was merged and conflicts occurred during merge</td>
925 8797b228 2019-08-04 stsp </tr>
926 8797b228 2019-08-04 stsp <tr>
927 8797b228 2019-08-04 stsp <td>!</td>
928 8797b228 2019-08-04 stsp <td>changes destined for a missing file were not merged</td>
929 8797b228 2019-08-04 stsp </tr>
930 8797b228 2019-08-04 stsp <tr>
931 8797b228 2019-08-04 stsp <td>D</td>
932 8797b228 2019-08-04 stsp <td>file was deleted</td>
933 8797b228 2019-08-04 stsp </tr>
934 8797b228 2019-08-04 stsp <tr>
935 8797b228 2019-08-04 stsp <td>d</td>
936 8797b228 2019-08-04 stsp <td>file's deletion was obstructed by local modifications</td>
937 8797b228 2019-08-04 stsp </tr>
938 8797b228 2019-08-04 stsp <tr>
939 8797b228 2019-08-04 stsp <td>A</td>
940 8797b228 2019-08-04 stsp <td>new file was added</td>
941 8797b228 2019-08-04 stsp </tr>
942 8797b228 2019-08-04 stsp <tr>
943 8797b228 2019-08-04 stsp <td>~</td>
944 8797b228 2019-08-04 stsp <td>changes destined for a non-regular file were not merged</td>
945 8797b228 2019-08-04 stsp </tr>
946 8797b228 2019-08-04 stsp </table>
947 8797b228 2019-08-04 stsp <p class="Pp">If merge conflicts occur the histedit operation is interrupted
948 8797b228 2019-08-04 stsp and may be continued once conflicts have been resolved. Alternatively,
949 8797b228 2019-08-04 stsp the histedit operation may be aborted which will leave the work tree
950 8797b228 2019-08-04 stsp switched back to its original branch.</p>
951 8797b228 2019-08-04 stsp <p class="Pp">If a merge conflict is resolved in a way which renders the
952 8797b228 2019-08-04 stsp merged change into a no-op change, the corresponding commit will be
953 8797b228 2019-08-04 stsp elided when the histedit operation continues.</p>
954 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got histedit</code> will refuse to run if
955 8797b228 2019-08-04 stsp certain preconditions are not met. If the work tree's current branch is
956 8797b228 2019-08-04 stsp not in the &#x201C;refs/heads/&#x201D; reference namespace, the history
957 8797b228 2019-08-04 stsp of the branch may not be edited. If the work tree contains multiple base
958 8797b228 2019-08-04 stsp commits it must first be updated to a single base commit with
959 8797b228 2019-08-04 stsp <code class="Cm">got update</code>. If changes have been staged with
960 8797b228 2019-08-04 stsp <code class="Cm">got stage</code>, these changes must first be comitted
961 8797b228 2019-08-04 stsp with <code class="Cm">got commit</code> or unstaged with
962 8797b228 2019-08-04 stsp <code class="Cm">got unstage</code>. If the work tree contains local
963 8797b228 2019-08-04 stsp changes, these changes must first be committed with <code class="Cm">got
964 8797b228 2019-08-04 stsp commit</code> or reverted with <code class="Cm">got revert</code>. If
965 8797b228 2019-08-04 stsp the edited history contains changes to files outside of the work tree's
966 8797b228 2019-08-04 stsp path prefix, the work tree cannot be used to edit the history of this
967 8797b228 2019-08-04 stsp branch.</p>
968 8797b228 2019-08-04 stsp <p class="Pp">The <code class="Cm">got update</code> command will refuse to
969 8797b228 2019-08-04 stsp run while a histedit operation is in progress. Other commands which
970 8797b228 2019-08-04 stsp manipulate the work tree may be used, and the <code class="Cm">got
971 8797b228 2019-08-04 stsp commit</code> command may be used to commit arbitrary changes to the
972 8797b228 2019-08-04 stsp temporary branch while the histedit operation is interrupted.</p>
973 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got histedit</code> are as
974 8797b228 2019-08-04 stsp follows:</p>
975 8797b228 2019-08-04 stsp <dl class="Bl-tag">
976 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#a_2"><code class="Fl" id="a_2">-a</code></a></dt>
977 8797b228 2019-08-04 stsp <dd>Abort an interrupted histedit operation. If this option is used, no
978 9b0c768d 2019-08-08 stsp other command-line arguments are allowed.</dd>
979 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#c_7"><code class="Fl" id="c_7">-c</code></a></dt>
980 8797b228 2019-08-04 stsp <dd>Continue an interrupted histedit operation. If this option is used, no
981 9b0c768d 2019-08-08 stsp other command-line arguments are allowed.</dd>
982 8797b228 2019-08-04 stsp </dl>
983 8797b228 2019-08-04 stsp </dd>
984 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#he"><code class="Cm" id="he">he</code></a></dt>
985 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">histedit</code>.</dd>
986 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#stage"><code class="Cm" id="stage">stage</code></a>
987 e0ed36ae 2019-08-07 stsp [<code class="Fl">-l</code>] [<code class="Fl">-p</code>]
988 37b56b1f 2019-08-07 stsp [<code class="Fl">-F</code> <var class="Ar">response-script</var>]
989 37b56b1f 2019-08-07 stsp [<var class="Ar">path ...</var>]</dt>
990 e0ed36ae 2019-08-07 stsp <dd>Stage local changes for inclusion in the next commit. If no
991 e0ed36ae 2019-08-07 stsp <var class="Ar">path</var> is specified, stage all changes in the work
992 e0ed36ae 2019-08-07 stsp tree. Otherwise, stage changes at or within the specified paths. Paths may
993 e0ed36ae 2019-08-07 stsp be staged if they are added, modified, or deleted according to
994 e0ed36ae 2019-08-07 stsp <code class="Cm">got status</code>.
995 00261839 2019-08-05 stsp <p class="Pp">Show the status of each affected file, using the following
996 00261839 2019-08-05 stsp status codes:</p>
997 00261839 2019-08-05 stsp <table class="Bl-column">
998 00261839 2019-08-05 stsp <tr>
999 00261839 2019-08-05 stsp <td>A</td>
1000 00261839 2019-08-05 stsp <td>file addition has been staged</td>
1001 00261839 2019-08-05 stsp </tr>
1002 00261839 2019-08-05 stsp <tr>
1003 00261839 2019-08-05 stsp <td>M</td>
1004 00261839 2019-08-05 stsp <td>file modification has been staged</td>
1005 00261839 2019-08-05 stsp </tr>
1006 00261839 2019-08-05 stsp <tr>
1007 00261839 2019-08-05 stsp <td>D</td>
1008 00261839 2019-08-05 stsp <td>file deletion has been staged</td>
1009 00261839 2019-08-05 stsp </tr>
1010 00261839 2019-08-05 stsp </table>
1011 00261839 2019-08-05 stsp <p class="Pp">Staged file contents are saved in newly created blob objects
1012 00261839 2019-08-05 stsp in the repository. These blobs will be referred to by tree objects once
1013 00261839 2019-08-05 stsp staged changes have been committed.</p>
1014 8797b228 2019-08-04 stsp <p class="Pp">Staged changes affect the behaviour of <code class="Cm">got
1015 8797b228 2019-08-04 stsp commit</code>, <code class="Cm">got status</code>, and
1016 8797b228 2019-08-04 stsp <code class="Cm">got diff</code>. While paths with staged changes exist,
1017 8797b228 2019-08-04 stsp the <code class="Cm">got commit</code> command will refuse to commit any
1018 8797b228 2019-08-04 stsp paths which do not have staged changes. Local changes created on top of
1019 8797b228 2019-08-04 stsp staged changes can only be committed if the path is staged again, or if
1020 8797b228 2019-08-04 stsp the staged changes are committed first. The <code class="Cm">got
1021 8797b228 2019-08-04 stsp status</code> command will show both local changes and staged changes.
1022 8797b228 2019-08-04 stsp The <code class="Cm">got diff</code> command is able to display local
1023 8797b228 2019-08-04 stsp changes relative to staged changes, and to display staged changes
1024 8797b228 2019-08-04 stsp relative to the repository. The <code class="Cm">got revert</code>
1025 8797b228 2019-08-04 stsp command cannot revert staged changes but may be used to revert local
1026 fc62dacd 2019-08-08 stsp changes created on top of staged changes.</p>
1027 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got stage</code> are as
1028 8797b228 2019-08-04 stsp follows:</p>
1029 8797b228 2019-08-04 stsp <dl class="Bl-tag">
1030 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#l_4"><code class="Fl" id="l_4">-l</code></a></dt>
1031 8797b228 2019-08-04 stsp <dd>Instead of staging new changes, list paths which are already staged,
1032 00261839 2019-08-05 stsp along with the IDs of staged blob objects and stage status codes. If
1033 00261839 2019-08-05 stsp paths were provided in the command line show the staged paths among
1034 00261839 2019-08-05 stsp the specified paths. Otherwise, show all staged paths.</dd>
1035 7da3b7f6 2019-08-08 stsp <dt><a class="permalink" href="#p_4"><code class="Fl" id="p_4">-p</code></a></dt>
1036 e0ed36ae 2019-08-07 stsp <dd>Instead of staging the entire content of a changed file, interactively
1037 fc62dacd 2019-08-08 stsp select or reject changes for staging based on &#x201C;y&#x201D; (stage
1038 fc62dacd 2019-08-08 stsp change), &#x201C;n&#x201D; (reject change), and &#x201C;q&#x201D;
1039 fc62dacd 2019-08-08 stsp (quit staging this file) responses. If a file is in modified status,
1040 fc62dacd 2019-08-08 stsp individual patches derived from the modified file content can be
1041 fc62dacd 2019-08-08 stsp staged. Files in added or deleted status may only be staged or
1042 fc62dacd 2019-08-08 stsp rejected in their entirety.</dd>
1043 7da3b7f6 2019-08-08 stsp <dt><a class="permalink" href="#F_2"><code class="Fl" id="F_2">-F</code></a>
1044 37b56b1f 2019-08-07 stsp <var class="Ar">response-script</var></dt>
1045 37b56b1f 2019-08-07 stsp <dd>With the <code class="Fl">-p</code> option, read &#x201C;y&#x201D;,
1046 cdd51db2 2019-08-07 stsp &#x201C;n&#x201D;, and &#x201C;q&#x201D; responses line-by-line from
1047 cdd51db2 2019-08-07 stsp the specified <var class="Ar">response-script</var> file instead of
1048 cdd51db2 2019-08-07 stsp prompting interactively.</dd>
1049 8797b228 2019-08-04 stsp </dl>
1050 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got stage</code> will refuse to run if
1051 8797b228 2019-08-04 stsp certain preconditions are not met. If a file contains merge conflicts,
1052 8797b228 2019-08-04 stsp these conflicts must be resolved first. If a file is found to be out of
1053 8797b228 2019-08-04 stsp date relative to the head commit on the work tree's current branch, the
1054 8797b228 2019-08-04 stsp file must be updated with <code class="Cm">got update</code> before it
1055 8797b228 2019-08-04 stsp can be staged (however, this does not prevent the file from becoming
1056 8797b228 2019-08-04 stsp out-of-date at some point after having been staged).</p>
1057 8797b228 2019-08-04 stsp <p class="Pp">The <code class="Cm">got update</code>, <code class="Cm">got
1058 8797b228 2019-08-04 stsp rebase</code>, and <code class="Cm">got histedit</code> commands will
1059 8797b228 2019-08-04 stsp refuse to run while staged changes exist. If staged changes cannot be
1060 8797b228 2019-08-04 stsp committed because a staged path is out of date, the path must be
1061 8797b228 2019-08-04 stsp unstaged with <code class="Cm">got unstage</code> before it can be
1062 8797b228 2019-08-04 stsp updated with <code class="Cm">got update</code>, and may then be staged
1063 8797b228 2019-08-04 stsp again if necessary.</p>
1064 8797b228 2019-08-04 stsp </dd>
1065 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#sg"><code class="Cm" id="sg">sg</code></a></dt>
1066 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">stage</code>.</dd>
1067 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#unstage"><code class="Cm" id="unstage">unstage</code></a>
1068 fc62dacd 2019-08-08 stsp [<code class="Fl">-p</code>] [<code class="Fl">-F</code>
1069 fc62dacd 2019-08-08 stsp <var class="Ar">response-script</var>] [<var class="Ar">path ...</var>]</dt>
1070 8797b228 2019-08-04 stsp <dd>Merge staged changes back into the work tree and put affected paths back
1071 8797b228 2019-08-04 stsp into non-staged status. If no <var class="Ar">path</var> is specified,
1072 e0ed36ae 2019-08-07 stsp unstage all staged changes across the entire work tree. Otherwise, unstage
1073 e0ed36ae 2019-08-07 stsp changes at or within the specified paths.
1074 8797b228 2019-08-04 stsp <p class="Pp">Show the status of each affected file, using the following
1075 8797b228 2019-08-04 stsp status codes:</p>
1076 8797b228 2019-08-04 stsp <table class="Bl-column">
1077 8797b228 2019-08-04 stsp <tr>
1078 8797b228 2019-08-04 stsp <td>G</td>
1079 8797b228 2019-08-04 stsp <td>file was unstaged</td>
1080 8797b228 2019-08-04 stsp </tr>
1081 8797b228 2019-08-04 stsp <tr>
1082 8797b228 2019-08-04 stsp <td>C</td>
1083 8797b228 2019-08-04 stsp <td>file was unstaged and conflicts occurred during merge</td>
1084 8797b228 2019-08-04 stsp </tr>
1085 8797b228 2019-08-04 stsp <tr>
1086 8797b228 2019-08-04 stsp <td>!</td>
1087 8797b228 2019-08-04 stsp <td>changes destined for a missing file were not merged</td>
1088 8797b228 2019-08-04 stsp </tr>
1089 8797b228 2019-08-04 stsp <tr>
1090 8797b228 2019-08-04 stsp <td>D</td>
1091 8797b228 2019-08-04 stsp <td>file was staged as deleted and still is deleted</td>
1092 8797b228 2019-08-04 stsp </tr>
1093 8797b228 2019-08-04 stsp <tr>
1094 8797b228 2019-08-04 stsp <td>d</td>
1095 8797b228 2019-08-04 stsp <td>file's deletion was obstructed by local modifications</td>
1096 8797b228 2019-08-04 stsp </tr>
1097 8797b228 2019-08-04 stsp <tr>
1098 8797b228 2019-08-04 stsp <td>~</td>
1099 8797b228 2019-08-04 stsp <td>changes destined for a non-regular file were not merged</td>
1100 8797b228 2019-08-04 stsp </tr>
1101 8797b228 2019-08-04 stsp </table>
1102 fc62dacd 2019-08-08 stsp <p class="Pp">The options for <code class="Cm">got unstage</code> are as
1103 fc62dacd 2019-08-08 stsp follows:</p>
1104 fc62dacd 2019-08-08 stsp <dl class="Bl-tag">
1105 7da3b7f6 2019-08-08 stsp <dt><a class="permalink" href="#p_5"><code class="Fl" id="p_5">-p</code></a></dt>
1106 fc62dacd 2019-08-08 stsp <dd>Instead of unstaging the entire content of a changed file,
1107 fc62dacd 2019-08-08 stsp interactively select or reject changes for unstaging based on
1108 fc62dacd 2019-08-08 stsp &#x201C;y&#x201D; (unstage change), &#x201C;n&#x201D; (keep change
1109 fc62dacd 2019-08-08 stsp staged), and &#x201C;q&#x201D; (quit unstaging this file) responses.
1110 fc62dacd 2019-08-08 stsp If a file is staged in modified status, individual patches derived
1111 fc62dacd 2019-08-08 stsp from the staged file content can be unstaged. Files staged in added or
1112 fc62dacd 2019-08-08 stsp deleted status may only be unstaged in their entirety.</dd>
1113 7da3b7f6 2019-08-08 stsp <dt><a class="permalink" href="#F_3"><code class="Fl" id="F_3">-F</code></a>
1114 fc62dacd 2019-08-08 stsp <var class="Ar">response-script</var></dt>
1115 fc62dacd 2019-08-08 stsp <dd>With the <code class="Fl">-p</code> option, read &#x201C;y&#x201D;,
1116 fc62dacd 2019-08-08 stsp &#x201C;n&#x201D;, and &#x201C;q&#x201D; responses line-by-line from
1117 fc62dacd 2019-08-08 stsp the specified <var class="Ar">response-script</var> file instead of
1118 fc62dacd 2019-08-08 stsp prompting interactively.</dd>
1119 fc62dacd 2019-08-08 stsp </dl>
1120 8797b228 2019-08-04 stsp </dd>
1121 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#ug"><code class="Cm" id="ug">ug</code></a></dt>
1122 8797b228 2019-08-04 stsp <dd>Short alias for <code class="Cm">unstage</code>.</dd>
1123 8797b228 2019-08-04 stsp </dl>
1124 8797b228 2019-08-04 stsp </section>
1125 8797b228 2019-08-04 stsp <section class="Sh">
1126 8797b228 2019-08-04 stsp <h1 class="Sh" id="ENVIRONMENT"><a class="permalink" href="#ENVIRONMENT">ENVIRONMENT</a></h1>
1127 8797b228 2019-08-04 stsp <dl class="Bl-tag">
1128 8797b228 2019-08-04 stsp <dt><a class="permalink" href="#GOT_AUTHOR"><code class="Ev" id="GOT_AUTHOR">GOT_AUTHOR</code></a></dt>
1129 8797b228 2019-08-04 stsp <dd>The author's name and email address for <code class="Cm">got commit</code>
1130 847d5fba 2019-08-06 stsp and <code class="Cm">got import</code>, for example: <span class="An">Flan
1131 847d5fba 2019-08-06 stsp Hacker</span>
1132 814569f4 2019-08-08 stsp &lt;<a class="Mt" href="mailto:flan_hacker@openbsd.org">flan_hacker@openbsd.org</a>&gt;.
1133 97e00196 2019-08-09 stsp Because <a class="Xr">git(1)</a> may fail to parse commits without an
1134 97e00196 2019-08-09 stsp email address in author data, <code class="Nm">got</code> attempts to
1135 97e00196 2019-08-09 stsp reject <code class="Ev">GOT_AUTHOR</code> environment variables with a
1136 97e00196 2019-08-09 stsp missing email address.</dd>
1137 4967d3c2 2019-08-12 stsp <dt><a class="permalink" href="#VISUAL"><code class="Ev" id="VISUAL">VISUAL</code></a>,
1138 8797b228 2019-08-04 stsp <code class="Ev">EDITOR</code></dt>
1139 8797b228 2019-08-04 stsp <dd>The editor spawned by <code class="Cm">got commit</code>.</dd>
1140 8797b228 2019-08-04 stsp </dl>
1141 8797b228 2019-08-04 stsp </section>
1142 8797b228 2019-08-04 stsp <section class="Sh">
1143 8797b228 2019-08-04 stsp <h1 class="Sh" id="EXIT_STATUS"><a class="permalink" href="#EXIT_STATUS">EXIT
1144 8797b228 2019-08-04 stsp STATUS</a></h1>
1145 8797b228 2019-08-04 stsp The <code class="Nm">got</code> utility exits&#x00A0;0 on success,
1146 8797b228 2019-08-04 stsp and&#x00A0;&gt;0 if an error occurs.
1147 8797b228 2019-08-04 stsp </section>
1148 8797b228 2019-08-04 stsp <section class="Sh">
1149 8797b228 2019-08-04 stsp <h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
1150 8797b228 2019-08-04 stsp Clone an existing Git repository for use with <code class="Nm">got</code>. This
1151 8797b228 2019-08-04 stsp step currently requires <a class="Xr">git(1)</a>:
1152 8797b228 2019-08-04 stsp <p class="Pp"></p>
1153 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/</code></div>
1154 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ git clone --bare
1155 8797b228 2019-08-04 stsp https://github.com/openbsd/src.git</code></div>
1156 8797b228 2019-08-04 stsp <p class="Pp">Alternatively, for quick and dirty local testing of
1157 8797b228 2019-08-04 stsp <code class="Nm">got</code> a new Git repository could be created and
1158 8797b228 2019-08-04 stsp populated with files, e.g. from a temporary CVS checkout located at
1159 8797b228 2019-08-04 stsp <span class="Pa">/tmp/src</span>:</p>
1160 8797b228 2019-08-04 stsp <p class="Pp"></p>
1161 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got init
1162 8797b228 2019-08-04 stsp /var/git/src.git</code></div>
1163 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got import -r /var/git/src.git -I
1164 8797b228 2019-08-04 stsp CVS -I obj /tmp/src</code></div>
1165 8797b228 2019-08-04 stsp <p class="Pp">Check out a work tree from the Git repository to /usr/src:</p>
1166 8797b228 2019-08-04 stsp <p class="Pp"></p>
1167 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got checkout /var/git/src.git
1168 8797b228 2019-08-04 stsp /usr/src</code></div>
1169 8797b228 2019-08-04 stsp <p class="Pp">View local changes in a work tree directory:</p>
1170 8797b228 2019-08-04 stsp <p class="Pp"></p>
1171 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got status</code></div>
1172 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got diff | less</code></div>
1173 7da3b7f6 2019-08-08 stsp <p class="Pp">Interactively revert selected local changes in a work tree
1174 7da3b7f6 2019-08-08 stsp directory:</p>
1175 7da3b7f6 2019-08-08 stsp <p class="Pp"></p>
1176 7da3b7f6 2019-08-08 stsp <div class="Bd Bd-indent"><code class="Li">$ got revert -p
1177 7da3b7f6 2019-08-08 stsp -R&#x00A0;.</code></div>
1178 8797b228 2019-08-04 stsp <p class="Pp">In a work tree or a git repository directory, list all branch
1179 8797b228 2019-08-04 stsp references:</p>
1180 8797b228 2019-08-04 stsp <p class="Pp"></p>
1181 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got branch -l</code></div>
1182 8797b228 2019-08-04 stsp <p class="Pp">In a work tree or a git repository directory, create a new branch
1183 8797b228 2019-08-04 stsp called &#x201C;unified-buffer-cache&#x201D; which is forked off the
1184 8797b228 2019-08-04 stsp &#x201C;master&#x201D; branch:</p>
1185 8797b228 2019-08-04 stsp <p class="Pp"></p>
1186 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got branch unified-buffer-cache
1187 8797b228 2019-08-04 stsp master</code></div>
1188 8797b228 2019-08-04 stsp <p class="Pp">Switch an existing work tree to the branch
1189 8797b228 2019-08-04 stsp &#x201C;unified-buffer-cache&#x201D;. Local changes in the work tree will be
1190 8797b228 2019-08-04 stsp preserved and merged if necessary:</p>
1191 8797b228 2019-08-04 stsp <p class="Pp"></p>
1192 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got update -b
1193 8797b228 2019-08-04 stsp unified-buffer-cache</code></div>
1194 8797b228 2019-08-04 stsp <p class="Pp">Create a new commit from local changes in a work tree directory.
1195 8797b228 2019-08-04 stsp This new commit will become the head commit of the work tree's current
1196 8797b228 2019-08-04 stsp branch:</p>
1197 8797b228 2019-08-04 stsp <p class="Pp"></p>
1198 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got commit</code></div>
1199 8797b228 2019-08-04 stsp <p class="Pp">In a work tree or a git repository directory, view changes
1200 8797b228 2019-08-04 stsp committed in the 3 most recent commits to the work tree's branch, or the
1201 8797b228 2019-08-04 stsp branch resolved via the repository's HEAD reference, respectively:</p>
1202 8797b228 2019-08-04 stsp <p class="Pp"></p>
1203 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got log -p -l 3 -f</code></div>
1204 8797b228 2019-08-04 stsp <p class="Pp">Add new files and remove obsolete files in a work tree
1205 8797b228 2019-08-04 stsp directory:</p>
1206 8797b228 2019-08-04 stsp <p class="Pp"></p>
1207 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got add
1208 8797b228 2019-08-04 stsp sys/uvm/uvm_ubc.c</code></div>
1209 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got remove
1210 8797b228 2019-08-04 stsp sys/uvm/uvm_vnode.c</code></div>
1211 8797b228 2019-08-04 stsp <p class="Pp">Create a new commit from local changes in a work tree directory
1212 8797b228 2019-08-04 stsp with a pre-defined log message.</p>
1213 8797b228 2019-08-04 stsp <p class="Pp"></p>
1214 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got commit -m 'unify the buffer
1215 8797b228 2019-08-04 stsp cache'</code></div>
1216 8797b228 2019-08-04 stsp <p class="Pp">Update any work tree checked out from the
1217 8797b228 2019-08-04 stsp &#x201C;unified-buffer-cache&#x201D; branch to the latest commit on this
1218 8797b228 2019-08-04 stsp branch:</p>
1219 8797b228 2019-08-04 stsp <p class="Pp"></p>
1220 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got update</code></div>
1221 8797b228 2019-08-04 stsp <p class="Pp">Roll file content on the unified-buffer-cache branch back by one
1222 8797b228 2019-08-04 stsp commit, and then fetch the rolled-back change into the work tree as a local
1223 8797b228 2019-08-04 stsp change to be amended and perhaps committed again:</p>
1224 8797b228 2019-08-04 stsp <p class="Pp"></p>
1225 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got backout
1226 8797b228 2019-08-04 stsp unified-buffer-cache</code></div>
1227 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got commit -m 'roll back
1228 8797b228 2019-08-04 stsp previous'</code></div>
1229 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ # now back out the previous backout
1230 8797b228 2019-08-04 stsp :-)</code></div>
1231 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got backout
1232 8797b228 2019-08-04 stsp unified-buffer-cache</code></div>
1233 8797b228 2019-08-04 stsp <p class="Pp">Fetch new upstream commits into the local repository's master
1234 8797b228 2019-08-04 stsp branch. This step currently requires <a class="Xr">git(1)</a>:</p>
1235 8797b228 2019-08-04 stsp <p class="Pp"></p>
1236 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/src.git</code></div>
1237 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ git fetch origin
1238 8797b228 2019-08-04 stsp master:master</code></div>
1239 8797b228 2019-08-04 stsp <p class="Pp">Rebase the &#x201C;unified-buffer-cache&#x201D; branch on top of
1240 8797b228 2019-08-04 stsp the new head commit of the &#x201C;master&#x201D; branch.</p>
1241 8797b228 2019-08-04 stsp <p class="Pp"></p>
1242 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got update -b master</code></div>
1243 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got rebase
1244 8797b228 2019-08-04 stsp unified-buffer-cache</code></div>
1245 8797b228 2019-08-04 stsp <p class="Pp">Create a patch from all changes on the unified-buffer-cache
1246 4967d3c2 2019-08-12 stsp branch. The patch can be mailed out for review and applied to
1247 4967d3c2 2019-08-12 stsp <span class="Ux">OpenBSD</span>'s CVS tree:</p>
1248 8797b228 2019-08-04 stsp <p class="Pp"></p>
1249 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got diff master
1250 8797b228 2019-08-04 stsp unified-buffer-cache &gt; /tmp/ubc.diff</code></div>
1251 8797b228 2019-08-04 stsp <p class="Pp">Edit the entire commit history of the
1252 8797b228 2019-08-04 stsp &#x201C;unified-buffer-cache&#x201D; branch:</p>
1253 8797b228 2019-08-04 stsp <p class="Pp"></p>
1254 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got update -b
1255 8797b228 2019-08-04 stsp unified-buffer-cache</code></div>
1256 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got update -c master</code></div>
1257 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got histedit</code></div>
1258 8797b228 2019-08-04 stsp <p class="Pp">Additional steps are necessary if local changes need to be pushed
1259 8797b228 2019-08-04 stsp back to the remote repository, which currently requires <code class="Cm">git
1260 8797b228 2019-08-04 stsp fetch</code> and <code class="Cm">git push</code>. Before working against
1261 8797b228 2019-08-04 stsp existing branches in a repository cloned with &#x201C;git clone
1262 8797b228 2019-08-04 stsp --bare&#x201D;, a Git &#x201C;refspec&#x201D; must be configured to map all
1263 8797b228 2019-08-04 stsp references in the remote repository into the &#x201C;refs/remotes&#x201D;
1264 8797b228 2019-08-04 stsp namespace of the local repository. This can achieved by setting Git's
1265 8797b228 2019-08-04 stsp <span class="Pa">remote.origin.fetch</span> configuration variable to the
1266 8797b228 2019-08-04 stsp value &#x201C;+refs/heads/*:refs/remotes/origin/*&#x201D; with the
1267 8797b228 2019-08-04 stsp <code class="Cm">git config</code> command:</p>
1268 8797b228 2019-08-04 stsp <p class="Pp"></p>
1269 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
1270 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ git config remote.origin.fetch
1271 8797b228 2019-08-04 stsp '+refs/heads/*:refs/remotes/origin/*'</code></div>
1272 8797b228 2019-08-04 stsp <p class="Pp">Alternatively, the following <span class="Pa">fetch</span>
1273 8797b228 2019-08-04 stsp configuration item can be added manually to the Git repository's
1274 8797b228 2019-08-04 stsp <span class="Pa">config</span> file:</p>
1275 8797b228 2019-08-04 stsp <p class="Pp"></p>
1276 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">[remote origin]</code></div>
1277 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">url = ...</code></div>
1278 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">fetch =
1279 8797b228 2019-08-04 stsp +refs/heads/*:refs/remotes/origin/*</code></div>
1280 8797b228 2019-08-04 stsp <p class="Pp">This configuration leaves the local repository's
1281 8797b228 2019-08-04 stsp &#x201C;refs/heads&#x201D; namespace free for use by local branches checked
1282 8797b228 2019-08-04 stsp out with <code class="Cm">got checkout</code> and, if needed, created with
1283 8797b228 2019-08-04 stsp <code class="Cm">got branch</code>.</p>
1284 8797b228 2019-08-04 stsp <p class="Pp">Branches in the &#x201C;remotes/origin&#x201D; namespace can be
1285 8797b228 2019-08-04 stsp updated with incoming changes from the remote repository with
1286 8797b228 2019-08-04 stsp <code class="Cm">git fetch</code>:</p>
1287 8797b228 2019-08-04 stsp <p class="Pp"></p>
1288 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
1289 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ git fetch</code></div>
1290 8797b228 2019-08-04 stsp <p class="Pp">Before outgoing changes on the local &#x201C;master&#x201D; branch
1291 8797b228 2019-08-04 stsp can be pushed to the remote repository, the local &#x201C;master&#x201D;
1292 8797b228 2019-08-04 stsp branch must be rebased onto the &#x201C;origin/master&#x201D; branch:</p>
1293 8797b228 2019-08-04 stsp <p class="Pp"></p>
1294 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got update -b
1295 8797b228 2019-08-04 stsp origin/master</code></div>
1296 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ got rebase master</code></div>
1297 8797b228 2019-08-04 stsp <p class="Pp">Changes on the local &#x201C;master&#x201D; branch can then be
1298 8797b228 2019-08-04 stsp pushed to the remote repository with <code class="Cm">git push</code>:</p>
1299 8797b228 2019-08-04 stsp <p class="Pp"></p>
1300 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
1301 8797b228 2019-08-04 stsp <div class="Bd Bd-indent"><code class="Li">$ git push origin master</code></div>
1302 8797b228 2019-08-04 stsp </section>
1303 8797b228 2019-08-04 stsp <section class="Sh">
1304 8797b228 2019-08-04 stsp <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
1305 8797b228 2019-08-04 stsp ALSO</a></h1>
1306 8797b228 2019-08-04 stsp <a class="Xr">tog(1)</a>, <a class="Xr">git-repository(5)</a>,
1307 8797b228 2019-08-04 stsp <a class="Xr">got-worktree(5)</a>
1308 8797b228 2019-08-04 stsp </section>
1309 8797b228 2019-08-04 stsp <section class="Sh">
1310 8797b228 2019-08-04 stsp <h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
1311 8797b228 2019-08-04 stsp <span class="An">Stefan Sperling</span>
1312 8797b228 2019-08-04 stsp &lt;<a class="Mt" href="mailto:stsp@openbsd.org">stsp@openbsd.org</a>&gt;
1313 8797b228 2019-08-04 stsp <br/>
1314 8797b228 2019-08-04 stsp <span class="An">Martin Pieuchot</span>
1315 8797b228 2019-08-04 stsp &lt;<a class="Mt" href="mailto:mpi@openbsd.org">mpi@openbsd.org</a>&gt;
1316 8797b228 2019-08-04 stsp <br/>
1317 8797b228 2019-08-04 stsp <span class="An">joshua stein</span>
1318 8797b228 2019-08-04 stsp &lt;<a class="Mt" href="mailto:jcs@openbsd.org">jcs@openbsd.org</a>&gt;
1319 8797b228 2019-08-04 stsp </section>
1320 8797b228 2019-08-04 stsp <section class="Sh">
1321 8797b228 2019-08-04 stsp <h1 class="Sh" id="CAVEATS"><a class="permalink" href="#CAVEATS">CAVEATS</a></h1>
1322 8797b228 2019-08-04 stsp <code class="Nm">got</code> is a work-in-progress and many commands remain to be
1323 8797b228 2019-08-04 stsp implemented. At present, the user has to fall back on <a class="Xr">git(1)</a>
1324 8797b228 2019-08-04 stsp to perform many tasks, in particular tasks related to repository
1325 8797b228 2019-08-04 stsp administration and tasks which require a network connection.
1326 8797b228 2019-08-04 stsp </section>
1327 8797b228 2019-08-04 stsp </div>
1328 8797b228 2019-08-04 stsp <table class="foot">
1329 8797b228 2019-08-04 stsp <tr>
1330 e8022e04 2019-08-13 stsp <td class="foot-date">August 13, 2019</td>
1331 8797b228 2019-08-04 stsp <td class="foot-os">OpenBSD 6.5</td>
1332 8797b228 2019-08-04 stsp </tr>
1333 8797b228 2019-08-04 stsp </table>
1334 8797b228 2019-08-04 stsp </body>
1335 8797b228 2019-08-04 stsp </html>