3 <!-- This is an automatically generated file. Do not edit.
4 Copyright (c) 2017 Martin Pieuchot
5 Copyright (c) 2018, 2019 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.
20 <meta charset="utf-8"/>
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 div.Pp { margin: 1ex 0ex; }
26 div.Nd, div.Bf, div.Op { display: inline; }
27 span.Pa, span.Ad { font-style: italic; }
28 span.Ms { font-weight: bold; }
29 dl.Bl-diag > dt { font-weight: bold; }
30 code.Nm, code.Fl, code.Cm, code.Ic, code.In, code.Fd, code.Fn,
31 code.Cd { font-weight: bold; font-family: inherit; }
38 <td class="head-ltitle">GOT(1)</td>
39 <td class="head-vol">General Commands Manual</td>
40 <td class="head-rtitle">GOT(1)</td>
43 <div class="manual-text">
45 <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
46 <code class="Nm">got</code> —
47 <div class="Nd">Game of Trees</div>
50 <h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
53 <td><code class="Nm">got</code></td>
54 <td><var class="Ar">command</var> [<code class="Fl">-h</code>]
55 [<var class="Ar">arg ...</var>]</td>
60 <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
61 <code class="Nm">got</code> is a version control system which stores the history
62 of tracked files in a Git repository, as used by the Git version control
63 system. This repository format is described in
64 <a class="Xr">git-repository(5)</a>.
65 <p class="Pp"><code class="Nm">got</code> is a “distributed”
66 version control system because every copy of a repository is writeable.
67 Modifications made to files can be synchronized between repositories at any
69 <p class="Pp">Files managed by <code class="Nm">got</code> must be checked out
70 from the repository for modification. Checked out files are stored in a
71 <i class="Em">work tree</i> which can be placed at an arbitrary directory in
72 the filesystem hierarchy. The on-disk format of this work tree is described
73 in <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 preceed the command name, and are as
78 <dt><a class="permalink" href="#h"><code class="Fl" id="h">-h</code></a></dt>
79 <dd>Display usage information and exit immediately.</dd>
80 <dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></dt>
81 <dd>Display program version and exit immediately.</dd>
83 <p class="Pp">The commands for <code class="Nm">got</code> are as follows:</p>
85 <dt><a class="permalink" href="#init"><code class="Cm" id="init">init</code></a>
86 <var class="Ar">repository-path</var></dt>
87 <dd>Create a new empty repository at the specified
88 <var class="Ar">repository-path</var>.
89 <p class="Pp">After <code class="Cm">got init</code>, the
90 <code class="Cm">got import</code> command must be used to populate the
91 empty repository before <code class="Cm">got checkout</code> can be
94 <dt><a class="permalink" href="#in"><code class="Cm" id="in">in</code></a></dt>
95 <dd>Short alias for <code class="Cm">init</code>.</dd>
96 <dt><a class="permalink" href="#import"><code class="Cm" id="import">import</code></a>
97 [<code class="Fl">-b</code> <var class="Ar">branch</var>]
98 [<code class="Fl">-m</code> <var class="Ar">message</var>]
99 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
100 [<code class="Fl">-I</code> <var class="Ar">pattern</var>]
101 <var class="Ar">directory</var></dt>
102 <dd>Create an initial commit in a repository from the file hierarchy within
103 the specified <var class="Ar">directory</var>. The created commit will not
104 have any parent commits, i.e. it will be a root commit. Also create a new
105 reference which provides a branch name for the newly created commit. Show
106 the path of each imported file to indicate progress.
107 <p class="Pp">The <code class="Cm">got import</code> command requires the
108 <code class="Ev">GOT_AUTHOR</code> environment variable to be set.</p>
109 <p class="Pp">The options for <code class="Cm">got import</code> are as
112 <dt><a class="permalink" href="#b"><code class="Fl" id="b">-b</code></a>
113 <var class="Ar">branch</var></dt>
114 <dd>Create the specified <var class="Ar">branch</var> instead of creating
115 the default branch “master”. Use of this option is
116 required if the “master” branch already exists.</dd>
117 <dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a>
118 <var class="Ar">message</var></dt>
119 <dd>Use the specified log message when creating the new commit. Without
120 the <code class="Fl">-m</code> option, <code class="Cm">got
121 import</code> opens a temporary file in an editor where a log message
123 <dt><a class="permalink" href="#r"><code class="Fl" id="r">-r</code></a>
124 <var class="Ar">repository-path</var></dt>
125 <dd>Use the repository at the specified path. If not specified, assume the
126 repository is located at or above the current working directory.</dd>
127 <dt><a class="permalink" href="#I"><code class="Fl" id="I">-I</code></a>
128 <var class="Ar">pattern</var></dt>
129 <dd>Ignore files or directories with a name which matches the specified
130 <var class="Ar">pattern</var>. This option may be specified multiple
131 times to build a list of ignore patterns. The
132 <var class="Ar">pattern</var> follows the globbing rules documented in
133 <a class="Xr">glob(7)</a>.</dd>
136 <dt><a class="permalink" href="#im"><code class="Cm" id="im">im</code></a></dt>
137 <dd>Short alias for <code class="Cm">import</code>.</dd>
138 <dt><a class="permalink" href="#checkout"><code class="Cm" id="checkout">checkout</code></a>
139 [<code class="Fl">-b</code> <var class="Ar">branch</var>]
140 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
141 [<code class="Fl">-p</code> <var class="Ar">path-prefix</var>]
142 <var class="Ar">repository-path</var>
143 [<var class="Ar">work-tree-path</var>]</dt>
144 <dd>Copy files from a repository into a new work tree. If the
145 <var class="Ar">work tree path</var> is not specified, either use the last
146 component of <var class="Ar">repository path</var>, or if a
147 <var class="Ar">path prefix</var> was specified use the last component of
148 <var class="Ar">path prefix</var>.
149 <p class="Pp">The options for <code class="Cm">got checkout</code> are as
152 <dt><a class="permalink" href="#b_2"><code class="Fl" id="b_2">-b</code></a>
153 <var class="Ar">branch</var></dt>
154 <dd>Check out files from a commit on the specified
155 <var class="Ar">branch</var>. If this option is not specified, a
156 branch resolved via the repository's HEAD reference will be used.</dd>
157 <dt><a class="permalink" href="#c"><code class="Fl" id="c">-c</code></a>
158 <var class="Ar">commit</var></dt>
159 <dd>Check out files from the specified <var class="Ar">commit</var> on the
160 selected branch. The expected argument is a commit ID SHA1 hash or an
161 existing reference which will be resolved to a commit ID. An
162 abbreviated hash argument will be expanded to a full SHA1 hash
163 automatically, provided the abbreviation is unique. If this option is
164 not specified, the most recent commit on the selected branch will be
166 <dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
167 <var class="Ar">path-prefix</var></dt>
168 <dd>Restrict the work tree to a subset of the repository's tree hierarchy.
169 Only files beneath the specified <var class="Ar">path-prefix</var>
170 will be checked out.</dd>
173 <dt><a class="permalink" href="#co"><code class="Cm" id="co">co</code></a></dt>
174 <dd>Short alias for <code class="Cm">checkout</code>.</dd>
175 <dt><a class="permalink" href="#update"><code class="Cm" id="update">update</code></a>
176 [<code class="Fl">-b</code> <var class="Ar">branch</var>]
177 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
178 [<var class="Ar">path ...</var>]</dt>
179 <dd>Update an existing work tree to a different commit. Show the status of
180 each affected file, using the following status codes:
181 <table class="Bl-column">
184 <td>file was updated and contained no local changes</td>
188 <td>file was updated and local changes were merged cleanly</td>
192 <td>file was updated and conflicts occurred during merge</td>
196 <td>file was deleted</td>
200 <td>new file was added</td>
204 <td>versioned file is obstructed by a non-regular file</td>
208 <td>a missing versioned file was restored</td>
211 <p class="Pp">If no <var class="Ar">path</var> is specified, update the
212 entire work tree. Otherwise, restrict the update operation to files at
213 or within the specified paths. Each path is required to exist in the
214 update operation's target commit. Files in the work tree outside
215 specified paths will remain unchanged and will retain their previously
216 recorded base commit. Some <code class="Nm">got</code> commands may
217 refuse to run while the work tree contains files from multiple base
218 commits. The base commit of such a work tree can be made consistent by
219 running <code class="Cm">got update</code> across the entire work tree.
220 Specifying a <var class="Ar">path</var> is incompatible with the
221 <code class="Fl">-b</code> option.</p>
222 <p class="Pp"><code class="Cm">got update</code> cannot update paths with
223 staged changes. If changes have been staged with <code class="Cm">got
224 stage</code>, these changes must first be comitted with
225 <code class="Cm">got commit</code> or unstaged with <code class="Cm">got
227 <p class="Pp">The options for <code class="Cm">got update</code> are as
230 <dt><a class="permalink" href="#b_3"><code class="Fl" id="b_3">-b</code></a>
231 <var class="Ar">branch</var></dt>
232 <dd>Switch the work tree's branch reference to the specified
233 <var class="Ar">branch</var> before updating the work tree. This
234 option requires that all paths in the work tree are updated.</dd>
235 <dt><a class="permalink" href="#c_2"><code class="Fl" id="c_2">-c</code></a>
236 <var class="Ar">commit</var></dt>
237 <dd>Update the work tree to the specified <var class="Ar">commit</var>.
238 The expected argument is a commit ID SHA1 hash or an existing
239 reference which will be resolved to a commit ID. An abbreviated hash
240 argument will be expanded to a full SHA1 hash automatically, provided
241 the abbreviation is unique. If this option is not specified, the most
242 recent commit on the work tree's branch will be used.</dd>
245 <dt><a class="permalink" href="#up"><code class="Cm" id="up">up</code></a></dt>
246 <dd>Short alias for <code class="Cm">update</code>.</dd>
247 <dt><a class="permalink" href="#status"><code class="Cm" id="status">status</code></a>
248 [<var class="Ar">path ...</var>]</dt>
249 <dd>Show the current modification status of files in a work tree, using the
250 following status codes:
251 <table class="Bl-column">
254 <td>modified file</td>
258 <td>file scheduled for addition in next commit</td>
262 <td>file scheduled for deletion in next commit</td>
266 <td>modified or added file which contains merge conflicts</td>
270 <td>versioned file was expected on disk but is missing</td>
274 <td>versioned file is obstructed by a non-regular file</td>
278 <td>unversioned item not tracked by <code class="Nm">got</code></td>
281 <p class="Pp">If no <var class="Ar">path</var> is specified, show
282 modifications in the entire work tree. Otherwise, show modifications at
283 or within the specified paths.</p>
284 <p class="Pp">If changes have been staged with <code class="Cm">got
285 stage</code>, staged changes are shown in the second output column,
286 using the following status codes:</p>
287 <table class="Bl-column">
290 <td>file modification is staged</td>
294 <td>file addition is staged</td>
298 <td>file deletion is staged</td>
301 <p class="Pp">Changes created on top of staged changes are indicated in the
303 <table class="Bl-column">
306 <td>file was modified after earlier changes have been staged</td>
310 <td>file was modified after having been staged for addition</td>
313 <p class="Pp">For compatibility with <a class="Xr">cvs(1)</a>,
314 <code class="Cm">got status</code> parses
315 <span class="Pa">.cvsignore</span> files in each traversed directory and
316 will not display unversioned files which match <a class="Xr">glob(7)</a>
317 ignore patterns contained in <span class="Pa">.cvsignore</span> files.
318 Unlike <a class="Xr">cvs(1)</a>, <code class="Cm">got status</code> only
319 supports a single ignore pattern per line.</p>
321 <dt><a class="permalink" href="#st"><code class="Cm" id="st">st</code></a></dt>
322 <dd>Short alias for <code class="Cm">status</code>.</dd>
323 <dt><a class="permalink" href="#log"><code class="Cm" id="log">log</code></a>
324 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
325 [<code class="Fl">-C</code> <var class="Ar">number</var>]
326 [<code class="Fl">-f</code>] [<code class="Fl">-l</code>
327 <var class="Ar">N</var>] [<code class="Fl">-p</code>]
328 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
329 [<var class="Ar">path</var>]</dt>
330 <dd>Display history of a repository. If a <var class="Ar">path</var> is
331 specified, show only commits which modified this path.
332 <p class="Pp">The options for <code class="Cm">got log</code> are as
335 <dt><a class="permalink" href="#c_3"><code class="Fl" id="c_3">-c</code></a>
336 <var class="Ar">commit</var></dt>
337 <dd>Start traversing history at the specified
338 <var class="Ar">commit</var>. The expected argument is a commit ID
339 SHA1 hash or an existing reference which will be resolved to a commit
340 ID. An abbreviated hash argument will be expanded to a full SHA1 hash
341 automatically, provided the abbreviation is unique. If this option is
342 not specified, default to the work tree's current branch if invoked in
343 a work tree, or to the repository's HEAD reference.</dd>
344 <dt><a class="permalink" href="#C"><code class="Fl" id="C">-C</code></a>
345 <var class="Ar">number</var></dt>
346 <dd>Set the number of context lines shown in diffs with
347 <code class="Fl">-p</code>. By default, 3 lines of context are
349 <dt><a class="permalink" href="#f"><code class="Fl" id="f">-f</code></a></dt>
350 <dd>Restrict history traversal to the first parent of each commit. This
351 shows the linear history of the current branch only. Merge commits
352 which affected the current branch will be shown but individual commits
353 which originated on other branches will be omitted.</dd>
354 <dt><a class="permalink" href="#l"><code class="Fl" id="l">-l</code></a>
355 <var class="Ar">N</var></dt>
356 <dd>Limit history traversal to a given number of commits.</dd>
357 <dt><a class="permalink" href="#p_2"><code class="Fl" id="p_2">-p</code></a></dt>
358 <dd>Display the patch of modifications made in each commit.</dd>
359 <dt><a class="permalink" href="#r_2"><code class="Fl" id="r_2">-r</code></a>
360 <var class="Ar">repository-path</var></dt>
361 <dd>Use the repository at the specified path. If not specified, assume the
362 repository is located at or above the current working directory. If
363 this directory is a <code class="Nm">got</code> work tree, use the
364 repository path associated with this work tree.</dd>
367 <dt><a class="permalink" href="#diff"><code class="Cm" id="diff">diff</code></a>
368 [<code class="Fl">-C</code> <var class="Ar">number</var>]
369 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
370 [<code class="Fl">-s</code>] [<var class="Ar">object1</var>
371 <var class="Ar">object2</var> | <var class="Ar">path</var>]</dt>
372 <dd>When invoked within a work tree with less than two arguments, display
373 uncommitted changes in the work tree. If a <var class="Ar">path</var> is
374 specified, only show changes within this path.
375 <p class="Pp">If two arguments are provided, treat each argument as a
376 reference, or an object ID SHA1 hash, and display differences between
377 these objects. Both objects must be of the same type (blobs, trees, or
378 commits). An abbreviated hash argument will be expanded to a full SHA1
379 hash automatically, provided the abbreviation is unique.</p>
380 <p class="Pp">The options for <code class="Cm">got diff</code> are as
383 <dt><a class="permalink" href="#C_2"><code class="Fl" id="C_2">-C</code></a>
384 <var class="Ar">number</var></dt>
385 <dd>Set the number of context lines shown in the diff. By default, 3 lines
386 of context are shown.</dd>
387 <dt><a class="permalink" href="#r_3"><code class="Fl" id="r_3">-r</code></a>
388 <var class="Ar">repository-path</var></dt>
389 <dd>Use the repository at the specified path. If not specified, assume the
390 repository is located at or above the current working directory. If
391 this directory is a <code class="Nm">got</code> work tree, use the
392 repository path associated with this work tree.</dd>
393 <dt><a class="permalink" href="#s"><code class="Fl" id="s">-s</code></a></dt>
394 <dd>Show changes staged with <code class="Cm">got stage</code> instead of
395 showing local changes. This option is only valid when
396 <code class="Cm">got diff</code> is invoked in a work tree.</dd>
399 <dt><a class="permalink" href="#di"><code class="Cm" id="di">di</code></a></dt>
400 <dd>Short alias for <code class="Cm">diff</code>.</dd>
401 <dt><a class="permalink" href="#blame"><code class="Cm" id="blame">blame</code></a>
402 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
403 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
404 <var class="Ar">path</var></dt>
405 <dd>Display line-by-line history of a file at the specified path.
406 <p class="Pp">The options for <code class="Cm">got blame</code> are as
409 <dt><a class="permalink" href="#c_4"><code class="Fl" id="c_4">-c</code></a>
410 <var class="Ar">commit</var></dt>
411 <dd>Start traversing history at the specified
412 <var class="Ar">commit</var>. The expected argument is a commit ID
413 SHA1 hash or an existing reference which will be resolved to a commit
414 ID. An abbreviated hash argument will be expanded to a full SHA1 hash
415 automatically, provided the abbreviation is unique.</dd>
416 <dt><a class="permalink" href="#r_4"><code class="Fl" id="r_4">-r</code></a>
417 <var class="Ar">repository-path</var></dt>
418 <dd>Use the repository at the specified path. If not specified, assume the
419 repository is located at or above the current working directory. If
420 this directory is a <code class="Nm">got</code> work tree, use the
421 repository path associated with this work tree.</dd>
424 <dt><a class="permalink" href="#bl"><code class="Cm" id="bl">bl</code></a></dt>
425 <dd>Short alias for <code class="Cm">blame</code>.</dd>
426 <dt><a class="permalink" href="#tree"><code class="Cm" id="tree">tree</code></a>
427 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
428 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
429 [<code class="Fl">-i</code>] [<code class="Fl">-R]</code>
430 [<var class="Ar">path</var>]</dt>
431 <dd>Display a listing of files and directories at the specified directory path
432 in the repository. Entries shown in this listing may carry one of the
433 following trailing annotations:
434 <table class="Bl-column">
437 <td>entry is a directory</td>
441 <td>entry is an executable file</td>
444 <p class="Pp">If no <var class="Ar">path</var> is specified, list the
445 repository path corresponding to the current directory of the work tree,
446 or the root directory of the repository if there is no work tree.</p>
447 <p class="Pp">The options for <code class="Cm">got tree</code> are as
450 <dt><a class="permalink" href="#c_5"><code class="Fl" id="c_5">-c</code></a>
451 <var class="Ar">commit</var></dt>
452 <dd>List files and directories as they appear in the specified
453 <var class="Ar">commit</var>. The expected argument is a commit ID
454 SHA1 hash or an existing reference which will be resolved to a commit
455 ID. An abbreviated hash argument will be expanded to a full SHA1 hash
456 automatically, provided the abbreviation is unique.</dd>
457 <dt><a class="permalink" href="#r_5"><code class="Fl" id="r_5">-r</code></a>
458 <var class="Ar">repository-path</var></dt>
459 <dd>Use the repository at the specified path. If not specified, assume the
460 repository is located at or above the current working directory. If
461 this directory is a <code class="Nm">got</code> work tree, use the
462 repository path associated with this work tree.</dd>
463 <dt><a class="permalink" href="#i"><code class="Fl" id="i">-i</code></a></dt>
464 <dd>Show object IDs of files (blob objects) and directories (tree
466 <dt><a class="permalink" href="#R"><code class="Fl" id="R">-R</code></a></dt>
467 <dd>Recurse into sub-directories in the repository.</dd>
470 <dt><a class="permalink" href="#tr"><code class="Cm" id="tr">tr</code></a></dt>
471 <dd>Short alias for <code class="Cm">tree</code>.</dd>
472 <dt><a class="permalink" href="#ref"><code class="Cm" id="ref">ref</code></a>
473 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
474 [<code class="Fl">-l</code>] [<code class="Fl">-d</code>
475 <var class="Ar">name</var>] [<var class="Ar">name</var>
476 <var class="Ar">target</var>]</dt>
477 <dd>Manage references in a repository.
478 <p class="Pp">If no options are passed, expect two arguments and attempt to
479 create, or update, the reference with the given
480 <var class="Ar">name</var>, and make it point at the given
481 <var class="Ar">target</var>. The target may be an object ID SHA1 hash
482 or an existing reference which will be resolved to an object ID. An
483 abbreviated hash argument will be expanded to a full SHA1 hash
484 automatically, provided the abbreviation is unique.</p>
485 <p class="Pp">The options for <code class="Cm">got ref</code> are as
488 <dt><a class="permalink" href="#r_6"><code class="Fl" id="r_6">-r</code></a>
489 <var class="Ar">repository-path</var></dt>
490 <dd>Use the repository at the specified path. If not specified, assume the
491 repository is located at or above the current working directory. If
492 this directory is a <code class="Nm">got</code> work tree, use the
493 repository path associated with this work tree.</dd>
494 <dt><a class="permalink" href="#l_2"><code class="Fl" id="l_2">-l</code></a></dt>
495 <dd>List all existing references in the repository.</dd>
496 <dt><a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a>
497 <var class="Ar">name</var></dt>
498 <dd>Delete the reference with the specified name from the repository.</dd>
501 <dt><a class="permalink" href="#branch"><code class="Cm" id="branch">branch</code></a>
502 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
503 [<code class="Fl">-l</code>] [<code class="Fl">-d</code>
504 <var class="Ar">name</var>] [<var class="Ar">name</var>
505 [<var class="Ar">base-branch</var>]]</dt>
506 <dd>Manage branches in a repository.
507 <p class="Pp">Branches are managed via references which live in the
508 “refs/heads/” reference namespace. The
509 <code class="Cm">got branch</code> command operates on references in
510 this namespace only.</p>
511 <p class="Pp">If no options are passed, expect one or two arguments and
512 attempt to create a branch with the given <var class="Ar">name</var>,
513 and make it point at the given <var class="Ar">base-branch</var>. If no
514 <var class="Ar">base-branch</var> is specified, default to the work
515 tree's current branch if invoked in a work tree, or to the repository's
517 <p class="Pp">The options for <code class="Cm">got branch</code> are as
520 <dt><a class="permalink" href="#r_7"><code class="Fl" id="r_7">-r</code></a>
521 <var class="Ar">repository-path</var></dt>
522 <dd>Use the repository at the specified path. If not specified, assume the
523 repository is located at or above the current working directory. If
524 this directory is a <code class="Nm">got</code> work tree, use the
525 repository path associated with this work tree.</dd>
526 <dt><a class="permalink" href="#l_3"><code class="Fl" id="l_3">-l</code></a></dt>
527 <dd>List all existing branches in the repository. If invoked in a work
528 tree, the work tree's current branch is shown with one the following
530 <table class="Bl-column">
533 <td>work tree's base commit matches the branch tip</td>
537 <td>work tree's base commit is out-of-date</td>
541 <dt><a class="permalink" href="#d_2"><code class="Fl" id="d_2">-d</code></a>
542 <var class="Ar">name</var></dt>
543 <dd>Delete the branch with the specified name from the repository. Only
544 the branch reference is deleted. Any commit, tree, and blob objects
545 belonging to the branch remain in the repository and may be removed
546 separately with Git's garbage collector.</dd>
549 <dt><a class="permalink" href="#br"><code class="Cm" id="br">br</code></a></dt>
550 <dd>Short alias for <code class="Cm">branch</code>.</dd>
551 <dt><a class="permalink" href="#add"><code class="Cm" id="add">add</code></a>
552 <var class="Ar">file-path ...</var></dt>
553 <dd>Schedule unversioned files in a work tree for addition to the repository
554 in the next commit.</dd>
555 <dt><a class="permalink" href="#remove"><code class="Cm" id="remove">remove</code></a>
556 <var class="Ar">file-path ...</var></dt>
557 <dd>Remove versioned files from a work tree and schedule them for deletion
558 from the repository in the next commit.
559 <p class="Pp">The options for <code class="Cm">got remove</code> are as
562 <dt><a class="permalink" href="#f_2"><code class="Fl" id="f_2">-f</code></a></dt>
563 <dd>Perform the operation even if a file contains uncommitted
567 <dt><a class="permalink" href="#rm"><code class="Cm" id="rm">rm</code></a></dt>
568 <dd>Short alias for <code class="Cm">remove</code>.</dd>
569 <dt><a class="permalink" href="#revert"><code class="Cm" id="revert">revert</code></a>
570 [<code class="Fl">-p</code>] [<code class="Fl">-F</code>
571 <var class="Ar">response-script</var>] [<code class="Fl">-R</code>]
572 <var class="Ar">path ...</var></dt>
573 <dd>Revert any uncommited changes in files at the specified paths. File
574 contents will be overwritten with those contained in the work tree's base
575 commit. There is no way to bring discarded changes back after
576 <code class="Cm">got revert</code>!
577 <p class="Pp">If a file was added with <code class="Cm">got add</code> it
578 will become an unversioned file again. If a file was deleted with
579 <code class="Cm">got remove</code> it will be restored.</p>
580 <p class="Pp">The options for <code class="Cm">got revert</code> are as
583 <dt><a class="permalink" href="#p_3"><code class="Fl" id="p_3">-p</code></a></dt>
584 <dd>Instead of reverting all changes in files, interactively select or
585 reject changes to revert based on “y” (revert change),
586 “n” (keep change), and “q” (quit reverting
587 this file) responses. If a file is in modified status, individual
588 patches derived from the modified file content can be reverted. Files
589 in added or deleted status may only be reverted in their
591 <dt><a class="permalink" href="#F"><code class="Fl" id="F">-F</code></a>
592 <var class="Ar">response-script</var></dt>
593 <dd>With the <code class="Fl">-p</code> option, read “y”,
594 “n”, and “q” responses line-by-line from
595 the specified <var class="Ar">response-script</var> file instead of
596 prompting interactively.</dd>
597 <dt><a class="permalink" href="#R_2"><code class="Fl" id="R_2">-R</code></a></dt>
598 <dd>Permit recursion into directories. If this option is not specified,
599 <code class="Cm">got revert</code> will refuse to run if a specified
600 <var class="Ar">path</var> is a directory.</dd>
603 <dt><a class="permalink" href="#rv"><code class="Cm" id="rv">rv</code></a></dt>
604 <dd>Short alias for <code class="Cm">revert</code>.</dd>
605 <dt><a class="permalink" href="#commit"><code class="Cm" id="commit">commit</code></a>
606 [<code class="Fl">-m</code> <var class="Ar">message</var>]
607 [<var class="Ar">path ...</var>]</dt>
608 <dd>Create a new commit in the repository from changes in a work tree and use
609 this commit as the new base commit for the work tree. If no
610 <var class="Ar">path</var> is specified, commit all changes in the work
611 tree. Otherwise, commit changes at or within the specified paths.
612 <p class="Pp">If changes have been explicitly staged for commit with
613 <code class="Cm">got stage,</code> only commit staged changes and reject
614 any specified paths which have not been staged.</p>
615 <p class="Pp">Show the status of each affected file, using the following
617 <table class="Bl-column">
620 <td>modified file</td>
624 <td>file was deleted</td>
628 <td>new file was added</td>
631 <p class="Pp">Files which are not part of the new commit will retain their
632 previously recorded base commit. Some <code class="Nm">got</code>
633 commands may refuse to run while the work tree contains files from
634 multiple base commits. The base commit of such a work tree can be made
635 consistent by running <code class="Cm">got update</code> across the
636 entire work tree.</p>
637 <p class="Pp">The <code class="Cm">got commit</code> command requires the
638 <code class="Ev">GOT_AUTHOR</code> environment variable to be set.</p>
639 <p class="Pp">The options for <code class="Cm">got commit</code> are as
642 <dt><a class="permalink" href="#m_2"><code class="Fl" id="m_2">-m</code></a>
643 <var class="Ar">message</var></dt>
644 <dd>Use the specified log message when creating the new commit. Without
645 the <code class="Fl">-m</code> option, <code class="Cm">got
646 commit</code> opens a temporary file in an editor where a log message
649 <p class="Pp"><code class="Cm">got commit</code> will refuse to run if
650 certain preconditions are not met. If the work tree's current branch is
651 not in the “refs/heads/” reference namespace, new commits
652 may not be created on this branch. Local changes may only be committed
653 if they are based on file content found in the most recent commit on the
654 work tree's branch. If a path is found to be out of date,
655 <code class="Cm">got update</code> must be used first in order to merge
656 local changes with changes made in the repository.</p>
658 <dt><a class="permalink" href="#ci"><code class="Cm" id="ci">ci</code></a></dt>
659 <dd>Short alias for <code class="Cm">commit</code>.</dd>
660 <dt><a class="permalink" href="#cherrypick"><code class="Cm" id="cherrypick">cherrypick</code></a>
661 <var class="Ar">commit</var></dt>
662 <dd>Merge changes from a single <var class="Ar">commit</var> into the work
663 tree. The specified <var class="Ar">commit</var> must be on a different
664 branch than the work tree's base commit. The expected argument is a
665 reference or a commit ID SHA1 hash. An abbreviated hash argument will be
666 expanded to a full SHA1 hash automatically, provided the abbreviation is
668 <p class="Pp">Show the status of each affected file, using the following
670 <table class="Bl-column">
673 <td>file was merged</td>
677 <td>file was merged and conflicts occurred during merge</td>
681 <td>changes destined for a missing file were not merged</td>
685 <td>file was deleted</td>
689 <td>file's deletion was obstructed by local modifications</td>
693 <td>new file was added</td>
697 <td>changes destined for a non-regular file were not merged</td>
700 <p class="Pp">The merged changes will appear as local changes in the work
701 tree, which may be viewed with <code class="Cm">got diff</code>, amended
702 manually or with further <code class="Cm">got cherrypick</code> comands,
703 committed with <code class="Cm">got commit</code>, or discarded again
704 with <code class="Cm">got revert</code>.</p>
705 <p class="Pp"><code class="Cm">got cherrypick</code> will refuse to run if
706 certain preconditions are not met. If the work tree contains multiple
707 base commits it must first be updated to a single base commit with
708 <code class="Cm">got update</code>. If the work tree already contains
709 files with merge conflicts, these conflicts must be resolved first.</p>
711 <dt><a class="permalink" href="#cy"><code class="Cm" id="cy">cy</code></a></dt>
712 <dd>Short alias for <code class="Cm">cherrypick</code>.</dd>
713 <dt><a class="permalink" href="#backout"><code class="Cm" id="backout">backout</code></a>
714 <var class="Ar">commit</var></dt>
715 <dd>Reverse-merge changes from a single <var class="Ar">commit</var> into the
716 work tree. The specified <var class="Ar">commit</var> must be on the same
717 branch as the work tree's base commit. The expected argument is a
718 reference or a commit ID SHA1 hash. An abbreviated hash argument will be
719 expanded to a full SHA1 hash automatically, provided the abbreviation is
721 <p class="Pp">Show the status of each affected file, using the following
723 <table class="Bl-column">
726 <td>file was merged</td>
730 <td>file was merged and conflicts occurred during merge</td>
734 <td>changes destined for a missing file were not merged</td>
738 <td>file was deleted</td>
742 <td>file's deletion was obstructed by local modifications</td>
746 <td>new file was added</td>
750 <td>changes destined for a non-regular file were not merged</td>
753 <p class="Pp">The reverse-merged changes will appear as local changes in the
754 work tree, which may be viewed with <code class="Cm">got diff</code>,
755 amended manually or with further <code class="Cm">got backout</code>
756 comands, committed with <code class="Cm">got commit</code>, or discarded
757 again with <code class="Cm">got revert</code>.</p>
758 <p class="Pp"><code class="Cm">got backout</code> will refuse to run if
759 certain preconditions are not met. If the work tree contains multiple
760 base commits it must first be updated to a single base commit with
761 <code class="Cm">got update</code>. If the work tree already contains
762 files with merge conflicts, these conflicts must be resolved first.</p>
764 <dt><a class="permalink" href="#bo"><code class="Cm" id="bo">bo</code></a></dt>
765 <dd>Short alias for <code class="Cm">backout</code>.</dd>
766 <dt><a class="permalink" href="#rebase"><code class="Cm" id="rebase">rebase</code></a>
767 [<code class="Fl">-a</code>] [<code class="Fl">-c]</code>
768 [<var class="Ar">branch</var>]</dt>
769 <dd>Rebase commits on the specified <var class="Ar">branch</var> onto the tip
770 of the current branch of the work tree. The <var class="Ar">branch</var>
771 must share common ancestry with the work tree's current branch. Rebasing
772 begins with the first descendent commit of the youngest common ancestor
773 commit shared by the specified <var class="Ar">branch</var> and the work
774 tree's current branch, and stops once the tip commit of the specified
775 <var class="Ar">branch</var> has been rebased.
776 <p class="Pp">Rebased commits are accumulated on a temporary branch which
777 the work tree will remain switched to throughout the entire rebase
778 operation. Commits on this branch represent the same changes with the
779 same log messages as their counterparts on the original
780 <var class="Ar">branch</var>, but with different commit IDs. Once
781 rebasing has completed successfully, the temporary branch becomes the
782 new version of the specified <var class="Ar">branch</var> and the work
783 tree is automatically switched to it.</p>
784 <p class="Pp">While rebasing commits, show the status of each affected file,
785 using the following status codes:</p>
786 <table class="Bl-column">
789 <td>file was merged</td>
793 <td>file was merged and conflicts occurred during merge</td>
797 <td>changes destined for a missing file were not merged</td>
801 <td>file was deleted</td>
805 <td>file's deletion was obstructed by local modifications</td>
809 <td>new file was added</td>
813 <td>changes destined for a non-regular file were not merged</td>
816 <p class="Pp">If merge conflicts occur the rebase operation is interrupted
817 and may be continued once conflicts have been resolved. Alternatively,
818 the rebase operation may be aborted which will leave
819 <var class="Ar">branch</var> unmodified and the work tree switched back
820 to its original branch.</p>
821 <p class="Pp">If a merge conflict is resolved in a way which renders the
822 merged change into a no-op change, the corresponding commit will be
823 elided when the rebase operation continues.</p>
824 <p class="Pp"><code class="Cm">got rebase</code> will refuse to run if
825 certain preconditions are not met. If the work tree contains multiple
826 base commits it must first be updated to a single base commit with
827 <code class="Cm">got update</code>. If changes have been staged with
828 <code class="Cm">got stage</code>, these changes must first be comitted
829 with <code class="Cm">got commit</code> or unstaged with
830 <code class="Cm">got unstage</code>. If the work tree contains local
831 changes, these changes must first be committed with <code class="Cm">got
832 commit</code> or reverted with <code class="Cm">got revert</code>. If
833 the <var class="Ar">branch</var> contains changes to files outside of
834 the work tree's path prefix, the work tree cannot be used to rebase this
836 <p class="Pp">The <code class="Cm">got update</code> and
837 <code class="Cm">got commit</code> commands will refuse to run while a
838 rebase operation is in progress. Other commands which manipulate the
839 work tree may be used for conflict resolution purposes.</p>
840 <p class="Pp">The options for <code class="Cm">got rebase</code> are as
843 <dt><a class="permalink" href="#a"><code class="Fl" id="a">-a</code></a></dt>
844 <dd>Abort an interrupted rebase operation. If this option is used, no
845 other command-line arguments are allowed.</dd>
846 <dt><a class="permalink" href="#c_6"><code class="Fl" id="c_6">-c</code></a></dt>
847 <dd>Continue an interrupted rebase operation. If this option is used, no
848 other command-line arguments are allowed.</dd>
851 <dt><a class="permalink" href="#rb"><code class="Cm" id="rb">rb</code></a></dt>
852 <dd>Short alias for <code class="Cm">rebase</code>.</dd>
853 <dt><a class="permalink" href="#histedit"><code class="Cm" id="histedit">histedit</code></a>
854 [<code class="Fl">-a</code>] [<code class="Fl">-c]</code>
855 [<code class="Fl">-F</code> <var class="Ar">histedit-script</var>]</dt>
856 <dd>Edit commit history between the work tree's current base commit and the
857 tip commit of the work tree's current branch.
858 <p class="Pp">Editing of commit history is controlled via a
859 <var class="Ar">histedit script</var> which can be edited interactively
860 or passed on the command line. The format of the histedit script is
861 line-based. Each line in the script begins with a command name, followed
862 by whitespace and an argument. For most commands, the expected argument
863 is a commit ID SHA1 hash. Any remaining text on the line is ignored.
864 Lines which begin with the ‘#’ character are ignored
866 <p class="Pp">The available commands are as follows:</p>
867 <table class="Bl-column">
869 <td>pick <var class="Ar">commit</var></td>
870 <td>Use the specified commit as it is.</td>
873 <td>edit <var class="Ar">commit</var></td>
874 <td>Use the specified commit but once changes have been merged into the
875 work tree interrupt the histedit operation for amending.</td>
878 <td>fold <var class="Ar">commit</var></td>
879 <td>Combine the specified commit with the next commit listed further
880 below that will be used.</td>
883 <td>drop <var class="Ar">commit</var></td>
884 <td>Remove this commit from the edited history.</td>
887 <td>mesg <var class="Ar">log-message</var></td>
888 <td>Use the specified single-line log message for the commit on the
889 previous line. If the log message argument is left empty, open an
890 editor where a new log message can be written.</td>
893 <p class="Pp">Every commit in the history being edited must be mentioned in
894 the script. Lines may be re-ordered to change the order of commits in
895 the edited history.</p>
896 <p class="Pp">Edited commits are accumulated on a temporary branch which the
897 work tree will remain switched to throughout the entire histedit
898 operation. Once history editing has completed successfully, the
899 temporary branch becomes the new version of the work tree's branch and
900 the work tree is automatically switched to it.</p>
901 <p class="Pp">While merging commits, show the status of each affected file,
902 using the following status codes:</p>
903 <table class="Bl-column">
906 <td>file was merged</td>
910 <td>file was merged and conflicts occurred during merge</td>
914 <td>changes destined for a missing file were not merged</td>
918 <td>file was deleted</td>
922 <td>file's deletion was obstructed by local modifications</td>
926 <td>new file was added</td>
930 <td>changes destined for a non-regular file were not merged</td>
933 <p class="Pp">If merge conflicts occur the histedit operation is interrupted
934 and may be continued once conflicts have been resolved. Alternatively,
935 the histedit operation may be aborted which will leave the work tree
936 switched back to its original branch.</p>
937 <p class="Pp">If a merge conflict is resolved in a way which renders the
938 merged change into a no-op change, the corresponding commit will be
939 elided when the histedit operation continues.</p>
940 <p class="Pp"><code class="Cm">got histedit</code> will refuse to run if
941 certain preconditions are not met. If the work tree's current branch is
942 not in the “refs/heads/” reference namespace, the history
943 of the branch may not be edited. If the work tree contains multiple base
944 commits it must first be updated to a single base commit with
945 <code class="Cm">got update</code>. If changes have been staged with
946 <code class="Cm">got stage</code>, these changes must first be comitted
947 with <code class="Cm">got commit</code> or unstaged with
948 <code class="Cm">got unstage</code>. If the work tree contains local
949 changes, these changes must first be committed with <code class="Cm">got
950 commit</code> or reverted with <code class="Cm">got revert</code>. If
951 the edited history contains changes to files outside of the work tree's
952 path prefix, the work tree cannot be used to edit the history of this
954 <p class="Pp">The <code class="Cm">got update</code> command will refuse to
955 run while a histedit operation is in progress. Other commands which
956 manipulate the work tree may be used, and the <code class="Cm">got
957 commit</code> command may be used to commit arbitrary changes to the
958 temporary branch while the histedit operation is interrupted.</p>
959 <p class="Pp">The options for <code class="Cm">got histedit</code> are as
962 <dt><a class="permalink" href="#a_2"><code class="Fl" id="a_2">-a</code></a></dt>
963 <dd>Abort an interrupted histedit operation. If this option is used, no
964 other command-line arguments are allowed.</dd>
965 <dt><a class="permalink" href="#c_7"><code class="Fl" id="c_7">-c</code></a></dt>
966 <dd>Continue an interrupted histedit operation. If this option is used, no
967 other command-line arguments are allowed.</dd>
970 <dt><a class="permalink" href="#he"><code class="Cm" id="he">he</code></a></dt>
971 <dd>Short alias for <code class="Cm">histedit</code>.</dd>
972 <dt><a class="permalink" href="#stage"><code class="Cm" id="stage">stage</code></a>
973 [<code class="Fl">-l</code>] [<code class="Fl">-p</code>]
974 [<code class="Fl">-F</code> <var class="Ar">response-script</var>]
975 [<var class="Ar">path ...</var>]</dt>
976 <dd>Stage local changes for inclusion in the next commit. If no
977 <var class="Ar">path</var> is specified, stage all changes in the work
978 tree. Otherwise, stage changes at or within the specified paths. Paths may
979 be staged if they are added, modified, or deleted according to
980 <code class="Cm">got status</code>.
981 <p class="Pp">Show the status of each affected file, using the following
983 <table class="Bl-column">
986 <td>file addition has been staged</td>
990 <td>file modification has been staged</td>
994 <td>file deletion has been staged</td>
997 <p class="Pp">Staged file contents are saved in newly created blob objects
998 in the repository. These blobs will be referred to by tree objects once
999 staged changes have been committed.</p>
1000 <p class="Pp">Staged changes affect the behaviour of <code class="Cm">got
1001 commit</code>, <code class="Cm">got status</code>, and
1002 <code class="Cm">got diff</code>. While paths with staged changes exist,
1003 the <code class="Cm">got commit</code> command will refuse to commit any
1004 paths which do not have staged changes. Local changes created on top of
1005 staged changes can only be committed if the path is staged again, or if
1006 the staged changes are committed first. The <code class="Cm">got
1007 status</code> command will show both local changes and staged changes.
1008 The <code class="Cm">got diff</code> command is able to display local
1009 changes relative to staged changes, and to display staged changes
1010 relative to the repository. The <code class="Cm">got revert</code>
1011 command cannot revert staged changes but may be used to revert local
1012 changes created on top of staged changes.</p>
1013 <p class="Pp">The options for <code class="Cm">got stage</code> are as
1016 <dt><a class="permalink" href="#l_4"><code class="Fl" id="l_4">-l</code></a></dt>
1017 <dd>Instead of staging new changes, list paths which are already staged,
1018 along with the IDs of staged blob objects and stage status codes. If
1019 paths were provided in the command line show the staged paths among
1020 the specified paths. Otherwise, show all staged paths.</dd>
1021 <dt><a class="permalink" href="#p_4"><code class="Fl" id="p_4">-p</code></a></dt>
1022 <dd>Instead of staging the entire content of a changed file, interactively
1023 select or reject changes for staging based on “y” (stage
1024 change), “n” (reject change), and “q”
1025 (quit staging this file) responses. If a file is in modified status,
1026 individual patches derived from the modified file content can be
1027 staged. Files in added or deleted status may only be staged or
1028 rejected in their entirety.</dd>
1029 <dt><a class="permalink" href="#F_2"><code class="Fl" id="F_2">-F</code></a>
1030 <var class="Ar">response-script</var></dt>
1031 <dd>With the <code class="Fl">-p</code> option, read “y”,
1032 “n”, and “q” responses line-by-line from
1033 the specified <var class="Ar">response-script</var> file instead of
1034 prompting interactively.</dd>
1036 <p class="Pp"><code class="Cm">got stage</code> will refuse to run if
1037 certain preconditions are not met. If a file contains merge conflicts,
1038 these conflicts must be resolved first. If a file is found to be out of
1039 date relative to the head commit on the work tree's current branch, the
1040 file must be updated with <code class="Cm">got update</code> before it
1041 can be staged (however, this does not prevent the file from becoming
1042 out-of-date at some point after having been staged).</p>
1043 <p class="Pp">The <code class="Cm">got update</code>, <code class="Cm">got
1044 rebase</code>, and <code class="Cm">got histedit</code> commands will
1045 refuse to run while staged changes exist. If staged changes cannot be
1046 committed because a staged path is out of date, the path must be
1047 unstaged with <code class="Cm">got unstage</code> before it can be
1048 updated with <code class="Cm">got update</code>, and may then be staged
1049 again if necessary.</p>
1051 <dt><a class="permalink" href="#sg"><code class="Cm" id="sg">sg</code></a></dt>
1052 <dd>Short alias for <code class="Cm">stage</code>.</dd>
1053 <dt><a class="permalink" href="#unstage"><code class="Cm" id="unstage">unstage</code></a>
1054 [<code class="Fl">-p</code>] [<code class="Fl">-F</code>
1055 <var class="Ar">response-script</var>] [<var class="Ar">path ...</var>]</dt>
1056 <dd>Merge staged changes back into the work tree and put affected paths back
1057 into non-staged status. If no <var class="Ar">path</var> is specified,
1058 unstage all staged changes across the entire work tree. Otherwise, unstage
1059 changes at or within the specified paths.
1060 <p class="Pp">Show the status of each affected file, using the following
1062 <table class="Bl-column">
1065 <td>file was unstaged</td>
1069 <td>file was unstaged and conflicts occurred during merge</td>
1073 <td>changes destined for a missing file were not merged</td>
1077 <td>file was staged as deleted and still is deleted</td>
1081 <td>file's deletion was obstructed by local modifications</td>
1085 <td>changes destined for a non-regular file were not merged</td>
1088 <p class="Pp">The options for <code class="Cm">got unstage</code> are as
1091 <dt><a class="permalink" href="#p_5"><code class="Fl" id="p_5">-p</code></a></dt>
1092 <dd>Instead of unstaging the entire content of a changed file,
1093 interactively select or reject changes for unstaging based on
1094 “y” (unstage change), “n” (keep change
1095 staged), and “q” (quit unstaging this file) responses.
1096 If a file is staged in modified status, individual patches derived
1097 from the staged file content can be unstaged. Files staged in added or
1098 deleted status may only be unstaged in their entirety.</dd>
1099 <dt><a class="permalink" href="#F_3"><code class="Fl" id="F_3">-F</code></a>
1100 <var class="Ar">response-script</var></dt>
1101 <dd>With the <code class="Fl">-p</code> option, read “y”,
1102 “n”, and “q” responses line-by-line from
1103 the specified <var class="Ar">response-script</var> file instead of
1104 prompting interactively.</dd>
1107 <dt><a class="permalink" href="#ug"><code class="Cm" id="ug">ug</code></a></dt>
1108 <dd>Short alias for <code class="Cm">unstage</code>.</dd>
1111 <section class="Sh">
1112 <h1 class="Sh" id="ENVIRONMENT"><a class="permalink" href="#ENVIRONMENT">ENVIRONMENT</a></h1>
1114 <dt><a class="permalink" href="#GOT_AUTHOR"><code class="Ev" id="GOT_AUTHOR">GOT_AUTHOR</code></a></dt>
1115 <dd>The author's name and email address for <code class="Cm">got commit</code>
1116 and <code class="Cm">got import</code>, for example: <span class="An">Flan
1118 <<a class="Mt" href="mailto:flan_hacker@openbsd.org">flan_hacker@openbsd.org</a>>.
1119 <a class="Xr">git(1)</a> may fail to parse commits created with
1120 <code class="Nm">got</code> if the <code class="Ev">GOT_AUTHOR</code>
1121 environment variable does not contain an email address.</dd>
1122 <dt><a class="permalink" href="#VISUAL,"><code class="Ev" id="VISUAL,">VISUAL,</code></a>
1123 <code class="Ev">EDITOR</code></dt>
1124 <dd>The editor spawned by <code class="Cm">got commit</code>.</dd>
1127 <section class="Sh">
1128 <h1 class="Sh" id="EXIT_STATUS"><a class="permalink" href="#EXIT_STATUS">EXIT
1130 The <code class="Nm">got</code> utility exits 0 on success,
1131 and >0 if an error occurs.
1133 <section class="Sh">
1134 <h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
1135 Clone an existing Git repository for use with <code class="Nm">got</code>. This
1136 step currently requires <a class="Xr">git(1)</a>:
1138 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/</code></div>
1139 <div class="Bd Bd-indent"><code class="Li">$ git clone --bare
1140 https://github.com/openbsd/src.git</code></div>
1141 <p class="Pp">Alternatively, for quick and dirty local testing of
1142 <code class="Nm">got</code> a new Git repository could be created and
1143 populated with files, e.g. from a temporary CVS checkout located at
1144 <span class="Pa">/tmp/src</span>:</p>
1146 <div class="Bd Bd-indent"><code class="Li">$ got init
1147 /var/git/src.git</code></div>
1148 <div class="Bd Bd-indent"><code class="Li">$ got import -r /var/git/src.git -I
1149 CVS -I obj /tmp/src</code></div>
1150 <p class="Pp">Check out a work tree from the Git repository to /usr/src:</p>
1152 <div class="Bd Bd-indent"><code class="Li">$ got checkout /var/git/src.git
1153 /usr/src</code></div>
1154 <p class="Pp">View local changes in a work tree directory:</p>
1156 <div class="Bd Bd-indent"><code class="Li">$ got status</code></div>
1157 <div class="Bd Bd-indent"><code class="Li">$ got diff | less</code></div>
1158 <p class="Pp">Interactively revert selected local changes in a work tree
1161 <div class="Bd Bd-indent"><code class="Li">$ got revert -p
1162 -R .</code></div>
1163 <p class="Pp">In a work tree or a git repository directory, list all branch
1166 <div class="Bd Bd-indent"><code class="Li">$ got branch -l</code></div>
1167 <p class="Pp">In a work tree or a git repository directory, create a new branch
1168 called “unified-buffer-cache” which is forked off the
1169 “master” branch:</p>
1171 <div class="Bd Bd-indent"><code class="Li">$ got branch unified-buffer-cache
1173 <p class="Pp">Switch an existing work tree to the branch
1174 “unified-buffer-cache”. Local changes in the work tree will be
1175 preserved and merged if necessary:</p>
1177 <div class="Bd Bd-indent"><code class="Li">$ got update -b
1178 unified-buffer-cache</code></div>
1179 <p class="Pp">Create a new commit from local changes in a work tree directory.
1180 This new commit will become the head commit of the work tree's current
1183 <div class="Bd Bd-indent"><code class="Li">$ got commit</code></div>
1184 <p class="Pp">In a work tree or a git repository directory, view changes
1185 committed in the 3 most recent commits to the work tree's branch, or the
1186 branch resolved via the repository's HEAD reference, respectively:</p>
1188 <div class="Bd Bd-indent"><code class="Li">$ got log -p -l 3 -f</code></div>
1189 <p class="Pp">Add new files and remove obsolete files in a work tree
1192 <div class="Bd Bd-indent"><code class="Li">$ got add
1193 sys/uvm/uvm_ubc.c</code></div>
1194 <div class="Bd Bd-indent"><code class="Li">$ got remove
1195 sys/uvm/uvm_vnode.c</code></div>
1196 <p class="Pp">Create a new commit from local changes in a work tree directory
1197 with a pre-defined log message.</p>
1199 <div class="Bd Bd-indent"><code class="Li">$ got commit -m 'unify the buffer
1201 <p class="Pp">Update any work tree checked out from the
1202 “unified-buffer-cache” branch to the latest commit on this
1205 <div class="Bd Bd-indent"><code class="Li">$ got update</code></div>
1206 <p class="Pp">Roll file content on the unified-buffer-cache branch back by one
1207 commit, and then fetch the rolled-back change into the work tree as a local
1208 change to be amended and perhaps committed again:</p>
1210 <div class="Bd Bd-indent"><code class="Li">$ got backout
1211 unified-buffer-cache</code></div>
1212 <div class="Bd Bd-indent"><code class="Li">$ got commit -m 'roll back
1213 previous'</code></div>
1214 <div class="Bd Bd-indent"><code class="Li">$ # now back out the previous backout
1216 <div class="Bd Bd-indent"><code class="Li">$ got backout
1217 unified-buffer-cache</code></div>
1218 <p class="Pp">Fetch new upstream commits into the local repository's master
1219 branch. This step currently requires <a class="Xr">git(1)</a>:</p>
1221 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/src.git</code></div>
1222 <div class="Bd Bd-indent"><code class="Li">$ git fetch origin
1223 master:master</code></div>
1224 <p class="Pp">Rebase the “unified-buffer-cache” branch on top of
1225 the new head commit of the “master” branch.</p>
1227 <div class="Bd Bd-indent"><code class="Li">$ got update -b master</code></div>
1228 <div class="Bd Bd-indent"><code class="Li">$ got rebase
1229 unified-buffer-cache</code></div>
1230 <p class="Pp">Create a patch from all changes on the unified-buffer-cache
1231 branch. The patch can be mailed out for review and applied to OpenBSD's CVS
1234 <div class="Bd Bd-indent"><code class="Li">$ got diff master
1235 unified-buffer-cache > /tmp/ubc.diff</code></div>
1236 <p class="Pp">Edit the entire commit history of the
1237 “unified-buffer-cache” branch:</p>
1239 <div class="Bd Bd-indent"><code class="Li">$ got update -b
1240 unified-buffer-cache</code></div>
1241 <div class="Bd Bd-indent"><code class="Li">$ got update -c master</code></div>
1242 <div class="Bd Bd-indent"><code class="Li">$ got histedit</code></div>
1243 <p class="Pp">Additional steps are necessary if local changes need to be pushed
1244 back to the remote repository, which currently requires <code class="Cm">git
1245 fetch</code> and <code class="Cm">git push</code>. Before working against
1246 existing branches in a repository cloned with “git clone
1247 --bare”, a Git “refspec” must be configured to map all
1248 references in the remote repository into the “refs/remotes”
1249 namespace of the local repository. This can achieved by setting Git's
1250 <span class="Pa">remote.origin.fetch</span> configuration variable to the
1251 value “+refs/heads/*:refs/remotes/origin/*” with the
1252 <code class="Cm">git config</code> command:</p>
1254 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
1255 <div class="Bd Bd-indent"><code class="Li">$ git config remote.origin.fetch
1256 '+refs/heads/*:refs/remotes/origin/*'</code></div>
1257 <p class="Pp">Alternatively, the following <span class="Pa">fetch</span>
1258 configuration item can be added manually to the Git repository's
1259 <span class="Pa">config</span> file:</p>
1261 <div class="Bd Bd-indent"><code class="Li">[remote origin]</code></div>
1262 <div class="Bd Bd-indent"><code class="Li">url = ...</code></div>
1263 <div class="Bd Bd-indent"><code class="Li">fetch =
1264 +refs/heads/*:refs/remotes/origin/*</code></div>
1265 <p class="Pp">This configuration leaves the local repository's
1266 “refs/heads” namespace free for use by local branches checked
1267 out with <code class="Cm">got checkout</code> and, if needed, created with
1268 <code class="Cm">got branch</code>.</p>
1269 <p class="Pp">Branches in the “remotes/origin” namespace can be
1270 updated with incoming changes from the remote repository with
1271 <code class="Cm">git fetch</code>:</p>
1273 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
1274 <div class="Bd Bd-indent"><code class="Li">$ git fetch</code></div>
1275 <p class="Pp">Before outgoing changes on the local “master” branch
1276 can be pushed to the remote repository, the local “master”
1277 branch must be rebased onto the “origin/master” branch:</p>
1279 <div class="Bd Bd-indent"><code class="Li">$ got update -b
1280 origin/master</code></div>
1281 <div class="Bd Bd-indent"><code class="Li">$ got rebase master</code></div>
1282 <p class="Pp">Changes on the local “master” branch can then be
1283 pushed to the remote repository with <code class="Cm">git push</code>:</p>
1285 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
1286 <div class="Bd Bd-indent"><code class="Li">$ git push origin master</code></div>
1288 <section class="Sh">
1289 <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
1291 <a class="Xr">tog(1)</a>, <a class="Xr">git-repository(5)</a>,
1292 <a class="Xr">got-worktree(5)</a>
1294 <section class="Sh">
1295 <h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
1296 <span class="An">Stefan Sperling</span>
1297 <<a class="Mt" href="mailto:stsp@openbsd.org">stsp@openbsd.org</a>>
1299 <span class="An">Martin Pieuchot</span>
1300 <<a class="Mt" href="mailto:mpi@openbsd.org">mpi@openbsd.org</a>>
1302 <span class="An">joshua stein</span>
1303 <<a class="Mt" href="mailto:jcs@openbsd.org">jcs@openbsd.org</a>>
1305 <section class="Sh">
1306 <h1 class="Sh" id="CAVEATS"><a class="permalink" href="#CAVEATS">CAVEATS</a></h1>
1307 <code class="Nm">got</code> is a work-in-progress and many commands remain to be
1308 implemented. At present, the user has to fall back on <a class="Xr">git(1)</a>
1309 to perform many tasks, in particular tasks related to repository
1310 administration and tasks which require a network connection.
1313 <table class="foot">
1315 <td class="foot-date">August 9, 2019</td>
1316 <td class="foot-os">OpenBSD 6.5</td>