Blob


1 <!DOCTYPE html>
2 <html>
3 <!-- This is an automatically generated file. Do not edit.
4 Copyright (c) 2017 Martin Pieuchot
5 Copyright (c) 2018, 2019, 2020 Stefan Sperling
7 Permission to use, copy, modify, and distribute this software for any
8 purpose with or without fee is hereby granted, provided that the above
9 copyright notice and this permission notice appear in all copies.
11 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 -->
19 <head>
20 <meta charset="utf-8"/>
21 <style>
22 table.head, table.foot { width: 100%; }
23 td.head-rtitle, td.foot-os { text-align: right; }
24 td.head-vol { text-align: center; }
25 .Nd, .Bf, .Op { display: inline; }
26 .Pa, .Ad { font-style: italic; }
27 .Ms { font-weight: bold; }
28 .Bl-diag > dt { font-weight: bold; }
29 code.Nm, .Fl, .Cm, .Ic, code.In, .Fd, .Fn, .Cd { font-weight: bold;
30 font-family: inherit; }
31 </style>
32 <title>GOT(1)</title>
33 </head>
34 <body>
35 <table class="head">
36 <tr>
37 <td class="head-ltitle">GOT(1)</td>
38 <td class="head-vol">General Commands Manual</td>
39 <td class="head-rtitle">GOT(1)</td>
40 </tr>
41 </table>
42 <div class="manual-text">
43 <section class="Sh">
44 <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
45 <p class="Pp"><code class="Nm">got</code> &#x2014; <span class="Nd">Game of
46 Trees</span></p>
47 </section>
48 <section class="Sh">
49 <h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
50 <table class="Nm">
51 <tr>
52 <td><code class="Nm">got</code></td>
53 <td><var class="Ar">command</var> [<code class="Fl">-h</code>]
54 [<var class="Ar">arg ...</var>]</td>
55 </tr>
56 </table>
57 </section>
58 <section class="Sh">
59 <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
60 <p class="Pp"><code class="Nm">got</code> is a version control system which
61 stores the history of tracked files in a Git repository, as used by the Git
62 version control system. This repository format is described in
63 <a class="Xr">git-repository(5)</a>.</p>
64 <p class="Pp"><code class="Nm">got</code> is a &#x201C;distributed&#x201D;
65 version control system because every copy of a repository is writeable.
66 Modifications made to files can be synchronized between repositories at any
67 time.</p>
68 <p class="Pp" id="work">Files managed by <code class="Nm">got</code> must be
69 checked out from the repository for modification. Checked out files are
70 stored in a <a class="permalink" href="#work"><i class="Em">work
71 tree</i></a> which can be placed at an arbitrary directory in the filesystem
72 hierarchy. The on-disk format of this work tree is described in
73 <a class="Xr">got-worktree(5)</a>.</p>
74 <p class="Pp"><code class="Nm">got</code> provides global and command-specific
75 options. Global options must precede the command name, and are as
76 follows:</p>
77 <dl class="Bl-tag">
78 <dt id="h"><a class="permalink" href="#h"><code class="Fl">-h</code></a></dt>
79 <dd>Display usage information and exit immediately.</dd>
80 <dt id="V,"><a class="permalink" href="#V,"><code class="Fl">-V,</code></a>
81 <code class="Fl">--version</code></dt>
82 <dd>Display program version and exit immediately.</dd>
83 </dl>
84 <p class="Pp">The commands for <code class="Nm">got</code> are as follows:</p>
85 <dl class="Bl-tag">
86 <dt id="init"><a class="permalink" href="#init"><code class="Cm">init</code></a>
87 <var class="Ar">repository-path</var></dt>
88 <dd>Create a new empty repository at the specified
89 <var class="Ar">repository-path</var>.
90 <p class="Pp">After <code class="Cm">got init</code>, the
91 <code class="Cm">got import</code> command must be used to populate the
92 empty repository before <code class="Cm">got checkout</code> can be
93 used.</p>
94 </dd>
95 <dt id="import"><a class="permalink" href="#import"><code class="Cm">import</code></a>
96 [<code class="Fl">-b</code> <var class="Ar">branch</var>]
97 [<code class="Fl">-m</code> <var class="Ar">message</var>]
98 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
99 [<code class="Fl">-I</code> <var class="Ar">pattern</var>]
100 <var class="Ar">directory</var></dt>
101 <dd>Create an initial commit in a repository from the file hierarchy within
102 the specified <var class="Ar">directory</var>. The created commit will not
103 have any parent commits, i.e. it will be a root commit. Also create a new
104 reference which provides a branch name for the newly created commit. Show
105 the path of each imported file to indicate progress.
106 <p class="Pp">The <code class="Cm">got import</code> command requires the
107 <code class="Ev">GOT_AUTHOR</code> environment variable to be set,
108 unless an author has been configured in <a class="Xr">got.conf(5)</a> or
109 Git's <code class="Dv">user.name</code> and
110 <code class="Dv">user.email</code> configuration settings can be
111 obtained from the repository's <span class="Pa">.git/config</span> file
112 or from Git's global <span class="Pa">~/.gitconfig</span> configuration
113 file.</p>
114 <p class="Pp">The options for <code class="Cm">got import</code> are as
115 follows:</p>
116 <dl class="Bl-tag">
117 <dt id="b"><a class="permalink" href="#b"><code class="Fl">-b</code></a>
118 <var class="Ar">branch</var></dt>
119 <dd>Create the specified <var class="Ar">branch</var> instead of creating
120 the default branch &#x201C;main&#x201D;. Use of this option is
121 required if the &#x201C;main&#x201D; branch already exists.</dd>
122 <dt id="m"><a class="permalink" href="#m"><code class="Fl">-m</code></a>
123 <var class="Ar">message</var></dt>
124 <dd>Use the specified log message when creating the new commit. Without
125 the <code class="Fl">-m</code> option, <code class="Cm">got
126 import</code> opens a temporary file in an editor where a log message
127 can be written.</dd>
128 <dt id="r"><a class="permalink" href="#r"><code class="Fl">-r</code></a>
129 <var class="Ar">repository-path</var></dt>
130 <dd>Use the repository at the specified path. If not specified, assume the
131 repository is located at or above the current working directory.</dd>
132 <dt id="I"><a class="permalink" href="#I"><code class="Fl">-I</code></a>
133 <var class="Ar">pattern</var></dt>
134 <dd>Ignore files or directories with a name which matches the specified
135 <var class="Ar">pattern</var>. This option may be specified multiple
136 times to build a list of ignore patterns. The
137 <var class="Ar">pattern</var> follows the globbing rules documented in
138 <a class="Xr">glob(7)</a>.</dd>
139 </dl>
140 </dd>
141 <dt id="im"><a class="permalink" href="#im"><code class="Cm">im</code></a></dt>
142 <dd>Short alias for <code class="Cm">import</code>.</dd>
143 <dt id="clone"><a class="permalink" href="#clone"><code class="Cm">clone</code></a>
144 [<code class="Fl">-a</code>] [<code class="Fl">-b</code>
145 <var class="Ar">branch</var>] [<code class="Fl">-l</code>]
146 [<code class="Fl">-m</code>] [<code class="Fl">-q</code>]
147 [<code class="Fl">-v</code>] [<code class="Fl">-R</code>
148 <var class="Ar">reference</var>] <var class="Ar">repository-URL</var>
149 [<var class="Ar">directory</var>]</dt>
150 <dd>Clone a Git repository at the specified
151 <var class="Ar">repository-URL</var> into the specified
152 <var class="Ar">directory</var>. If no <var class="Ar">directory</var> is
153 specified the directory name will be derived from the name of the cloned
154 repository. <code class="Cm">got clone</code> will refuse to run if the
155 <var class="Ar">directory</var> already exists.
156 <p class="Pp">The <var class="Ar">repository-URL</var> specifies a protocol
157 scheme, a server hostname, an optional port number separated from the
158 hostname by a colon, and a path to the repository on the server:
159 <a class="Lk" href="scheme://hostname:port/path/to/repository">scheme://hostname:port/path/to/repository</a></p>
160 <p class="Pp">The following protocol schemes are supported:</p>
161 <dl class="Bl-tag">
162 <dt>git</dt>
163 <dd>The Git protocol as implemented by the <a class="Xr">git-daemon(1)</a>
164 server. Use of this protocol is discouraged since it supports neither
165 authentication nor encryption.</dd>
166 <dt>git+ssh</dt>
167 <dd>The Git protocol wrapped in an authenticated and encrypted
168 <a class="Xr">ssh(1)</a> tunnel. With this protocol the hostname may
169 contain an embedded username for <a class="Xr">ssh(1)</a> to use:
170 <a class="Mt" href="mailto:user@hostname">user@hostname</a></dd>
171 <dt>ssh</dt>
172 <dd>Short alias for git+ssh.</dd>
173 </dl>
174 <p class="Pp">Objects in the cloned repository are stored in a pack file
175 which is downloaded from the server. This pack file will then be indexed
176 to facilitate access to the objects stored within. If any objects in the
177 pack file are stored in deltified form, all deltas will be fully
178 resolved in order to compute the ID of such objects. This can take some
179 time. More details about the pack file format are documented in
180 <a class="Xr">git-repository(5)</a>.</p>
181 <p class="Pp"><code class="Cm">got clone</code> creates a remote repository
182 entry in the <a class="Xr">got.conf(5)</a> and
183 <span class="Pa">config</span> files of the cloned repository to store
184 the <var class="Ar">repository-url</var> for future use by
185 <code class="Cm">got fetch</code> or <a class="Xr">git-fetch(1)</a>.</p>
186 <p class="Pp">The options for <code class="Cm">got clone</code> are as
187 follows:</p>
188 <dl class="Bl-tag">
189 <dt id="a"><a class="permalink" href="#a"><code class="Fl">-a</code></a></dt>
190 <dd>Fetch all branches from the remote repository's
191 &#x201C;refs/heads/&#x201D; reference namespace. If this option is not
192 specified, a branch resolved via the remote repository's HEAD
193 reference will be fetched. Cannot be used together with the
194 <code class="Fl">-b</code> option.</dd>
195 <dt id="b~2"><a class="permalink" href="#b~2"><code class="Fl">-b</code></a>
196 <var class="Ar">branch</var></dt>
197 <dd>Fetch the specified <var class="Ar">branch</var> from the remote
198 repository's &#x201C;refs/heads/&#x201D; reference namespace. This
199 option may be specified multiple times to build a list of branches to
200 fetch. If the branch corresponding to the remote repository's HEAD
201 reference is not in this list, the cloned repository's HEAD reference
202 will be set to the first branch which was fetched. If this option is
203 not specified, a branch resolved via the remote repository's HEAD
204 reference will be fetched. Cannot be used together with the
205 <code class="Fl">-a</code> option.</dd>
206 <dt id="l"><a class="permalink" href="#l"><code class="Fl">-l</code></a></dt>
207 <dd>List branches and tags available for fetching from the remote
208 repository and exit immediately. Cannot be used together with any of
209 the other options except <code class="Fl">-v</code>.</dd>
210 <dt id="m~2"><a class="permalink" href="#m~2"><code class="Fl">-m</code></a></dt>
211 <dd>Create the cloned repository as a mirror of the original repository.
212 This is useful if the cloned repository will not be used to store
213 locally created commits.
214 <p class="Pp">The repository's <a class="Xr">got.conf(5)</a> and
215 <span class="Pa">config</span> files will be set up with the
216 &#x201C;mirror&#x201D; option enabled, such that
217 <code class="Cm">got fetch</code> or <a class="Xr">git-fetch(1)</a>
218 will write incoming changes directly to branches in the
219 &#x201C;refs/heads/&#x201D; reference namespace, rather than to
220 branches in the &#x201C;refs/remotes/&#x201D; namespace. This avoids
221 the usual requirement of having to run <code class="Cm">got
222 rebase</code> after <code class="Cm">got fetch</code> in order to
223 make incoming changes appear on branches in the
224 &#x201C;refs/heads/&#x201D; namespace. But maintaining custom
225 changes in the cloned repository becomes difficult since such
226 changes will be at risk of being discarded whenever incoming changes
227 are fetched.</p>
228 </dd>
229 <dt id="q"><a class="permalink" href="#q"><code class="Fl">-q</code></a></dt>
230 <dd>Suppress progress reporting output. The same option will be passed to
231 <a class="Xr">ssh(1)</a> if applicable.</dd>
232 <dt id="v"><a class="permalink" href="#v"><code class="Fl">-v</code></a></dt>
233 <dd>Verbose mode. Causes <code class="Cm">got clone</code> to print
234 debugging messages to standard error output. This option will be
235 passed to <a class="Xr">ssh(1)</a> if applicable. Multiple -v options
236 increase the verbosity. The maximum is 3.</dd>
237 <dt id="R"><a class="permalink" href="#R"><code class="Fl">-R</code></a>
238 <var class="Ar">reference</var></dt>
239 <dd>In addition to the branches and tags that will be fetched, fetch an
240 arbitrary <var class="Ar">reference</var> from the remote repository's
241 &#x201C;refs/&#x201D; namespace. This option may be specified multiple
242 times to build a list of additional references to fetch. The specified
243 <var class="Ar">reference</var> may either be a path to a specific
244 reference, or a reference namespace which will cause all references in
245 this namespace to be fetched.
246 <p class="Pp">Each reference will be mapped into the cloned repository's
247 &#x201C;refs/remotes/&#x201D; namespace, unless the
248 <code class="Fl">-m</code> option is used to mirror references
249 directly into the cloned repository's &#x201C;refs/&#x201D;
250 namespace.</p>
251 <p class="Pp"><code class="Cm">got clone</code> will refuse to fetch
252 references from the remote repository's
253 &#x201C;refs/remotes/&#x201D; or &#x201C;refs/got/&#x201D;
254 namespace.</p>
255 </dd>
256 </dl>
257 </dd>
258 <dt id="cl"><a class="permalink" href="#cl"><code class="Cm">cl</code></a></dt>
259 <dd>Short alias for <code class="Cm">clone</code>.</dd>
260 <dt id="fetch"><a class="permalink" href="#fetch"><code class="Cm">fetch</code></a>
261 [<code class="Fl">-a</code>] [<code class="Fl">-b</code>
262 <var class="Ar">branch</var>] [<code class="Fl">-d</code>]
263 [<code class="Fl">-l</code>] [<code class="Fl">-r</code>
264 <var class="Ar">repository-path</var>] [<code class="Fl">-t</code>]
265 [<code class="Fl">-q</code>] [<code class="Fl">-v</code>]
266 [<code class="Fl">-R</code> <var class="Ar">reference</var>]
267 [<var class="Ar">remote-repository</var>]</dt>
268 <dd>Fetch new changes from a remote repository. If no
269 <var class="Ar">remote-repository</var> is specified,
270 &#x201C;origin&#x201D; will be used. The remote repository's URL is
271 obtained from the corresponding entry in <a class="Xr">got.conf(5)</a> or
272 Git's <span class="Pa">config</span> file of the local repository, as
273 created by <code class="Cm">got clone</code>.
274 <p class="Pp">New changes will be stored in a separate pack file downloaded
275 from the server. Optionally, separate pack files stored in the
276 repository can be combined with <a class="Xr">git-repack(1)</a>.</p>
277 <p class="Pp">By default, branch references in the
278 &#x201C;refs/remotes/&#x201D; reference namespace will be updated to
279 point at the newly fetched commits. The <code class="Cm">got
280 rebase</code> command can then be used to make new changes visible on
281 branches in the &#x201C;refs/heads/&#x201D; namespace, merging incoming
282 changes with the changes on those branches as necessary.</p>
283 <p class="Pp">If the repository was created as a mirror with
284 <code class="Cm">got clone -m</code> then all branches in the
285 &#x201C;refs/heads/&#x201D; namespace will be updated directly to match
286 the corresponding branches in the remote repository. If those branches
287 contained local commits, these commits will no longer be reachable via a
288 reference and will therefore be at risk of being discarded by Git's
289 garbage collector. Maintaining custom changes in a mirror repository is
290 therefore discouraged.</p>
291 <p class="Pp">In any case, references in the &#x201C;refs/tags/&#x201D;
292 namespace will always be fetched and mapped directly to local references
293 in the same namespace.</p>
294 <p class="Pp">The options for <code class="Cm">got fetch</code> are as
295 follows:</p>
296 <dl class="Bl-tag">
297 <dt id="a~2"><a class="permalink" href="#a~2"><code class="Fl">-a</code></a></dt>
298 <dd>Fetch all branches from the remote repository's
299 &#x201C;refs/heads/&#x201D; reference namespace. If this option is not
300 specified, a branch resolved via the remote repository's HEAD
301 reference will be fetched. Cannot be used together with the
302 <code class="Fl">-b</code> option.</dd>
303 <dt id="b~3"><a class="permalink" href="#b~3"><code class="Fl">-b</code></a>
304 <var class="Ar">branch</var></dt>
305 <dd>Fetch the specified <var class="Ar">branch</var> from the remote
306 repository's &#x201C;refs/heads/&#x201D; reference namespace. This
307 option may be specified multiple times to build a list of branches to
308 fetch. If this option is not specified, a branch resolved via the
309 remote repository's HEAD reference will be fetched. Cannot be used
310 together with the <code class="Fl">-a</code> option.</dd>
311 <dt id="d"><a class="permalink" href="#d"><code class="Fl">-d</code></a></dt>
312 <dd>Delete branches and tags from the local repository which are no longer
313 present in the remote repository. Only references are deleted. Any
314 commit, tree, tag, and blob objects belonging to deleted branches or
315 tags remain in the repository and may be removed separately with Git's
316 garbage collector.</dd>
317 <dt id="l~2"><a class="permalink" href="#l~2"><code class="Fl">-l</code></a></dt>
318 <dd>List branches and tags available for fetching from the remote
319 repository and exit immediately. Cannot be used together with any of
320 the other options except <code class="Fl">-v</code> and
321 <code class="Fl">-r</code>.</dd>
322 <dt id="t"><a class="permalink" href="#t"><code class="Fl">-t</code></a></dt>
323 <dd>Allow existing references in the &#x201C;refs/tags&#x201D; namespace
324 to be updated if they have changed on the server. If not specified,
325 only new tag references will be created.</dd>
326 <dt id="r~2"><a class="permalink" href="#r~2"><code class="Fl">-r</code></a>
327 <var class="Ar">repository-path</var></dt>
328 <dd>Use the repository at the specified path. If not specified, assume the
329 repository is located at or above the current working directory. If
330 this directory is a <code class="Nm">got</code> work tree, use the
331 repository path associated with this work tree.</dd>
332 <dt id="q~2"><a class="permalink" href="#q~2"><code class="Fl">-q</code></a></dt>
333 <dd>Suppress progress reporting output. The same option will be passed to
334 <a class="Xr">ssh(1)</a> if applicable.</dd>
335 <dt id="v~2"><a class="permalink" href="#v~2"><code class="Fl">-v</code></a></dt>
336 <dd>Verbose mode. Causes <code class="Cm">got fetch</code> to print
337 debugging messages to standard error output. The same option will be
338 passed to <a class="Xr">ssh(1)</a> if applicable. Multiple -v options
339 increase the verbosity. The maximum is 3.</dd>
340 <dt id="R~2"><a class="permalink" href="#R~2"><code class="Fl">-R</code></a>
341 <var class="Ar">reference</var></dt>
342 <dd>In addition to the branches and tags that will be fetched, fetch an
343 arbitrary <var class="Ar">reference</var> from the remote repository's
344 &#x201C;refs/&#x201D; namespace. This option may be specified multiple
345 times to build a list of additional references to fetch. The specified
346 <var class="Ar">reference</var> may either be a path to a specific
347 reference, or a reference namespace which will cause all references in
348 this namespace to be fetched.
349 <p class="Pp">Each reference will be mapped into the local repository's
350 &#x201C;refs/remotes/&#x201D; namespace, unless the local repository
351 was created as a mirror with <code class="Cm">got clone -m</code> in
352 which case references will be mapped directly into the local
353 repository's &#x201C;refs/&#x201D; namespace.</p>
354 <p class="Pp">Once a reference has been fetched, a branch based on it
355 can be created with <code class="Cm">got branch</code> if
356 needed.</p>
357 <p class="Pp"><code class="Cm">got fetch</code> will refuse to fetch
358 references from the remote repository's
359 &#x201C;refs/remotes/&#x201D; or &#x201C;refs/got/&#x201D;
360 namespace.</p>
361 </dd>
362 </dl>
363 </dd>
364 <dt id="fe"><a class="permalink" href="#fe"><code class="Cm">fe</code></a></dt>
365 <dd>Short alias for <code class="Cm">fetch</code>.</dd>
366 <dt id="checkout"><a class="permalink" href="#checkout"><code class="Cm">checkout</code></a>
367 [<code class="Fl">-E</code>] [<code class="Fl">-b</code>
368 <var class="Ar">branch</var>] [<code class="Fl">-c</code>
369 <var class="Ar">commit</var>] [<code class="Fl">-p</code>
370 <var class="Ar">path-prefix</var>] <var class="Ar">repository-path</var>
371 [<var class="Ar">work-tree-path</var>]</dt>
372 <dd>Copy files from a repository into a new work tree. Show the status of each
373 affected file, using the following status codes:
374 <table class="Bl-column">
375 <tr>
376 <td>A</td>
377 <td>new file was added</td>
378 </tr>
379 <tr>
380 <td>E</td>
381 <td>file already exists in work tree's meta-data</td>
382 </tr>
383 </table>
384 <p class="Pp">If the <var class="Ar">work tree path</var> is not specified,
385 either use the last component of <var class="Ar">repository path</var>,
386 or if a <var class="Ar">path prefix</var> was specified use the last
387 component of <var class="Ar">path prefix</var>.</p>
388 <p class="Pp">The options for <code class="Cm">got checkout</code> are as
389 follows:</p>
390 <dl class="Bl-tag">
391 <dt id="E"><a class="permalink" href="#E"><code class="Fl">-E</code></a></dt>
392 <dd>Proceed with the checkout operation even if the directory at
393 <var class="Ar">work-tree-path</var> is not empty. Existing files will
394 be left intact.</dd>
395 <dt id="b~4"><a class="permalink" href="#b~4"><code class="Fl">-b</code></a>
396 <var class="Ar">branch</var></dt>
397 <dd>Check out files from a commit on the specified
398 <var class="Ar">branch</var>. If this option is not specified, a
399 branch resolved via the repository's HEAD reference will be used.</dd>
400 <dt id="c"><a class="permalink" href="#c"><code class="Fl">-c</code></a>
401 <var class="Ar">commit</var></dt>
402 <dd>Check out files from the specified <var class="Ar">commit</var> on the
403 selected branch. The expected argument is a commit ID SHA1 hash or an
404 existing reference or tag name which will be resolved to a commit ID.
405 An abbreviated hash argument will be expanded to a full SHA1 hash
406 automatically, provided the abbreviation is unique. If this option is
407 not specified, the most recent commit on the selected branch will be
408 used.
409 <p class="Pp">If the specified <var class="Ar">commit</var> is not
410 contained in the selected branch, a different branch which contains
411 this commit must be specified with the <code class="Fl">-b</code>
412 option. If no such branch is known a new branch must be created for
413 this commit with <code class="Cm">got branch</code> before
414 <code class="Cm">got checkout</code> can be used. Checking out work
415 trees with an unknown branch is intentionally not supported.</p>
416 </dd>
417 <dt id="p"><a class="permalink" href="#p"><code class="Fl">-p</code></a>
418 <var class="Ar">path-prefix</var></dt>
419 <dd>Restrict the work tree to a subset of the repository's tree hierarchy.
420 Only files beneath the specified <var class="Ar">path-prefix</var>
421 will be checked out.</dd>
422 </dl>
423 </dd>
424 <dt id="co"><a class="permalink" href="#co"><code class="Cm">co</code></a></dt>
425 <dd>Short alias for <code class="Cm">checkout</code>.</dd>
426 <dt id="update"><a class="permalink" href="#update"><code class="Cm">update</code></a>
427 [<code class="Fl">-b</code> <var class="Ar">branch</var>]
428 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
429 [<var class="Ar">path ...</var>]</dt>
430 <dd>Update an existing work tree to a different <var class="Ar">commit</var>.
431 Change existing files in the work tree as necessary to match file contents
432 of this commit. Preserve any local changes in the work tree and merge them
433 with the incoming changes.
434 <p class="Pp">Files which already contain merge conflicts will not be
435 updated to avoid further complications. Such files will be updated when
436 <code class="Cm">got update</code> is run again after merge conflicts
437 have been resolved. If the conflicting changes are no longer needed
438 affected files can be reverted with <code class="Cm">got revert</code>
439 before running <code class="Cm">got update</code> again.</p>
440 <p class="Pp">Show the status of each affected file, using the following
441 status codes:</p>
442 <table class="Bl-column">
443 <tr>
444 <td>U</td>
445 <td>file was updated and contained no local changes</td>
446 </tr>
447 <tr>
448 <td>G</td>
449 <td>file was updated and local changes were merged cleanly</td>
450 </tr>
451 <tr>
452 <td>C</td>
453 <td>file was updated and conflicts occurred during merge</td>
454 </tr>
455 <tr>
456 <td>D</td>
457 <td>file was deleted</td>
458 </tr>
459 <tr>
460 <td>A</td>
461 <td>new file was added</td>
462 </tr>
463 <tr>
464 <td>~</td>
465 <td>versioned file is obstructed by a non-regular file</td>
466 </tr>
467 <tr>
468 <td>!</td>
469 <td>a missing versioned file was restored</td>
470 </tr>
471 <tr>
472 <td>#</td>
473 <td>file was not updated because it contains merge conflicts</td>
474 </tr>
475 <tr>
476 <td>?</td>
477 <td>changes destined for an unversioned file were not merged</td>
478 </tr>
479 </table>
480 <p class="Pp">If no <var class="Ar">path</var> is specified, update the
481 entire work tree. Otherwise, restrict the update operation to files at
482 or within the specified paths. Each path is required to exist in the
483 update operation's target commit. Files in the work tree outside
484 specified paths will remain unchanged and will retain their previously
485 recorded base commit. Some <code class="Nm">got</code> commands may
486 refuse to run while the work tree contains files from multiple base
487 commits. The base commit of such a work tree can be made consistent by
488 running <code class="Cm">got update</code> across the entire work tree.
489 Specifying a <var class="Ar">path</var> is incompatible with the
490 <code class="Fl">-b</code> option.</p>
491 <p class="Pp"><code class="Cm">got update</code> cannot update paths with
492 staged changes. If changes have been staged with <code class="Cm">got
493 stage</code>, these changes must first be committed with
494 <code class="Cm">got commit</code> or unstaged with <code class="Cm">got
495 unstage</code>.</p>
496 <p class="Pp">The options for <code class="Cm">got update</code> are as
497 follows:</p>
498 <dl class="Bl-tag">
499 <dt id="b~5"><a class="permalink" href="#b~5"><code class="Fl">-b</code></a>
500 <var class="Ar">branch</var></dt>
501 <dd>Switch the work tree's branch reference to the specified
502 <var class="Ar">branch</var> before updating the work tree. This
503 option requires that all paths in the work tree are updated.
504 <p class="Pp">As usual, any local changes in the work tree will be
505 preserved. This can be useful when switching to a newly created
506 branch in order to commit existing local changes to this branch.</p>
507 <p class="Pp">Any local changes must be dealt with separately in order
508 to obtain a work tree with pristine file contents corresponding
509 exactly to the specified <var class="Ar">branch</var>. Such changes
510 could first be committed to a different branch with
511 <code class="Cm">got commit</code>, or could be discarded with
512 <code class="Cm">got revert</code>.</p>
513 </dd>
514 <dt id="c~2"><a class="permalink" href="#c~2"><code class="Fl">-c</code></a>
515 <var class="Ar">commit</var></dt>
516 <dd>Update the work tree to the specified <var class="Ar">commit</var>.
517 The expected argument is a commit ID SHA1 hash or an existing
518 reference or tag name which will be resolved to a commit ID. An
519 abbreviated hash argument will be expanded to a full SHA1 hash
520 automatically, provided the abbreviation is unique. If this option is
521 not specified, the most recent commit on the work tree's branch will
522 be used.</dd>
523 </dl>
524 </dd>
525 <dt id="up"><a class="permalink" href="#up"><code class="Cm">up</code></a></dt>
526 <dd>Short alias for <code class="Cm">update</code>.</dd>
527 <dt id="status"><a class="permalink" href="#status"><code class="Cm">status</code></a>
528 [<code class="Fl">-s</code> <var class="Ar">status-codes</var>]
529 [<var class="Ar">path ...</var>]</dt>
530 <dd>Show the current modification status of files in a work tree, using the
531 following status codes:
532 <table class="Bl-column">
533 <tr>
534 <td>M</td>
535 <td>modified file</td>
536 </tr>
537 <tr>
538 <td>A</td>
539 <td>file scheduled for addition in next commit</td>
540 </tr>
541 <tr>
542 <td>D</td>
543 <td>file scheduled for deletion in next commit</td>
544 </tr>
545 <tr>
546 <td>C</td>
547 <td>modified or added file which contains merge conflicts</td>
548 </tr>
549 <tr>
550 <td>!</td>
551 <td>versioned file was expected on disk but is missing</td>
552 </tr>
553 <tr>
554 <td>~</td>
555 <td>versioned file is obstructed by a non-regular file</td>
556 </tr>
557 <tr>
558 <td>?</td>
559 <td>unversioned item not tracked by <code class="Nm">got</code></td>
560 </tr>
561 <tr>
562 <td>m</td>
563 <td>modified file modes (executable bit only)</td>
564 </tr>
565 <tr>
566 <td>N</td>
567 <td>non-existent <var class="Ar">path</var> specified on the command
568 line</td>
569 </tr>
570 </table>
571 <p class="Pp">If no <var class="Ar">path</var> is specified, show
572 modifications in the entire work tree. Otherwise, show modifications at
573 or within the specified paths.</p>
574 <p class="Pp">If changes have been staged with <code class="Cm">got
575 stage</code>, staged changes are shown in the second output column,
576 using the following status codes:</p>
577 <table class="Bl-column">
578 <tr>
579 <td>M</td>
580 <td>file modification is staged</td>
581 </tr>
582 <tr>
583 <td>A</td>
584 <td>file addition is staged</td>
585 </tr>
586 <tr>
587 <td>D</td>
588 <td>file deletion is staged</td>
589 </tr>
590 </table>
591 <p class="Pp">Changes created on top of staged changes are indicated in the
592 first column:</p>
593 <table class="Bl-column">
594 <tr>
595 <td>MM</td>
596 <td>file was modified after earlier changes have been staged</td>
597 </tr>
598 <tr>
599 <td>MA</td>
600 <td>file was modified after having been staged for addition</td>
601 </tr>
602 </table>
603 <p class="Pp">The options for <code class="Cm">got status</code> are as
604 follows:</p>
605 <dl class="Bl-tag">
606 <dt id="s"><a class="permalink" href="#s"><code class="Fl">-s</code></a>
607 <var class="Ar">status-codes</var></dt>
608 <dd>Only show files with a modification status matching any of the
609 single-character status codes contained in the
610 <var class="Ar">status-codes</var> argument. Any combination of codes
611 from the above list of possible status codes may be specified. For
612 staged files, status codes displayed in either column will be
613 matched.</dd>
614 </dl>
615 <p class="Pp">For compatibility with <a class="Xr">cvs(1)</a> and
616 <a class="Xr">git(1)</a>, <code class="Cm">got status</code> reads
617 <a class="Xr">glob(7)</a> patterns from
618 <span class="Pa">.cvsignore</span> and
619 <span class="Pa">.gitignore</span> files in each traversed directory and
620 will not display unversioned files which match these patterns. As an
621 extension to <a class="Xr">glob(7)</a> matching rules,
622 <code class="Cm">got status</code> supports consecutive asterisks,
623 &#x201C;**&#x201D;, which will match an arbitrary amount of directories.
624 Unlike <a class="Xr">cvs(1)</a>, <code class="Cm">got status</code> only
625 supports a single ignore pattern per line. Unlike
626 <a class="Xr">git(1)</a>, <code class="Cm">got status</code> does not
627 support negated ignore patterns prefixed with &#x201C;!&#x201D;, and
628 gives no special significance to the location of path component
629 separators, &#x201C;/&#x201D;, in a pattern.</p>
630 </dd>
631 <dt id="st"><a class="permalink" href="#st"><code class="Cm">st</code></a></dt>
632 <dd>Short alias for <code class="Cm">status</code>.</dd>
633 <dt id="log"><a class="permalink" href="#log"><code class="Cm">log</code></a>
634 [<code class="Fl">-b</code>] [<code class="Fl">-c</code>
635 <var class="Ar">commit</var>] [<code class="Fl">-C</code>
636 <var class="Ar">number</var>] [<code class="Fl">-l</code>
637 <var class="Ar">N</var>] [<code class="Fl">-p</code>]
638 [<code class="Fl">-P</code>] [<code class="Fl">-s</code>
639 <var class="Ar">search-pattern</var>] [<code class="Fl">-r</code>
640 <var class="Ar">repository-path</var>] [<code class="Fl">-R</code>]
641 [<code class="Fl">-x</code> <var class="Ar">commit</var>]
642 [<var class="Ar">path</var>]</dt>
643 <dd>Display history of a repository. If a <var class="Ar">path</var> is
644 specified, show only commits which modified this path. If invoked in a
645 work tree, the <var class="Ar">path</var> is interpreted relative to the
646 current working directory, and the work tree's path prefix is implicitly
647 prepended. Otherwise, the path is interpreted relative to the repository
648 root.
649 <p class="Pp">The options for <code class="Cm">got log</code> are as
650 follows:</p>
651 <dl class="Bl-tag">
652 <dt id="b~6"><a class="permalink" href="#b~6"><code class="Fl">-b</code></a></dt>
653 <dd>Display individual commits which were merged into the current branch
654 from other branches. By default, <code class="Cm">got log</code> shows
655 the linear history of the current branch only.</dd>
656 <dt id="c~3"><a class="permalink" href="#c~3"><code class="Fl">-c</code></a>
657 <var class="Ar">commit</var></dt>
658 <dd>Start traversing history at the specified
659 <var class="Ar">commit</var>. The expected argument is a commit ID
660 SHA1 hash or an existing reference or tag name which will be resolved
661 to a commit ID. An abbreviated hash argument will be expanded to a
662 full SHA1 hash automatically, provided the abbreviation is unique. If
663 this option is not specified, default to the work tree's current
664 branch if invoked in a work tree, or to the repository's HEAD
665 reference.</dd>
666 <dt id="C"><a class="permalink" href="#C"><code class="Fl">-C</code></a>
667 <var class="Ar">number</var></dt>
668 <dd>Set the number of context lines shown in diffs with
669 <code class="Fl">-p</code>. By default, 3 lines of context are
670 shown.</dd>
671 <dt id="l~3"><a class="permalink" href="#l~3"><code class="Fl">-l</code></a>
672 <var class="Ar">N</var></dt>
673 <dd>Limit history traversal to a given number of commits. If this option
674 is not specified, a default limit value of zero is used, which is
675 treated as an unbounded limit. The
676 <code class="Ev">GOT_LOG_DEFAULT_LIMIT</code> environment variable may
677 be set to change this default value.</dd>
678 <dt id="p~2"><a class="permalink" href="#p~2"><code class="Fl">-p</code></a></dt>
679 <dd>Display the patch of modifications made in each commit. If a
680 <var class="Ar">path</var> is specified, only show the patch of
681 modifications at or within this path.</dd>
682 <dt id="P"><a class="permalink" href="#P"><code class="Fl">-P</code></a></dt>
683 <dd>Display the list of file paths changed in each commit, using the
684 following status codes:
685 <table class="Bl-column">
686 <tr>
687 <td>M</td>
688 <td>modified file</td>
689 </tr>
690 <tr>
691 <td>D</td>
692 <td>file was deleted</td>
693 </tr>
694 <tr>
695 <td>A</td>
696 <td>new file was added</td>
697 </tr>
698 <tr>
699 <td>m</td>
700 <td>modified file modes (executable bit only)</td>
701 </tr>
702 </table>
703 </dd>
704 <dt id="s~2"><a class="permalink" href="#s~2"><code class="Fl">-s</code></a>
705 <var class="Ar">search-pattern</var></dt>
706 <dd>If specified, show only commits with a log message matched by the
707 extended regular expression <var class="Ar">search-pattern</var>. When
708 used together with <code class="Fl">-P</code> then the file paths
709 changed by a commit can be matched as well. Regular expression syntax
710 is documented in <a class="Xr">re_format(7)</a>.</dd>
711 <dt id="r~3"><a class="permalink" href="#r~3"><code class="Fl">-r</code></a>
712 <var class="Ar">repository-path</var></dt>
713 <dd>Use the repository at the specified path. If not specified, assume the
714 repository is located at or above the current working directory. If
715 this directory is a <code class="Nm">got</code> work tree, use the
716 repository path associated with this work tree.</dd>
717 <dt id="R~3"><a class="permalink" href="#R~3"><code class="Fl">-R</code></a></dt>
718 <dd>Determine a set of commits to display as usual, but display these
719 commits in reverse order.</dd>
720 <dt id="x"><a class="permalink" href="#x"><code class="Fl">-x</code></a>
721 <var class="Ar">commit</var></dt>
722 <dd>Stop traversing commit history as soon as the specified
723 <var class="Ar">commit</var> has been traversed. This option has no
724 effect if the specified <var class="Ar">commit</var> is never
725 traversed.</dd>
726 </dl>
727 </dd>
728 <dt id="diff"><a class="permalink" href="#diff"><code class="Cm">diff</code></a>
729 [<code class="Fl">-a</code>] [<code class="Fl">-C</code>
730 <var class="Ar">number</var>] [<code class="Fl">-r</code>
731 <var class="Ar">repository-path</var>] [<code class="Fl">-s</code>]
732 [<code class="Fl">-w</code>] [<var class="Ar">object1</var>
733 <var class="Ar">object2</var> | <var class="Ar">path</var>]</dt>
734 <dd>When invoked within a work tree with less than two arguments, display
735 local changes in the work tree. If a <var class="Ar">path</var> is
736 specified, only show changes within this path.
737 <p class="Pp">If two arguments are provided, treat each argument as a
738 reference, a tag name, or an object ID SHA1 hash, and display
739 differences between the corresponding objects. Both objects must be of
740 the same type (blobs, trees, or commits). An abbreviated hash argument
741 will be expanded to a full SHA1 hash automatically, provided the
742 abbreviation is unique.</p>
743 <p class="Pp">The options for <code class="Cm">got diff</code> are as
744 follows:</p>
745 <dl class="Bl-tag">
746 <dt id="a~3"><a class="permalink" href="#a~3"><code class="Fl">-a</code></a></dt>
747 <dd>Treat file contents as ASCII text even if binary data is
748 detected.</dd>
749 <dt id="C~2"><a class="permalink" href="#C~2"><code class="Fl">-C</code></a>
750 <var class="Ar">number</var></dt>
751 <dd>Set the number of context lines shown in the diff. By default, 3 lines
752 of context are shown.</dd>
753 <dt id="r~4"><a class="permalink" href="#r~4"><code class="Fl">-r</code></a>
754 <var class="Ar">repository-path</var></dt>
755 <dd>Use the repository at the specified path. If not specified, assume the
756 repository is located at or above the current working directory. If
757 this directory is a <code class="Nm">got</code> work tree, use the
758 repository path associated with this work tree.</dd>
759 <dt id="s~3"><a class="permalink" href="#s~3"><code class="Fl">-s</code></a></dt>
760 <dd>Show changes staged with <code class="Cm">got stage</code> instead of
761 showing local changes in the work tree. This option is only valid when
762 <code class="Cm">got diff</code> is invoked in a work tree.</dd>
763 <dt id="w"><a class="permalink" href="#w"><code class="Fl">-w</code></a></dt>
764 <dd>Ignore whitespace-only changes.</dd>
765 </dl>
766 </dd>
767 <dt id="di"><a class="permalink" href="#di"><code class="Cm">di</code></a></dt>
768 <dd>Short alias for <code class="Cm">diff</code>.</dd>
769 <dt id="blame"><a class="permalink" href="#blame"><code class="Cm">blame</code></a>
770 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
771 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
772 <var class="Ar">path</var></dt>
773 <dd>Display line-by-line history of a file at the specified path.
774 <p class="Pp">The options for <code class="Cm">got blame</code> are as
775 follows:</p>
776 <dl class="Bl-tag">
777 <dt id="c~4"><a class="permalink" href="#c~4"><code class="Fl">-c</code></a>
778 <var class="Ar">commit</var></dt>
779 <dd>Start traversing history at the specified
780 <var class="Ar">commit</var>. The expected argument is a commit ID
781 SHA1 hash or an existing reference or tag name which will be resolved
782 to a commit ID. An abbreviated hash argument will be expanded to a
783 full SHA1 hash automatically, provided the abbreviation is
784 unique.</dd>
785 <dt id="r~5"><a class="permalink" href="#r~5"><code class="Fl">-r</code></a>
786 <var class="Ar">repository-path</var></dt>
787 <dd>Use the repository at the specified path. If not specified, assume the
788 repository is located at or above the current working directory. If
789 this directory is a <code class="Nm">got</code> work tree, use the
790 repository path associated with this work tree.</dd>
791 </dl>
792 </dd>
793 <dt id="bl"><a class="permalink" href="#bl"><code class="Cm">bl</code></a></dt>
794 <dd>Short alias for <code class="Cm">blame</code>.</dd>
795 <dt id="tree"><a class="permalink" href="#tree"><code class="Cm">tree</code></a>
796 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
797 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
798 [<code class="Fl">-i</code>] [<code class="Fl">-R</code>]
799 [<var class="Ar">path</var>]</dt>
800 <dd>Display a listing of files and directories at the specified directory path
801 in the repository. Entries shown in this listing may carry one of the
802 following trailing annotations:
803 <table class="Bl-column">
804 <tr>
805 <td>@</td>
806 <td>entry is a symbolic link</td>
807 </tr>
808 <tr>
809 <td>/</td>
810 <td>entry is a directory</td>
811 </tr>
812 <tr>
813 <td>*</td>
814 <td>entry is an executable file</td>
815 </tr>
816 <tr>
817 <td>$</td>
818 <td>entry is a Git submodule</td>
819 </tr>
820 </table>
821 <p class="Pp">Symbolic link entries are also annotated with the target path
822 of the link.</p>
823 <p class="Pp">If no <var class="Ar">path</var> is specified, list the
824 repository path corresponding to the current directory of the work tree,
825 or the root directory of the repository if there is no work tree.</p>
826 <p class="Pp">The options for <code class="Cm">got tree</code> are as
827 follows:</p>
828 <dl class="Bl-tag">
829 <dt id="c~5"><a class="permalink" href="#c~5"><code class="Fl">-c</code></a>
830 <var class="Ar">commit</var></dt>
831 <dd>List files and directories as they appear in the specified
832 <var class="Ar">commit</var>. The expected argument is a commit ID
833 SHA1 hash or an existing reference or tag name which will be resolved
834 to a commit ID. An abbreviated hash argument will be expanded to a
835 full SHA1 hash automatically, provided the abbreviation is
836 unique.</dd>
837 <dt id="r~6"><a class="permalink" href="#r~6"><code class="Fl">-r</code></a>
838 <var class="Ar">repository-path</var></dt>
839 <dd>Use the repository at the specified path. If not specified, assume the
840 repository is located at or above the current working directory. If
841 this directory is a <code class="Nm">got</code> work tree, use the
842 repository path associated with this work tree.</dd>
843 <dt id="i"><a class="permalink" href="#i"><code class="Fl">-i</code></a></dt>
844 <dd>Show object IDs of files (blob objects) and directories (tree
845 objects).</dd>
846 <dt id="R~4"><a class="permalink" href="#R~4"><code class="Fl">-R</code></a></dt>
847 <dd>Recurse into sub-directories in the repository.</dd>
848 </dl>
849 </dd>
850 <dt id="tr"><a class="permalink" href="#tr"><code class="Cm">tr</code></a></dt>
851 <dd>Short alias for <code class="Cm">tree</code>.</dd>
852 <dt id="ref"><a class="permalink" href="#ref"><code class="Cm">ref</code></a>
853 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
854 [<code class="Fl">-l</code>] [<code class="Fl">-c</code>
855 <var class="Ar">object</var>] [<code class="Fl">-s</code>
856 <var class="Ar">reference</var>] [<code class="Fl">-d</code>]
857 [<var class="Ar">name</var>]</dt>
858 <dd>Manage references in a repository.
859 <p class="Pp">References may be listed, created, deleted, and changed. When
860 creating, deleting, or changing a reference the specified
861 <var class="Ar">name</var> must be an absolute reference name, i.e. it
862 must begin with &#x201C;refs/&#x201D;.</p>
863 <p class="Pp">The options for <code class="Cm">got ref</code> are as
864 follows:</p>
865 <dl class="Bl-tag">
866 <dt id="r~7"><a class="permalink" href="#r~7"><code class="Fl">-r</code></a>
867 <var class="Ar">repository-path</var></dt>
868 <dd>Use the repository at the specified path. If not specified, assume the
869 repository is located at or above the current working directory. If
870 this directory is a <code class="Nm">got</code> work tree, use the
871 repository path associated with this work tree.</dd>
872 <dt id="l~4"><a class="permalink" href="#l~4"><code class="Fl">-l</code></a></dt>
873 <dd>List references in the repository. If no <var class="Ar">name</var> is
874 specified, list all existing references in the repository. If
875 <var class="Ar">name</var> is a reference namespace, list all
876 references in this namespace. Otherwise, show only the reference with
877 the given <var class="Ar">name</var>. Cannot be used together with any
878 other options except <code class="Fl">-r</code>.</dd>
879 <dt id="c~6"><a class="permalink" href="#c~6"><code class="Fl">-c</code></a>
880 <var class="Ar">object</var></dt>
881 <dd>Create a reference or change an existing reference. The reference with
882 the specified <var class="Ar">name</var> will point at the specified
883 <var class="Ar">object.</var> The expected
884 <var class="Ar">object</var> argument is a ID SHA1 hash or an existing
885 reference or tag name which will be resolved to the ID of a
886 corresponding commit, tree, tag, or blob object. Cannot be used
887 together with any other options except
888 <code class="Fl">-r</code>.</dd>
889 <dt id="s~4"><a class="permalink" href="#s~4"><code class="Fl">-s</code></a>
890 <var class="Ar">reference</var></dt>
891 <dd>Create a symbolic reference, or change an existing symbolic reference.
892 The symbolic reference with the specified <var class="Ar">name</var>
893 will point at the specified <var class="Ar">reference</var> which must
894 already exist in the repository. Care should be taken not to create
895 loops between references when this option is used. Cannot be used
896 together with any other options except
897 <code class="Fl">-r</code>.</dd>
898 <dt id="d~2"><a class="permalink" href="#d~2"><code class="Fl">-d</code></a></dt>
899 <dd>Delete the reference with the specified <var class="Ar">name</var>
900 from the repository. Cannot be used together with any other options
901 except <code class="Fl">-r</code>.</dd>
902 </dl>
903 </dd>
904 <dt id="branch"><a class="permalink" href="#branch"><code class="Cm">branch</code></a>
905 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
906 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
907 [<code class="Fl">-l</code>] [<code class="Fl">-d</code>
908 <var class="Ar">name</var>] [<code class="Fl">-n</code>]
909 [<var class="Ar">name</var>]</dt>
910 <dd>Create, list, or delete branches.
911 <p class="Pp">Branches are managed via references which live in the
912 &#x201C;refs/heads/&#x201D; reference namespace. The
913 <code class="Cm">got branch</code> command operates on references in
914 this namespace only.</p>
915 <p class="Pp">If invoked in a work tree without any arguments, print the
916 name of the work tree's current branch.</p>
917 <p class="Pp">If a <var class="Ar">name</var> argument is passed, attempt to
918 create a branch reference with the given name. By default the new branch
919 reference will point at the latest commit on the work tree's current
920 branch if invoked in a work tree, and otherwise to a commit resolved via
921 the repository's HEAD reference.</p>
922 <p class="Pp">If invoked in a work tree, once the branch was created
923 successfully switch the work tree's head reference to the newly created
924 branch and update files across the entire work tree, just like
925 <code class="Cm">got update -b</code> <var class="Ar">name</var> would
926 do. Show the status of each affected file, using the following status
927 codes:</p>
928 <table class="Bl-column">
929 <tr>
930 <td>U</td>
931 <td>file was updated and contained no local changes</td>
932 </tr>
933 <tr>
934 <td>G</td>
935 <td>file was updated and local changes were merged cleanly</td>
936 </tr>
937 <tr>
938 <td>C</td>
939 <td>file was updated and conflicts occurred during merge</td>
940 </tr>
941 <tr>
942 <td>D</td>
943 <td>file was deleted</td>
944 </tr>
945 <tr>
946 <td>A</td>
947 <td>new file was added</td>
948 </tr>
949 <tr>
950 <td>~</td>
951 <td>versioned file is obstructed by a non-regular file</td>
952 </tr>
953 <tr>
954 <td>!</td>
955 <td>a missing versioned file was restored</td>
956 </tr>
957 </table>
958 <p class="Pp">The options for <code class="Cm">got branch</code> are as
959 follows:</p>
960 <dl class="Bl-tag">
961 <dt id="c~7"><a class="permalink" href="#c~7"><code class="Fl">-c</code></a>
962 <var class="Ar">commit</var></dt>
963 <dd>Make a newly created branch reference point at the specified
964 <var class="Ar">commit</var>. The expected
965 <var class="Ar">commit</var> argument is a commit ID SHA1 hash or an
966 existing reference or tag name which will be resolved to a commit
967 ID.</dd>
968 <dt id="r~8"><a class="permalink" href="#r~8"><code class="Fl">-r</code></a>
969 <var class="Ar">repository-path</var></dt>
970 <dd>Use the repository at the specified path. If not specified, assume the
971 repository is located at or above the current working directory. If
972 this directory is a <code class="Nm">got</code> work tree, use the
973 repository path associated with this work tree.</dd>
974 <dt id="l~5"><a class="permalink" href="#l~5"><code class="Fl">-l</code></a></dt>
975 <dd>List all existing branches in the repository. If invoked in a work
976 tree, the work tree's current branch is shown with one the following
977 annotations:
978 <table class="Bl-column">
979 <tr>
980 <td>*</td>
981 <td>work tree's base commit matches the branch tip</td>
982 </tr>
983 <tr>
984 <td>~</td>
985 <td>work tree's base commit is out-of-date</td>
986 </tr>
987 </table>
988 </dd>
989 <dt id="d~3"><a class="permalink" href="#d~3"><code class="Fl">-d</code></a>
990 <var class="Ar">name</var></dt>
991 <dd>Delete the branch with the specified name from the repository. Only
992 the branch reference is deleted. Any commit, tree, and blob objects
993 belonging to the branch remain in the repository and may be removed
994 separately with Git's garbage collector.</dd>
995 <dt id="n"><a class="permalink" href="#n"><code class="Fl">-n</code></a></dt>
996 <dd>Do not switch and update the work tree after creating a new
997 branch.</dd>
998 </dl>
999 </dd>
1000 <dt id="br"><a class="permalink" href="#br"><code class="Cm">br</code></a></dt>
1001 <dd>Short alias for <code class="Cm">branch</code>.</dd>
1002 <dt id="tag"><a class="permalink" href="#tag"><code class="Cm">tag</code></a>
1003 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
1004 [<code class="Fl">-m</code> <var class="Ar">message</var>]
1005 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
1006 [<code class="Fl">-l</code>] <var class="Ar">name</var></dt>
1007 <dd>Manage tags in a repository.
1008 <p class="Pp">Tags are managed via references which live in the
1009 &#x201C;refs/tags/&#x201D; reference namespace. The <code class="Cm">got
1010 tag</code> command operates on references in this namespace only.
1011 References in this namespace point at tag objects which contain a
1012 pointer to another object, a tag message, as well as author and
1013 timestamp information.</p>
1014 <p class="Pp">Attempt to create a tag with the given
1015 <var class="Ar">name</var>, and make this tag point at the given
1016 <var class="Ar">commit</var>. If no commit is specified, default to the
1017 latest commit on the work tree's current branch if invoked in a work
1018 tree, and to a commit resolved via the repository's HEAD reference
1019 otherwise.</p>
1020 <p class="Pp">The options for <code class="Cm">got tag</code> are as
1021 follows:</p>
1022 <dl class="Bl-tag">
1023 <dt id="c~8"><a class="permalink" href="#c~8"><code class="Fl">-c</code></a>
1024 <var class="Ar">commit</var></dt>
1025 <dd>Make the newly created tag reference point at the specified
1026 <var class="Ar">commit</var>. The expected
1027 <var class="Ar">commit</var> argument is a commit ID SHA1 hash or an
1028 existing reference or tag name which will be resolved to a commit ID.
1029 An abbreviated hash argument will be expanded to a full SHA1 hash
1030 automatically, provided the abbreviation is unique.</dd>
1031 <dt id="m~3"><a class="permalink" href="#m~3"><code class="Fl">-m</code></a>
1032 <var class="Ar">message</var></dt>
1033 <dd>Use the specified tag message when creating the new tag. Without the
1034 <code class="Fl">-m</code> option, <code class="Cm">got tag</code>
1035 opens a temporary file in an editor where a tag message can be
1036 written.</dd>
1037 <dt id="r~9"><a class="permalink" href="#r~9"><code class="Fl">-r</code></a>
1038 <var class="Ar">repository-path</var></dt>
1039 <dd>Use the repository at the specified path. If not specified, assume the
1040 repository is located at or above the current working directory. If
1041 this directory is a <code class="Nm">got</code> work tree, use the
1042 repository path associated with this work tree.</dd>
1043 <dt id="l~6"><a class="permalink" href="#l~6"><code class="Fl">-l</code></a></dt>
1044 <dd>List all existing tags in the repository instead of creating a new
1045 tag. If this option is used, no other command-line arguments are
1046 allowed.</dd>
1047 </dl>
1048 <p class="Pp">By design, the <code class="Cm">got tag</code> command will
1049 not delete tags or change existing tags. If a tag must be deleted, the
1050 <code class="Cm">got ref</code> command may be used to delete a tag's
1051 reference. This should only be done if the tag has not already been
1052 copied to another repository.</p>
1053 </dd>
1054 <dt id="add"><a class="permalink" href="#add"><code class="Cm">add</code></a>
1055 [<code class="Fl">-R</code>] [<code class="Fl">-I</code>]
1056 <var class="Ar">path ...</var></dt>
1057 <dd>Schedule unversioned files in a work tree for addition to the repository
1058 in the next commit.
1059 <p class="Pp">The options for <code class="Cm">got add</code> are as
1060 follows:</p>
1061 <dl class="Bl-tag">
1062 <dt id="R~5"><a class="permalink" href="#R~5"><code class="Fl">-R</code></a></dt>
1063 <dd>Permit recursion into directories. If this option is not specified,
1064 <code class="Cm">got add</code> will refuse to run if a specified
1065 <var class="Ar">path</var> is a directory.</dd>
1066 <dt id="I~2"><a class="permalink" href="#I~2"><code class="Fl">-I</code></a></dt>
1067 <dd>With -R, add files even if they match a <code class="Cm">got
1068 status</code> ignore pattern.</dd>
1069 </dl>
1070 </dd>
1071 <dt id="remove"><a class="permalink" href="#remove"><code class="Cm">remove</code></a>
1072 [<code class="Fl">-f</code>] [<code class="Fl">-k</code>]
1073 [<code class="Fl">-R</code>] [<code class="Fl">-s</code>
1074 <var class="Ar">status-codes</var>] <var class="Ar">path ...</var></dt>
1075 <dd>Remove versioned files from a work tree and schedule them for deletion
1076 from the repository in the next commit.
1077 <p class="Pp">The options for <code class="Cm">got remove</code> are as
1078 follows:</p>
1079 <dl class="Bl-tag">
1080 <dt id="f"><a class="permalink" href="#f"><code class="Fl">-f</code></a></dt>
1081 <dd>Perform the operation even if a file contains local
1082 modifications.</dd>
1083 <dt id="k"><a class="permalink" href="#k"><code class="Fl">-k</code></a></dt>
1084 <dd>Keep affected files on disk.</dd>
1085 <dt id="R~6"><a class="permalink" href="#R~6"><code class="Fl">-R</code></a></dt>
1086 <dd>Permit recursion into directories. If this option is not specified,
1087 <code class="Cm">got remove</code> will refuse to run if a specified
1088 <var class="Ar">path</var> is a directory.</dd>
1089 <dt id="s~5"><a class="permalink" href="#s~5"><code class="Fl">-s</code></a>
1090 <var class="Ar">status-codes</var></dt>
1091 <dd>Only delete files with a modification status matching one of the
1092 single-character status codes contained in the
1093 <var class="Ar">status-codes</var> argument. The following status
1094 codes may be specified:
1095 <table class="Bl-column">
1096 <tr>
1097 <td>M</td>
1098 <td>modified file (this implies the <code class="Fl">-f</code>
1099 option)</td>
1100 </tr>
1101 <tr>
1102 <td>!</td>
1103 <td>versioned file expected on disk but missing</td>
1104 </tr>
1105 </table>
1106 </dd>
1107 </dl>
1108 </dd>
1109 <dt id="rm"><a class="permalink" href="#rm"><code class="Cm">rm</code></a></dt>
1110 <dd>Short alias for <code class="Cm">remove</code>.</dd>
1111 <dt id="revert"><a class="permalink" href="#revert"><code class="Cm">revert</code></a>
1112 [<code class="Fl">-p</code>] [<code class="Fl">-F</code>
1113 <var class="Ar">response-script</var>] [<code class="Fl">-R</code>]
1114 <var class="Ar">path ...</var></dt>
1115 <dd>Revert any local changes in files at the specified paths in a work tree.
1116 File contents will be overwritten with those contained in the work tree's
1117 base commit. There is no way to bring discarded changes back after
1118 <code class="Cm">got revert</code>!
1119 <p class="Pp">If a file was added with <code class="Cm">got add</code> it
1120 will become an unversioned file again. If a file was deleted with
1121 <code class="Cm">got remove</code> it will be restored.</p>
1122 <p class="Pp">The options for <code class="Cm">got revert</code> are as
1123 follows:</p>
1124 <dl class="Bl-tag">
1125 <dt id="p~3"><a class="permalink" href="#p~3"><code class="Fl">-p</code></a></dt>
1126 <dd>Instead of reverting all changes in files, interactively select or
1127 reject changes to revert based on &#x201C;y&#x201D; (revert change),
1128 &#x201C;n&#x201D; (keep change), and &#x201C;q&#x201D; (quit reverting
1129 this file) responses. If a file is in modified status, individual
1130 patches derived from the modified file content can be reverted. Files
1131 in added or deleted status may only be reverted in their
1132 entirety.</dd>
1133 <dt id="F"><a class="permalink" href="#F"><code class="Fl">-F</code></a>
1134 <var class="Ar">response-script</var></dt>
1135 <dd>With the <code class="Fl">-p</code> option, read &#x201C;y&#x201D;,
1136 &#x201C;n&#x201D;, and &#x201C;q&#x201D; responses line-by-line from
1137 the specified <var class="Ar">response-script</var> file instead of
1138 prompting interactively.</dd>
1139 <dt id="R~7"><a class="permalink" href="#R~7"><code class="Fl">-R</code></a></dt>
1140 <dd>Permit recursion into directories. If this option is not specified,
1141 <code class="Cm">got revert</code> will refuse to run if a specified
1142 <var class="Ar">path</var> is a directory.</dd>
1143 </dl>
1144 </dd>
1145 <dt id="rv"><a class="permalink" href="#rv"><code class="Cm">rv</code></a></dt>
1146 <dd>Short alias for <code class="Cm">revert</code>.</dd>
1147 <dt id="commit"><a class="permalink" href="#commit"><code class="Cm">commit</code></a>
1148 [<code class="Fl">-m</code> <var class="Ar">message</var>]
1149 [<code class="Fl">-S</code>] [<var class="Ar">path ...</var>]</dt>
1150 <dd>Create a new commit in the repository from changes in a work tree and use
1151 this commit as the new base commit for the work tree. If no
1152 <var class="Ar">path</var> is specified, commit all changes in the work
1153 tree. Otherwise, commit changes at or within the specified paths.
1154 <p class="Pp">If changes have been explicitly staged for commit with
1155 <code class="Cm">got stage</code>, only commit staged changes and reject
1156 any specified paths which have not been staged.</p>
1157 <p class="Pp">Show the status of each affected file, using the following
1158 status codes:</p>
1159 <table class="Bl-column">
1160 <tr>
1161 <td>M</td>
1162 <td>modified file</td>
1163 </tr>
1164 <tr>
1165 <td>D</td>
1166 <td>file was deleted</td>
1167 </tr>
1168 <tr>
1169 <td>A</td>
1170 <td>new file was added</td>
1171 </tr>
1172 <tr>
1173 <td>m</td>
1174 <td>modified file modes (executable bit only)</td>
1175 </tr>
1176 </table>
1177 <p class="Pp">Files which are not part of the new commit will retain their
1178 previously recorded base commit. Some <code class="Nm">got</code>
1179 commands may refuse to run while the work tree contains files from
1180 multiple base commits. The base commit of such a work tree can be made
1181 consistent by running <code class="Cm">got update</code> across the
1182 entire work tree.</p>
1183 <p class="Pp">The <code class="Cm">got commit</code> command requires the
1184 <code class="Ev">GOT_AUTHOR</code> environment variable to be set,
1185 unless an author has been configured in <a class="Xr">got.conf(5)</a> or
1186 Git's <code class="Dv">user.name</code> and
1187 <code class="Dv">user.email</code> configuration settings can be
1188 obtained from the repository's <span class="Pa">.git/config</span> file
1189 or from Git's global <span class="Pa">~/.gitconfig</span> configuration
1190 file.</p>
1191 <p class="Pp">The options for <code class="Cm">got commit</code> are as
1192 follows:</p>
1193 <dl class="Bl-tag">
1194 <dt id="m~4"><a class="permalink" href="#m~4"><code class="Fl">-m</code></a>
1195 <var class="Ar">message</var></dt>
1196 <dd>Use the specified log message when creating the new commit. Without
1197 the <code class="Fl">-m</code> option, <code class="Cm">got
1198 commit</code> opens a temporary file in an editor where a log message
1199 can be written.</dd>
1200 <dt id="S"><a class="permalink" href="#S"><code class="Fl">-S</code></a></dt>
1201 <dd>Allow the addition of symbolic links which point outside of the path
1202 space that is under version control. By default, <code class="Cm">got
1203 commit</code> will reject such symbolic links due to safety concerns.
1204 As a precaution, <code class="Nm">got</code> may decide to represent
1205 such a symbolic link as a regular file which contains the link's
1206 target path, rather than creating an actual symbolic link which points
1207 outside of the work tree. Use of this option is discouraged because
1208 external mechanisms such as &#x201C;make obj&#x201D; are better suited
1209 for managing symbolic links to paths not under version control.</dd>
1210 </dl>
1211 <p class="Pp"><code class="Cm">got commit</code> will refuse to run if
1212 certain preconditions are not met. If the work tree's current branch is
1213 not in the &#x201C;refs/heads/&#x201D; reference namespace, new commits
1214 may not be created on this branch. Local changes may only be committed
1215 if they are based on file content found in the most recent commit on the
1216 work tree's branch. If a path is found to be out of date,
1217 <code class="Cm">got update</code> must be used first in order to merge
1218 local changes with changes made in the repository.</p>
1219 </dd>
1220 <dt id="ci"><a class="permalink" href="#ci"><code class="Cm">ci</code></a></dt>
1221 <dd>Short alias for <code class="Cm">commit</code>.</dd>
1222 <dt id="cherrypick"><a class="permalink" href="#cherrypick"><code class="Cm">cherrypick</code></a>
1223 <var class="Ar">commit</var></dt>
1224 <dd>Merge changes from a single <var class="Ar">commit</var> into the work
1225 tree. The specified <var class="Ar">commit</var> must be on a different
1226 branch than the work tree's base commit. The expected argument is a
1227 reference or a commit ID SHA1 hash. An abbreviated hash argument will be
1228 expanded to a full SHA1 hash automatically, provided the abbreviation is
1229 unique.
1230 <p class="Pp">Show the status of each affected file, using the following
1231 status codes:</p>
1232 <table class="Bl-column">
1233 <tr>
1234 <td>G</td>
1235 <td>file was merged</td>
1236 </tr>
1237 <tr>
1238 <td>C</td>
1239 <td>file was merged and conflicts occurred during merge</td>
1240 </tr>
1241 <tr>
1242 <td>!</td>
1243 <td>changes destined for a missing file were not merged</td>
1244 </tr>
1245 <tr>
1246 <td>D</td>
1247 <td>file was deleted</td>
1248 </tr>
1249 <tr>
1250 <td>d</td>
1251 <td>file's deletion was obstructed by local modifications</td>
1252 </tr>
1253 <tr>
1254 <td>A</td>
1255 <td>new file was added</td>
1256 </tr>
1257 <tr>
1258 <td>~</td>
1259 <td>changes destined for a non-regular file were not merged</td>
1260 </tr>
1261 <tr>
1262 <td>?</td>
1263 <td>changes destined for an unversioned file were not merged</td>
1264 </tr>
1265 </table>
1266 <p class="Pp">The merged changes will appear as local changes in the work
1267 tree, which may be viewed with <code class="Cm">got diff</code>, amended
1268 manually or with further <code class="Cm">got cherrypick</code>
1269 commands, committed with <code class="Cm">got commit</code>, or
1270 discarded again with <code class="Cm">got revert</code>.</p>
1271 <p class="Pp"><code class="Cm">got cherrypick</code> will refuse to run if
1272 certain preconditions are not met. If the work tree contains multiple
1273 base commits it must first be updated to a single base commit with
1274 <code class="Cm">got update</code>. If the work tree already contains
1275 files with merge conflicts, these conflicts must be resolved first.</p>
1276 </dd>
1277 <dt id="cy"><a class="permalink" href="#cy"><code class="Cm">cy</code></a></dt>
1278 <dd>Short alias for <code class="Cm">cherrypick</code>.</dd>
1279 <dt id="backout"><a class="permalink" href="#backout"><code class="Cm">backout</code></a>
1280 <var class="Ar">commit</var></dt>
1281 <dd>Reverse-merge changes from a single <var class="Ar">commit</var> into the
1282 work tree. The specified <var class="Ar">commit</var> must be on the same
1283 branch as the work tree's base commit. The expected argument is a
1284 reference or a commit ID SHA1 hash. An abbreviated hash argument will be
1285 expanded to a full SHA1 hash automatically, provided the abbreviation is
1286 unique.
1287 <p class="Pp">Show the status of each affected file, using the following
1288 status codes:</p>
1289 <table class="Bl-column">
1290 <tr>
1291 <td>G</td>
1292 <td>file was merged</td>
1293 </tr>
1294 <tr>
1295 <td>C</td>
1296 <td>file was merged and conflicts occurred during merge</td>
1297 </tr>
1298 <tr>
1299 <td>!</td>
1300 <td>changes destined for a missing file were not merged</td>
1301 </tr>
1302 <tr>
1303 <td>D</td>
1304 <td>file was deleted</td>
1305 </tr>
1306 <tr>
1307 <td>d</td>
1308 <td>file's deletion was obstructed by local modifications</td>
1309 </tr>
1310 <tr>
1311 <td>A</td>
1312 <td>new file was added</td>
1313 </tr>
1314 <tr>
1315 <td>~</td>
1316 <td>changes destined for a non-regular file were not merged</td>
1317 </tr>
1318 <tr>
1319 <td>?</td>
1320 <td>changes destined for an unversioned file were not merged</td>
1321 </tr>
1322 </table>
1323 <p class="Pp">The reverse-merged changes will appear as local changes in the
1324 work tree, which may be viewed with <code class="Cm">got diff</code>,
1325 amended manually or with further <code class="Cm">got backout</code>
1326 commands, committed with <code class="Cm">got commit</code>, or
1327 discarded again with <code class="Cm">got revert</code>.</p>
1328 <p class="Pp"><code class="Cm">got backout</code> will refuse to run if
1329 certain preconditions are not met. If the work tree contains multiple
1330 base commits it must first be updated to a single base commit with
1331 <code class="Cm">got update</code>. If the work tree already contains
1332 files with merge conflicts, these conflicts must be resolved first.</p>
1333 </dd>
1334 <dt id="bo"><a class="permalink" href="#bo"><code class="Cm">bo</code></a></dt>
1335 <dd>Short alias for <code class="Cm">backout</code>.</dd>
1336 <dt id="rebase"><a class="permalink" href="#rebase"><code class="Cm">rebase</code></a>
1337 [<code class="Fl">-a</code>] [<code class="Fl">-c</code>]
1338 [<var class="Ar">branch</var>]</dt>
1339 <dd>Rebase commits on the specified <var class="Ar">branch</var> onto the tip
1340 of the current branch of the work tree. The <var class="Ar">branch</var>
1341 must share common ancestry with the work tree's current branch. Rebasing
1342 begins with the first descendant commit of the youngest common ancestor
1343 commit shared by the specified <var class="Ar">branch</var> and the work
1344 tree's current branch, and stops once the tip commit of the specified
1345 <var class="Ar">branch</var> has been rebased.
1346 <p class="Pp">When <code class="Cm">got rebase</code> is used as intended,
1347 the specified <var class="Ar">branch</var> represents a local commit
1348 history and may already contain changes that are not yet visible in any
1349 other repositories. The work tree's current branch, which must be set
1350 with <code class="Cm">got update -b</code> before starting the
1351 <code class="Cm">rebase</code> operation, represents a branch from a
1352 remote repository which shares a common history with the specified
1353 <var class="Ar">branch</var> but has progressed, and perhaps diverged,
1354 due to commits added to the remote repository.</p>
1355 <p class="Pp">Rebased commits are accumulated on a temporary branch which
1356 the work tree will remain switched to throughout the entire rebase
1357 operation. Commits on this branch represent the same changes with the
1358 same log messages as their counterparts on the original
1359 <var class="Ar">branch</var>, but with different commit IDs. Once
1360 rebasing has completed successfully, the temporary branch becomes the
1361 new version of the specified <var class="Ar">branch</var> and the work
1362 tree is automatically switched to it.</p>
1363 <p class="Pp">While rebasing commits, show the status of each affected file,
1364 using the following status codes:</p>
1365 <table class="Bl-column">
1366 <tr>
1367 <td>G</td>
1368 <td>file was merged</td>
1369 </tr>
1370 <tr>
1371 <td>C</td>
1372 <td>file was merged and conflicts occurred during merge</td>
1373 </tr>
1374 <tr>
1375 <td>!</td>
1376 <td>changes destined for a missing file were not merged</td>
1377 </tr>
1378 <tr>
1379 <td>D</td>
1380 <td>file was deleted</td>
1381 </tr>
1382 <tr>
1383 <td>d</td>
1384 <td>file's deletion was obstructed by local modifications</td>
1385 </tr>
1386 <tr>
1387 <td>A</td>
1388 <td>new file was added</td>
1389 </tr>
1390 <tr>
1391 <td>~</td>
1392 <td>changes destined for a non-regular file were not merged</td>
1393 </tr>
1394 <tr>
1395 <td>?</td>
1396 <td>changes destined for an unversioned file were not merged</td>
1397 </tr>
1398 </table>
1399 <p class="Pp">If merge conflicts occur the rebase operation is interrupted
1400 and may be continued once conflicts have been resolved. Alternatively,
1401 the rebase operation may be aborted which will leave
1402 <var class="Ar">branch</var> unmodified and the work tree switched back
1403 to its original branch.</p>
1404 <p class="Pp">If a merge conflict is resolved in a way which renders the
1405 merged change into a no-op change, the corresponding commit will be
1406 elided when the rebase operation continues.</p>
1407 <p class="Pp"><code class="Cm">got rebase</code> will refuse to run if
1408 certain preconditions are not met. If the work tree is not yet fully
1409 updated to the tip commit of its branch then the work tree must first be
1410 updated with <code class="Cm">got update</code>. If changes have been
1411 staged with <code class="Cm">got stage</code>, these changes must first
1412 be committed with <code class="Cm">got commit</code> or unstaged with
1413 <code class="Cm">got unstage</code>. If the work tree contains local
1414 changes, these changes must first be committed with <code class="Cm">got
1415 commit</code> or reverted with <code class="Cm">got revert</code>. If
1416 the <var class="Ar">branch</var> contains changes to files outside of
1417 the work tree's path prefix, the work tree cannot be used to rebase this
1418 branch.</p>
1419 <p class="Pp">The <code class="Cm">got update</code> and
1420 <code class="Cm">got commit</code> commands will refuse to run while a
1421 rebase operation is in progress. Other commands which manipulate the
1422 work tree may be used for conflict resolution purposes.</p>
1423 <p class="Pp">The options for <code class="Cm">got rebase</code> are as
1424 follows:</p>
1425 <dl class="Bl-tag">
1426 <dt id="a~4"><a class="permalink" href="#a~4"><code class="Fl">-a</code></a></dt>
1427 <dd>Abort an interrupted rebase operation. If this option is used, no
1428 other command-line arguments are allowed.</dd>
1429 <dt id="c~9"><a class="permalink" href="#c~9"><code class="Fl">-c</code></a></dt>
1430 <dd>Continue an interrupted rebase operation. If this option is used, no
1431 other command-line arguments are allowed.</dd>
1432 </dl>
1433 </dd>
1434 <dt id="rb"><a class="permalink" href="#rb"><code class="Cm">rb</code></a></dt>
1435 <dd>Short alias for <code class="Cm">rebase</code>.</dd>
1436 <dt id="histedit"><a class="permalink" href="#histedit"><code class="Cm">histedit</code></a>
1437 [<code class="Fl">-a</code>] [<code class="Fl">-c</code>]
1438 [<code class="Fl">-f</code>] [<code class="Fl">-F</code>
1439 <var class="Ar">histedit-script</var>] [<code class="Fl">-m</code>]</dt>
1440 <dd>Edit commit history between the work tree's current base commit and the
1441 tip commit of the work tree's current branch.
1442 <p class="Pp">Before starting a <code class="Cm">histedit</code> operation
1443 the work tree's current branch must be set with <code class="Cm">got
1444 update -b</code> to the branch which should be edited, unless this
1445 branch is already the current branch of the work tree. The tip of this
1446 branch represents the upper bound (inclusive) of commits touched by the
1447 <code class="Cm">histedit</code> operation.</p>
1448 <p class="Pp">Furthermore, the work tree's base commit must be set with
1449 <code class="Cm">got update -c</code> to a point in this branch's commit
1450 history where editing should begin. This commit represents the lower
1451 bound (non-inclusive) of commits touched by the
1452 <code class="Cm">histedit</code> operation.</p>
1453 <p class="Pp">Editing of commit history is controlled via a
1454 <var class="Ar">histedit script</var> which can be written in an editor
1455 based on a template, passed on the command line, or generated with the
1456 <code class="Fl">-f</code> or <code class="Fl">-m</code> options.</p>
1457 <p class="Pp">The format of the histedit script is line-based. Each line in
1458 the script begins with a command name, followed by whitespace and an
1459 argument. For most commands, the expected argument is a commit ID SHA1
1460 hash. Any remaining text on the line is ignored. Lines which begin with
1461 the &#x2018;#&#x2019; character are ignored entirely.</p>
1462 <p class="Pp">The available commands are as follows:</p>
1463 <table class="Bl-column">
1464 <tr>
1465 <td>pick <var class="Ar">commit</var></td>
1466 <td>Use the specified commit as it is.</td>
1467 </tr>
1468 <tr>
1469 <td>edit <var class="Ar">commit</var></td>
1470 <td>Use the specified commit but once changes have been merged into the
1471 work tree interrupt the histedit operation for amending.</td>
1472 </tr>
1473 <tr>
1474 <td>fold <var class="Ar">commit</var></td>
1475 <td>Combine the specified commit with the next commit listed further
1476 below that will be used.</td>
1477 </tr>
1478 <tr>
1479 <td>drop <var class="Ar">commit</var></td>
1480 <td>Remove this commit from the edited history.</td>
1481 </tr>
1482 <tr>
1483 <td>mesg <var class="Ar">log-message</var></td>
1484 <td>Use the specified single-line log message for the commit on the
1485 previous line. If the log message argument is left empty, open an
1486 editor where a new log message can be written.</td>
1487 </tr>
1488 </table>
1489 <p class="Pp">Every commit in the history being edited must be mentioned in
1490 the script. Lines may be re-ordered to change the order of commits in
1491 the edited history. No commit may be listed more than once.</p>
1492 <p class="Pp">Edited commits are accumulated on a temporary branch which the
1493 work tree will remain switched to throughout the entire histedit
1494 operation. Once history editing has completed successfully, the
1495 temporary branch becomes the new version of the work tree's branch and
1496 the work tree is automatically switched to it.</p>
1497 <p class="Pp">While merging commits, show the status of each affected file,
1498 using the following status codes:</p>
1499 <table class="Bl-column">
1500 <tr>
1501 <td>G</td>
1502 <td>file was merged</td>
1503 </tr>
1504 <tr>
1505 <td>C</td>
1506 <td>file was merged and conflicts occurred during merge</td>
1507 </tr>
1508 <tr>
1509 <td>!</td>
1510 <td>changes destined for a missing file were not merged</td>
1511 </tr>
1512 <tr>
1513 <td>D</td>
1514 <td>file was deleted</td>
1515 </tr>
1516 <tr>
1517 <td>d</td>
1518 <td>file's deletion was obstructed by local modifications</td>
1519 </tr>
1520 <tr>
1521 <td>A</td>
1522 <td>new file was added</td>
1523 </tr>
1524 <tr>
1525 <td>~</td>
1526 <td>changes destined for a non-regular file were not merged</td>
1527 </tr>
1528 <tr>
1529 <td>?</td>
1530 <td>changes destined for an unversioned file were not merged</td>
1531 </tr>
1532 </table>
1533 <p class="Pp">If merge conflicts occur the histedit operation is interrupted
1534 and may be continued once conflicts have been resolved. Alternatively,
1535 the histedit operation may be aborted which will leave the work tree
1536 switched back to its original branch.</p>
1537 <p class="Pp">If a merge conflict is resolved in a way which renders the
1538 merged change into a no-op change, the corresponding commit will be
1539 elided when the histedit operation continues.</p>
1540 <p class="Pp"><code class="Cm">got histedit</code> will refuse to run if
1541 certain preconditions are not met. If the work tree's current branch is
1542 not in the &#x201C;refs/heads/&#x201D; reference namespace, the history
1543 of the branch may not be edited. If the work tree contains multiple base
1544 commits it must first be updated to a single base commit with
1545 <code class="Cm">got update</code>. If changes have been staged with
1546 <code class="Cm">got stage</code>, these changes must first be committed
1547 with <code class="Cm">got commit</code> or unstaged with
1548 <code class="Cm">got unstage</code>. If the work tree contains local
1549 changes, these changes must first be committed with <code class="Cm">got
1550 commit</code> or reverted with <code class="Cm">got revert</code>. If
1551 the edited history contains changes to files outside of the work tree's
1552 path prefix, the work tree cannot be used to edit the history of this
1553 branch.</p>
1554 <p class="Pp">The <code class="Cm">got update</code>, <code class="Cm">got
1555 rebase</code>, and <code class="Cm">got integrate</code> commands will
1556 refuse to run while a histedit operation is in progress. Other commands
1557 which manipulate the work tree may be used, and the <code class="Cm">got
1558 commit</code> command may be used to commit arbitrary changes to the
1559 temporary branch while the histedit operation is interrupted.</p>
1560 <p class="Pp">The options for <code class="Cm">got histedit</code> are as
1561 follows:</p>
1562 <dl class="Bl-tag">
1563 <dt id="a~5"><a class="permalink" href="#a~5"><code class="Fl">-a</code></a></dt>
1564 <dd>Abort an interrupted histedit operation. If this option is used, no
1565 other command-line arguments are allowed.</dd>
1566 <dt id="c~10"><a class="permalink" href="#c~10"><code class="Fl">-c</code></a></dt>
1567 <dd>Continue an interrupted histedit operation. If this option is used, no
1568 other command-line arguments are allowed.</dd>
1569 <dt id="f~2"><a class="permalink" href="#f~2"><code class="Fl">-f</code></a></dt>
1570 <dd>Fold all commits into a single commit. This option is a quick
1571 equivalent to a histedit script which folds all commits, combining
1572 them all into one commit. The <code class="Fl">-f</code> option can
1573 only be used when starting a new histedit operation. If this option is
1574 used, no other command-line arguments are allowed.</dd>
1575 <dt id="F~2"><a class="permalink" href="#F~2"><code class="Fl">-F</code></a>
1576 <var class="Ar">histedit-script</var></dt>
1577 <dd>Use the specified <var class="Ar">histedit-script</var> instead of
1578 opening a temporary file in an editor where a histedit script can be
1579 written.</dd>
1580 <dt id="m~5"><a class="permalink" href="#m~5"><code class="Fl">-m</code></a></dt>
1581 <dd>Edit log messages only. This option is a quick equivalent to a
1582 histedit script which edits only log messages but otherwise leaves
1583 every picked commit as-is. The <code class="Fl">-m</code> option can
1584 only be used when starting a new histedit operation. If this option is
1585 used, no other command-line arguments are allowed.</dd>
1586 </dl>
1587 </dd>
1588 <dt id="he"><a class="permalink" href="#he"><code class="Cm">he</code></a></dt>
1589 <dd>Short alias for <code class="Cm">histedit</code>.</dd>
1590 <dt id="integrate"><a class="permalink" href="#integrate"><code class="Cm">integrate</code></a>
1591 <var class="Ar">branch</var></dt>
1592 <dd>Integrate the specified <var class="Ar">branch</var> into the work tree's
1593 current branch. Files in the work tree are updated to match the contents
1594 on the integrated <var class="Ar">branch</var>, and the reference of the
1595 work tree's branch is changed to point at the head commit of the
1596 integrated <var class="Ar">branch</var>.
1597 <p class="Pp">Both branches can be considered equivalent after integration
1598 since they will be pointing at the same commit. Both branches remain
1599 available for future work, if desired. In case the integrated
1600 <var class="Ar">branch</var> is no longer needed it may be deleted with
1601 <code class="Cm">got branch -d</code>.</p>
1602 <p class="Pp">Show the status of each affected file, using the following
1603 status codes:</p>
1604 <table class="Bl-column">
1605 <tr>
1606 <td>U</td>
1607 <td>file was updated</td>
1608 </tr>
1609 <tr>
1610 <td>D</td>
1611 <td>file was deleted</td>
1612 </tr>
1613 <tr>
1614 <td>A</td>
1615 <td>new file was added</td>
1616 </tr>
1617 <tr>
1618 <td>~</td>
1619 <td>versioned file is obstructed by a non-regular file</td>
1620 </tr>
1621 <tr>
1622 <td>!</td>
1623 <td>a missing versioned file was restored</td>
1624 </tr>
1625 </table>
1626 <p class="Pp"><code class="Cm">got integrate</code> will refuse to run if
1627 certain preconditions are not met. Most importantly, the
1628 <var class="Ar">branch</var> must have been rebased onto the work tree's
1629 current branch with <code class="Cm">got rebase</code> before it can be
1630 integrated, in order to linearize commit history and resolve merge
1631 conflicts. If the work tree contains multiple base commits it must first
1632 be updated to a single base commit with <code class="Cm">got
1633 update</code>. If changes have been staged with <code class="Cm">got
1634 stage</code>, these changes must first be committed with
1635 <code class="Cm">got commit</code> or unstaged with <code class="Cm">got
1636 unstage</code>. If the work tree contains local changes, these changes
1637 must first be committed with <code class="Cm">got commit</code> or
1638 reverted with <code class="Cm">got revert</code>.</p>
1639 </dd>
1640 <dt id="ig"><a class="permalink" href="#ig"><code class="Cm">ig</code></a></dt>
1641 <dd>Short alias for <code class="Cm">integrate</code>.</dd>
1642 <dt id="stage"><a class="permalink" href="#stage"><code class="Cm">stage</code></a>
1643 [<code class="Fl">-l</code>] [<code class="Fl">-p</code>]
1644 [<code class="Fl">-F</code> <var class="Ar">response-script</var>]
1645 [<code class="Fl">-S</code>] [<var class="Ar">path ...</var>]</dt>
1646 <dd>Stage local changes for inclusion in the next commit. If no
1647 <var class="Ar">path</var> is specified, stage all changes in the work
1648 tree. Otherwise, stage changes at or within the specified paths. Paths may
1649 be staged if they are added, modified, or deleted according to
1650 <code class="Cm">got status</code>.
1651 <p class="Pp">Show the status of each affected file, using the following
1652 status codes:</p>
1653 <table class="Bl-column">
1654 <tr>
1655 <td>A</td>
1656 <td>file addition has been staged</td>
1657 </tr>
1658 <tr>
1659 <td>M</td>
1660 <td>file modification has been staged</td>
1661 </tr>
1662 <tr>
1663 <td>D</td>
1664 <td>file deletion has been staged</td>
1665 </tr>
1666 </table>
1667 <p class="Pp">Staged file contents are saved in newly created blob objects
1668 in the repository. These blobs will be referred to by tree objects once
1669 staged changes have been committed.</p>
1670 <p class="Pp">Staged changes affect the behaviour of <code class="Cm">got
1671 commit</code>, <code class="Cm">got status</code>, and
1672 <code class="Cm">got diff</code>. While paths with staged changes exist,
1673 the <code class="Cm">got commit</code> command will refuse to commit any
1674 paths which do not have staged changes. Local changes created on top of
1675 staged changes can only be committed if the path is staged again, or if
1676 the staged changes are committed first. The <code class="Cm">got
1677 status</code> command will show both local changes and staged changes.
1678 The <code class="Cm">got diff</code> command is able to display local
1679 changes relative to staged changes, and to display staged changes
1680 relative to the repository. The <code class="Cm">got revert</code>
1681 command cannot revert staged changes but may be used to revert local
1682 changes created on top of staged changes.</p>
1683 <p class="Pp">The options for <code class="Cm">got stage</code> are as
1684 follows:</p>
1685 <dl class="Bl-tag">
1686 <dt id="l~7"><a class="permalink" href="#l~7"><code class="Fl">-l</code></a></dt>
1687 <dd>Instead of staging new changes, list paths which are already staged,
1688 along with the IDs of staged blob objects and stage status codes. If
1689 paths were provided in the command line show the staged paths among
1690 the specified paths. Otherwise, show all staged paths.</dd>
1691 <dt id="p~4"><a class="permalink" href="#p~4"><code class="Fl">-p</code></a></dt>
1692 <dd>Instead of staging the entire content of a changed file, interactively
1693 select or reject changes for staging based on &#x201C;y&#x201D; (stage
1694 change), &#x201C;n&#x201D; (reject change), and &#x201C;q&#x201D;
1695 (quit staging this file) responses. If a file is in modified status,
1696 individual patches derived from the modified file content can be
1697 staged. Files in added or deleted status may only be staged or
1698 rejected in their entirety.</dd>
1699 <dt id="F~3"><a class="permalink" href="#F~3"><code class="Fl">-F</code></a>
1700 <var class="Ar">response-script</var></dt>
1701 <dd>With the <code class="Fl">-p</code> option, read &#x201C;y&#x201D;,
1702 &#x201C;n&#x201D;, and &#x201C;q&#x201D; responses line-by-line from
1703 the specified <var class="Ar">response-script</var> file instead of
1704 prompting interactively.</dd>
1705 <dt id="S~2"><a class="permalink" href="#S~2"><code class="Fl">-S</code></a></dt>
1706 <dd>Allow staging of symbolic links which point outside of the path space
1707 that is under version control. By default, <code class="Cm">got
1708 stage</code> will reject such symbolic links due to safety concerns.
1709 As a precaution, <code class="Nm">got</code> may decide to represent
1710 such a symbolic link as a regular file which contains the link's
1711 target path, rather than creating an actual symbolic link which points
1712 outside of the work tree. Use of this option is discouraged because
1713 external mechanisms such as &#x201C;make obj&#x201D; are better suited
1714 for managing symbolic links to paths not under version control.</dd>
1715 </dl>
1716 <p class="Pp"><code class="Cm">got stage</code> will refuse to run if
1717 certain preconditions are not met. If a file contains merge conflicts,
1718 these conflicts must be resolved first. If a file is found to be out of
1719 date relative to the head commit on the work tree's current branch, the
1720 file must be updated with <code class="Cm">got update</code> before it
1721 can be staged (however, this does not prevent the file from becoming
1722 out-of-date at some point after having been staged).</p>
1723 <p class="Pp">The <code class="Cm">got update</code>, <code class="Cm">got
1724 rebase</code>, and <code class="Cm">got histedit</code> commands will
1725 refuse to run while staged changes exist. If staged changes cannot be
1726 committed because a staged path is out of date, the path must be
1727 unstaged with <code class="Cm">got unstage</code> before it can be
1728 updated with <code class="Cm">got update</code>, and may then be staged
1729 again if necessary.</p>
1730 </dd>
1731 <dt id="sg"><a class="permalink" href="#sg"><code class="Cm">sg</code></a></dt>
1732 <dd>Short alias for <code class="Cm">stage</code>.</dd>
1733 <dt id="unstage"><a class="permalink" href="#unstage"><code class="Cm">unstage</code></a>
1734 [<code class="Fl">-p</code>] [<code class="Fl">-F</code>
1735 <var class="Ar">response-script</var>] [<var class="Ar">path ...</var>]</dt>
1736 <dd>Merge staged changes back into the work tree and put affected paths back
1737 into non-staged status. If no <var class="Ar">path</var> is specified,
1738 unstage all staged changes across the entire work tree. Otherwise, unstage
1739 changes at or within the specified paths.
1740 <p class="Pp">Show the status of each affected file, using the following
1741 status codes:</p>
1742 <table class="Bl-column">
1743 <tr>
1744 <td>G</td>
1745 <td>file was unstaged</td>
1746 </tr>
1747 <tr>
1748 <td>C</td>
1749 <td>file was unstaged and conflicts occurred during merge</td>
1750 </tr>
1751 <tr>
1752 <td>!</td>
1753 <td>changes destined for a missing file were not merged</td>
1754 </tr>
1755 <tr>
1756 <td>D</td>
1757 <td>file was staged as deleted and still is deleted</td>
1758 </tr>
1759 <tr>
1760 <td>d</td>
1761 <td>file's deletion was obstructed by local modifications</td>
1762 </tr>
1763 <tr>
1764 <td>~</td>
1765 <td>changes destined for a non-regular file were not merged</td>
1766 </tr>
1767 </table>
1768 <p class="Pp">The options for <code class="Cm">got unstage</code> are as
1769 follows:</p>
1770 <dl class="Bl-tag">
1771 <dt id="p~5"><a class="permalink" href="#p~5"><code class="Fl">-p</code></a></dt>
1772 <dd>Instead of unstaging the entire content of a changed file,
1773 interactively select or reject changes for unstaging based on
1774 &#x201C;y&#x201D; (unstage change), &#x201C;n&#x201D; (keep change
1775 staged), and &#x201C;q&#x201D; (quit unstaging this file) responses.
1776 If a file is staged in modified status, individual patches derived
1777 from the staged file content can be unstaged. Files staged in added or
1778 deleted status may only be unstaged in their entirety.</dd>
1779 <dt id="F~4"><a class="permalink" href="#F~4"><code class="Fl">-F</code></a>
1780 <var class="Ar">response-script</var></dt>
1781 <dd>With the <code class="Fl">-p</code> option, read &#x201C;y&#x201D;,
1782 &#x201C;n&#x201D;, and &#x201C;q&#x201D; responses line-by-line from
1783 the specified <var class="Ar">response-script</var> file instead of
1784 prompting interactively.</dd>
1785 </dl>
1786 </dd>
1787 <dt id="ug"><a class="permalink" href="#ug"><code class="Cm">ug</code></a></dt>
1788 <dd>Short alias for <code class="Cm">unstage</code>.</dd>
1789 <dt id="cat"><a class="permalink" href="#cat"><code class="Cm">cat</code></a>
1790 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
1791 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
1792 [<code class="Fl">-P</code>] <var class="Ar">arg ...</var></dt>
1793 <dd>Parse and print contents of objects to standard output in a line-based
1794 text format. Content of commit, tree, and tag objects is printed in a way
1795 similar to the actual content stored in such objects. Blob object contents
1796 are printed as they would appear in files on disk.
1797 <p class="Pp">Attempt to interpret each argument as a reference, a tag name,
1798 or an object ID SHA1 hash. References will be resolved to an object ID.
1799 Tag names will resolved to a tag object. An abbreviated hash argument
1800 will be expanded to a full SHA1 hash automatically, provided the
1801 abbreviation is unique.</p>
1802 <p class="Pp">If none of the above interpretations produce a valid result,
1803 or if the <code class="Fl">-P</code> option is used, attempt to
1804 interpret the argument as a path which will be resolved to the ID of an
1805 object found at this path in the repository.</p>
1806 <p class="Pp">The options for <code class="Cm">got cat</code> are as
1807 follows:</p>
1808 <dl class="Bl-tag">
1809 <dt id="c~11"><a class="permalink" href="#c~11"><code class="Fl">-c</code></a>
1810 <var class="Ar">commit</var></dt>
1811 <dd>Look up paths in the specified <var class="Ar">commit</var>. If this
1812 option is not used, paths are looked up in the commit resolved via the
1813 repository's HEAD reference. The expected argument is a commit ID SHA1
1814 hash or an existing reference or tag name which will be resolved to a
1815 commit ID. An abbreviated hash argument will be expanded to a full
1816 SHA1 hash automatically, provided the abbreviation is unique.</dd>
1817 <dt id="r~10"><a class="permalink" href="#r~10"><code class="Fl">-r</code></a>
1818 <var class="Ar">repository-path</var></dt>
1819 <dd>Use the repository at the specified path. If not specified, assume the
1820 repository is located at or above the current working directory. If
1821 this directory is a <code class="Nm">got</code> work tree, use the
1822 repository path associated with this work tree.</dd>
1823 <dt id="P~2"><a class="permalink" href="#P~2"><code class="Fl">-P</code></a></dt>
1824 <dd>Interpret all arguments as paths only. This option can be used to
1825 resolve ambiguity in cases where paths look like tag names, reference
1826 names, or object IDs.</dd>
1827 </dl>
1828 </dd>
1829 <dt id="info"><a class="permalink" href="#info"><code class="Cm">info</code></a>
1830 [<var class="Ar">path ...</var>]</dt>
1831 <dd>Display meta-data stored in a work tree. See
1832 <a class="Xr">got-worktree(5)</a> for details.
1833 <p class="Pp">The work tree to use is resolved implicitly by walking upwards
1834 from the current working directory.</p>
1835 <p class="Pp">If one or more <var class="Ar">path</var> arguments are
1836 specified, show additional per-file information for tracked files
1837 located at or within these paths. If a <var class="Ar">path</var>
1838 argument corresponds to the work tree's root directory, display
1839 information for all tracked files.</p>
1840 </dd>
1841 </dl>
1842 </section>
1843 <section class="Sh">
1844 <h1 class="Sh" id="ENVIRONMENT"><a class="permalink" href="#ENVIRONMENT">ENVIRONMENT</a></h1>
1845 <dl class="Bl-tag">
1846 <dt id="GOT_AUTHOR"><a class="permalink" href="#GOT_AUTHOR"><code class="Ev">GOT_AUTHOR</code></a></dt>
1847 <dd>The author's name and email address for <code class="Cm">got commit</code>
1848 and <code class="Cm">got import</code>, for example:
1849 &#x201C;<span class="An">Flan Hacker</span>
1850 &lt;<a class="Mt" href="mailto:flan_hacker@openbsd.org">flan_hacker@openbsd.org</a>&gt;&#x201D;.
1851 Because <a class="Xr">git(1)</a> may fail to parse commits without an
1852 email address in author data, <code class="Nm">got</code> attempts to
1853 reject <code class="Ev">GOT_AUTHOR</code> environment variables with a
1854 missing email address.
1855 <p class="Pp"><code class="Ev">GOT_AUTHOR will be overriden by configuration
1856 settings in</code> <a class="Xr">got.conf(5)</a> or by Git's
1857 <code class="Dv">user.name</code> and <code class="Dv">user.email</code>
1858 configuration settings in the repository's
1859 <span class="Pa">.git/config</span> file. The
1860 <code class="Dv">user.name</code> and <code class="Dv">user.email</code>
1861 configuration settings contained in Git's global
1862 <span class="Pa">~/.gitconfig</span> configuration file will only be
1863 used if neither <a class="Xr">got.conf(5)</a> nor the
1864 <code class="Ev">GOT_AUTHOR</code> environment variable provide author
1865 information.</p>
1866 </dd>
1867 <dt id="VISUAL"><a class="permalink" href="#VISUAL"><code class="Ev">VISUAL</code></a>,
1868 <code class="Ev">EDITOR</code></dt>
1869 <dd>The editor spawned by <code class="Cm">got commit</code>,
1870 <code class="Cm">got histedit</code>, <code class="Cm">got import</code>,
1871 or <code class="Cm">got tag</code>. If not set, the
1872 <a class="Xr">ed(1)</a> text editor will be spawned in order to give
1873 <a class="Xr">ed(1)</a> the attention it deserves.</dd>
1874 <dt id="GOT_LOG_DEFAULT_LIMIT"><a class="permalink" href="#GOT_LOG_DEFAULT_LIMIT"><code class="Ev">GOT_LOG_DEFAULT_LIMIT</code></a></dt>
1875 <dd>The default limit on the number of commits traversed by
1876 <code class="Cm">got log</code>. If set to zero, the limit is unbounded.
1877 This variable will be silently ignored if it is set to a non-numeric
1878 value.</dd>
1879 </dl>
1880 </section>
1881 <section class="Sh">
1882 <h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
1883 <dl class="Bl-tag Bl-compact">
1884 <dt><span class="Pa">got.conf</span></dt>
1885 <dd>Repository-wide configuration settings for <code class="Nm">got</code>. If
1886 present, a <a class="Xr">got.conf(5)</a> configuration file located in the
1887 root directory of a Git repository supersedes any relevant settings in
1888 Git's <span class="Pa">config</span> file.
1889 <p class="Pp"></p>
1890 </dd>
1891 <dt><span class="Pa">.got/got.conf</span></dt>
1892 <dd>Worktree-specific configuration settings for <code class="Nm">got</code>.
1893 If present, a <a class="Xr">got.conf</a> configuration file in the
1894 <span class="Pa">.got</span> meta-data directory of a work tree supersedes
1895 any relevant settings in the repository's <a class="Xr">got.conf(5)</a>
1896 configuration file and Git's <span class="Pa">config</span> file.</dd>
1897 </dl>
1898 </section>
1899 <section class="Sh">
1900 <h1 class="Sh" id="EXIT_STATUS"><a class="permalink" href="#EXIT_STATUS">EXIT
1901 STATUS</a></h1>
1902 <p class="Pp">The <code class="Nm">got</code> utility exits&#x00A0;0 on success,
1903 and&#x00A0;&gt;0 if an error occurs.</p>
1904 </section>
1905 <section class="Sh">
1906 <h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
1907 <p class="Pp">Clone an existing Git repository for use with
1908 <code class="Nm">got</code>.</p>
1909 <p class="Pp"></p>
1910 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/</code></div>
1911 <div class="Bd Bd-indent"><code class="Li">$ got clone
1912 ssh://git@github.com/openbsd/src.git</code></div>
1913 <p class="Pp">Use of HTTP URLs currently requires <a class="Xr">git(1)</a>:</p>
1914 <p class="Pp"></p>
1915 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/</code></div>
1916 <div class="Bd Bd-indent"><code class="Li">$ git clone --bare
1917 https://github.com/openbsd/src.git</code></div>
1918 <p class="Pp">Alternatively, for quick and dirty local testing of
1919 <code class="Nm">got</code> a new Git repository could be created and
1920 populated with files, e.g. from a temporary CVS checkout located at
1921 <span class="Pa">/tmp/src</span>:</p>
1922 <p class="Pp"></p>
1923 <div class="Bd Bd-indent"><code class="Li">$ got init
1924 /var/git/src.git</code></div>
1925 <div class="Bd Bd-indent"><code class="Li">$ got import -r /var/git/src.git -I
1926 CVS -I obj /tmp/src</code></div>
1927 <p class="Pp">Check out a work tree from the Git repository to /usr/src:</p>
1928 <p class="Pp"></p>
1929 <div class="Bd Bd-indent"><code class="Li">$ got checkout /var/git/src.git
1930 /usr/src</code></div>
1931 <p class="Pp">View local changes in a work tree directory:</p>
1932 <p class="Pp"></p>
1933 <div class="Bd Bd-indent"><code class="Li">$ got diff | less</code></div>
1934 <p class="Pp">In a work tree, display files in a potentially problematic
1935 state:</p>
1936 <p class="Pp"></p>
1937 <div class="Bd Bd-indent"><code class="Li">$ got status -s 'C!~?'</code></div>
1938 <p class="Pp">Interactively revert selected local changes in a work tree
1939 directory:</p>
1940 <p class="Pp"></p>
1941 <div class="Bd Bd-indent"><code class="Li">$ got revert -p
1942 -R&#x00A0;.</code></div>
1943 <p class="Pp">In a work tree or a git repository directory, list all branch
1944 references:</p>
1945 <p class="Pp"></p>
1946 <div class="Bd Bd-indent"><code class="Li">$ got branch -l</code></div>
1947 <p class="Pp">In a work tree or a git repository directory, create a new branch
1948 called &#x201C;unified-buffer-cache&#x201D; which is forked off the
1949 &#x201C;master&#x201D; branch:</p>
1950 <p class="Pp"></p>
1951 <div class="Bd Bd-indent"><code class="Li">$ got branch unified-buffer-cache
1952 master</code></div>
1953 <p class="Pp">Switch an existing work tree to the branch
1954 &#x201C;unified-buffer-cache&#x201D;. Local changes in the work tree will be
1955 preserved and merged if necessary:</p>
1956 <p class="Pp"></p>
1957 <div class="Bd Bd-indent"><code class="Li">$ got update -b
1958 unified-buffer-cache</code></div>
1959 <p class="Pp">Create a new commit from local changes in a work tree directory.
1960 This new commit will become the head commit of the work tree's current
1961 branch:</p>
1962 <p class="Pp"></p>
1963 <div class="Bd Bd-indent"><code class="Li">$ got commit</code></div>
1964 <p class="Pp">In a work tree or a git repository directory, view changes
1965 committed in the 3 most recent commits to the work tree's branch, or the
1966 branch resolved via the repository's HEAD reference, respectively:</p>
1967 <p class="Pp"></p>
1968 <div class="Bd Bd-indent"><code class="Li">$ got log -p -l 3</code></div>
1969 <p class="Pp">As above, but display changes in the order in which
1970 <a class="Xr">patch(1)</a> could apply them in sequence:</p>
1971 <p class="Pp"></p>
1972 <div class="Bd Bd-indent"><code class="Li">$ got log -p -l 3 -R</code></div>
1973 <p class="Pp">In a work tree or a git repository directory, log the history of a
1974 subdirectory:</p>
1975 <p class="Pp"></p>
1976 <div class="Bd Bd-indent"><code class="Li">$ got log sys/uvm</code></div>
1977 <p class="Pp">While operating inside a work tree, paths are specified relative
1978 to the current working directory, so this command will log the subdirectory
1979 <span class="Pa">sys/uvm</span>:</p>
1980 <p class="Pp"></p>
1981 <div class="Bd Bd-indent"><code class="Li">$ cd sys/uvm &amp;&amp; got
1982 log&#x00A0;.</code></div>
1983 <p class="Pp">And this command has the same effect:</p>
1984 <p class="Pp"></p>
1985 <div class="Bd Bd-indent"><code class="Li">$ cd sys/dev/usb &amp;&amp; got log
1986 ../../uvm</code></div>
1987 <p class="Pp">And this command displays work tree meta-data about all tracked
1988 files:</p>
1989 <p class="Pp"></p>
1990 <div class="Bd Bd-indent"><code class="Li">$ cd /usr/src</code></div>
1991 <div class="Bd Bd-indent"><code class="Li">$ got info&#x00A0;. |
1992 less</code></div>
1993 <p class="Pp">Add new files and remove obsolete files in a work tree
1994 directory:</p>
1995 <p class="Pp"></p>
1996 <div class="Bd Bd-indent"><code class="Li">$ got add
1997 sys/uvm/uvm_ubc.c</code></div>
1998 <div class="Bd Bd-indent"><code class="Li">$ got remove
1999 sys/uvm/uvm_vnode.c</code></div>
2000 <p class="Pp">Create a new commit from local changes in a work tree directory
2001 with a pre-defined log message.</p>
2002 <p class="Pp"></p>
2003 <div class="Bd Bd-indent"><code class="Li">$ got commit -m 'unify the buffer
2004 cache'</code></div>
2005 <p class="Pp">Alternatively, create a new commit from local changes in a work
2006 tree directory with a log message that has been prepared in the file
2007 <span class="Pa">/tmp/msg</span>. If <a class="Xr">vi(1)</a> is set as the
2008 <code class="Ev">EDITOR</code>, <span class="Pa">/tmp/msg</span> can be read
2009 into the buffer for review:</p>
2010 <p class="Pp"></p>
2011 <div class="Bd Bd-indent"><code class="Li">$ got commit</code></div>
2012 <div class="Bd Bd-indent"><code class="Li">:r /tmp/msg</code></div>
2013 <p class="Pp">Update any work tree checked out from the
2014 &#x201C;unified-buffer-cache&#x201D; branch to the latest commit on this
2015 branch:</p>
2016 <p class="Pp"></p>
2017 <div class="Bd Bd-indent"><code class="Li">$ got update</code></div>
2018 <p class="Pp">Roll file content on the unified-buffer-cache branch back by one
2019 commit, and then fetch the rolled-back change into the work tree as a local
2020 change to be amended and perhaps committed again:</p>
2021 <p class="Pp"></p>
2022 <div class="Bd Bd-indent"><code class="Li">$ got backout
2023 unified-buffer-cache</code></div>
2024 <div class="Bd Bd-indent"><code class="Li">$ got commit -m 'roll back
2025 previous'</code></div>
2026 <div class="Bd Bd-indent"><code class="Li">$ # now back out the previous backout
2027 :-)</code></div>
2028 <div class="Bd Bd-indent"><code class="Li">$ got backout
2029 unified-buffer-cache</code></div>
2030 <p class="Pp">Fetch new upstream commits into the local repository's
2031 &#x201C;origin/master&#x201D; branch:</p>
2032 <p class="Pp"></p>
2033 <div class="Bd Bd-indent"><code class="Li">$ cd /usr/src</code></div>
2034 <div class="Bd Bd-indent"><code class="Li">$ got fetch</code></div>
2035 <p class="Pp">In a repository created with a HTTP URL and <code class="Cm">git
2036 clone --bare</code> the <a class="Xr">git-fetch(1)</a> command must be used
2037 instead:</p>
2038 <p class="Pp"></p>
2039 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/src.git</code></div>
2040 <div class="Bd Bd-indent"><code class="Li">$ git fetch origin
2041 master:refs/remotes/origin/master</code></div>
2042 <p class="Pp">Rebase the local &#x201C;master&#x201D; branch to merge the new
2043 changes that are now visible on the &#x201C;origin/master&#x201D;
2044 branch:</p>
2045 <p class="Pp"></p>
2046 <div class="Bd Bd-indent"><code class="Li">$ cd /usr/src</code></div>
2047 <div class="Bd Bd-indent"><code class="Li">$ got update -b
2048 origin/master</code></div>
2049 <div class="Bd Bd-indent"><code class="Li">$ got rebase master</code></div>
2050 <p class="Pp">Rebase the &#x201C;unified-buffer-cache&#x201D; branch on top of
2051 the new head commit of the &#x201C;master&#x201D; branch.</p>
2052 <p class="Pp"></p>
2053 <div class="Bd Bd-indent"><code class="Li">$ got update -b master</code></div>
2054 <div class="Bd Bd-indent"><code class="Li">$ got rebase
2055 unified-buffer-cache</code></div>
2056 <p class="Pp">Create a patch from all changes on the unified-buffer-cache
2057 branch. The patch can be mailed out for review and applied to
2058 <span class="Ux">OpenBSD</span>'s CVS tree:</p>
2059 <p class="Pp"></p>
2060 <div class="Bd Bd-indent"><code class="Li">$ got diff master
2061 unified-buffer-cache &gt; /tmp/ubc.diff</code></div>
2062 <p class="Pp">Edit the entire commit history of the
2063 &#x201C;unified-buffer-cache&#x201D; branch:</p>
2064 <p class="Pp"></p>
2065 <div class="Bd Bd-indent"><code class="Li">$ got update -b
2066 unified-buffer-cache</code></div>
2067 <div class="Bd Bd-indent"><code class="Li">$ got update -c master</code></div>
2068 <div class="Bd Bd-indent"><code class="Li">$ got histedit</code></div>
2069 <p class="Pp">In order to merge changes committed to the
2070 &#x201C;unified-buffer-cache&#x201D; branch back into the
2071 &#x201C;master&#x201D; branch, the &#x201C;unified-buffer-cache&#x201D;
2072 branch must first be rebased onto the &#x201C;master&#x201D; branch:</p>
2073 <p class="Pp"></p>
2074 <div class="Bd Bd-indent"><code class="Li">$ got update -b master</code></div>
2075 <div class="Bd Bd-indent"><code class="Li">$ got rebase
2076 unified-buffer-cache</code></div>
2077 <p class="Pp">Changes on the &#x201C;unified-buffer-cache&#x201D; branch can now
2078 be made visible on the &#x201C;master&#x201D; branch with
2079 <code class="Cm">got integrate</code>. Because the rebase operation switched
2080 the work tree to the &#x201C;unified-buffer-cache&#x201D; branch, the work
2081 tree must be switched back to the &#x201C;master&#x201D; branch before the
2082 &#x201C;unified-buffer-cache&#x201D; branch can be integrated into
2083 &#x201C;master&#x201D;:</p>
2084 <p class="Pp"></p>
2085 <div class="Bd Bd-indent"><code class="Li">$ got update -b master</code></div>
2086 <div class="Bd Bd-indent"><code class="Li">$ got integrate
2087 unified-buffer-cache</code></div>
2088 <p class="Pp">Additional steps may be necessary if local changes need to be
2089 pushed back to the remote repository, which currently requires
2090 <code class="Cm">git push</code>. Before working against existing branches
2091 in a repository cloned with <code class="Cm">git clone --bare</code> instead
2092 of <code class="Cm">got clone</code>, a Git &#x201C;refspec&#x201D; must be
2093 configured to map all references in the remote repository into the
2094 &#x201C;refs/remotes&#x201D; namespace of the local repository. This can
2095 achieved by setting Git's <span class="Pa">remote.origin.fetch</span>
2096 configuration variable to the value
2097 &#x201C;+refs/heads/*:refs/remotes/origin/*&#x201D; with the
2098 <code class="Cm">git config</code> command:</p>
2099 <p class="Pp"></p>
2100 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
2101 <div class="Bd Bd-indent"><code class="Li">$ git config remote.origin.fetch
2102 '+refs/heads/*:refs/remotes/origin/*'</code></div>
2103 <p class="Pp">Additionally, the &#x201C;mirror&#x201D; option must be
2104 disabled:</p>
2105 <p class="Pp"></p>
2106 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
2107 <div class="Bd Bd-indent"><code class="Li">$ git config remote.origin.mirror
2108 false</code></div>
2109 <p class="Pp">Alternatively, the following <a class="Xr">git-fetch(1)</a>
2110 configuration item can be added manually to the Git repository's
2111 <span class="Pa">config</span> file:</p>
2112 <p class="Pp"></p>
2113 <div class="Bd Bd-indent"><code class="Li">[remote origin</code></div>
2115 <div class="Bd Bd-indent"><code class="Li">url = ...</code></div>
2116 <div class="Bd Bd-indent"><code class="Li">fetch =
2117 +refs/heads/*:refs/remotes/origin/*</code></div>
2118 <div class="Bd Bd-indent"><code class="Li">mirror = false</code></div>
2119 <p class="Pp">This configuration leaves the local repository's
2120 &#x201C;refs/heads&#x201D; namespace free for use by local branches checked
2121 out with <code class="Cm">got checkout</code> and, if needed, created with
2122 <code class="Cm">got branch</code>.</p>
2123 <p class="Pp">Branches in the &#x201C;remotes/origin&#x201D; namespace can now
2124 be updated with incoming changes from the remote repository with
2125 <code class="Cm">got fetch</code> or <a class="Xr">git-fetch(1)</a> without
2126 extra command line arguments:</p>
2127 <p class="Pp"></p>
2128 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
2129 <div class="Bd Bd-indent"><code class="Li">$ git fetch</code></div>
2130 <p class="Pp">To make changes fetched from the remote repository appear on the
2131 &#x201C;master&#x201D; branch, the &#x201C;master&#x201D; branch must be
2132 rebased onto the &#x201C;origin/master&#x201D; branch. This will also merge
2133 local changes, if any, with the incoming changes:</p>
2134 <p class="Pp"></p>
2135 <div class="Bd Bd-indent"><code class="Li">$ got update -b
2136 origin/master</code></div>
2137 <div class="Bd Bd-indent"><code class="Li">$ got rebase master</code></div>
2138 <p class="Pp">On the &#x201C;master&#x201D; branch, log messages for local
2139 changes can now be amended with &#x201C;OK&#x201D; by other developers and
2140 any other important new information:</p>
2141 <p class="Pp"></p>
2142 <div class="Bd Bd-indent"><code class="Li">$ got update -c
2143 origin/master</code></div>
2144 <div class="Bd Bd-indent"><code class="Li">$ got histedit -m</code></div>
2145 <p class="Pp">Local changes on the &#x201C;master&#x201D; branch can then be
2146 pushed to the remote repository with <code class="Cm">git push</code>:</p>
2147 <p class="Pp"></p>
2148 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
2149 <div class="Bd Bd-indent"><code class="Li">$ git push origin master</code></div>
2150 </section>
2151 <section class="Sh">
2152 <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
2153 ALSO</a></h1>
2154 <p class="Pp"><a class="Xr">tog(1)</a>, <a class="Xr">git-repository(5)</a>,
2155 <a class="Xr">got-worktree(5)</a>, <a class="Xr">got.conf(5)</a></p>
2156 </section>
2157 <section class="Sh">
2158 <h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
2159 <p class="Pp"><span class="An">Stefan Sperling</span>
2160 &lt;<a class="Mt" href="mailto:stsp@openbsd.org">stsp@openbsd.org</a>&gt;
2161 <br/>
2162 <span class="An">Martin Pieuchot</span>
2163 &lt;<a class="Mt" href="mailto:mpi@openbsd.org">mpi@openbsd.org</a>&gt;
2164 <br/>
2165 <span class="An">Joshua Stein</span>
2166 &lt;<a class="Mt" href="mailto:jcs@openbsd.org">jcs@openbsd.org</a>&gt;
2167 <br/>
2168 <span class="An">Ori Bernstein</span>
2169 &lt;<a class="Mt" href="mailto:ori@openbsd.org">ori@openbsd.org</a>&gt;</p>
2170 </section>
2171 <section class="Sh">
2172 <h1 class="Sh" id="CAVEATS"><a class="permalink" href="#CAVEATS">CAVEATS</a></h1>
2173 <p class="Pp"><code class="Nm">got</code> is a work-in-progress and many
2174 commands remain to be implemented. At present, the user has to fall back on
2175 <a class="Xr">git(1)</a> to perform many tasks, in particular tasks related
2176 to repository administration and tasks which require a network
2177 connection.</p>
2178 </section>
2179 </div>
2180 <table class="foot">
2181 <tr>
2182 <td class="foot-date">December 13, 2020</td>
2183 <td class="foot-os">OpenBSD 6.8</td>
2184 </tr>
2185 </table>
2186 </body>
2187 </html>