Blob


1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta charset="utf-8"/>
5 <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6 <link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
7 <title>GOT(1)</title>
8 </head>
9 <!-- This is an automatically generated file. Do not edit.
10 Copyright (c) 2017 Martin Pieuchot
11 Copyright (c) 2018, 2019, 2020 Stefan Sperling
13 Permission to use, copy, modify, and distribute this software for any
14 purpose with or without fee is hereby granted, provided that the above
15 copyright notice and this permission notice appear in all copies.
17 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
18 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
19 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
20 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
21 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
22 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
23 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 -->
25 <body>
26 <div class="head" role="doc-pageheader" aria-label="Manual header
27 line"><span class="head-ltitle">GOT(1)</span> <span class="head-vol">General
28 Commands Manual</span> <span class="head-rtitle">GOT(1)</span></div>
29 <main class="manual-text">
30 <section class="Sh">
31 <h2 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h2>
32 <p class="Pp"><code class="Nm">got</code> &#x2014;
33 <span class="Nd" role="doc-subtitle">Game of Trees</span></p>
34 </section>
35 <section class="Sh">
36 <h2 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h2>
37 <table class="Nm">
38 <tr>
39 <td><code class="Nm">got</code></td>
40 <td>[<code class="Fl">-hV</code>] <var class="Ar">command</var>
41 [<var class="Ar">arg ...</var>]</td>
42 </tr>
43 </table>
44 </section>
45 <section class="Sh">
46 <h2 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h2>
47 <p class="Pp"><code class="Nm">got</code> is a version control system which
48 stores the history of tracked files in a Git repository, as used by the Git
49 version control system. This repository format is described in
50 <a class="Xr" aria-label="git-repository, section
51 5">git-repository(5)</a>.</p>
52 <p class="Pp"><code class="Nm">got</code> is a &#x201C;distributed&#x201D;
53 version control system because every copy of a repository is writeable.
54 Modifications made to files can be synchronized between repositories at any
55 time.</p>
56 <p class="Pp" id="work">Files managed by <code class="Nm">got</code> must be
57 checked out from the repository for modification. Checked out files are
58 stored in a <a class="permalink" href="#work"><i class="Em">work
59 tree</i></a> which can be placed at an arbitrary directory in the filesystem
60 hierarchy. The on-disk format of this work tree is described in
61 <a class="Xr" aria-label="got-worktree, section 5">got-worktree(5)</a>.</p>
62 <p class="Pp"><code class="Nm">got</code> provides global and command-specific
63 options. Global options must precede the command name, and are as
64 follows:</p>
65 <dl class="Bl-tag">
66 <dt id="h"><a class="permalink" href="#h"><code class="Fl">-h</code></a></dt>
67 <dd>Display usage information and exit immediately.</dd>
68 <dt id="V"><a class="permalink" href="#V"><code class="Fl">-V</code></a>,
69 <code class="Fl">--version</code></dt>
70 <dd>Display program version and exit immediately.</dd>
71 </dl>
72 <p class="Pp">The commands for <code class="Nm">got</code> are as follows:</p>
73 <dl class="Bl-tag">
74 <dt id="im"><a class="permalink" href="#import"><code class="Cm" id="import">import</code></a>
75 [<code class="Fl">-b</code> <var class="Ar">branch</var>]
76 [<code class="Fl">-I</code> <var class="Ar">pattern</var>]
77 [<code class="Fl">-m</code> <var class="Ar">message</var>]
78 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
79 <var class="Ar">directory</var></dt>
80 <dd>
81 <div class="Bd Bd-indent"><code class="Li">(alias:
82 <code class="Cm">im</code>)</code></div>
83 Create an initial commit in a repository from the file hierarchy within the
84 specified <var class="Ar">directory</var>. The created commit will not
85 have any parent commits, i.e. it will be a root commit. Also create a new
86 reference which provides a branch name for the newly created commit. Show
87 the path of each imported file to indicate progress.
88 <p class="Pp">The <code class="Cm">got import</code> command requires the
89 <code class="Ev">GOT_AUTHOR</code> environment variable to be set,
90 unless an author has been configured in
91 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
92 <code class="Dv">user.name</code> and <code class="Dv">user.email</code>
93 configuration settings can be obtained from the repository's
94 <span class="Pa">.git/config</span> file or from Git's global
95 <span class="Pa">~/.gitconfig</span> configuration file.</p>
96 <p class="Pp">The options for <code class="Cm">got import</code> are as
97 follows:</p>
98 <dl class="Bl-tag">
99 <dt id="b"><a class="permalink" href="#b"><code class="Fl">-b</code></a>
100 <var class="Ar">branch</var></dt>
101 <dd>Create the specified <var class="Ar">branch</var>. If this option is
102 not specified, a branch corresponding to the repository's HEAD
103 reference will be used. Use of this option is required if the branch
104 resolved via the repository's HEAD reference already exists.</dd>
105 <dt id="I"><a class="permalink" href="#I"><code class="Fl">-I</code></a>
106 <var class="Ar">pattern</var></dt>
107 <dd>Ignore files or directories with a name which matches the specified
108 <var class="Ar">pattern</var>. This option may be specified multiple
109 times to build a list of ignore patterns. The
110 <var class="Ar">pattern</var> follows the globbing rules documented in
111 <a class="Xr" aria-label="glob, section 7">glob(7)</a>. Ignore
112 patterns which end with a slash, &#x201C;/&#x201D;, will only match
113 directories.</dd>
114 <dt id="m"><a class="permalink" href="#m"><code class="Fl">-m</code></a>
115 <var class="Ar">message</var></dt>
116 <dd>Use the specified log message when creating the new commit. Without
117 the <code class="Fl">-m</code> option, <code class="Cm">got
118 import</code> opens a temporary file in an editor where a log message
119 can be written. Quitting the editor without saving the file will abort
120 the import operation.</dd>
121 <dt id="r"><a class="permalink" href="#r"><code class="Fl">-r</code></a>
122 <var class="Ar">repository-path</var></dt>
123 <dd>Use the repository at the specified path. If not specified, assume the
124 repository is located at or above the current working directory.</dd>
125 </dl>
126 </dd>
127 <dt id="cl"><a class="permalink" href="#clone"><code class="Cm" id="clone">clone</code></a>
128 [<code class="Fl">-almqv</code>] [<code class="Fl">-b</code>
129 <var class="Ar">branch</var>] [<code class="Fl">-R</code>
130 <var class="Ar">reference</var>] <var class="Ar">repository-URL</var>
131 [<var class="Ar">directory</var>]</dt>
132 <dd>
133 <div class="Bd Bd-indent"><code class="Li">(alias:
134 <code class="Cm">cl</code>)</code></div>
135 Clone a Git repository at the specified <var class="Ar">repository-URL</var>
136 into the specified <var class="Ar">directory</var>. If no
137 <var class="Ar">directory</var> is specified, the directory name will be
138 derived from the name of the cloned repository. <code class="Cm">got
139 clone</code> will refuse to run if the <var class="Ar">directory</var>
140 already exists.
141 <p class="Pp">The <var class="Ar">repository-URL</var> specifies a protocol
142 scheme, a server hostname, an optional port number separated from the
143 hostname by a colon, and a path to the repository on the server:
144 <a class="Lk" href="scheme://hostname:port/path/to/repository">scheme://hostname:port/path/to/repository</a></p>
145 <p class="Pp">The following protocol schemes are supported:</p>
146 <dl class="Bl-tag">
147 <dt>git</dt>
148 <dd>The Git protocol as implemented by the
149 <a class="Xr" aria-label="git-daemon, section 1">git-daemon(1)</a>
150 server. Use of this protocol is discouraged since it supports neither
151 authentication nor encryption.</dd>
152 <dt>git+ssh</dt>
153 <dd>The Git protocol wrapped in an authenticated and encrypted
154 <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> tunnel. With this
155 protocol the hostname may contain an embedded username for
156 <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> to use:
157 <a class="Mt" href="mailto:user@hostname">user@hostname</a></dd>
158 <dt>ssh</dt>
159 <dd>Short alias for git+ssh.</dd>
160 </dl>
161 <p class="Pp">Objects in the cloned repository are stored in a pack file
162 which is downloaded from the server. This pack file will then be indexed
163 to facilitate access to the objects stored within. If any objects in the
164 pack file are stored in deltified form, all deltas will be fully
165 resolved in order to compute the ID of such objects. This can take some
166 time. More details about the pack file format are documented in
167 <a class="Xr" aria-label="git-repository, section
168 5">git-repository(5)</a>.</p>
169 <p class="Pp"><code class="Cm">got clone</code> creates a remote repository
170 entry in the <a class="Xr" aria-label="got.conf, section
171 5">got.conf(5)</a> and <span class="Pa">config</span> files of the
172 cloned repository to store the <var class="Ar">repository-url</var> and
173 any <var class="Ar">branch</var> or <var class="Ar">reference</var>
174 arguments for future use by <code class="Cm">got fetch</code> or
175 <a class="Xr" aria-label="git-fetch, section 1">git-fetch(1)</a>.</p>
176 <p class="Pp">The options for <code class="Cm">got clone</code> are as
177 follows:</p>
178 <dl class="Bl-tag">
179 <dt id="a"><a class="permalink" href="#a"><code class="Fl">-a</code></a></dt>
180 <dd>Fetch all branches from the remote repository's
181 &#x201C;refs/heads/&#x201D; reference namespace and set
182 <code class="Cm">fetch_all_branches</code> in the cloned repository's
183 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> file
184 for future use by <code class="Cm">got fetch</code>. If this option is
185 not specified, a branch resolved via the remote repository's HEAD
186 reference will be fetched. Cannot be used together with the
187 <code class="Fl">-b</code> option.</dd>
188 <dt id="b~2"><a class="permalink" href="#b~2"><code class="Fl">-b</code></a>
189 <var class="Ar">branch</var></dt>
190 <dd>Fetch the specified <var class="Ar">branch</var> from the remote
191 repository's &#x201C;refs/heads/&#x201D; reference namespace. This
192 option may be specified multiple times to build a list of branches to
193 fetch. If the branch corresponding to the remote repository's HEAD
194 reference is not in this list, the cloned repository's HEAD reference
195 will be set to the first branch which was fetched. If this option is
196 not specified, a branch resolved via the remote repository's HEAD
197 reference will be fetched. Cannot be used together with the
198 <code class="Fl">-a</code> option.</dd>
199 <dt id="l"><a class="permalink" href="#l"><code class="Fl">-l</code></a></dt>
200 <dd>List branches and tags available for fetching from the remote
201 repository and exit immediately. Cannot be used together with any of
202 the other options except <code class="Fl">-q</code> and
203 <code class="Fl">-v</code>.</dd>
204 <dt id="m~2"><a class="permalink" href="#m~2"><code class="Fl">-m</code></a></dt>
205 <dd>Create the cloned repository as a mirror of the original repository.
206 This is useful if the cloned repository will not be used to store
207 locally created commits.
208 <p class="Pp">The repository's <a class="Xr" aria-label="got.conf,
209 section 5">got.conf(5)</a> and <span class="Pa">config</span> files
210 will be set up with the &#x201C;mirror&#x201D; option enabled, such
211 that <code class="Cm">got fetch</code> or
212 <a class="Xr" aria-label="git-fetch, section 1">git-fetch(1)</a>
213 will write incoming changes directly to branches in the
214 &#x201C;refs/heads/&#x201D; reference namespace, rather than to
215 branches in the &#x201C;refs/remotes/&#x201D; namespace. This avoids
216 the usual requirement of having to run <code class="Cm">got
217 rebase</code> or <code class="Cm">got merge</code> after
218 <code class="Cm">got fetch</code> in order to make incoming changes
219 appear on branches in the &#x201C;refs/heads/&#x201D; namespace. But
220 maintaining custom changes in the cloned repository becomes
221 difficult since such changes will be at risk of being discarded
222 whenever incoming changes are fetched.</p>
223 </dd>
224 <dt id="q"><a class="permalink" href="#q"><code class="Fl">-q</code></a></dt>
225 <dd>Suppress progress reporting output. The same option will be passed to
226 <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
227 applicable.</dd>
228 <dt id="R"><a class="permalink" href="#R"><code class="Fl">-R</code></a>
229 <var class="Ar">reference</var></dt>
230 <dd>In addition to the branches and tags that will be fetched, fetch an
231 arbitrary <var class="Ar">reference</var> from the remote repository's
232 &#x201C;refs/&#x201D; namespace. This option may be specified multiple
233 times to build a list of additional references to fetch. The specified
234 <var class="Ar">reference</var> may either be a path to a specific
235 reference, or a reference namespace which will cause all references in
236 this namespace to be fetched.
237 <p class="Pp">Each reference will be mapped into the cloned repository's
238 &#x201C;refs/remotes/&#x201D; namespace, unless the
239 <code class="Fl">-m</code> option is used to mirror references
240 directly into the cloned repository's &#x201C;refs/&#x201D;
241 namespace.</p>
242 <p class="Pp"><code class="Cm">got clone</code> will refuse to fetch
243 references from the remote repository's
244 &#x201C;refs/remotes/&#x201D; or &#x201C;refs/got/&#x201D;
245 namespace.</p>
246 </dd>
247 <dt id="v"><a class="permalink" href="#v"><code class="Fl">-v</code></a></dt>
248 <dd>Verbose mode. Causes <code class="Cm">got clone</code> to print
249 debugging messages to standard error output. This option will be
250 passed to <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
251 applicable. Multiple -v options increase the verbosity. The maximum is
252 3.</dd>
253 </dl>
254 </dd>
255 <dt id="fe"><a class="permalink" href="#fetch"><code class="Cm" id="fetch">fetch</code></a>
256 [<code class="Fl">-adlqtvX</code>] [<code class="Fl">-b</code>
257 <var class="Ar">branch</var>] [<code class="Fl">-R</code>
258 <var class="Ar">reference</var>] [<code class="Fl">-r</code>
259 <var class="Ar">repository-path</var>]
260 [<var class="Ar">remote-repository</var>]</dt>
261 <dd>
262 <div class="Bd Bd-indent"><code class="Li">(alias:
263 <code class="Cm">fe</code>)</code></div>
264 Fetch new changes from a remote repository. If no
265 <var class="Ar">remote-repository</var> is specified,
266 &#x201C;origin&#x201D; will be used. The remote repository's URL is
267 obtained from the corresponding entry in
268 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
269 <span class="Pa">config</span> file of the local repository, as created by
270 <code class="Cm">got clone</code>.
271 <p class="Pp">By default, any branches configured in
272 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> for the
273 <var class="Ar">remote-repository</var> will be fetched. If
274 <code class="Cm">got fetch</code> is invoked in a work tree then this
275 work tree's current branch will be fetched, too, provided it is present
276 on the server. If no branches to fetch can be found in
277 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or via a
278 work tree, or said branches are not found on the server, a branch
279 resolved via the remote repository's HEAD reference will be fetched.
280 Likewise, if a HEAD reference for the
281 <var class="Ar">remote-repository</var> exists but its target no longer
282 matches the remote HEAD, then the new target branch will be fetched.
283 This default behaviour can be overridden with the
284 <code class="Fl">-a</code> and <code class="Fl">-b</code> options.</p>
285 <p class="Pp">New changes will be stored in a separate pack file downloaded
286 from the server. Optionally, separate pack files stored in the
287 repository can be combined with <a class="Xr" aria-label="git-repack,
288 section 1">git-repack(1)</a>.</p>
289 <p class="Pp">By default, branch references in the
290 &#x201C;refs/remotes/&#x201D; reference namespace will be updated to
291 point at the newly fetched commits. The <code class="Cm">got
292 rebase</code> or <code class="Cm">got merge</code> command can then be
293 used to make new changes visible on branches in the
294 &#x201C;refs/heads/&#x201D; namespace, merging incoming changes with the
295 changes on those branches as necessary.</p>
296 <p class="Pp">If the repository was created as a mirror with
297 <code class="Cm">got clone -m</code>, then all branches in the
298 &#x201C;refs/heads/&#x201D; namespace will be updated directly to match
299 the corresponding branches in the remote repository. If those branches
300 contained local commits, these commits will no longer be reachable via a
301 reference and will therefore be at risk of being discarded by Git's
302 garbage collector or <code class="Cm">gotadmin cleanup</code>.
303 Maintaining custom changes in a mirror repository is therefore
304 discouraged.</p>
305 <p class="Pp">In any case, references in the &#x201C;refs/tags/&#x201D;
306 namespace will always be fetched and mapped directly to local references
307 in the same namespace.</p>
308 <p class="Pp">The options for <code class="Cm">got fetch</code> are as
309 follows:</p>
310 <dl class="Bl-tag">
311 <dt id="a~2"><a class="permalink" href="#a~2"><code class="Fl">-a</code></a></dt>
312 <dd>Fetch all branches from the remote repository's
313 &#x201C;refs/heads/&#x201D; reference namespace. This option can be
314 enabled by default for specific repositories in
315 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a>. Cannot
316 be used together with the <code class="Fl">-b</code> option.</dd>
317 <dt id="b~3"><a class="permalink" href="#b~3"><code class="Fl">-b</code></a>
318 <var class="Ar">branch</var></dt>
319 <dd>Fetch the specified <var class="Ar">branch</var> from the remote
320 repository's &#x201C;refs/heads/&#x201D; reference namespace. This
321 option may be specified multiple times to build a list of branches to
322 fetch. Cannot be used together with the <code class="Fl">-a</code>
323 option.</dd>
324 <dt id="d"><a class="permalink" href="#d"><code class="Fl">-d</code></a></dt>
325 <dd>Delete branches and tags from the local repository which are no longer
326 present in the remote repository. Only references are deleted. Any
327 commit, tree, tag, and blob objects belonging to deleted branches or
328 tags remain in the repository and may be removed separately with Git's
329 garbage collector or <code class="Cm">gotadmin cleanup</code>.</dd>
330 <dt id="l~2"><a class="permalink" href="#l~2"><code class="Fl">-l</code></a></dt>
331 <dd>List branches and tags available for fetching from the remote
332 repository and exit immediately. Cannot be used together with any of
333 the other options except <code class="Fl">-v</code>,
334 <code class="Fl">-q</code>, and <code class="Fl">-r</code>.</dd>
335 <dt id="q~2"><a class="permalink" href="#q~2"><code class="Fl">-q</code></a></dt>
336 <dd>Suppress progress reporting output. The same option will be passed to
337 <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
338 applicable.</dd>
339 <dt id="R~2"><a class="permalink" href="#R~2"><code class="Fl">-R</code></a>
340 <var class="Ar">reference</var></dt>
341 <dd>In addition to the branches and tags that will be fetched, fetch an
342 arbitrary <var class="Ar">reference</var> from the remote repository's
343 &#x201C;refs/&#x201D; namespace. This option may be specified multiple
344 times to build a list of additional references to fetch. The specified
345 <var class="Ar">reference</var> may either be a path to a specific
346 reference, or a reference namespace which will cause all references in
347 this namespace to be fetched.
348 <p class="Pp">Each reference will be mapped into the local repository's
349 &#x201C;refs/remotes/&#x201D; namespace, unless the local repository
350 was created as a mirror with <code class="Cm">got clone -m</code> in
351 which case references will be mapped directly into the local
352 repository's &#x201C;refs/&#x201D; namespace.</p>
353 <p class="Pp">Once a reference has been fetched, a branch based on it
354 can be created with <code class="Cm">got branch</code> if
355 needed.</p>
356 <p class="Pp"><code class="Cm">got fetch</code> will refuse to fetch
357 references from the remote repository's
358 &#x201C;refs/remotes/&#x201D; or &#x201C;refs/got/&#x201D;
359 namespace.</p>
360 </dd>
361 <dt id="r~2"><a class="permalink" href="#r~2"><code class="Fl">-r</code></a>
362 <var class="Ar">repository-path</var></dt>
363 <dd>Use the repository at the specified path. If not specified, assume the
364 repository is located at or above the current working directory. If
365 this directory is a <code class="Nm">got</code> work tree, use the
366 repository path associated with this work tree.</dd>
367 <dt id="t"><a class="permalink" href="#t"><code class="Fl">-t</code></a></dt>
368 <dd>Allow existing references in the &#x201C;refs/tags&#x201D; namespace
369 to be updated if they have changed on the server. If not specified,
370 only new tag references will be created.</dd>
371 <dt id="v~2"><a class="permalink" href="#v~2"><code class="Fl">-v</code></a></dt>
372 <dd>Verbose mode. Causes <code class="Cm">got fetch</code> to print
373 debugging messages to standard error output. The same option will be
374 passed to <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
375 applicable. Multiple -v options increase the verbosity. The maximum is
376 3.</dd>
377 <dt id="X"><a class="permalink" href="#X"><code class="Fl">-X</code></a></dt>
378 <dd>Delete all references which correspond to a particular
379 <var class="Ar">remote-repository</var> instead of fetching new
380 changes. This can be useful when a remote repository is being removed
381 from <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a>.
382 <p class="Pp">With <code class="Fl">-X</code>, the
383 <var class="Ar">remote-repository</var> argument is mandatory and no
384 other options except <code class="Fl">-r</code>,
385 <code class="Fl">-v</code>, and <code class="Fl">-q</code> are
386 allowed.</p>
387 <p class="Pp">Only references are deleted. Any commit, tree, tag, and
388 blob objects fetched from a remote repository will generally be
389 stored in pack files and may be removed separately with
390 <a class="Xr" aria-label="git-repack, section 1">git-repack(1)</a>
391 and Git's garbage collector.</p>
392 </dd>
393 </dl>
394 </dd>
395 <dt id="co"><a class="permalink" href="#checkout"><code class="Cm" id="checkout">checkout</code></a>
396 [<code class="Fl">-Eq</code>] [<code class="Fl">-b</code>
397 <var class="Ar">branch</var>] [<code class="Fl">-c</code>
398 <var class="Ar">commit</var>] [<code class="Fl">-p</code>
399 <var class="Ar">path-prefix</var>] <var class="Ar">repository-path</var>
400 [<var class="Ar">work-tree-path</var>]</dt>
401 <dd>
402 <div class="Bd Bd-indent"><code class="Li">(alias:
403 <code class="Cm">co</code>)</code></div>
404 Copy files from a repository into a new work tree. Show the status of each
405 affected file, using the following status codes:
406 <table class="Bl-column">
407 <tr>
408 <td>A</td>
409 <td>new file was added</td>
410 </tr>
411 <tr>
412 <td>E</td>
413 <td>file already exists in work tree's meta-data</td>
414 </tr>
415 </table>
416 <p class="Pp">If the <var class="Ar">work tree path</var> is not specified,
417 either use the last component of <var class="Ar">repository path</var>,
418 or if a <var class="Ar">path prefix</var> was specified use the last
419 component of <var class="Ar">path prefix</var>.</p>
420 <p class="Pp">The options for <code class="Cm">got checkout</code> are as
421 follows:</p>
422 <dl class="Bl-tag">
423 <dt id="b~4"><a class="permalink" href="#b~4"><code class="Fl">-b</code></a>
424 <var class="Ar">branch</var></dt>
425 <dd>Check out files from a commit on the specified
426 <var class="Ar">branch</var>. If this option is not specified, a
427 branch resolved via the repository's HEAD reference will be used.</dd>
428 <dt id="c"><a class="permalink" href="#c"><code class="Fl">-c</code></a>
429 <var class="Ar">commit</var></dt>
430 <dd>Check out files from the specified <var class="Ar">commit</var> on the
431 selected branch. If this option is not specified, the most recent
432 commit on the selected branch will be used.
433 <p class="Pp">The expected <var class="Ar">commit</var> argument is a
434 commit ID SHA1 hash, or a reference name or a keyword which will be
435 resolved to a commit ID. An abbreviated hash argument will be
436 expanded to a full SHA1 hash automatically, provided the
437 abbreviation is unique. The keywords &quot;:base&quot; and
438 &quot;:head&quot; resolve to the repository's HEAD reference, or, if
439 the <code class="Fl">-b</code> option is used, the head of the
440 checked-out <var class="Ar">branch</var>. Keywords and reference
441 names may be appended with &quot;:+&quot; or &quot;:-&quot;
442 modifiers and an optional integer N to denote the Nth descendant or
443 antecedent by first parent traversal, respectively; for example,
444 <b class="Sy">:head:-2</b> denotes the work tree branch head's 2nd
445 generation ancestor, and <b class="Sy">foo:-3</b> will denote the
446 3rd generation ancestor of the commit resolved by the
447 &quot;foo&quot; reference. If an integer does not follow the
448 &quot;:+&quot; or &quot;:-&quot; modifier, a &quot;1&quot; is
449 implicitly appended (e.g., <b class="Sy">:head:-</b> is equivalent
450 to <b class="Sy">:head:-1</b>).</p>
451 <p class="Pp">If the specified <var class="Ar">commit</var> is not
452 contained in the selected branch, a different branch which contains
453 this commit must be specified with the <code class="Fl">-b</code>
454 option. If no such branch is known, a new branch must be created for
455 this commit with <code class="Cm">got branch</code> before
456 <code class="Cm">got checkout</code> can be used. Checking out work
457 trees with an unknown branch is intentionally not supported.</p>
458 </dd>
459 <dt id="E"><a class="permalink" href="#E"><code class="Fl">-E</code></a></dt>
460 <dd>Proceed with the checkout operation even if the directory at
461 <var class="Ar">work-tree-path</var> is not empty. Existing files will
462 be left intact.</dd>
463 <dt id="p"><a class="permalink" href="#p"><code class="Fl">-p</code></a>
464 <var class="Ar">path-prefix</var></dt>
465 <dd>Restrict the work tree to a subset of the repository's tree hierarchy.
466 Only files beneath the specified <var class="Ar">path-prefix</var>
467 will be checked out.</dd>
468 <dt id="q~3"><a class="permalink" href="#q~3"><code class="Fl">-q</code></a></dt>
469 <dd>Silence progress output.</dd>
470 </dl>
471 </dd>
472 <dt id="up"><a class="permalink" href="#update"><code class="Cm" id="update">update</code></a>
473 [<code class="Fl">-q</code>] [<code class="Fl">-b</code>
474 <var class="Ar">branch</var>] [<code class="Fl">-c</code>
475 <var class="Ar">commit</var>] [<var class="Ar">path ...</var>]</dt>
476 <dd>
477 <div class="Bd Bd-indent"><code class="Li">(alias:
478 <code class="Cm">up</code>)</code></div>
479 Update an existing work tree to a different <var class="Ar">commit</var>.
480 Change existing files in the work tree as necessary to match file contents
481 of this commit. Preserve any local changes in the work tree and merge them
482 with the incoming changes.
483 <p class="Pp">Files which already contain merge conflicts will not be
484 updated to avoid further complications. Such files will be updated when
485 <code class="Cm">got update</code> is run again after merge conflicts
486 have been resolved. If the conflicting changes are no longer needed,
487 affected files can be reverted with <code class="Cm">got revert</code>
488 before running <code class="Cm">got update</code> again.</p>
489 <p class="Pp">Show the status of each affected file, using the following
490 status codes:</p>
491 <table class="Bl-column">
492 <tr>
493 <td>U</td>
494 <td>file was updated and contained no local changes</td>
495 </tr>
496 <tr>
497 <td>G</td>
498 <td>file was updated and local changes were merged cleanly</td>
499 </tr>
500 <tr>
501 <td>C</td>
502 <td>file was updated and conflicts occurred during merge</td>
503 </tr>
504 <tr>
505 <td>D</td>
506 <td>file was deleted</td>
507 </tr>
508 <tr>
509 <td>d</td>
510 <td>file's deletion was prevented by local modifications</td>
511 </tr>
512 <tr>
513 <td>A</td>
514 <td>new file was added</td>
515 </tr>
516 <tr>
517 <td>~</td>
518 <td>versioned file is obstructed by a non-regular file</td>
519 </tr>
520 <tr>
521 <td>!</td>
522 <td>a missing versioned file was restored</td>
523 </tr>
524 <tr>
525 <td>#</td>
526 <td>file was not updated because it contains merge conflicts</td>
527 </tr>
528 <tr>
529 <td>?</td>
530 <td>changes destined for an unversioned file were not merged</td>
531 </tr>
532 </table>
533 <p class="Pp">If no <var class="Ar">path</var> is specified, update the
534 entire work tree. Otherwise, restrict the update operation to files at
535 or within the specified paths. Each path is required to exist in the
536 update operation's target commit. Files in the work tree outside
537 specified paths will remain unchanged and will retain their previously
538 recorded base commit. Some <code class="Nm">got</code> commands may
539 refuse to run while the work tree contains files from multiple base
540 commits. The base commit of such a work tree can be made consistent by
541 running <code class="Cm">got update</code> across the entire work tree.
542 Specifying a <var class="Ar">path</var> is incompatible with the
543 <code class="Fl">-b</code> option.</p>
544 <p class="Pp"><code class="Cm">got update</code> cannot update paths with
545 staged changes. If changes have been staged with <code class="Cm">got
546 stage</code>, these changes must first be committed with
547 <code class="Cm">got commit</code> or unstaged with <code class="Cm">got
548 unstage</code>.</p>
549 <p class="Pp">The options for <code class="Cm">got update</code> are as
550 follows:</p>
551 <dl class="Bl-tag">
552 <dt id="b~5"><a class="permalink" href="#b~5"><code class="Fl">-b</code></a>
553 <var class="Ar">branch</var></dt>
554 <dd>Switch the work tree's branch reference to the specified
555 <var class="Ar">branch</var> before updating the work tree. This
556 option requires that all paths in the work tree are updated.
557 <p class="Pp">As usual, any local changes in the work tree will be
558 preserved. This can be useful when switching to a newly created
559 branch in order to commit existing local changes to this branch.</p>
560 <p class="Pp">Any local changes must be dealt with separately in order
561 to obtain a work tree with pristine file contents corresponding
562 exactly to the specified <var class="Ar">branch</var>. Such changes
563 could first be committed to a different branch with
564 <code class="Cm">got commit</code>, or could be discarded with
565 <code class="Cm">got revert</code>.</p>
566 </dd>
567 <dt id="c~2"><a class="permalink" href="#c~2"><code class="Fl">-c</code></a>
568 <var class="Ar">commit</var></dt>
569 <dd>Update the work tree to the specified <var class="Ar">commit</var>. If
570 this option is not specified, the most recent commit on the work
571 tree's branch will be used.
572 <p class="Pp">The expected <var class="Ar">commit</var> argument is a
573 commit ID SHA1 hash, or a reference name or a keyword which will be
574 resolved to a commit ID. An abbreviated hash argument will be
575 expanded to a full SHA1 hash automatically, provided the
576 abbreviation is unique. The keywords &quot;:base&quot; and
577 &quot;:head&quot; resolve to the work tree's base commit and branch
578 head, respectively. Keywords and reference names may be appended
579 with &quot;:+&quot; or &quot;:-&quot; modifiers and an optional
580 integer N to denote the Nth descendant or antecedent, respectively,
581 by first parent traversal; for example, <b class="Sy">:head:-2</b>
582 denotes the work tree branch head's 2nd generation ancestor, and
583 <b class="Sy">:base:+4</b> denotes the 4th generation descendant of
584 the work tree's base commit. Similarly, <b class="Sy">foo:-3</b>
585 will denote the 3rd generation ancestor of the commit resolved by
586 the &quot;foo&quot; reference. If an integer does not follow the
587 &quot;:+&quot; or &quot;:-&quot; modifier, a &quot;1&quot; is
588 implicitly appended (e.g., <b class="Sy">:head:-</b> is equivalent
589 to <b class="Sy">:head:-1</b>).</p>
590 </dd>
591 <dt id="q~4"><a class="permalink" href="#q~4"><code class="Fl">-q</code></a></dt>
592 <dd>Silence progress output.</dd>
593 </dl>
594 </dd>
595 <dt id="st"><a class="permalink" href="#status"><code class="Cm" id="status">status</code></a>
596 [<code class="Fl">-I</code>] [<code class="Fl">-S</code>
597 <var class="Ar">status-codes</var>] [<code class="Fl">-s</code>
598 <var class="Ar">status-codes</var>] [<var class="Ar">path ...</var>]</dt>
599 <dd>
600 <div class="Bd Bd-indent"><code class="Li">(alias:
601 <code class="Cm">st</code>)</code></div>
602 Show the current modification status of files in a work tree, using the
603 following status codes:
604 <table class="Bl-column">
605 <tr>
606 <td>M</td>
607 <td>modified file</td>
608 </tr>
609 <tr>
610 <td>A</td>
611 <td>file scheduled for addition in next commit</td>
612 </tr>
613 <tr>
614 <td>D</td>
615 <td>file scheduled for deletion in next commit</td>
616 </tr>
617 <tr>
618 <td>C</td>
619 <td>modified or added file which contains merge conflicts</td>
620 </tr>
621 <tr>
622 <td>!</td>
623 <td>versioned file was expected on disk but is missing</td>
624 </tr>
625 <tr>
626 <td>~</td>
627 <td>versioned file is obstructed by a non-regular file</td>
628 </tr>
629 <tr>
630 <td>?</td>
631 <td>unversioned item not tracked by <code class="Nm">got</code></td>
632 </tr>
633 <tr>
634 <td>m</td>
635 <td>modified file modes (executable bit only)</td>
636 </tr>
637 <tr>
638 <td>N</td>
639 <td>non-existent <var class="Ar">path</var> specified on the command
640 line</td>
641 </tr>
642 </table>
643 <p class="Pp">If no <var class="Ar">path</var> is specified, show
644 modifications in the entire work tree. Otherwise, show modifications at
645 or within the specified paths.</p>
646 <p class="Pp">If changes have been staged with <code class="Cm">got
647 stage</code>, staged changes are shown in the second output column,
648 using the following status codes:</p>
649 <table class="Bl-column">
650 <tr>
651 <td>M</td>
652 <td>file modification is staged</td>
653 </tr>
654 <tr>
655 <td>A</td>
656 <td>file addition is staged</td>
657 </tr>
658 <tr>
659 <td>D</td>
660 <td>file deletion is staged</td>
661 </tr>
662 </table>
663 <p class="Pp">Changes created on top of staged changes are indicated in the
664 first column:</p>
665 <table class="Bl-column">
666 <tr>
667 <td>MM</td>
668 <td>file was modified after earlier changes have been staged</td>
669 </tr>
670 <tr>
671 <td>MA</td>
672 <td>file was modified after having been staged for addition</td>
673 </tr>
674 </table>
675 <p class="Pp">The options for <code class="Cm">got status</code> are as
676 follows:</p>
677 <dl class="Bl-tag">
678 <dt id="I~2"><a class="permalink" href="#I~2"><code class="Fl">-I</code></a></dt>
679 <dd>Show unversioned files even if they match an ignore pattern.</dd>
680 <dt id="S"><a class="permalink" href="#S"><code class="Fl">-S</code></a>
681 <var class="Ar">status-codes</var></dt>
682 <dd>Suppress the output of files with a modification status matching any
683 of the single-character status codes contained in the
684 <var class="Ar">status-codes</var> argument. Any combination of codes
685 from the above list of possible status codes may be specified. For
686 staged files, status codes displayed in either column will be matched.
687 Cannot be used together with the <code class="Fl">-s</code>
688 option.</dd>
689 <dt id="s"><a class="permalink" href="#s"><code class="Fl">-s</code></a>
690 <var class="Ar">status-codes</var></dt>
691 <dd>Only show files with a modification status matching any of the
692 single-character status codes contained in the
693 <var class="Ar">status-codes</var> argument. Any combination of codes
694 from the above list of possible status codes may be specified. For
695 staged files, status codes displayed in either column will be matched.
696 Cannot be used together with the <code class="Fl">-S</code>
697 option.</dd>
698 </dl>
699 <p class="Pp">For compatibility with <a class="Xr" aria-label="cvs, section
700 1">cvs(1)</a> and <a class="Xr" aria-label="git, section 1">git(1)</a>,
701 <code class="Cm">got status</code> reads <a class="Xr" aria-label="glob,
702 section 7">glob(7)</a> patterns from <span class="Pa">.cvsignore</span>
703 and <span class="Pa">.gitignore</span> files in each traversed directory
704 and will not display unversioned files which match these patterns.
705 Ignore patterns which end with a slash, &#x201C;/&#x201D;, will only
706 match directories. As an extension to <a class="Xr" aria-label="glob,
707 section 7">glob(7)</a> matching rules, <code class="Cm">got
708 status</code> supports consecutive asterisks, &#x201C;**&#x201D;, which
709 will match an arbitrary amount of directories. Unlike
710 <a class="Xr" aria-label="cvs, section 1">cvs(1)</a>,
711 <code class="Cm">got status</code> only supports a single ignore pattern
712 per line. Unlike <a class="Xr" aria-label="git, section 1">git(1)</a>,
713 <code class="Cm">got status</code> does not support negated ignore
714 patterns prefixed with &#x201C;!&#x201D;, and gives no special
715 significance to the location of path component separators,
716 &#x201C;/&#x201D;, in a pattern.</p>
717 </dd>
718 <dt id="log"><a class="permalink" href="#log"><code class="Cm">log</code></a>
719 [<code class="Fl">-bdPpRs</code>] [<code class="Fl">-C</code>
720 <var class="Ar">number</var>] [<code class="Fl">-c</code>
721 <var class="Ar">commit</var>] [<code class="Fl">-l</code>
722 <var class="Ar">N</var>] [<code class="Fl">-r</code>
723 <var class="Ar">repository-path</var>] [<code class="Fl">-S</code>
724 <var class="Ar">search-pattern</var>] [<code class="Fl">-x</code>
725 <var class="Ar">commit</var>] [<var class="Ar">path</var>]</dt>
726 <dd>Display history of a repository. If a <var class="Ar">path</var> is
727 specified, show only commits which modified this path. If invoked in a
728 work tree, the <var class="Ar">path</var> is interpreted relative to the
729 current working directory, and the work tree's path prefix is implicitly
730 prepended. Otherwise, the path is interpreted relative to the repository
731 root.
732 <p class="Pp">The options for <code class="Cm">got log</code> are as
733 follows:</p>
734 <dl class="Bl-tag">
735 <dt id="b~6"><a class="permalink" href="#b~6"><code class="Fl">-b</code></a></dt>
736 <dd>Display individual commits which were merged into the current branch
737 from other branches. By default, <code class="Cm">got log</code> shows
738 the linear history of the current branch only.</dd>
739 <dt id="C"><a class="permalink" href="#C"><code class="Fl">-C</code></a>
740 <var class="Ar">number</var></dt>
741 <dd>Set the number of context lines shown in diffs with
742 <code class="Fl">-p</code>. By default, 3 lines of context are
743 shown.</dd>
744 <dt id="c~3"><a class="permalink" href="#c~3"><code class="Fl">-c</code></a>
745 <var class="Ar">commit</var></dt>
746 <dd>Start traversing history at the specified
747 <var class="Ar">commit</var>. If this option is not specified, default
748 to the work tree's current branch if invoked in a work tree, or to the
749 repository's HEAD reference.
750 <p class="Pp" id="bar:+3">The expected <var class="Ar">commit</var>
751 argument is a commit ID SHA1 hash, or a reference name or a keyword
752 which will be resolved to a commit ID. An abbreviated hash argument
753 will be expanded to a full SHA1 hash automatically, provided the
754 abbreviation is unique. The keywords &quot;:base&quot; and
755 &quot;:head&quot; resolve to the work tree's base commit and branch
756 head, respectively. The former is only valid if invoked in a work
757 tree, while the latter will resolve to the tip of the work tree's
758 current branch if invoked in a work tree, otherwise it will resolve
759 to the repository's HEAD reference. Keywords and references may be
760 appended with &quot;:+&quot; or &quot;:-&quot; modifiers and an
761 optional integer N to denote the Nth descendant or antecedent,
762 respectively, by first parent traversal; for example,
763 <b class="Sy">:head:-2</b> denotes the HEAD reference's 2nd
764 generation ancestor, and <b class="Sy">:base:+4</b> denotes the 4th
765 generation descendant of the work tree's base commit. Similarly,
766 <a class="permalink" href="#bar:+3"><b class="Sy">bar:+3</b></a>
767 will denote the 3rd generation descendant of the commit resolved by
768 the &quot;bar&quot; reference. A &quot;:+&quot; or &quot;:-&quot;
769 modifier without a trailing integer has an implicit &quot;1&quot;
770 appended (e.g., <b class="Sy">:base:+</b> is equivalent to
771 <b class="Sy">:base:+1</b>).</p>
772 </dd>
773 <dt id="d~2"><a class="permalink" href="#d~2"><code class="Fl">-d</code></a></dt>
774 <dd>Display diffstat of changes introduced in each commit. Cannot be used
775 with the <code class="Fl">-s</code> option.</dd>
776 <dt id="l~3"><a class="permalink" href="#l~3"><code class="Fl">-l</code></a>
777 <var class="Ar">N</var></dt>
778 <dd>Limit history traversal to a given number of commits. If this option
779 is not specified, a default limit value of zero is used, which is
780 treated as an unbounded limit. The
781 <code class="Ev">GOT_LOG_DEFAULT_LIMIT</code> environment variable may
782 be set to change this default value.</dd>
783 <dt id="P"><a class="permalink" href="#P"><code class="Fl">-P</code></a></dt>
784 <dd>Display the list of file paths changed in each commit, using the
785 following status codes:
786 <table class="Bl-column">
787 <tr>
788 <td>M</td>
789 <td>modified file</td>
790 </tr>
791 <tr>
792 <td>D</td>
793 <td>file was deleted</td>
794 </tr>
795 <tr>
796 <td>A</td>
797 <td>new file was added</td>
798 </tr>
799 <tr>
800 <td>m</td>
801 <td>modified file modes (executable bit only)</td>
802 </tr>
803 </table>
804 <p class="Pp">Cannot be used with the <code class="Fl">-s</code>
805 option.</p>
806 </dd>
807 <dt id="p~2"><a class="permalink" href="#p~2"><code class="Fl">-p</code></a></dt>
808 <dd>Display the patch of modifications made in each commit. If a
809 <var class="Ar">path</var> is specified, only show the patch of
810 modifications at or within this path. Cannot be used with the
811 <code class="Fl">-s</code> option.</dd>
812 <dt id="R~3"><a class="permalink" href="#R~3"><code class="Fl">-R</code></a></dt>
813 <dd>Determine a set of commits to display as usual, but display these
814 commits in reverse order.</dd>
815 <dt id="r~3"><a class="permalink" href="#r~3"><code class="Fl">-r</code></a>
816 <var class="Ar">repository-path</var></dt>
817 <dd>Use the repository at the specified path. If not specified, assume the
818 repository is located at or above the current working directory. If
819 this directory is a <code class="Nm">got</code> work tree, use the
820 repository path associated with this work tree.</dd>
821 <dt id="S~2"><a class="permalink" href="#S~2"><code class="Fl">-S</code></a>
822 <var class="Ar">search-pattern</var></dt>
823 <dd>If specified, show only commits with a log message, author name,
824 committer name, or ID SHA1 hash matched by the extended regular
825 expression <var class="Ar">search-pattern</var>. Lines in committed
826 patches will be matched if <code class="Fl">-p</code> is specified.
827 File paths changed by a commit will be matched if
828 <code class="Fl">-P</code> is specified. Regular expression syntax is
829 documented in <a class="Xr" aria-label="re_format, section
830 7">re_format(7)</a>.</dd>
831 <dt id="s~2"><a class="permalink" href="#s~2"><code class="Fl">-s</code></a></dt>
832 <dd>Display a short one-line summary of each commit, instead of the
833 default history format. Cannot be used together with the
834 <code class="Fl">-p</code> or <code class="Fl">-P</code> option.</dd>
835 <dt id="x"><a class="permalink" href="#x"><code class="Fl">-x</code></a>
836 <var class="Ar">commit</var></dt>
837 <dd>Stop traversing commit history immediately after the specified
838 <var class="Ar">commit</var> has been traversed. This option has no
839 effect if the specified <var class="Ar">commit</var> is never
840 traversed.</dd>
841 </dl>
842 </dd>
843 <dt id="di"><a class="permalink" href="#diff"><code class="Cm" id="diff">diff</code></a>
844 [<code class="Fl">-adPsw</code>] [<code class="Fl">-C</code>
845 <var class="Ar">number</var>] [<code class="Fl">-c</code>
846 <var class="Ar">commit</var>] [<code class="Fl">-r</code>
847 <var class="Ar">repository-path</var>] [<var class="Ar">object1</var>
848 <var class="Ar">object2</var> | <var class="Ar">path ...</var>]</dt>
849 <dd>
850 <div class="Bd Bd-indent"><code class="Li">(alias:
851 <code class="Cm">di</code>)</code></div>
852 When invoked within a work tree without any arguments, display all local
853 changes in the work tree. If one or more <var class="Ar">path</var>
854 arguments are specified, only show changes within the specified paths.
855 <p class="Pp">If two arguments are provided, treat each argument as a
856 reference, a tag name, or an object ID SHA1 hash, and display
857 differences between the corresponding objects. Both objects must be of
858 the same type (blobs, trees, or commits). An abbreviated hash argument
859 will be expanded to a full SHA1 hash automatically, provided the
860 abbreviation is unique. If none of these interpretations produce a valid
861 result or if the <code class="Fl">-P</code> option is used, and if
862 <code class="Cm">got diff</code> is running in a work tree, attempt to
863 interpret the two arguments as paths.</p>
864 <p class="Pp">The options for <code class="Cm">got diff</code> are as
865 follows:</p>
866 <dl class="Bl-tag">
867 <dt id="a~3"><a class="permalink" href="#a~3"><code class="Fl">-a</code></a></dt>
868 <dd>Treat file contents as ASCII text even if binary data is
869 detected.</dd>
870 <dt id="C~2"><a class="permalink" href="#C~2"><code class="Fl">-C</code></a>
871 <var class="Ar">number</var></dt>
872 <dd>Set the number of context lines shown in the diff. By default, 3 lines
873 of context are shown.</dd>
874 <dt id="c~4"><a class="permalink" href="#c~4"><code class="Fl">-c</code></a>
875 <var class="Ar">commit</var></dt>
876 <dd>Show differences between commits in the repository. This option may be
877 used up to two times. When used only once, show differences between
878 the specified <var class="Ar">commit</var> and its first parent
879 commit. When used twice, show differences between the two specified
880 commits.
881 <p class="Pp">If the <code class="Fl">-c</code> option is used, all
882 non-option arguments will be interpreted as paths. If one or more
883 such <var class="Ar">path</var> arguments are provided, only show
884 differences for the specified paths.</p>
885 <p class="Pp" id="baz:+8">The expected <var class="Ar">commit</var>
886 argument is a commit ID SHA1 hash, or a reference name or a keyword
887 which will be resolved to a commit ID. An abbreviated hash argument
888 will be expanded to a full SHA1 hash automatically, provided the
889 abbreviation is unique. The keywords &quot;:base&quot; and
890 &quot;:head&quot; resolve to the work tree's base commit and branch
891 head, respectively. The former is only valid if invoked in a work
892 tree, while the latter will resolve to the tip of the work tree's
893 current branch if invoked in a work tree, otherwise it will resolve
894 to the repository's HEAD reference. Keywords and references may be
895 appended with &quot;:+&quot; or &quot;:-&quot; modifiers and an
896 optional integer N to denote the Nth descendant or antecedent,
897 respectively, by first parent traversal; for example,
898 <b class="Sy">:head:-2</b> denotes the HEAD reference's 2nd
899 generation ancestor, and <b class="Sy">:base:+4</b> denotes the 4th
900 generation descendant of the work tree's base commit. Similarly,
901 <a class="permalink" href="#baz:+8"><b class="Sy">baz:+8</b></a>
902 will denote the 8th generation descendant of the commit resolved by
903 the &quot;baz&quot; reference. If an integer does not follow the
904 &quot;:+&quot; or &quot;:-&quot; modifier, a &quot;1&quot; is
905 implicitly appended (e.g., <b class="Sy">:head:-</b> is equivalent
906 to <b class="Sy">:head:-1</b>).</p>
907 <p class="Pp">Cannot be used together with the
908 <code class="Fl">-P</code> option.</p>
909 </dd>
910 <dt id="d~3"><a class="permalink" href="#d~3"><code class="Fl">-d</code></a></dt>
911 <dd>Display diffstat of changes before the actual diff by annotating each
912 file path or blob hash being diffed with the total number of lines
913 added and removed. A summary line will display the total number of
914 changes across all files.</dd>
915 <dt id="P~2"><a class="permalink" href="#P~2"><code class="Fl">-P</code></a></dt>
916 <dd>Interpret all arguments as paths only. This option can be used to
917 resolve ambiguity in cases where paths look like tag names, reference
918 names, or object IDs. This option is only valid when
919 <code class="Cm">got diff</code> is invoked in a work tree.</dd>
920 <dt id="r~4"><a class="permalink" href="#r~4"><code class="Fl">-r</code></a>
921 <var class="Ar">repository-path</var></dt>
922 <dd>Use the repository at the specified path. If not specified, assume the
923 repository is located at or above the current working directory. If
924 this directory is a <code class="Nm">got</code> work tree, use the
925 repository path associated with this work tree.</dd>
926 <dt id="s~3"><a class="permalink" href="#s~3"><code class="Fl">-s</code></a></dt>
927 <dd>Show changes staged with <code class="Cm">got stage</code> instead of
928 showing local changes in the work tree. This option is only valid when
929 <code class="Cm">got diff</code> is invoked in a work tree.</dd>
930 <dt id="w"><a class="permalink" href="#w"><code class="Fl">-w</code></a></dt>
931 <dd>Ignore whitespace-only changes.</dd>
932 </dl>
933 </dd>
934 <dt id="bl"><a class="permalink" href="#blame"><code class="Cm" id="blame">blame</code></a>
935 [<code class="Fl">-c</code> <var class="Ar">commit</var>]
936 [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
937 <var class="Ar">path</var></dt>
938 <dd>
939 <div class="Bd Bd-indent"><code class="Li">(alias:
940 <code class="Cm">bl</code>)</code></div>
941 Display line-by-line history of a file at the specified path.
942 <p class="Pp">The options for <code class="Cm">got blame</code> are as
943 follows:</p>
944 <dl class="Bl-tag">
945 <dt id="c~5"><a class="permalink" href="#c~5"><code class="Fl">-c</code></a>
946 <var class="Ar">commit</var></dt>
947 <dd>Start traversing history at the specified
948 <var class="Ar">commit</var>. The expected argument is a commit ID
949 SHA1 hash, or a reference name or a keyword which will be resolved to
950 a commit ID. An abbreviated hash argument will be expanded to a full
951 SHA1 hash automatically, provided the abbreviation is unique. The
952 keywords &quot;:base&quot; and &quot;:head&quot; resolve to the work
953 tree's base commit and branch head, respectively. The former is only
954 valid if invoked in a work tree, while the latter will resolve to the
955 tip of the work tree's current branch if invoked in a work tree,
956 otherwise it will resolve to the repository's HEAD reference. Keywords
957 and references may be appended with &quot;:+&quot; or &quot;:-&quot;
958 modifiers and an optional integer N to denote the Nth descendant or
959 antecedent by first parent traversal, respectively; for example,
960 <b class="Sy">:head:-2</b> denotes the work tree branch head's 2nd
961 generation ancestor, and <b class="Sy">:base:+4</b> denotes the 4th
962 generation descendant of the work tree's base commit. Similarly,
963 <a class="permalink" href="#xyz:-5"><b class="Sy" id="xyz:-5">xyz:-5</b></a>
964 will denote the 5th generation ancestor of the commit resolved by the
965 &quot;xyz&quot; reference. A &quot;:+&quot; or &quot;:-&quot; modifier
966 without a trailing integer has an implicit &quot;1&quot; appended
967 (e.g., <b class="Sy">:base:+</b> is equivalent to
968 <b class="Sy">:base:+1</b>).</dd>
969 <dt id="r~5"><a class="permalink" href="#r~5"><code class="Fl">-r</code></a>
970 <var class="Ar">repository-path</var></dt>
971 <dd>Use the repository at the specified path. If not specified, assume the
972 repository is located at or above the current working directory. If
973 this directory is a <code class="Nm">got</code> work tree, use the
974 repository path associated with this work tree.</dd>
975 </dl>
976 </dd>
977 <dt id="tr"><a class="permalink" href="#tree"><code class="Cm" id="tree">tree</code></a>
978 [<code class="Fl">-iR</code>] [<code class="Fl">-c</code>
979 <var class="Ar">commit</var>] [<code class="Fl">-r</code>
980 <var class="Ar">repository-path</var>] [<var class="Ar">path</var>]</dt>
981 <dd>
982 <div class="Bd Bd-indent"><code class="Li">(alias:
983 <code class="Cm">tr</code>)</code></div>
984 Display a listing of files and directories at the specified directory path
985 in the repository. Entries shown in this listing may carry one of the
986 following trailing annotations:
987 <table class="Bl-column">
988 <tr>
989 <td>@</td>
990 <td>entry is a symbolic link</td>
991 </tr>
992 <tr>
993 <td>/</td>
994 <td>entry is a directory</td>
995 </tr>
996 <tr>
997 <td>*</td>
998 <td>entry is an executable file</td>
999 </tr>
1000 <tr>
1001 <td>$</td>
1002 <td>entry is a Git submodule</td>
1003 </tr>
1004 </table>
1005 <p class="Pp">Symbolic link entries are also annotated with the target path
1006 of the link.</p>
1007 <p class="Pp">If no <var class="Ar">path</var> is specified, list the
1008 repository path corresponding to the current directory of the work tree,
1009 or the root directory of the repository if there is no work tree.</p>
1010 <p class="Pp">The options for <code class="Cm">got tree</code> are as
1011 follows:</p>
1012 <dl class="Bl-tag">
1013 <dt id="c~6"><a class="permalink" href="#c~6"><code class="Fl">-c</code></a>
1014 <var class="Ar">commit</var></dt>
1015 <dd>List files and directories as they appear in the specified
1016 <var class="Ar">commit</var>.
1017 <p class="Pp" id="spam:-3">The expected argument is a commit ID SHA1
1018 hash, or a reference name or a keyword which will be resolved to a
1019 commit ID. An abbreviated hash argument will be expanded to a full
1020 SHA1 hash automatically, provided the abbreviation is unique. The
1021 keywords &quot;:base&quot; and &quot;:head&quot; resolve to the work
1022 tree's base commit and branch head, respectively. The former is only
1023 valid if invoked in a work tree, while the latter will resolve to
1024 the tip of the work tree's current branch if invoked in a work tree,
1025 otherwise it will resolve to the repository's HEAD reference.
1026 Keywords and references may be appended with &quot;:+&quot; or
1027 &quot;:-&quot; modifiers and an optional integer N to denote the Nth
1028 descendant or antecedent by first parent traversal, respectively;
1029 for example, <b class="Sy">:head:-2</b> denotes the work tree branch
1030 head's 2nd generation ancestor, and <b class="Sy">:base:+4</b>
1031 denotes the 4th generation descendant of the work tree's base
1032 commit. Similarly,
1033 <a class="permalink" href="#spam:-3"><b class="Sy">spam:-3</b></a>
1034 will denote the 3rd generation ancestor of the commit resolved by
1035 the &quot;spam&quot; reference. A &quot;:+&quot; or &quot;:-&quot;
1036 modifier without a trailing integer has an implicit &quot;1&quot;
1037 appended (e.g., <b class="Sy">:base:+</b> is equivalent to
1038 <b class="Sy">:base:+1</b>).</p>
1039 </dd>
1040 <dt id="i"><a class="permalink" href="#i"><code class="Fl">-i</code></a></dt>
1041 <dd>Show object IDs of files (blob objects) and directories (tree
1042 objects).</dd>
1043 <dt id="R~4"><a class="permalink" href="#R~4"><code class="Fl">-R</code></a></dt>
1044 <dd>Recurse into sub-directories in the repository.</dd>
1045 <dt id="r~6"><a class="permalink" href="#r~6"><code class="Fl">-r</code></a>
1046 <var class="Ar">repository-path</var></dt>
1047 <dd>Use the repository at the specified path. If not specified, assume the
1048 repository is located at or above the current working directory. If
1049 this directory is a <code class="Nm">got</code> work tree, use the
1050 repository path associated with this work tree.</dd>
1051 </dl>
1052 </dd>
1053 <dt id="ref"><a class="permalink" href="#ref"><code class="Cm">ref</code></a>
1054 [<code class="Fl">-dlt</code>] [<code class="Fl">-c</code>
1055 <var class="Ar">object</var>] [<code class="Fl">-r</code>
1056 <var class="Ar">repository-path</var>] [<code class="Fl">-s</code>
1057 <var class="Ar">reference</var>] [<var class="Ar">name</var>]</dt>
1058 <dd>Manage references in a repository.
1059 <p class="Pp">References may be listed, created, deleted, and changed. When
1060 creating, deleting, or changing a reference the specified
1061 <var class="Ar">name</var> must be an absolute reference name, i.e. it
1062 must begin with &#x201C;refs/&#x201D;.</p>
1063 <p class="Pp">The options for <code class="Cm">got ref</code> are as
1064 follows:</p>
1065 <dl class="Bl-tag">
1066 <dt id="c~7"><a class="permalink" href="#c~7"><code class="Fl">-c</code></a>
1067 <var class="Ar">object</var></dt>
1068 <dd>Create a reference or change an existing reference. The reference with
1069 the specified <var class="Ar">name</var> will point at the specified
1070 <var class="Ar">object</var>.
1071 <p class="Pp" id="tagged:-3">The expected <var class="Ar">object</var>
1072 argument is an ID SHA1 hash or an existing reference or tag name or
1073 a keyword which will be resolved to the ID of a corresponding
1074 commit, tree, tag, or blob object. An abbreviated hash argument will
1075 be expanded to a full SHA1 hash automatically, provided the
1076 abbreviation is unique. The keywords &quot;:base&quot; and
1077 &quot;:head&quot; resolve to the work tree's base commit and branch
1078 head, respectively. The former is only valid if invoked in a work
1079 tree, while the latter will resolve to the tip of the work tree's
1080 current branch if invoked in a work tree, otherwise it will resolve
1081 to the repository's HEAD reference. Keywords and reference names may
1082 be appended with &quot;:+&quot; or &quot;:-&quot; modifiers and an
1083 optional integer N to denote the Nth descendant or antecedent by
1084 first parent traversal, respectively; for example,
1085 <b class="Sy">:head:-2</b> denotes the work tree branch head's 2nd
1086 generation ancestor, and
1087 <a class="permalink" href="#tagged:-3"><b class="Sy">tagged:-3</b></a>
1088 will denote the 3rd generation ancestor of the commit resolved by
1089 the &quot;tagged&quot; reference. If an integer does not follow the
1090 &quot;:+&quot; or &quot;:-&quot; modifier, a &quot;1&quot; is
1091 implicitly appended (e.g., <b class="Sy">:head:-</b> is equivalent
1092 to <b class="Sy">:head:-1</b>).</p>
1093 <p class="Pp">Cannot be used together with any other options except
1094 <code class="Fl">-r</code>.</p>
1095 </dd>
1096 <dt id="d~4"><a class="permalink" href="#d~4"><code class="Fl">-d</code></a></dt>
1097 <dd>Delete the reference with the specified <var class="Ar">name</var>
1098 from the repository. Any commit, tree, tag, and blob objects belonging
1099 to deleted references remain in the repository and may be removed
1100 separately with Git's garbage collector or <code class="Cm">gotadmin
1101 cleanup</code>. Cannot be used together with any other options except
1102 <code class="Fl">-r</code>.</dd>
1103 <dt id="l~4"><a class="permalink" href="#l~4"><code class="Fl">-l</code></a></dt>
1104 <dd>List references in the repository. If no <var class="Ar">name</var> is
1105 specified, list all existing references in the repository. If
1106 <var class="Ar">name</var> is a reference namespace, list all
1107 references in this namespace. Otherwise, show only the reference with
1108 the given <var class="Ar">name</var>. Cannot be used together with any
1109 other options except <code class="Fl">-r</code> and
1110 <code class="Fl">-t</code>.</dd>
1111 <dt id="r~7"><a class="permalink" href="#r~7"><code class="Fl">-r</code></a>
1112 <var class="Ar">repository-path</var></dt>
1113 <dd>Use the repository at the specified path. If not specified, assume the
1114 repository is located at or above the current working directory. If
1115 this directory is a <code class="Nm">got</code> work tree, use the
1116 repository path associated with this work tree.</dd>
1117 <dt id="s~4"><a class="permalink" href="#s~4"><code class="Fl">-s</code></a>
1118 <var class="Ar">reference</var></dt>
1119 <dd>Create a symbolic reference, or change an existing symbolic reference.
1120 The symbolic reference with the specified <var class="Ar">name</var>
1121 will point at the specified <var class="Ar">reference</var> which must
1122 already exist in the repository. Care should be taken not to create
1123 loops between references when this option is used. Cannot be used
1124 together with any other options except
1125 <code class="Fl">-r</code>.</dd>
1126 <dt id="t~2"><a class="permalink" href="#t~2"><code class="Fl">-t</code></a></dt>
1127 <dd>Sort listed references by modification time (most recently modified
1128 first) instead of sorting by lexicographical order. Use of this option
1129 requires the <code class="Fl">-l</code> option to be used as
1130 well.</dd>
1131 </dl>
1132 </dd>
1133 <dt id="br"><a class="permalink" href="#branch"><code class="Cm" id="branch">branch</code></a>
1134 [<code class="Fl">-lnt</code>] [<code class="Fl">-c</code>
1135 <var class="Ar">commit</var>] [<code class="Fl">-d</code>
1136 <var class="Ar">name</var>] [<code class="Fl">-r</code>
1137 <var class="Ar">repository-path</var>] [<var class="Ar">name</var>]</dt>
1138 <dd>
1139 <div class="Bd Bd-indent"><code class="Li">(alias:
1140 <code class="Cm">br</code>)</code></div>
1141 Create, list, or delete branches.
1142 <p class="Pp">Local branches are managed via references which live in the
1143 &#x201C;refs/heads/&#x201D; reference namespace. The
1144 <code class="Cm">got branch</code> command creates references in this
1145 namespace only.</p>
1146 <p class="Pp">When deleting branches, the specified
1147 <var class="Ar">name</var> is searched in the &#x201C;refs/heads&#x201D;
1148 reference namespace first. If no corresponding branch is found, the
1149 &#x201C;refs/remotes&#x201D; namespace will be searched next.</p>
1150 <p class="Pp">If invoked in a work tree without any arguments, print the
1151 name of the work tree's current branch.</p>
1152 <p class="Pp">If a <var class="Ar">name</var> argument is passed, attempt to
1153 create a branch reference with the given name. By default the new branch
1154 reference will point at the latest commit on the work tree's current
1155 branch if invoked in a work tree, and otherwise to a commit resolved via
1156 the repository's HEAD reference.</p>
1157 <p class="Pp">If invoked in a work tree, once the branch was created
1158 successfully switch the work tree's head reference to the newly created
1159 branch and update files across the entire work tree, just like
1160 <code class="Cm">got update -b</code> <var class="Ar">name</var> would
1161 do. Show the status of each affected file, using the following status
1162 codes:</p>
1163 <table class="Bl-column">
1164 <tr>
1165 <td>U</td>
1166 <td>file was updated and contained no local changes</td>
1167 </tr>
1168 <tr>
1169 <td>G</td>
1170 <td>file was updated and local changes were merged cleanly</td>
1171 </tr>
1172 <tr>
1173 <td>C</td>
1174 <td>file was updated and conflicts occurred during merge</td>
1175 </tr>
1176 <tr>
1177 <td>D</td>
1178 <td>file was deleted</td>
1179 </tr>
1180 <tr>
1181 <td>A</td>
1182 <td>new file was added</td>
1183 </tr>
1184 <tr>
1185 <td>~</td>
1186 <td>versioned file is obstructed by a non-regular file</td>
1187 </tr>
1188 <tr>
1189 <td>!</td>
1190 <td>a missing versioned file was restored</td>
1191 </tr>
1192 </table>
1193 <p class="Pp">The options for <code class="Cm">got branch</code> are as
1194 follows:</p>
1195 <dl class="Bl-tag">
1196 <dt id="c~8"><a class="permalink" href="#c~8"><code class="Fl">-c</code></a>
1197 <var class="Ar">commit</var></dt>
1198 <dd>Make a newly created branch reference point at the specified
1199 <var class="Ar">commit</var>. The expected argument is a commit ID
1200 SHA1 hash, or a reference name or keyword which will be resolved to a
1201 commit ID. An abbreviated hash argument will be expanded to a full
1202 SHA1 hash automatically, provided the abbreviation is unique. The
1203 keywords &quot;:base&quot; and &quot;:head&quot; resolve to the work
1204 tree's base commit and branch head, respectively. The former is only
1205 valid if invoked in a work tree, while the latter will resolve to the
1206 tip of the work tree's current branch if invoked in a work tree,
1207 otherwise it will resolve to the repository's HEAD reference. Keywords
1208 and references may be appended with &quot;:+&quot; or &quot;:-&quot;
1209 modifiers and an optional integer N to denote the Nth descendant or
1210 antecedent by first parent traversal, respectively; for example,
1211 <b class="Sy">:head:-2</b> denotes the work tree branch head's 2nd
1212 generation ancestor, and <b class="Sy">:base:+4</b> denotes the 4th
1213 generation descendant of the work tree's base commit. Similarly,
1214 <a class="permalink" href="#foobar:+3"><b class="Sy" id="foobar:+3">foobar:+3</b></a>
1215 will denote the 3rd generation descendant of the commit resolved by
1216 the &quot;foobar&quot; reference. A &quot;:+&quot; or &quot;:-&quot;
1217 modifier without a trailing integer has an implicit &quot;1&quot;
1218 appended (e.g., <b class="Sy">:base:+</b> is equivalent to
1219 <b class="Sy">:base:+1</b>).</dd>
1220 <dt id="d~5"><a class="permalink" href="#d~5"><code class="Fl">-d</code></a>
1221 <var class="Ar">name</var></dt>
1222 <dd>Delete the branch with the specified <var class="Ar">name</var> from
1223 the &#x201C;refs/heads&#x201D; or &#x201C;refs/remotes&#x201D;
1224 reference namespace.
1225 <p class="Pp">Only the branch reference is deleted. Any commit, tree,
1226 and blob objects belonging to the branch remain in the repository
1227 and may be removed separately with Git's garbage collector or
1228 <code class="Cm">gotadmin cleanup</code>.</p>
1229 </dd>
1230 <dt id="l~5"><a class="permalink" href="#l~5"><code class="Fl">-l</code></a></dt>
1231 <dd>List all existing branches in the repository, including copies of
1232 remote repositories' branches in the &#x201C;refs/remotes/&#x201D;
1233 reference namespace.
1234 <p class="Pp">If invoked in a work tree, the work tree's current branch
1235 is shown with one of the following annotations:</p>
1236 <table class="Bl-column">
1237 <tr>
1238 <td>*</td>
1239 <td>work tree's base commit matches the branch tip</td>
1240 </tr>
1241 <tr>
1242 <td>~</td>
1243 <td>work tree's base commit is out-of-date</td>
1244 </tr>
1245 </table>
1246 </dd>
1247 <dt id="n"><a class="permalink" href="#n"><code class="Fl">-n</code></a></dt>
1248 <dd>Do not switch and update the work tree after creating a new
1249 branch.</dd>
1250 <dt id="r~8"><a class="permalink" href="#r~8"><code class="Fl">-r</code></a>
1251 <var class="Ar">repository-path</var></dt>
1252 <dd>Use the repository at the specified path. If not specified, assume the
1253 repository is located at or above the current working directory. If
1254 this directory is a <code class="Nm">got</code> work tree, use the
1255 repository path associated with this work tree.</dd>
1256 <dt id="t~3"><a class="permalink" href="#t~3"><code class="Fl">-t</code></a></dt>
1257 <dd>Sort listed branches by modification time (most recently modified
1258 first) instead of sorting by lexicographical order. Branches in the
1259 &#x201C;refs/heads/&#x201D; reference namespace are listed before
1260 branches in &#x201C;refs/remotes/&#x201D; regardless. Use of this
1261 option requires the <code class="Fl">-l</code> option to be used as
1262 well.</dd>
1263 </dl>
1264 </dd>
1265 <dt id="tag"><a class="permalink" href="#tag"><code class="Cm">tag</code></a>
1266 [<code class="Fl">-lVv</code>] [<code class="Fl">-c</code>
1267 <var class="Ar">commit</var>] [<code class="Fl">-m</code>
1268 <var class="Ar">message</var>] [<code class="Fl">-r</code>
1269 <var class="Ar">repository-path</var>] [<code class="Fl">-s</code>
1270 <var class="Ar">signer-id</var>] <var class="Ar">name</var></dt>
1271 <dd>Manage tags in a repository.
1272 <p class="Pp">Tags are managed via references which live in the
1273 &#x201C;refs/tags/&#x201D; reference namespace. The <code class="Cm">got
1274 tag</code> command operates on references in this namespace only.
1275 References in this namespace point at tag objects which contain a
1276 pointer to another object, a tag message, as well as author and
1277 timestamp information.</p>
1278 <p class="Pp">Attempt to create a tag with the given
1279 <var class="Ar">name</var>, and make this tag point at the given
1280 <var class="Ar">commit</var>. If no commit is specified, default to the
1281 latest commit on the work tree's current branch if invoked in a work
1282 tree, and to a commit resolved via the repository's HEAD reference
1283 otherwise.</p>
1284 <p class="Pp">The options for <code class="Cm">got tag</code> are as
1285 follows:</p>
1286 <dl class="Bl-tag">
1287 <dt id="c~9"><a class="permalink" href="#c~9"><code class="Fl">-c</code></a>
1288 <var class="Ar">commit</var></dt>
1289 <dd>Make the newly created tag reference point at the specified
1290 <var class="Ar">commit</var>. The expected
1291 <var class="Ar">commit</var> argument is a commit ID SHA1 hash, or a
1292 reference or keyword which will be resolved to a commit ID. An
1293 abbreviated hash argument will be expanded to a full SHA1 hash
1294 automatically, provided the abbreviation is unique. The keywords
1295 &quot;:base&quot; and &quot;:head&quot; resolve to the work tree's
1296 base commit and branch head, respectively. The former is only valid if
1297 invoked in a work tree, while the latter will resolve to the tip of
1298 the work tree's current branch if invoked in a work tree, otherwise it
1299 will resolve to the repository's HEAD reference. Keywords and
1300 references may be appended with &quot;:+&quot; or &quot;:-&quot;
1301 modifiers and an optional integer N to denote the Nth descendant or
1302 antecedent by first parent traversal, respectively; for example,
1303 <b class="Sy">:head:-2</b> denotes the work tree branch head's 2nd
1304 generation ancestor, and <b class="Sy">:base:+4</b> denotes the 4th
1305 generation descendant of the work tree's base commit. Similarly,
1306 <a class="permalink" href="#eggs:-3"><b class="Sy" id="eggs:-3">eggs:-3</b></a>
1307 will denote the 3rd generation ancestor of the commit resolved by the
1308 &quot;eggs&quot; reference. A &quot;:+&quot; or &quot;:-&quot;
1309 modifier without a trailing integer has an implicit &quot;1&quot;
1310 appended (e.g., <b class="Sy">:base:+</b> is equivalent to
1311 <b class="Sy">:base:+1</b>).</dd>
1312 <dt id="l~6"><a class="permalink" href="#l~6"><code class="Fl">-l</code></a></dt>
1313 <dd>List all existing tags in the repository instead of creating a new
1314 tag. If a <var class="Ar">name</var> argument is passed, show only the
1315 tag with the given <var class="Ar">name</var>.</dd>
1316 <dt id="m~3"><a class="permalink" href="#m~3"><code class="Fl">-m</code></a>
1317 <var class="Ar">message</var></dt>
1318 <dd>Use the specified tag message when creating the new tag. Without the
1319 <code class="Fl">-m</code> option, <code class="Cm">got tag</code>
1320 opens a temporary file in an editor where a tag message can be
1321 written. Quitting the editor without saving the file will abort the
1322 tag operation.</dd>
1323 <dt id="r~9"><a class="permalink" href="#r~9"><code class="Fl">-r</code></a>
1324 <var class="Ar">repository-path</var></dt>
1325 <dd>Use the repository at the specified path. If not specified, assume the
1326 repository is located at or above the current working directory. If
1327 this directory is a <code class="Nm">got</code> work tree, use the
1328 repository path associated with this work tree.</dd>
1329 <dt id="s~5"><a class="permalink" href="#s~5"><code class="Fl">-s</code></a>
1330 <var class="Ar">signer-id</var></dt>
1331 <dd>While creating a new tag, sign this tag with the identity given in
1332 <var class="Ar">signer-id</var>.
1333 <p class="Pp">For SSH-based signatures, <var class="Ar">signer-id</var>
1334 is the path to a file which may refer to either a private SSH key,
1335 or a public SSH key with the private half available via
1336 <a class="Xr" aria-label="ssh-agent, section 1">ssh-agent(1)</a>.
1337 <code class="Cm">got tag</code> will sign the tag object by invoking
1338 <a class="Xr" aria-label="ssh-keygen, section 1">ssh-keygen(1)</a>
1339 with the <code class="Fl">-Y</code> <code class="Cm">sign</code>
1340 command, using the signature namespace &#x201C;git&#x201D; for
1341 compatibility with <a class="Xr" aria-label="git, section
1342 1">git(1)</a>.</p>
1343 </dd>
1344 <dt id="V~2"><a class="permalink" href="#V~2"><code class="Fl">-V</code></a></dt>
1345 <dd>Verify tag object signatures. If a <var class="Ar">name</var> is
1346 specified, show and verify the tag object with the provided name.
1347 Otherwise, list all tag objects and verify signatures where present.
1348 <p class="Pp"><code class="Cm">got tag</code> verifies SSH-based
1349 signatures by invoking <a class="Xr" aria-label="ssh-keygen, section
1350 1">ssh-keygen(1)</a> with the options <code class="Fl">-Y</code>
1351 <code class="Cm">verify</code> <code class="Fl">-f</code>
1352 <var class="Ar">allowed_signers</var>. A path to the
1353 <var class="Ar">allowed_signers</var> file must be set in
1354 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a>,
1355 otherwise verification is impossible.</p>
1356 </dd>
1357 <dt id="v~3"><a class="permalink" href="#v~3"><code class="Fl">-v</code></a></dt>
1358 <dd>Verbose mode. During SSH signature creation and verification this
1359 option will be passed to <a class="Xr" aria-label="ssh-keygen, section
1360 1">ssh-keygen(1)</a>. Multiple -v options increase the verbosity. The
1361 maximum is 3.</dd>
1362 </dl>
1363 <p class="Pp">By design, the <code class="Cm">got tag</code> command will
1364 not delete tags or change existing tags. If a tag must be deleted, the
1365 <code class="Cm">got ref</code> command may be used to delete a tag's
1366 reference. This should only be done if the tag has not already been
1367 copied to another repository.</p>
1368 </dd>
1369 <dt id="add"><a class="permalink" href="#add"><code class="Cm">add</code></a>
1370 [<code class="Fl">-IR</code>] <var class="Ar">path ...</var></dt>
1371 <dd>Schedule unversioned files in a work tree for addition to the repository
1372 in the next commit. By default, files which match a <code class="Cm">got
1373 status</code> ignore pattern will not be added.
1374 <p class="Pp">If a <var class="Ar">path</var> mentioned in the command line
1375 is not an unversioned file then <code class="Cm">got add</code> may
1376 raise an error. To avoid unnecessary errors from paths picked up by file
1377 globbing patterns in the shell, paths in the argument list will be
1378 silently ignored if they are not reported by <code class="Cm">got
1379 status</code> at all, or if they are reported with one of the following
1380 status codes and do not have changes staged via <code class="Cm">got
1381 stage</code>:</p>
1382 <table class="Bl-column">
1383 <tr>
1384 <td>M</td>
1385 <td>modified file</td>
1386 </tr>
1387 <tr>
1388 <td>A</td>
1389 <td>file scheduled for addition in next commit</td>
1390 </tr>
1391 <tr>
1392 <td>C</td>
1393 <td>modified or added file which contains merge conflicts</td>
1394 </tr>
1395 <tr>
1396 <td>m</td>
1397 <td>modified file modes (executable bit only)</td>
1398 </tr>
1399 </table>
1400 <p class="Pp">The options for <code class="Cm">got add</code> are as
1401 follows:</p>
1402 <dl class="Bl-tag">
1403 <dt id="I~3"><a class="permalink" href="#I~3"><code class="Fl">-I</code></a></dt>
1404 <dd>Add files even if they match a <code class="Cm">got status</code>
1405 ignore pattern.</dd>
1406 <dt id="R~5"><a class="permalink" href="#R~5"><code class="Fl">-R</code></a></dt>
1407 <dd>Permit recursion into directories. If this option is not specified,
1408 <code class="Cm">got add</code> will refuse to run if a specified
1409 <var class="Ar">path</var> is a directory.</dd>
1410 </dl>
1411 </dd>
1412 <dt id="rm"><a class="permalink" href="#remove"><code class="Cm" id="remove">remove</code></a>
1413 [<code class="Fl">-fkR</code>] [<code class="Fl">-s</code>
1414 <var class="Ar">status-codes</var>] <var class="Ar">path ...</var></dt>
1415 <dd>
1416 <div class="Bd Bd-indent"><code class="Li">(alias:
1417 <code class="Cm">rm</code>)</code></div>
1418 Remove versioned files from a work tree and schedule them for deletion from
1419 the repository in the next commit.
1420 <p class="Pp">The options for <code class="Cm">got remove</code> are as
1421 follows:</p>
1422 <dl class="Bl-tag">
1423 <dt id="f"><a class="permalink" href="#f"><code class="Fl">-f</code></a></dt>
1424 <dd>Perform the operation even if a file contains local modifications, and
1425 do not raise an error if a specified <var class="Ar">path</var> does
1426 not exist on disk.</dd>
1427 <dt id="k"><a class="permalink" href="#k"><code class="Fl">-k</code></a></dt>
1428 <dd>Keep affected files on disk.</dd>
1429 <dt id="R~6"><a class="permalink" href="#R~6"><code class="Fl">-R</code></a></dt>
1430 <dd>Permit recursion into directories. If this option is not specified,
1431 <code class="Cm">got remove</code> will refuse to run if a specified
1432 <var class="Ar">path</var> is a directory.</dd>
1433 <dt id="s~6"><a class="permalink" href="#s~6"><code class="Fl">-s</code></a>
1434 <var class="Ar">status-codes</var></dt>
1435 <dd>Only delete files with a modification status matching one of the
1436 single-character status codes contained in the
1437 <var class="Ar">status-codes</var> argument. The following status
1438 codes may be specified:
1439 <table class="Bl-column">
1440 <tr>
1441 <td>M</td>
1442 <td>modified file (this implies the <code class="Fl">-f</code>
1443 option)</td>
1444 </tr>
1445 <tr>
1446 <td>!</td>
1447 <td>versioned file expected on disk but missing</td>
1448 </tr>
1449 </table>
1450 </dd>
1451 </dl>
1452 </dd>
1453 <dt id="pa"><a class="permalink" href="#patch"><code class="Cm" id="patch">patch</code></a>
1454 [<code class="Fl">-nR</code>] [<code class="Fl">-c</code>
1455 <var class="Ar">commit</var>] [<code class="Fl">-p</code>
1456 <var class="Ar">strip-count</var>] [<var class="Ar">patchfile</var>]</dt>
1457 <dd>
1458 <div class="Bd Bd-indent"><code class="Li">(alias:
1459 <code class="Cm">pa</code>)</code></div>
1460 Apply changes from <var class="Ar">patchfile</var> to files in a work tree.
1461 Files added or removed by a patch will be scheduled for addition or
1462 removal in the work tree.
1463 <p class="Pp">The patch must be in the unified diff format as produced by
1464 <code class="Cm">got diff</code>, <a class="Xr" aria-label="git-diff,
1465 section 1">git-diff(1)</a>, or by <a class="Xr" aria-label="diff,
1466 section 1">diff(1)</a> and <a class="Xr" aria-label="cvs, section
1467 1">cvs(1)</a> diff when invoked with their <code class="Fl">-u</code>
1468 options. If no <var class="Ar">patchfile</var> argument is provided,
1469 read unified diff data from standard input instead.</p>
1470 <p class="Pp">If the <var class="Ar">patchfile</var> contains multiple
1471 patches, then attempt to apply each of them in sequence.</p>
1472 <p class="Pp">Show the status of each affected file, using the following
1473 status codes:</p>
1474 <table class="Bl-column">
1475 <tr>
1476 <td>M</td>
1477 <td>file was modified</td>
1478 </tr>
1479 <tr>
1480 <td>G</td>
1481 <td>file was merged using a merge-base found in the repository</td>
1482 </tr>
1483 <tr>
1484 <td>C</td>
1485 <td>file was merged and conflicts occurred during merge</td>
1486 </tr>
1487 <tr>
1488 <td>D</td>
1489 <td>file was deleted</td>
1490 </tr>
1491 <tr>
1492 <td>A</td>
1493 <td>file was added</td>
1494 </tr>
1495 <tr>
1496 <td>#</td>
1497 <td>failed to patch the file</td>
1498 </tr>
1499 </table>
1500 <p class="Pp">If a change does not match at its exact line number, attempt
1501 to apply it somewhere else in the file if a good spot can be found.
1502 Otherwise, the patch will fail to apply.</p>
1503 <p class="Pp"><code class="Nm">got</code> <code class="Cm">patch</code> will
1504 refuse to apply a patch if certain preconditions are not met. Files to
1505 be deleted must already be under version control, and must not have been
1506 scheduled for deletion already. Files to be added must not yet be under
1507 version control and must not already be present on disk. Files to be
1508 modified must already be under version control and may not contain
1509 conflict markers.</p>
1510 <p class="Pp">If an error occurs, the <code class="Cm">patch</code>
1511 operation will be aborted. Any changes made to the work tree up to this
1512 point will be left behind. Such changes can be viewed with
1513 <code class="Cm">got diff</code> and can be reverted with
1514 <code class="Cm">got revert</code> if needed.</p>
1515 <p class="Pp">The options for <code class="Cm">got patch</code> are as
1516 follows:</p>
1517 <dl class="Bl-tag">
1518 <dt id="c~10"><a class="permalink" href="#c~10"><code class="Fl">-c</code></a>
1519 <var class="Ar">commit</var></dt>
1520 <dd>Attempt to locate files within the specified
1521 <var class="Ar">commit</var> for use as a merge-base for 3-way merges.
1522 <p class="Pp">If the <code class="Fl">-c</code> option is not used then
1523 <code class="Cm">got patch</code> will attempt to locate merge-bases
1524 via object IDs found in <var class="Ar">patchfile</var> meta-data,
1525 such as produced by <code class="Cm">got diff</code> or
1526 <a class="Xr" aria-label="git-diff, section 1">git-diff(1)</a>. Use
1527 of the <code class="Fl">-c</code> option is only recommended in the
1528 absence of such meta-data.</p>
1529 <p class="Pp">Ideally, the specified <var class="Ar">commit</var> should
1530 contain versions of files which the changes contained in the
1531 <var class="Ar">patchfile</var> were based on. Files will be located
1532 by path, relative to the repository root. If the
1533 <code class="Fl">-p</code> option is used then leading path
1534 components will be stripped before paths are looked up in the
1535 repository.</p>
1536 <p class="Pp">In case no merge-base is available for a file, changes
1537 will be applied without doing a 3-way merge. Changes which do not
1538 apply cleanly may then be rejected entirely, rather than producing
1539 merge conflicts in the patched target file.</p>
1540 <p class="Pp" id="flan:+3">The expected <var class="Ar">commit</var>
1541 argument is a commit ID SHA1 hash, or a reference name or a keyword
1542 which will be resolved to a commit ID. An abbreviated hash argument
1543 will be expanded to a full SHA1 hash automatically, provided the
1544 abbreviation is unique. The keywords &quot;:base&quot; and
1545 &quot;:head&quot; resolve to the work tree's base commit and branch
1546 head, respectively. Keywords and references may be appended with
1547 &quot;:+&quot; or &quot;:-&quot; modifiers and an optional integer N
1548 to denote the Nth descendant or antecedent by first parent
1549 traversal, respectively; for example, <b class="Sy">:head:-2</b>
1550 denotes the work tree branch head's 2nd generation ancestor, and
1551 <b class="Sy">:base:+4</b> denotes the 4th generation descendant of
1552 the work tree's base commit. Similarly,
1553 <a class="permalink" href="#flan:+3"><b class="Sy">flan:+3</b></a>
1554 will denote the 3rd generation descendant of the commit resolved by
1555 the &quot;flan&quot; reference. A &quot;:+&quot; or &quot;:-&quot;
1556 modifier without a trailing integer has an implicit &quot;1&quot;
1557 appended (e.g., <b class="Sy">:base:+</b> is equivalent to
1558 <b class="Sy">:base:+1</b>).</p>
1559 </dd>
1560 <dt id="n~2"><a class="permalink" href="#n~2"><code class="Fl">-n</code></a></dt>
1561 <dd>Do not make any modifications to the work tree. This can be used to
1562 check whether a patch would apply without issues. If the
1563 <var class="Ar">patchfile</var> contains diffs that affect the same
1564 file multiple times, the results displayed may be incorrect.</dd>
1565 <dt id="p~3"><a class="permalink" href="#p~3"><code class="Fl">-p</code></a>
1566 <var class="Ar">strip-count</var></dt>
1567 <dd>Specify the number of leading path components to strip from paths
1568 parsed from <var class="Ar">patchfile</var>. If the
1569 <code class="Fl">-p</code> option is not used, &#x2018;a/&#x2019; and
1570 &#x2018;b/&#x2019; path prefixes generated by
1571 <a class="Xr" aria-label="git-diff, section 1">git-diff(1)</a> will be
1572 recognized and stripped automatically.</dd>
1573 <dt id="R~7"><a class="permalink" href="#R~7"><code class="Fl">-R</code></a></dt>
1574 <dd>Reverse the patch before applying it.</dd>
1575 </dl>
1576 </dd>
1577 <dt id="rv"><a class="permalink" href="#revert"><code class="Cm" id="revert">revert</code></a>
1578 [<code class="Fl">-pR</code>] [<code class="Fl">-F</code>
1579 <var class="Ar">response-script</var>] <var class="Ar">path ...</var></dt>
1580 <dd>
1581 <div class="Bd Bd-indent"><code class="Li">(alias:
1582 <code class="Cm">rv</code>)</code></div>
1583 Revert any local changes in files at the specified paths in a work tree.
1584 File contents will be overwritten with those contained in the work tree's
1585 base commit. There is no way to bring discarded changes back after
1586 <code class="Cm">got revert</code>!
1587 <p class="Pp">If a file was added with <code class="Cm">got add</code>, it
1588 will become an unversioned file again. If a file was deleted with
1589 <code class="Cm">got remove</code>, it will be restored.</p>
1590 <p class="Pp">The options for <code class="Cm">got revert</code> are as
1591 follows:</p>
1592 <dl class="Bl-tag">
1593 <dt id="F"><a class="permalink" href="#F"><code class="Fl">-F</code></a>
1594 <var class="Ar">response-script</var></dt>
1595 <dd>With the <code class="Fl">-p</code> option, read &#x201C;y&#x201D;,
1596 &#x201C;n&#x201D;, and &#x201C;q&#x201D; responses line-by-line from
1597 the specified <var class="Ar">response-script</var> file instead of
1598 prompting interactively.</dd>
1599 <dt id="p~4"><a class="permalink" href="#p~4"><code class="Fl">-p</code></a></dt>
1600 <dd>Instead of reverting all changes in files, interactively select or
1601 reject changes to revert based on &#x201C;y&#x201D; (revert change),
1602 &#x201C;n&#x201D; (keep change), and &#x201C;q&#x201D; (quit reverting
1603 this file) responses. If a file is in modified status, individual
1604 patches derived from the modified file content can be reverted. Files
1605 in added or deleted status may only be reverted in their
1606 entirety.</dd>
1607 <dt id="R~8"><a class="permalink" href="#R~8"><code class="Fl">-R</code></a></dt>
1608 <dd>Permit recursion into directories. If this option is not specified,
1609 <code class="Cm">got revert</code> will refuse to run if a specified
1610 <var class="Ar">path</var> is a directory.</dd>
1611 </dl>
1612 </dd>
1613 <dt id="ci"><a class="permalink" href="#commit"><code class="Cm" id="commit">commit</code></a>
1614 [<code class="Fl">-CNnS</code>] [<code class="Fl">-A</code>
1615 <var class="Ar">author</var>] [<code class="Fl">-F</code>
1616 <var class="Ar">path</var>] [<code class="Fl">-m</code>
1617 <var class="Ar">message</var>] [<var class="Ar">path ...</var>]</dt>
1618 <dd>
1619 <div class="Bd Bd-indent"><code class="Li">(alias:
1620 <code class="Cm">ci</code>)</code></div>
1621 Create a new commit in the repository from changes in a work tree and use
1622 this commit as the new base commit for the work tree. If no
1623 <var class="Ar">path</var> is specified, commit all changes in the work
1624 tree. Otherwise, commit changes at or within the specified paths.
1625 <p class="Pp">If changes have been explicitly staged for commit with
1626 <code class="Cm">got stage</code>, only commit staged changes and reject
1627 any specified paths which have not been staged.</p>
1628 <p class="Pp"><code class="Cm">got commit</code> opens a temporary file in
1629 an editor where a log message can be written unless the
1630 <code class="Fl">-m</code> option is used or the
1631 <code class="Fl">-F</code> and <code class="Fl">-N</code> options are
1632 used together. Quitting the editor without saving the file will abort
1633 the commit operation.</p>
1634 <p class="Pp">Show the status of each affected file, using the following
1635 status codes:</p>
1636 <table class="Bl-column">
1637 <tr>
1638 <td>M</td>
1639 <td>modified file</td>
1640 </tr>
1641 <tr>
1642 <td>D</td>
1643 <td>file was deleted</td>
1644 </tr>
1645 <tr>
1646 <td>A</td>
1647 <td>new file was added</td>
1648 </tr>
1649 <tr>
1650 <td>m</td>
1651 <td>modified file modes (executable bit only)</td>
1652 </tr>
1653 </table>
1654 <p class="Pp">Files which are not part of the new commit will retain their
1655 previously recorded base commit. Some <code class="Nm">got</code>
1656 commands may refuse to run while the work tree contains files from
1657 multiple base commits. The base commit of such a work tree can be made
1658 consistent by running <code class="Cm">got update</code> across the
1659 entire work tree.</p>
1660 <p class="Pp">The <code class="Cm">got commit</code> command requires the
1661 <code class="Ev">GOT_AUTHOR</code> environment variable to be set,
1662 unless an author has been configured in
1663 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
1664 <code class="Dv">user.name</code> and <code class="Dv">user.email</code>
1665 configuration settings can be obtained from the repository's
1666 <span class="Pa">.git/config</span> file or from Git's global
1667 <span class="Pa">~/.gitconfig</span> configuration file.</p>
1668 <p class="Pp">The options for <code class="Cm">got commit</code> are as
1669 follows:</p>
1670 <dl class="Bl-tag">
1671 <dt id="A"><a class="permalink" href="#A"><code class="Fl">-A</code></a>
1672 <var class="Ar">author</var></dt>
1673 <dd>Set author information in the newly created commit to
1674 <var class="Ar">author</var>. This is useful when committing changes
1675 on behalf of someone else. The <var class="Ar">author</var> argument
1676 must use the same format as the <code class="Ev">GOT_AUTHOR</code>
1677 environment variable.
1678 <p class="Pp">In addition to storing author information, the newly
1679 created commit object will retain &#x201C;committer&#x201D;
1680 information which is obtained, as usual, from the
1681 <code class="Ev">GOT_AUTHOR</code> environment variable, or
1682 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a>, or
1683 Git configuration settings.</p>
1684 </dd>
1685 <dt id="C~3"><a class="permalink" href="#C~3"><code class="Fl">-C</code></a></dt>
1686 <dd>Allow committing files in conflicted status.
1687 <p class="Pp">Committing files with conflict markers should generally be
1688 avoided. Cases where conflict markers must be stored in the
1689 repository for some legitimate reason should be very rare. There are
1690 usually ways to avoid storing conflict markers verbatim by applying
1691 appropriate programming tricks.</p>
1692 </dd>
1693 <dt id="F~2"><a class="permalink" href="#F~2"><code class="Fl">-F</code></a>
1694 <var class="Ar">path</var></dt>
1695 <dd>Use the prepared log message stored in the file found at
1696 <var class="Ar">path</var> when creating the new commit.
1697 <code class="Cm">got commit</code> opens a temporary file in an editor
1698 where the prepared log message can be reviewed and edited further if
1699 needed. Cannot be used together with the <code class="Fl">-m</code>
1700 option.</dd>
1701 <dt id="m~4"><a class="permalink" href="#m~4"><code class="Fl">-m</code></a>
1702 <var class="Ar">message</var></dt>
1703 <dd>Use the specified log message when creating the new commit. Cannot be
1704 used together with the <code class="Fl">-F</code> option.</dd>
1705 <dt id="N"><a class="permalink" href="#N"><code class="Fl">-N</code></a></dt>
1706 <dd>This option prevents <code class="Cm">got commit</code> from opening
1707 the commit message in an editor. It has no effect unless it is used
1708 together with the <code class="Fl">-F</code> option and is intended
1709 for non-interactive use such as scripting.</dd>
1710 <dt id="n~3"><a class="permalink" href="#n~3"><code class="Fl">-n</code></a></dt>
1711 <dd>This option prevents <code class="Cm">got commit</code> from
1712 generating a diff of the to-be-committed changes in a temporary file
1713 which can be viewed while editing a commit message.</dd>
1714 <dt id="S~3"><a class="permalink" href="#S~3"><code class="Fl">-S</code></a></dt>
1715 <dd>Allow the addition of symbolic links which point outside of the path
1716 space that is under version control. By default, <code class="Cm">got
1717 commit</code> will reject such symbolic links due to safety concerns.
1718 As a precaution, <code class="Nm">got</code> may decide to represent
1719 such a symbolic link as a regular file which contains the link's
1720 target path, rather than creating an actual symbolic link which points
1721 outside of the work tree. Use of this option is discouraged because
1722 external mechanisms such as &#x201C;make obj&#x201D; are better suited
1723 for managing symbolic links to paths not under version control.</dd>
1724 </dl>
1725 <p class="Pp"><code class="Cm">got commit</code> will refuse to run if
1726 certain preconditions are not met. If the work tree's current branch is
1727 not in the &#x201C;refs/heads/&#x201D; reference namespace, new commits
1728 may not be created on this branch. Local changes may only be committed
1729 if they are based on file content found in the most recent commit on the
1730 work tree's branch. If a path is found to be out of date,
1731 <code class="Cm">got update</code> must be used first in order to merge
1732 local changes with changes made in the repository.</p>
1733 </dd>
1734 <dt id="se"><a class="permalink" href="#send"><code class="Cm" id="send">send</code></a>
1735 [<code class="Fl">-afqTv</code>] [<code class="Fl">-b</code>
1736 <var class="Ar">branch</var>] [<code class="Fl">-d</code>
1737 <var class="Ar">branch</var>] [<code class="Fl">-r</code>
1738 <var class="Ar">repository-path</var>] [<code class="Fl">-t</code>
1739 <var class="Ar">tag</var>] [<var class="Ar">remote-repository</var>]</dt>
1740 <dd>
1741 <div class="Bd Bd-indent"><code class="Li">(alias:
1742 <code class="Cm">se</code>)</code></div>
1743 Send new changes to a remote repository. If no
1744 <var class="Ar">remote-repository</var> is specified,
1745 &#x201C;origin&#x201D; will be used. The remote repository's URL is
1746 obtained from the corresponding entry in
1747 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
1748 <span class="Pa">config</span> file of the local repository, as created by
1749 <code class="Cm">got clone</code>.
1750 <p class="Pp">All objects corresponding to new changes will be written to a
1751 temporary pack file which is then uploaded to the server. Upon success,
1752 references in the &#x201C;refs/remotes/&#x201D; reference namespace of
1753 the local repository will be updated to point at the commits which have
1754 been sent.</p>
1755 <p class="Pp">By default, changes will only be sent if they are based on
1756 up-to-date copies of relevant branches in the remote repository. If any
1757 changes to be sent are based on out-of-date copies or would otherwise
1758 break linear history of existing branches, new changes must be fetched
1759 from the server with <code class="Cm">got fetch</code> and local
1760 branches must be rebased with <code class="Cm">got rebase</code> before
1761 <code class="Cm">got send</code> can succeed. The
1762 <code class="Fl">-f</code> option can be used to make exceptions to
1763 these requirements.</p>
1764 <p class="Pp">The options for <code class="Cm">got send</code> are as
1765 follows:</p>
1766 <dl class="Bl-tag">
1767 <dt id="a~4"><a class="permalink" href="#a~4"><code class="Fl">-a</code></a></dt>
1768 <dd>Send all branches from the local repository's
1769 &#x201C;refs/heads/&#x201D; reference namespace. The
1770 <code class="Fl">-a</code> option is equivalent to listing all
1771 branches with multiple <code class="Fl">-b</code> options. Cannot be
1772 used together with the <code class="Fl">-b</code> option.</dd>
1773 <dt id="b~7"><a class="permalink" href="#b~7"><code class="Fl">-b</code></a>
1774 <var class="Ar">branch</var></dt>
1775 <dd>Send the specified <var class="Ar">branch</var> from the local
1776 repository's &#x201C;refs/heads/&#x201D; reference namespace. This
1777 option may be specified multiple times to build a list of branches to
1778 send. If this option is not specified, default to the work tree's
1779 current branch if invoked in a work tree, or to the repository's HEAD
1780 reference. Cannot be used together with the <code class="Fl">-a</code>
1781 option.</dd>
1782 <dt id="d~6"><a class="permalink" href="#d~6"><code class="Fl">-d</code></a>
1783 <var class="Ar">branch</var></dt>
1784 <dd>Delete the specified <var class="Ar">branch</var> from the remote
1785 repository's &#x201C;refs/heads/&#x201D; reference namespace. This
1786 option may be specified multiple times to build a list of branches to
1787 delete.
1788 <p class="Pp">Only references are deleted. Any commit, tree, tag, and
1789 blob objects belonging to deleted branches may become subject to
1790 deletion by Git's garbage collector running on the server.</p>
1791 <p class="Pp">Requesting deletion of branches results in an error if the
1792 server does not support this feature or disallows the deletion of
1793 branches based on its configuration.</p>
1794 </dd>
1795 <dt id="f~2"><a class="permalink" href="#f~2"><code class="Fl">-f</code></a></dt>
1796 <dd>Attempt to force the server to overwrite existing branches or tags in
1797 the remote repository, even when <code class="Cm">got fetch</code>
1798 followed by <code class="Cm">got rebase</code> or <code class="Cm">got
1799 merge</code> would usually be required before changes can be sent. The
1800 server may reject forced requests regardless, depending on its
1801 configuration.
1802 <p class="Pp">Any commit, tree, tag, and blob objects belonging to
1803 overwritten branches or tags may become subject to deletion by Git's
1804 garbage collector running on the server.</p>
1805 <p class="Pp">The &#x201C;refs/tags&#x201D; reference namespace is
1806 globally shared between all repositories. Use of the
1807 <code class="Fl">-f</code> option to overwrite tags is discouraged
1808 because it can lead to inconsistencies between the tags present in
1809 different repositories. In general, creating a new tag with a
1810 different name is recommended instead of overwriting an existing
1811 tag.</p>
1812 <p class="Pp">Use of the <code class="Fl">-f</code> option is
1813 particularly discouraged if changes being sent are based on an
1814 out-of-date copy of a branch in the remote repository. Instead of
1815 using the <code class="Fl">-f</code> option, new changes should be
1816 fetched with <code class="Cm">got fetch</code> and local branches
1817 should be rebased with <code class="Cm">got rebase</code> or merged
1818 with <code class="Cm">got merge</code>, followed by another attempt
1819 to send the changes.</p>
1820 <p class="Pp">The <code class="Fl">-f</code> option should only be
1821 needed in situations where the remote repository's copy of a branch
1822 or tag is known to be out-of-date and is considered disposable. The
1823 risks of creating inconsistencies between different repositories
1824 should also be taken into account.</p>
1825 </dd>
1826 <dt id="q~5"><a class="permalink" href="#q~5"><code class="Fl">-q</code></a></dt>
1827 <dd>Suppress progress reporting output. The same option will be passed to
1828 <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
1829 applicable.</dd>
1830 <dt id="r~10"><a class="permalink" href="#r~10"><code class="Fl">-r</code></a>
1831 <var class="Ar">repository-path</var></dt>
1832 <dd>Use the repository at the specified path. If not specified, assume the
1833 repository is located at or above the current working directory. If
1834 this directory is a <code class="Nm">got</code> work tree, use the
1835 repository path associated with this work tree.</dd>
1836 <dt id="T"><a class="permalink" href="#T"><code class="Fl">-T</code></a></dt>
1837 <dd>Attempt to send all tags from the local repository's
1838 &#x201C;refs/tags/&#x201D; reference namespace. The
1839 <code class="Fl">-T</code> option is equivalent to listing all tags
1840 with multiple <code class="Fl">-t</code> options. Cannot be used
1841 together with the <code class="Fl">-t</code> option.</dd>
1842 <dt id="t~4"><a class="permalink" href="#t~4"><code class="Fl">-t</code></a>
1843 <var class="Ar">tag</var></dt>
1844 <dd>Send the specified <var class="Ar">tag</var> from the local
1845 repository's &#x201C;refs/tags/&#x201D; reference namespace, in
1846 addition to any branches that are being sent. The
1847 <code class="Fl">-t</code> option may be specified multiple times to
1848 build a list of tags to send. No tags will be sent if the
1849 <code class="Fl">-t</code> option is not used.
1850 <p class="Pp">Raise an error if the specified <var class="Ar">tag</var>
1851 already exists in the remote repository, unless the
1852 <code class="Fl">-f</code> option is used to overwrite the server's
1853 copy of the tag. In general, creating a new tag with a different
1854 name is recommended instead of overwriting an existing tag.</p>
1855 <p class="Pp">Cannot be used together with the
1856 <code class="Fl">-T</code> option.</p>
1857 </dd>
1858 <dt id="v~4"><a class="permalink" href="#v~4"><code class="Fl">-v</code></a></dt>
1859 <dd>Verbose mode. Causes <code class="Cm">got send</code> to print
1860 debugging messages to standard error output. The same option will be
1861 passed to <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
1862 applicable. Multiple -v options increase the verbosity. The maximum is
1863 3.</dd>
1864 </dl>
1865 </dd>
1866 <dt id="cy"><a class="permalink" href="#cherrypick"><code class="Cm" id="cherrypick">cherrypick</code></a>
1867 [<code class="Fl">-lX</code>] [<var class="Ar">commit</var>]</dt>
1868 <dd>
1869 <div class="Bd Bd-indent"><code class="Li">(alias:
1870 <code class="Cm">cy</code>)</code></div>
1871 Merge changes from a single <var class="Ar">commit</var> into the work tree.
1872 The specified <var class="Ar">commit</var> should be on a different branch
1873 than the work tree's base commit.
1874 <p class="Pp" id="barbaz:+3">The expected argument is a commit ID SHA1 hash,
1875 or a reference name or keyword which will be resolved to a commit ID. An
1876 abbreviated hash argument will be expanded to a full SHA1 hash
1877 automatically, provided the abbreviation is unique. The keywords
1878 &quot;:base&quot; and &quot;:head&quot; resolve to the work tree's base
1879 commit and branch head, respectively. Keywords and references may be
1880 appended with &quot;:+&quot; or &quot;:-&quot; modifiers and an optional
1881 integer N to denote the Nth descendant or antecedent by first parent
1882 traversal, respectively; for example, <b class="Sy">:head:-2</b> denotes
1883 the work tree branch head's 2nd generation ancestor, and
1884 <b class="Sy">:base:+4</b> denotes the 4th generation descendant of the
1885 work tree's base commit. Similarly,
1886 <a class="permalink" href="#barbaz:+3"><b class="Sy">barbaz:+3</b></a>
1887 will denote the 3rd generation descendant of the commit resolved by the
1888 &quot;barbaz&quot; reference. A &quot;:+&quot; or &quot;:-&quot;
1889 modifier without a trailing integer has an implicit &quot;1&quot;
1890 appended (e.g., <b class="Sy">:base:+</b> is equivalent to
1891 <b class="Sy">:base:+1</b>).</p>
1892 <p class="Pp">Show the status of each affected file, using the following
1893 status codes:</p>
1894 <table class="Bl-column">
1895 <tr>
1896 <td>G</td>
1897 <td>file was merged</td>
1898 </tr>
1899 <tr>
1900 <td>C</td>
1901 <td>file was merged and conflicts occurred during merge</td>
1902 </tr>
1903 <tr>
1904 <td>!</td>
1905 <td>changes destined for a missing file were not merged</td>
1906 </tr>
1907 <tr>
1908 <td>D</td>
1909 <td>file was deleted</td>
1910 </tr>
1911 <tr>
1912 <td>d</td>
1913 <td>file's deletion was prevented by local modifications</td>
1914 </tr>
1915 <tr>
1916 <td>A</td>
1917 <td>new file was added</td>
1918 </tr>
1919 <tr>
1920 <td>~</td>
1921 <td>changes destined for a non-regular file were not merged</td>
1922 </tr>
1923 <tr>
1924 <td>?</td>
1925 <td>changes destined for an unversioned file were not merged</td>
1926 </tr>
1927 </table>
1928 <p class="Pp">The merged changes will appear as local changes in the work
1929 tree, which may be viewed with <code class="Cm">got diff</code>, amended
1930 manually or with further <code class="Cm">got cherrypick</code>
1931 commands, committed with <code class="Cm">got commit</code>.</p>
1932 <p class="Pp">If invoked in a work tree where no
1933 <code class="Cm">rebase</code>, <code class="Cm">histedit</code>, or
1934 <code class="Cm">merge</code> operation is taking place,
1935 <code class="Cm">got cherrypick</code> creates a record of commits which
1936 have been merged into the work tree. When a file changed by
1937 <code class="Cm">got cherrypick</code> is committed with
1938 <code class="Cm">got commit</code>, the log messages of relevant merged
1939 commits will then appear in the editor, where the messages should be
1940 further adjusted to convey the reasons for cherrypicking the changes.
1941 Upon exiting the editor, if the time stamp of the log message file is
1942 unchanged or the log message is empty, <code class="Cm">got
1943 commit</code> will fail with an unmodified or empty log message
1944 error.</p>
1945 <p class="Pp">If all the changes in all files touched by a given commit are
1946 discarded, e.g. with <code class="Cm">got revert</code>, this commit's
1947 log message record will also disappear.</p>
1948 <p class="Pp"><code class="Cm">got cherrypick</code> will refuse to run if
1949 certain preconditions are not met. If the work tree contains multiple
1950 base commits, it must first be updated to a single base commit with
1951 <code class="Cm">got update</code>. If any relevant files already
1952 contain merge conflicts, these conflicts must be resolved first.</p>
1953 <p class="Pp">The options for <code class="Nm">got</code>
1954 <code class="Cm">cherrypick</code> are as follows:</p>
1955 <dl class="Bl-tag">
1956 <dt id="l~7"><a class="permalink" href="#l~7"><code class="Fl">-l</code></a></dt>
1957 <dd>Display a list of commit log messages recorded by cherrypick
1958 operations, represented by references in the
1959 &#x201C;refs/got/worktree&#x201D; reference namespace. If a
1960 <var class="Ar">commit</var> is specified, only show the log message
1961 of the specified commit.
1962 <p class="Pp">If invoked in a work tree, only log messages recorded by
1963 cherrypick operations in the current work tree will be displayed.
1964 Otherwise, all commit log messages will be displayed irrespective of
1965 the work tree in which they were created. This option cannot be used
1966 with <code class="Fl">-X</code>.</p>
1967 </dd>
1968 <dt id="X~2"><a class="permalink" href="#X~2"><code class="Fl">-X</code></a></dt>
1969 <dd>Delete log messages created by previous cherrypick operations,
1970 represented by references in the &#x201C;refs/got/worktree&#x201D;
1971 reference namespace. If a <var class="Ar">commit</var> is specified,
1972 only delete the log message of the specified commit.
1973 <p class="Pp">If invoked in a work tree, only log messages recorded by
1974 cherrypick operations in the current work tree will be deleted.
1975 Otherwise, all commit log messages will be deleted irrespective of
1976 the work tree in which they were created. This option cannot be used
1977 with <code class="Fl">-l</code>.</p>
1978 </dd>
1979 </dl>
1980 <p class="Pp"></p>
1981 </dd>
1982 <dt id="bo"><a class="permalink" href="#backout"><code class="Cm" id="backout">backout</code></a>
1983 [<code class="Fl">-lX</code>] [<var class="Ar">commit</var>]</dt>
1984 <dd>
1985 <div class="Bd Bd-indent"><code class="Li">(alias:
1986 <code class="Cm">bo</code>)</code></div>
1987 Reverse-merge changes from a single <var class="Ar">commit</var> into the
1988 work tree. The specified <var class="Ar">commit</var> should be on the
1989 same branch as the work tree's base commit.
1990 <p class="Pp" id="wip:+5">The expected argument is a commit ID SHA1 hash, or
1991 a reference name or keyword which will be resolved to a commit ID. An
1992 abbreviated hash argument will be expanded to a full SHA1 hash
1993 automatically, provided the abbreviation is unique. The keywords
1994 &quot;:base&quot; and &quot;:head&quot; resolve to the work tree's base
1995 commit and branch head, respectively. Keywords and references may be
1996 appended with &quot;:+&quot; or &quot;:-&quot; modifiers and an optional
1997 integer N to denote the Nth descendant or antecedent by first parent
1998 traversal, respectively; for example, <b class="Sy">:head:-2</b> denotes
1999 the work tree branch head's 2nd generation ancestor, and
2000 <b class="Sy">:base:+4</b> denotes the 4th generation descendant of the
2001 work tree's base commit. Similarly,
2002 <a class="permalink" href="#wip:+5"><b class="Sy">wip:+5</b></a> will
2003 denote the 5th generation descendant of the commit resolved by the
2004 &quot;wip&quot; reference. A &quot;:+&quot; or &quot;:-&quot; modifier
2005 without a trailing integer has an implicit &quot;1&quot; appended (e.g.,
2006 <b class="Sy">:base:+</b> is equivalent to
2007 <b class="Sy">:base:+1</b>).</p>
2008 <p class="Pp">Show the status of each affected file, using the following
2009 status codes:</p>
2010 <table class="Bl-column">
2011 <tr>
2012 <td>G</td>
2013 <td>file was merged</td>
2014 </tr>
2015 <tr>
2016 <td>C</td>
2017 <td>file was merged and conflicts occurred during merge</td>
2018 </tr>
2019 <tr>
2020 <td>!</td>
2021 <td>changes destined for a missing file were not merged</td>
2022 </tr>
2023 <tr>
2024 <td>D</td>
2025 <td>file was deleted</td>
2026 </tr>
2027 <tr>
2028 <td>d</td>
2029 <td>file's deletion was prevented by local modifications</td>
2030 </tr>
2031 <tr>
2032 <td>A</td>
2033 <td>new file was added</td>
2034 </tr>
2035 <tr>
2036 <td>~</td>
2037 <td>changes destined for a non-regular file were not merged</td>
2038 </tr>
2039 <tr>
2040 <td>?</td>
2041 <td>changes destined for an unversioned file were not merged</td>
2042 </tr>
2043 </table>
2044 <p class="Pp">The reverse-merged changes will appear as local changes in the
2045 work tree, which may be viewed with <code class="Cm">got diff</code>,
2046 amended manually or with further <code class="Cm">got backout</code>
2047 commands, committed with <code class="Cm">got commit</code>.</p>
2048 <p class="Pp">If invoked in a work tree where no
2049 <code class="Cm">rebase</code>, <code class="Cm">histedit</code>, or
2050 <code class="Cm">merge</code> operation is taking place,
2051 <code class="Cm">got backout</code> creates a record of commits which
2052 have been reverse-merged into the work tree. When a file changed by
2053 <code class="Cm">got backout</code> is committed with
2054 <code class="Cm">got commit</code>, the log messages of relevant
2055 reverse-merged commits will then appear in the editor, where the
2056 messages should be further adjusted to convey the reasons for backing
2057 out the changes. Upon exiting the editor, if the time stamp of the log
2058 message file is unchanged or the log message is empty,
2059 <code class="Cm">got commit</code> will fail with an unmodified or empty
2060 log message error.</p>
2061 <p class="Pp">If all the changes in all files touched by a given commit are
2062 discarded, e.g. with <code class="Cm">got revert</code>, this commit's
2063 log message record will also disappear.</p>
2064 <p class="Pp"><code class="Cm">got backout</code> will refuse to run if
2065 certain preconditions are not met. If the work tree contains multiple
2066 base commits, it must first be updated to a single base commit with
2067 <code class="Cm">got update</code>. If any relevant files already
2068 contain merge conflicts, these conflicts must be resolved first.</p>
2069 <p class="Pp">The options for <code class="Nm">got</code>
2070 <code class="Cm">backout</code> are as follows:</p>
2071 <dl class="Bl-tag">
2072 <dt id="l~8"><a class="permalink" href="#l~8"><code class="Fl">-l</code></a></dt>
2073 <dd>Display a list of commit log messages recorded by backout operations,
2074 represented by references in the &#x201C;refs/got/worktree&#x201D;
2075 reference namespace. If a <var class="Ar">commit</var> is specified,
2076 only show the log message of the specified commit.
2077 <p class="Pp">If invoked in a work tree, only log messages recorded by
2078 backout operations in the current work tree will be displayed.
2079 Otherwise, all commit log messages will be displayed irrespective of
2080 the work tree in which they were created. This option cannot be used
2081 with <code class="Fl">-X</code>.</p>
2082 </dd>
2083 <dt id="X~3"><a class="permalink" href="#X~3"><code class="Fl">-X</code></a></dt>
2084 <dd>Delete log messages created by previous backout operations,
2085 represented by references in the &#x201C;refs/got/worktree&#x201D;
2086 reference namespace. If a <var class="Ar">commit</var> is specified,
2087 only delete the log message of the specified commit.
2088 <p class="Pp">If invoked in a work tree, only log messages recorded by
2089 backout operations in the current work tree will be deleted.
2090 Otherwise, all commit log messages will be deleted irrespective of
2091 the work tree in which they were created. This option cannot be used
2092 with <code class="Fl">-l</code>.</p>
2093 </dd>
2094 </dl>
2095 <p class="Pp"></p>
2096 </dd>
2097 <dt id="rb"><a class="permalink" href="#rebase"><code class="Cm" id="rebase">rebase</code></a>
2098 [<code class="Fl">-aCclX</code>] [<var class="Ar">branch</var>]</dt>
2099 <dd>
2100 <div class="Bd Bd-indent"><code class="Li">(alias:
2101 <code class="Cm">rb</code>)</code></div>
2102 Rebase commits on the specified <var class="Ar">branch</var> onto the tip of
2103 the current branch of the work tree. The <var class="Ar">branch</var> must
2104 share common ancestry with the work tree's current branch. Rebasing begins
2105 with the first descendant commit of the youngest common ancestor commit
2106 shared by the specified <var class="Ar">branch</var> and the work tree's
2107 current branch, and stops once the tip commit of the specified
2108 <var class="Ar">branch</var> has been rebased.
2109 <p class="Pp">When <code class="Cm">got rebase</code> is used as intended,
2110 the specified <var class="Ar">branch</var> represents a local commit
2111 history and may already contain changes that are not yet visible in any
2112 other repositories. The work tree's current branch, which must be set
2113 with <code class="Cm">got update -b</code> before starting the
2114 <code class="Cm">rebase</code> operation, represents a branch from a
2115 remote repository which shares a common history with the specified
2116 <var class="Ar">branch</var> but has progressed, and perhaps diverged,
2117 due to commits added to the remote repository.</p>
2118 <p class="Pp">Rebased commits are accumulated on a temporary branch which
2119 the work tree will remain switched to throughout the entire rebase
2120 operation. Commits on this branch represent the same changes with the
2121 same log messages as their counterparts on the original
2122 <var class="Ar">branch</var>, but with different commit IDs. Once
2123 rebasing has completed successfully, the temporary branch becomes the
2124 new version of the specified <var class="Ar">branch</var> and the work
2125 tree is automatically switched to it. If author information is available
2126 via the <code class="Ev">GOT_AUTHOR</code> environment variable,
2127 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
2128 <code class="Dv">user.name</code> and <code class="Dv">user.email</code>
2129 configuration settings, this author information will be used to identify
2130 the &#x201C;committer&#x201D; of rebased commits.</p>
2131 <p class="Pp">Old commits in their pre-rebase state are automatically backed
2132 up in the &#x201C;refs/got/backup/rebase&#x201D; reference namespace. As
2133 long as these references are not removed older versions of rebased
2134 commits will remain in the repository and can be viewed with the
2135 <code class="Cm">got rebase -l</code> command. Removal of these
2136 references makes objects which become unreachable via any reference
2137 subject to removal by Git's garbage collector or
2138 <code class="Cm">gotadmin cleanup</code>.</p>
2139 <p class="Pp">While rebasing commits, show the status of each affected file,
2140 using the following status codes:</p>
2141 <table class="Bl-column">
2142 <tr>
2143 <td>G</td>
2144 <td>file was merged</td>
2145 </tr>
2146 <tr>
2147 <td>C</td>
2148 <td>file was merged and conflicts occurred during merge</td>
2149 </tr>
2150 <tr>
2151 <td>!</td>
2152 <td>changes destined for a missing file were not merged</td>
2153 </tr>
2154 <tr>
2155 <td>D</td>
2156 <td>file was deleted</td>
2157 </tr>
2158 <tr>
2159 <td>d</td>
2160 <td>file's deletion was prevented by local modifications</td>
2161 </tr>
2162 <tr>
2163 <td>A</td>
2164 <td>new file was added</td>
2165 </tr>
2166 <tr>
2167 <td>~</td>
2168 <td>changes destined for a non-regular file were not merged</td>
2169 </tr>
2170 <tr>
2171 <td>?</td>
2172 <td>changes destined for an unversioned file were not merged</td>
2173 </tr>
2174 </table>
2175 <p class="Pp">If merge conflicts occur, the rebase operation is interrupted
2176 and may be continued once conflicts have been resolved. If any files
2177 with destined changes are found to be missing or unversioned, or if
2178 files could not be deleted due to differences in deleted content, the
2179 rebase operation will be interrupted to prevent potentially incomplete
2180 changes from being committed to the repository without user
2181 intervention. The work tree may be modified as desired and the rebase
2182 operation can be continued once the changes present in the work tree are
2183 considered complete. Alternatively, the rebase operation may be aborted
2184 which will leave <var class="Ar">branch</var> unmodified and the work
2185 tree switched back to its original branch.</p>
2186 <p class="Pp">If a merge conflict is resolved in a way which renders the
2187 merged change into a no-op change, the corresponding commit will be
2188 elided when the rebase operation continues.</p>
2189 <p class="Pp"><code class="Cm">got rebase</code> will refuse to run if
2190 certain preconditions are not met. If the <var class="Ar">branch</var>
2191 is not in the &#x201C;refs/heads/&#x201D; reference namespace, the
2192 branch may not be rebased. If the work tree is not yet fully updated to
2193 the tip commit of its branch, then the work tree must first be updated
2194 with <code class="Cm">got update</code>. If changes have been staged
2195 with <code class="Cm">got stage</code>, these changes must first be
2196 committed with <code class="Cm">got commit</code> or unstaged with
2197 <code class="Cm">got unstage</code>. If the work tree contains local
2198 changes, these changes must first be committed with <code class="Cm">got
2199 commit</code> or reverted with <code class="Cm">got revert</code>. If
2200 the <var class="Ar">branch</var> contains changes to files outside of
2201 the work tree's path prefix, the work tree cannot be used to rebase this
2202 branch.</p>
2203 <p class="Pp">The <code class="Cm">got update</code>, <code class="Cm">got
2204 integrate</code>, <code class="Cm">got merge</code>,
2205 <code class="Cm">got commit</code>, and <code class="Cm">got
2206 histedit</code> commands will refuse to run while a rebase operation is
2207 in progress. Other commands which manipulate the work tree may be used
2208 for conflict resolution purposes.</p>
2209 <p class="Pp">If the specified <var class="Ar">branch</var> is already based
2210 on the work tree's current branch, then no commits need to be rebased
2211 and <code class="Cm">got rebase</code> will simply switch the work tree
2212 to the specified <var class="Ar">branch</var> and update files in the
2213 work tree accordingly.</p>
2214 <p class="Pp">The options for <code class="Cm">got rebase</code> are as
2215 follows:</p>
2216 <dl class="Bl-tag">
2217 <dt id="a~5"><a class="permalink" href="#a~5"><code class="Fl">-a</code></a></dt>
2218 <dd>Abort an interrupted rebase operation. If this option is used, no
2219 other command-line arguments are allowed.</dd>
2220 <dt id="C~4"><a class="permalink" href="#C~4"><code class="Fl">-C</code></a></dt>
2221 <dd>Allow a rebase operation to continue with files in conflicted status.
2222 This option should generally be avoided, and can only be used with the
2223 <code class="Fl">-c</code> option.</dd>
2224 <dt id="c~11"><a class="permalink" href="#c~11"><code class="Fl">-c</code></a></dt>
2225 <dd>Continue an interrupted rebase operation. If this option is used, no
2226 other command-line arguments are allowed except
2227 <code class="Fl">-C</code>.</dd>
2228 <dt id="l~9"><a class="permalink" href="#l~9"><code class="Fl">-l</code></a></dt>
2229 <dd>Show a list of past rebase operations, represented by references in
2230 the &#x201C;refs/got/backup/rebase&#x201D; reference namespace.
2231 <p class="Pp">Display the author, date, and log message of each backed
2232 up commit, the object ID of the corresponding post-rebase commit,
2233 and the object ID of their common ancestor commit. Given these
2234 object IDs, the <code class="Cm">got log</code> command with the
2235 <code class="Fl">-c</code> and <code class="Fl">-x</code> options
2236 can be used to examine the history of either version of the branch,
2237 and the <code class="Cm">got branch</code> command with the
2238 <code class="Fl">-c</code> option can be used to create a new branch
2239 from a pre-rebase state if desired.</p>
2240 <p class="Pp">If a <var class="Ar">branch</var> is specified, only show
2241 commits which at some point in time represented this branch.
2242 Otherwise, list all backed up commits for any branches.</p>
2243 <p class="Pp">If this option is used, <code class="Cm">got rebase</code>
2244 does not require a work tree. None of the other options can be used
2245 together with <code class="Fl">-l</code>.</p>
2246 </dd>
2247 <dt id="X~4"><a class="permalink" href="#X~4"><code class="Fl">-X</code></a></dt>
2248 <dd>Delete backups created by past rebase operations, represented by
2249 references in the &#x201C;refs/got/backup/rebase&#x201D; reference
2250 namespace.
2251 <p class="Pp">If a <var class="Ar">branch</var> is specified, only
2252 delete backups which at some point in time represented this branch.
2253 Otherwise, delete all references found within
2254 &#x201C;refs/got/backup/rebase&#x201D;.</p>
2255 <p class="Pp">Any commit, tree, tag, and blob objects belonging to
2256 deleted backups remain in the repository and may be removed
2257 separately with Git's garbage collector or <code class="Cm">gotadmin
2258 cleanup</code>.</p>
2259 <p class="Pp">If this option is used, <code class="Cm">got rebase</code>
2260 does not require a work tree. None of the other options can be used
2261 together with <code class="Fl">-X</code>.</p>
2262 </dd>
2263 </dl>
2264 </dd>
2265 <dt id="he"><a class="permalink" href="#histedit"><code class="Cm" id="histedit">histedit</code></a>
2266 [<code class="Fl">-aCcdeflmX</code>] [<code class="Fl">-F</code>
2267 <var class="Ar">histedit-script</var>] [<var class="Ar">branch</var>]</dt>
2268 <dd>
2269 <div class="Bd Bd-indent"><code class="Li">(alias:
2270 <code class="Cm">he</code>)</code></div>
2271 Edit commit history between the work tree's current base commit and the tip
2272 commit of the work tree's current branch.
2273 <p class="Pp">The <code class="Cm">got histedit</code> command requires the
2274 <code class="Ev">GOT_AUTHOR</code> environment variable to be set,
2275 unless an author has been configured in
2276 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
2277 <code class="Dv">user.name</code> and <code class="Dv">user.email</code>
2278 configuration settings can be obtained from the repository's
2279 <span class="Pa">.git/config</span> file or from Git's global
2280 <span class="Pa">~/.gitconfig</span> configuration file.</p>
2281 <p class="Pp">Before starting a <code class="Cm">histedit</code> operation,
2282 the work tree's current branch must be set with <code class="Cm">got
2283 update -b</code> to the branch which should be edited, unless this
2284 branch is already the current branch of the work tree. The tip of this
2285 branch represents the upper bound (inclusive) of commits touched by the
2286 <code class="Cm">histedit</code> operation.</p>
2287 <p class="Pp">Furthermore, the work tree's base commit must be set with
2288 <code class="Cm">got update -c</code> to a point in this branch's commit
2289 history where editing should begin. This commit represents the lower
2290 bound (non-inclusive) of commits touched by the
2291 <code class="Cm">histedit</code> operation.</p>
2292 <p class="Pp">Editing of commit history is controlled via a
2293 <var class="Ar">histedit script</var> which can be written in an editor
2294 based on a template, passed on the command line, or generated with the
2295 <code class="Fl">-d</code>, <code class="Fl">-e</code>,
2296 <code class="Fl">-f</code>, or <code class="Fl">-m</code> options.
2297 Quitting the editor without saving the file will abort the histedit
2298 operation.</p>
2299 <p class="Pp">The format of the histedit script is line-based. Each line in
2300 the script begins with a command name, followed by whitespace and an
2301 argument. For most commands, the expected argument is a commit ID SHA1
2302 hash. Any remaining text on the line is ignored. Lines which begin with
2303 the &#x2018;#&#x2019; character are ignored entirely.</p>
2304 <p class="Pp">The available histedit script commands are as follows:</p>
2305 <table class="Bl-column">
2306 <tr id="pick">
2307 <td><a class="permalink" href="#pick"><code class="Cm">pick</code></a>
2308 <var class="Ar">commit</var></td>
2309 <td>Use the specified commit as it is.</td>
2310 </tr>
2311 <tr id="edit">
2312 <td><a class="permalink" href="#edit"><code class="Cm">edit</code></a>
2313 <var class="Ar">commit</var></td>
2314 <td>Apply the changes from the specified commit, but then interrupt the
2315 histedit operation for amending, without creating a commit. While the
2316 histedit operation is interrupted arbitrary files may be edited, and
2317 commands which manipulate the work tree can be used freely. The
2318 <code class="Cm">got add</code> and <code class="Cm">got remove</code>
2319 commands can be used to add new files or remove existing ones. The
2320 <code class="Cm">got revert -p</code> command can be used to eliminate
2321 arbitrary changes from files in the work tree. The
2322 <code class="Cm">got stage -p</code> command may be used to prepare a
2323 subset of changes for inclusion in the next commit. Finally, the
2324 <code class="Cm">got commit</code> command can be used to insert
2325 arbitrary commits into the edited history. Regular editing of history
2326 must eventually be resumed by running <code class="Cm">got histedit
2327 -c</code>.</td>
2328 </tr>
2329 <tr id="fold">
2330 <td><a class="permalink" href="#fold"><code class="Cm">fold</code></a>
2331 <var class="Ar">commit</var></td>
2332 <td>Combine the specified commit with the next commit listed further
2333 below that will be used.</td>
2334 </tr>
2335 <tr id="drop">
2336 <td><a class="permalink" href="#drop"><code class="Cm">drop</code></a>
2337 <var class="Ar">commit</var></td>
2338 <td>Remove this commit from the edited history.</td>
2339 </tr>
2340 <tr id="mesg">
2341 <td><a class="permalink" href="#mesg"><code class="Cm">mesg</code></a>
2342 [<var class="Ar">log-message</var>]</td>
2343 <td>Create a new log message for the commit of a preceding
2344 <code class="Cm">pick</code> or <code class="Cm">edit</code> command
2345 on the previous line of the histedit script. The optional
2346 <var class="Ar">log-message</var> argument provides a new single-line
2347 log message to use. If the <var class="Ar">log-message</var> argument
2348 is omitted, open an editor where a new log message can be
2349 written.</td>
2350 </tr>
2351 </table>
2352 <p class="Pp">Every commit in the history being edited must be mentioned in
2353 the script. Lines may be re-ordered to change the order of commits in
2354 the edited history. No commit may be listed more than once.</p>
2355 <p class="Pp">Edited commits are accumulated on a temporary branch which the
2356 work tree will remain switched to throughout the entire histedit
2357 operation. Once history editing has completed successfully, the
2358 temporary branch becomes the new version of the work tree's branch and
2359 the work tree is automatically switched to it.</p>
2360 <p class="Pp">Old commits in their pre-histedit state are automatically
2361 backed up in the &#x201C;refs/got/backup/histedit&#x201D; reference
2362 namespace. As long as these references are not removed older versions of
2363 edited commits will remain in the repository and can be viewed with the
2364 <code class="Cm">got histedit -l</code> command. Removal of these
2365 references makes objects which become unreachable via any reference
2366 subject to removal by Git's garbage collector or
2367 <code class="Cm">gotadmin cleanup</code>.</p>
2368 <p class="Pp">While merging commits, show the status of each affected file,
2369 using the following status codes:</p>
2370 <table class="Bl-column">
2371 <tr>
2372 <td>G</td>
2373 <td>file was merged</td>
2374 </tr>
2375 <tr>
2376 <td>C</td>
2377 <td>file was merged and conflicts occurred during merge</td>
2378 </tr>
2379 <tr>
2380 <td>!</td>
2381 <td>changes destined for a missing file were not merged</td>
2382 </tr>
2383 <tr>
2384 <td>D</td>
2385 <td>file was deleted</td>
2386 </tr>
2387 <tr>
2388 <td>d</td>
2389 <td>file's deletion was prevented by local modifications</td>
2390 </tr>
2391 <tr>
2392 <td>A</td>
2393 <td>new file was added</td>
2394 </tr>
2395 <tr>
2396 <td>~</td>
2397 <td>changes destined for a non-regular file were not merged</td>
2398 </tr>
2399 <tr>
2400 <td>?</td>
2401 <td>changes destined for an unversioned file were not merged</td>
2402 </tr>
2403 </table>
2404 <p class="Pp">If merge conflicts occur, the histedit operation is
2405 interrupted and may be continued once conflicts have been resolved. If
2406 any files with destined changes are found to be missing or unversioned,
2407 or if files could not be deleted due to differences in deleted content,
2408 the histedit operation will be interrupted to prevent potentially
2409 incomplete changes from being committed to the repository without user
2410 intervention. The work tree may be modified as desired and the histedit
2411 operation can be continued once the changes present in the work tree are
2412 considered complete. Alternatively, the histedit operation may be
2413 aborted which will leave the work tree switched back to its original
2414 branch.</p>
2415 <p class="Pp">If a merge conflict is resolved in a way which renders the
2416 merged change into a no-op change, the corresponding commit will be
2417 elided when the histedit operation continues.</p>
2418 <p class="Pp"><code class="Cm">got histedit</code> will refuse to run if
2419 certain preconditions are not met. If the work tree's current branch is
2420 not in the &#x201C;refs/heads/&#x201D; reference namespace, the history
2421 of the branch may not be edited. If the work tree contains multiple base
2422 commits, it must first be updated to a single base commit with
2423 <code class="Cm">got update</code>. If changes have been staged with
2424 <code class="Cm">got stage</code>, these changes must first be committed
2425 with <code class="Cm">got commit</code> or unstaged with
2426 <code class="Cm">got unstage</code>. If the work tree contains local
2427 changes, these changes must first be committed with <code class="Cm">got
2428 commit</code> or reverted with <code class="Cm">got revert</code>. If
2429 the edited history contains changes to files outside of the work tree's
2430 path prefix, the work tree cannot be used to edit the history of this
2431 branch.</p>
2432 <p class="Pp">The <code class="Cm">got update</code>, <code class="Cm">got
2433 rebase</code>, <code class="Cm">got merge</code>, and
2434 <code class="Cm">got integrate</code> commands will refuse to run while
2435 a histedit operation is in progress. Other commands which manipulate the
2436 work tree may be used, and the <code class="Cm">got commit</code>
2437 command may be used to commit arbitrary changes to the temporary branch
2438 while the histedit operation is interrupted.</p>
2439 <p class="Pp">The options for <code class="Cm">got histedit</code> are as
2440 follows:</p>
2441 <dl class="Bl-tag">
2442 <dt id="a~6"><a class="permalink" href="#a~6"><code class="Fl">-a</code></a></dt>
2443 <dd>Abort an interrupted histedit operation. If this option is used, no
2444 other command-line arguments are allowed.</dd>
2445 <dt id="C~5"><a class="permalink" href="#C~5"><code class="Fl">-C</code></a></dt>
2446 <dd>Allow a histedit operation to continue with files in conflicted
2447 status. This option should generally be avoided, and can only be used
2448 with the <code class="Fl">-c</code> option.</dd>
2449 <dt id="c~12"><a class="permalink" href="#c~12"><code class="Fl">-c</code></a></dt>
2450 <dd>Continue an interrupted histedit operation. If this option is used, no
2451 other command-line arguments are allowed except
2452 <code class="Fl">-C</code>.</dd>
2453 <dt id="d~7"><a class="permalink" href="#d~7"><code class="Fl">-d</code></a></dt>
2454 <dd>Drop all commits. This option is a quick equivalent to a histedit
2455 script which drops all commits. The <code class="Fl">-d</code> option
2456 can only be used when starting a new histedit operation. If this
2457 option is used, no other command-line arguments are allowed.</dd>
2458 <dt id="e"><a class="permalink" href="#e"><code class="Fl">-e</code></a></dt>
2459 <dd>Interrupt the histedit operation for editing after merging each
2460 commit. This option is a quick equivalent to a histedit script which
2461 uses the <code class="Cm">edit</code> command for all commits. The
2462 <code class="Fl">-e</code> option can only be used when starting a new
2463 histedit operation. If this option is used, no other command-line
2464 arguments are allowed.</dd>
2465 <dt id="F~3"><a class="permalink" href="#F~3"><code class="Fl">-F</code></a>
2466 <var class="Ar">histedit-script</var></dt>
2467 <dd>Use the specified <var class="Ar">histedit-script</var> instead of
2468 opening a temporary file in an editor where a histedit script can be
2469 written.</dd>
2470 <dt id="f~3"><a class="permalink" href="#f~3"><code class="Fl">-f</code></a></dt>
2471 <dd>Fold all commits into a single commit. This option is a quick
2472 equivalent to a histedit script which folds all commits, combining
2473 them all into one commit. The <code class="Fl">-f</code> option can
2474 only be used when starting a new histedit operation. If this option is
2475 used, no other command-line arguments are allowed.</dd>
2476 <dt id="l~10"><a class="permalink" href="#l~10"><code class="Fl">-l</code></a></dt>
2477 <dd>Show a list of past histedit operations, represented by references in
2478 the &#x201C;refs/got/backup/histedit&#x201D; reference namespace.
2479 <p class="Pp">Display the author, date, and log message of each backed
2480 up commit, the object ID of the corresponding post-histedit commit,
2481 and the object ID of their common ancestor commit. Given these
2482 object IDs, the <code class="Cm">got log</code> command with the
2483 <code class="Fl">-c</code> and <code class="Fl">-x</code> options
2484 can be used to examine the history of either version of the branch,
2485 and the <code class="Cm">got branch</code> command with the
2486 <code class="Fl">-c</code> option can be used to create a new branch
2487 from a pre-histedit state if desired.</p>
2488 <p class="Pp">If a <var class="Ar">branch</var> is specified, only show
2489 commits which at some point in time represented this branch.
2490 Otherwise, list all backed up commits for any branches.</p>
2491 <p class="Pp">If this option is used, <code class="Cm">got
2492 histedit</code> does not require a work tree. None of the other
2493 options can be used together with <code class="Fl">-l</code>.</p>
2494 </dd>
2495 <dt id="m~5"><a class="permalink" href="#m~5"><code class="Fl">-m</code></a></dt>
2496 <dd>Edit log messages only. This option is a quick equivalent to a
2497 histedit script which edits only log messages but otherwise leaves
2498 every picked commit as-is. The <code class="Fl">-m</code> option can
2499 only be used when starting a new histedit operation. If this option is
2500 used, no other command-line arguments are allowed.</dd>
2501 <dt id="X~5"><a class="permalink" href="#X~5"><code class="Fl">-X</code></a></dt>
2502 <dd>Delete backups created by past histedit operations, represented by
2503 references in the &#x201C;refs/got/backup/histedit&#x201D; reference
2504 namespace.
2505 <p class="Pp">If a <var class="Ar">branch</var> is specified, only
2506 delete backups which at some point in time represented this branch.
2507 Otherwise, delete all references found within
2508 &#x201C;refs/got/backup/histedit&#x201D;.</p>
2509 <p class="Pp">Any commit, tree, tag, and blob objects belonging to
2510 deleted backups remain in the repository and may be removed
2511 separately with Git's garbage collector or <code class="Cm">gotadmin
2512 cleanup</code>.</p>
2513 <p class="Pp">If this option is used, <code class="Cm">got
2514 histedit</code> does not require a work tree. None of the other
2515 options can be used together with <code class="Fl">-X</code>.</p>
2516 </dd>
2517 </dl>
2518 </dd>
2519 <dt id="ig"><a class="permalink" href="#integrate"><code class="Cm" id="integrate">integrate</code></a>
2520 <var class="Ar">branch</var></dt>
2521 <dd>
2522 <div class="Bd Bd-indent"><code class="Li">(alias:
2523 <code class="Cm">ig</code>)</code></div>
2524 Integrate the specified <var class="Ar">branch</var> into the work tree's
2525 current branch. Files in the work tree are updated to match the contents
2526 on the integrated <var class="Ar">branch</var>, and the reference of the
2527 work tree's branch is changed to point at the head commit of the
2528 integrated <var class="Ar">branch</var>.
2529 <p class="Pp">Both branches can be considered equivalent after integration
2530 since they will be pointing at the same commit. Both branches remain
2531 available for future work, if desired. In case the integrated
2532 <var class="Ar">branch</var> is no longer needed it may be deleted with
2533 <code class="Cm">got branch -d</code>.</p>
2534 <p class="Pp">Show the status of each affected file, using the following
2535 status codes:</p>
2536 <table class="Bl-column">
2537 <tr>
2538 <td>U</td>
2539 <td>file was updated</td>
2540 </tr>
2541 <tr>
2542 <td>D</td>
2543 <td>file was deleted</td>
2544 </tr>
2545 <tr>
2546 <td>A</td>
2547 <td>new file was added</td>
2548 </tr>
2549 <tr>
2550 <td>~</td>
2551 <td>versioned file is obstructed by a non-regular file</td>
2552 </tr>
2553 <tr>
2554 <td>!</td>
2555 <td>a missing versioned file was restored</td>
2556 </tr>
2557 </table>
2558 <p class="Pp"><code class="Cm">got integrate</code> will refuse to run if
2559 certain preconditions are not met. Most importantly, the
2560 <var class="Ar">branch</var> must have been rebased onto the work tree's
2561 current branch with <code class="Cm">got rebase</code> before it can be
2562 integrated, in order to linearize commit history and resolve merge
2563 conflicts. If the work tree contains multiple base commits, it must
2564 first be updated to a single base commit with <code class="Cm">got
2565 update</code>. If changes have been staged with <code class="Cm">got
2566 stage</code>, these changes must first be committed with
2567 <code class="Cm">got commit</code> or unstaged with <code class="Cm">got
2568 unstage</code>. If the work tree contains local changes, these changes
2569 must first be committed with <code class="Cm">got commit</code> or
2570 reverted with <code class="Cm">got revert</code>.</p>
2571 </dd>
2572 <dt id="mg"><a class="permalink" href="#merge"><code class="Cm" id="merge">merge</code></a>
2573 [<code class="Fl">-aCcMn</code>] [<var class="Ar">branch</var>]</dt>
2574 <dd>
2575 <div class="Bd Bd-indent"><code class="Li">(alias:
2576 <code class="Cm">mg</code>)</code></div>
2577 Merge the specified <var class="Ar">branch</var> into the current branch of
2578 the work tree. If the branches have diverged, creates a merge commit.
2579 Otherwise, if <var class="Ar">branch</var> already includes all commits
2580 from the work tree's branch, updates the work tree's branch to be the same
2581 as <var class="Ar">branch</var> without creating a commit, and updates the
2582 work tree to the most recent commit on the branch.
2583 <p class="Pp">If a linear project history is desired, then use of
2584 <code class="Cm">got rebase</code> should be preferred over
2585 <code class="Cm">got merge</code>. However, even strictly linear
2586 projects may require merge commits in order to merge in new versions of
2587 third-party code stored on vendor branches created with
2588 <code class="Cm">got import</code>.</p>
2589 <p class="Pp">Merge commits are commits based on multiple parent commits.
2590 The tip commit of the work tree's current branch, which must be in the
2591 &#x201C;refs/heads/&#x201D; reference namespace and must be set with
2592 <code class="Cm">got update -b</code> before starting the
2593 <code class="Cm">merge</code> operation, will be used as the first
2594 parent. The tip commit of the specified <var class="Ar">branch</var>
2595 will be used as the second parent.</p>
2596 <p class="Pp">No ancestral relationship between the two branches is
2597 required. If the two branches have already been merged previously, only
2598 new changes will be merged.</p>
2599 <p class="Pp">It is not possible to create merge commits with more than two
2600 parents. If more than one branch needs to be merged, then multiple merge
2601 commits with two parents each can be created in sequence.</p>
2602 <p class="Pp">While merging changes found on the
2603 <var class="Ar">branch</var> into the work tree, show the status of each
2604 affected file, using the following status codes:</p>
2605 <table class="Bl-column">
2606 <tr>
2607 <td>G</td>
2608 <td>file was merged</td>
2609 </tr>
2610 <tr>
2611 <td>C</td>
2612 <td>file was merged and conflicts occurred during merge</td>
2613 </tr>
2614 <tr>
2615 <td>!</td>
2616 <td>changes destined for a missing file were not merged</td>
2617 </tr>
2618 <tr>
2619 <td>D</td>
2620 <td>file was deleted</td>
2621 </tr>
2622 <tr>
2623 <td>d</td>
2624 <td>file's deletion was prevented by local modifications</td>
2625 </tr>
2626 <tr>
2627 <td>A</td>
2628 <td>new file was added</td>
2629 </tr>
2630 <tr>
2631 <td>~</td>
2632 <td>changes destined for a non-regular file were not merged</td>
2633 </tr>
2634 <tr>
2635 <td>?</td>
2636 <td>changes destined for an unversioned file were not merged</td>
2637 </tr>
2638 </table>
2639 <p class="Pp">If merge conflicts occur, the merge operation is interrupted
2640 and conflicts must be resolved before the merge operation can continue.
2641 If any files with destined changes are found to be missing or
2642 unversioned, or if files could not be deleted due to differences in
2643 deleted content, the merge operation will be interrupted to prevent
2644 potentially incomplete changes from being committed to the repository
2645 without user intervention. The work tree may be modified as desired and
2646 the merge can be continued once the changes present in the work tree are
2647 considered complete. Alternatively, the merge operation may be aborted
2648 which will leave the work tree's current branch unmodified.</p>
2649 <p class="Pp"><code class="Cm">got merge</code> will refuse to run if
2650 certain preconditions are not met. If the work tree's current branch is
2651 not in the &#x201C;refs/heads/&#x201D; reference namespace then the work
2652 tree must first be switched to a branch in the
2653 &#x201C;refs/heads/&#x201D; namespace with <code class="Cm">got update
2654 -b</code>. If the work tree is not yet fully updated to the tip commit
2655 of its branch, then the work tree must first be updated with
2656 <code class="Cm">got update</code>. If the work tree contains multiple
2657 base commits, it must first be updated to a single base commit with
2658 <code class="Cm">got update</code>. If changes have been staged with
2659 <code class="Cm">got stage</code>, these changes must first be committed
2660 with <code class="Cm">got commit</code> or unstaged with
2661 <code class="Cm">got unstage</code>. If the work tree contains local
2662 changes, these changes must first be committed with <code class="Cm">got
2663 commit</code> or reverted with <code class="Cm">got revert</code>. If
2664 the <var class="Ar">branch</var> contains changes to files outside of
2665 the work tree's path prefix, the work tree cannot be used to merge this
2666 branch.</p>
2667 <p class="Pp">The <code class="Cm">got update</code>, <code class="Cm">got
2668 commit</code>, <code class="Cm">got rebase</code>, <code class="Cm">got
2669 histedit</code>, <code class="Cm">got integrate</code>, and
2670 <code class="Cm">got stage</code> commands will refuse to run while a
2671 merge operation is in progress. Other commands which manipulate the work
2672 tree may be used for conflict resolution purposes.</p>
2673 <p class="Pp">The options for <code class="Cm">got merge</code> are as
2674 follows:</p>
2675 <dl class="Bl-tag">
2676 <dt id="a~7"><a class="permalink" href="#a~7"><code class="Fl">-a</code></a></dt>
2677 <dd>Abort an interrupted merge operation. If this option is used, no other
2678 command-line arguments are allowed.</dd>
2679 <dt id="C~6"><a class="permalink" href="#C~6"><code class="Fl">-C</code></a></dt>
2680 <dd>Allow a merge operation to continue with files in conflicted status.
2681 This option should generally be avoided, and can only be used with the
2682 <code class="Fl">-c</code> option.</dd>
2683 <dt id="c~13"><a class="permalink" href="#c~13"><code class="Fl">-c</code></a></dt>
2684 <dd>Continue an interrupted merge operation. If this option is used, no
2685 other command-line arguments are allowed except
2686 <code class="Fl">-C</code>.</dd>
2687 <dt id="M"><a class="permalink" href="#M"><code class="Fl">-M</code></a></dt>
2688 <dd>Create a merge commit even if the branches have not diverged.</dd>
2689 <dt id="n~4"><a class="permalink" href="#n~4"><code class="Fl">-n</code></a></dt>
2690 <dd>Merge changes into the work tree as usual but do not create a merge
2691 commit immediately. The merge result can be adjusted as desired before
2692 a merge commit is created with <code class="Cm">got merge -c</code>.
2693 Alternatively, the merge may be aborted with <code class="Cm">got
2694 merge -a</code>.</dd>
2695 </dl>
2696 </dd>
2697 <dt id="sg"><a class="permalink" href="#stage"><code class="Cm" id="stage">stage</code></a>
2698 [<code class="Fl">-lpS</code>] [<code class="Fl">-F</code>
2699 <var class="Ar">response-script</var>] [<var class="Ar">path ...</var>]</dt>
2700 <dd>
2701 <div class="Bd Bd-indent"><code class="Li">(alias:
2702 <code class="Cm">sg</code>)</code></div>
2703 Stage local changes for inclusion in the next commit. If no
2704 <var class="Ar">path</var> is specified, stage all changes in the work
2705 tree. Otherwise, stage changes at or within the specified paths. Paths may
2706 be staged if they are added, modified, or deleted according to
2707 <code class="Cm">got status</code>.
2708 <p class="Pp">Show the status of each affected file, using the following
2709 status codes:</p>
2710 <table class="Bl-column">
2711 <tr>
2712 <td>A</td>
2713 <td>file addition has been staged</td>
2714 </tr>
2715 <tr>
2716 <td>M</td>
2717 <td>file modification has been staged</td>
2718 </tr>
2719 <tr>
2720 <td>D</td>
2721 <td>file deletion has been staged</td>
2722 </tr>
2723 </table>
2724 <p class="Pp">Staged file contents are saved in newly created blob objects
2725 in the repository. These blobs will be referred to by tree objects once
2726 staged changes have been committed.</p>
2727 <p class="Pp">Staged changes affect the behaviour of <code class="Cm">got
2728 commit</code>, <code class="Cm">got status</code>, and
2729 <code class="Cm">got diff</code>. While paths with staged changes exist,
2730 the <code class="Cm">got commit</code> command will refuse to commit any
2731 paths which do not have staged changes. Local changes created on top of
2732 staged changes can only be committed if the path is staged again, or if
2733 the staged changes are committed first. The <code class="Cm">got
2734 status</code> command will show both local changes and staged changes.
2735 The <code class="Cm">got diff</code> command is able to display local
2736 changes relative to staged changes, and to display staged changes
2737 relative to the repository. The <code class="Cm">got revert</code>
2738 command cannot revert staged changes but may be used to revert local
2739 changes created on top of staged changes.</p>
2740 <p class="Pp">The options for <code class="Cm">got stage</code> are as
2741 follows:</p>
2742 <dl class="Bl-tag">
2743 <dt id="F~4"><a class="permalink" href="#F~4"><code class="Fl">-F</code></a>
2744 <var class="Ar">response-script</var></dt>
2745 <dd>With the <code class="Fl">-p</code> option, read &#x201C;y&#x201D;,
2746 &#x201C;n&#x201D;, and &#x201C;q&#x201D; responses line-by-line from
2747 the specified <var class="Ar">response-script</var> file instead of
2748 prompting interactively.</dd>
2749 <dt id="l~11"><a class="permalink" href="#l~11"><code class="Fl">-l</code></a></dt>
2750 <dd>Instead of staging new changes, list paths which are already staged,
2751 along with the IDs of staged blob objects and stage status codes. If
2752 paths were provided on the command line, show the staged paths among
2753 the specified paths. Otherwise, show all staged paths.</dd>
2754 <dt id="p~5"><a class="permalink" href="#p~5"><code class="Fl">-p</code></a></dt>
2755 <dd>Instead of staging the entire content of a changed file, interactively
2756 select or reject changes for staging based on &#x201C;y&#x201D; (stage
2757 change), &#x201C;n&#x201D; (reject change), and &#x201C;q&#x201D;
2758 (quit staging this file) responses. If a file is in modified status,
2759 individual patches derived from the modified file content can be
2760 staged. Files in added or deleted status may only be staged or
2761 rejected in their entirety.</dd>
2762 <dt id="S~4"><a class="permalink" href="#S~4"><code class="Fl">-S</code></a></dt>
2763 <dd>Allow staging of symbolic links which point outside of the path space
2764 that is under version control. By default, <code class="Cm">got
2765 stage</code> will reject such symbolic links due to safety concerns.
2766 As a precaution, <code class="Nm">got</code> may decide to represent
2767 such a symbolic link as a regular file which contains the link's
2768 target path, rather than creating an actual symbolic link which points
2769 outside of the work tree. Use of this option is discouraged because
2770 external mechanisms such as &#x201C;make obj&#x201D; are better suited
2771 for managing symbolic links to paths not under version control.</dd>
2772 </dl>
2773 <p class="Pp"><code class="Cm">got stage</code> will refuse to run if
2774 certain preconditions are not met. If a file contains merge conflicts,
2775 these conflicts must be resolved first. If a file is found to be out of
2776 date relative to the head commit on the work tree's current branch, the
2777 file must be updated with <code class="Cm">got update</code> before it
2778 can be staged (however, this does not prevent the file from becoming
2779 out-of-date at some point after having been staged).</p>
2780 <p class="Pp">The <code class="Cm">got update</code>, <code class="Cm">got
2781 rebase</code>, <code class="Cm">got merge</code>, and
2782 <code class="Cm">got histedit</code> commands will refuse to run while
2783 staged changes exist. If staged changes cannot be committed because a
2784 staged path is out of date, the path must be unstaged with
2785 <code class="Cm">got unstage</code> before it can be updated with
2786 <code class="Cm">got update</code>, and may then be staged again if
2787 necessary.</p>
2788 </dd>
2789 <dt id="ug"><a class="permalink" href="#unstage"><code class="Cm" id="unstage">unstage</code></a>
2790 [<code class="Fl">-p</code>] [<code class="Fl">-F</code>
2791 <var class="Ar">response-script</var>] [<var class="Ar">path ...</var>]</dt>
2792 <dd>
2793 <div class="Bd Bd-indent"><code class="Li">(alias:
2794 <code class="Cm">ug</code>)</code></div>
2795 Merge staged changes back into the work tree and put affected paths back
2796 into non-staged status. If no <var class="Ar">path</var> is specified,
2797 unstage all staged changes across the entire work tree. Otherwise, unstage
2798 changes at or within the specified paths.
2799 <p class="Pp">Show the status of each affected file, using the following
2800 status codes:</p>
2801 <table class="Bl-column">
2802 <tr>
2803 <td>G</td>
2804 <td>file was unstaged</td>
2805 </tr>
2806 <tr>
2807 <td>C</td>
2808 <td>file was unstaged and conflicts occurred during merge</td>
2809 </tr>
2810 <tr>
2811 <td>!</td>
2812 <td>changes destined for a missing file were not merged</td>
2813 </tr>
2814 <tr>
2815 <td>D</td>
2816 <td>file was staged as deleted and still is deleted</td>
2817 </tr>
2818 <tr>
2819 <td>d</td>
2820 <td>file's deletion was prevented by local modifications</td>
2821 </tr>
2822 <tr>
2823 <td>~</td>
2824 <td>changes destined for a non-regular file were not merged</td>
2825 </tr>
2826 </table>
2827 <p class="Pp">The options for <code class="Cm">got unstage</code> are as
2828 follows:</p>
2829 <dl class="Bl-tag">
2830 <dt id="F~5"><a class="permalink" href="#F~5"><code class="Fl">-F</code></a>
2831 <var class="Ar">response-script</var></dt>
2832 <dd>With the <code class="Fl">-p</code> option, read &#x201C;y&#x201D;,
2833 &#x201C;n&#x201D;, and &#x201C;q&#x201D; responses line-by-line from
2834 the specified <var class="Ar">response-script</var> file instead of
2835 prompting interactively.</dd>
2836 <dt id="p~6"><a class="permalink" href="#p~6"><code class="Fl">-p</code></a></dt>
2837 <dd>Instead of unstaging the entire content of a changed file,
2838 interactively select or reject changes for unstaging based on
2839 &#x201C;y&#x201D; (unstage change), &#x201C;n&#x201D; (keep change
2840 staged), and &#x201C;q&#x201D; (quit unstaging this file) responses.
2841 If a file is staged in modified status, individual patches derived
2842 from the staged file content can be unstaged. Files staged in added or
2843 deleted status may only be unstaged in their entirety.</dd>
2844 </dl>
2845 </dd>
2846 <dt id="cat"><a class="permalink" href="#cat"><code class="Cm">cat</code></a>
2847 [<code class="Fl">-P</code>] [<code class="Fl">-c</code>
2848 <var class="Ar">commit</var>] [<code class="Fl">-r</code>
2849 <var class="Ar">repository-path</var>] <var class="Ar">arg ...</var></dt>
2850 <dd>Parse and print contents of objects to standard output in a line-based
2851 text format. Content of commit, tree, and tag objects is printed in a way
2852 similar to the actual content stored in such objects. Blob object contents
2853 are printed as they would appear in files on disk.
2854 <p class="Pp">Attempt to interpret each argument as a reference, a tag name,
2855 or an object ID SHA1 hash. References will be resolved to an object ID.
2856 Tag names will resolved to a tag object. An abbreviated hash argument
2857 will be expanded to a full SHA1 hash automatically, provided the
2858 abbreviation is unique.</p>
2859 <p class="Pp">If none of the above interpretations produce a valid result,
2860 or if the <code class="Fl">-P</code> option is used, attempt to
2861 interpret the argument as a path which will be resolved to the ID of an
2862 object found at this path in the repository.</p>
2863 <p class="Pp">The options for <code class="Cm">got cat</code> are as
2864 follows:</p>
2865 <dl class="Bl-tag">
2866 <dt id="c~14"><a class="permalink" href="#c~14"><code class="Fl">-c</code></a>
2867 <var class="Ar">commit</var></dt>
2868 <dd>Look up paths in the specified <var class="Ar">commit</var>. If this
2869 option is not used, paths are looked up in the commit resolved via the
2870 repository's HEAD reference.
2871 <p class="Pp" id="quux:-8">The expected argument is a commit ID SHA1
2872 hash, or a reference name or keyword which will be resolved to a
2873 commit ID. An abbreviated hash argument will be expanded to a full
2874 SHA1 hash automatically, provided the abbreviation is unique. The
2875 keywords &quot;:base&quot; and &quot;:head&quot; resolve to the work
2876 tree's base commit and branch head, respectively. The former is only
2877 valid if invoked in a work tree, while the latter will resolve to
2878 the tip of the work tree's current branch if invoked in a work tree,
2879 otherwise it will resolve to the repository's HEAD reference.
2880 Keywords and references may be appended with &quot;:+&quot; or
2881 &quot;:-&quot; modifiers and an optional integer N to denote the Nth
2882 descendant or antecedent by first parent traversal, respectively;
2883 for example, <b class="Sy">:head:-2</b> denotes the work tree branch
2884 head's 2nd generation ancestor, and <b class="Sy">:base:+4</b>
2885 denotes the 4th generation descendant of the work tree's base
2886 commit. Similarly,
2887 <a class="permalink" href="#quux:-8"><b class="Sy">quux:-8</b></a>
2888 will denote the 8th generation ancestor of the commit resolved by
2889 the &quot;quux&quot; reference. A &quot;:+&quot; or &quot;:-&quot;
2890 modifier without a trailing integer has an implicit &quot;1&quot;
2891 appended (e.g., <b class="Sy">:base:+</b> is equivalent to
2892 <b class="Sy">:base:+1</b>).</p>
2893 </dd>
2894 <dt id="P~3"><a class="permalink" href="#P~3"><code class="Fl">-P</code></a></dt>
2895 <dd>Interpret all arguments as paths only. This option can be used to
2896 resolve ambiguity in cases where paths look like tag names, reference
2897 names, or object IDs.</dd>
2898 <dt id="r~11"><a class="permalink" href="#r~11"><code class="Fl">-r</code></a>
2899 <var class="Ar">repository-path</var></dt>
2900 <dd>Use the repository at the specified path. If not specified, assume the
2901 repository is located at or above the current working directory. If
2902 this directory is a <code class="Nm">got</code> work tree, use the
2903 repository path associated with this work tree.</dd>
2904 </dl>
2905 </dd>
2906 <dt id="info"><a class="permalink" href="#info"><code class="Cm">info</code></a>
2907 [<var class="Ar">path ...</var>]</dt>
2908 <dd>Display meta-data stored in a work tree. See
2909 <a class="Xr" aria-label="got-worktree, section 5">got-worktree(5)</a> for
2910 details.
2911 <p class="Pp">The work tree to use is resolved implicitly by walking upwards
2912 from the current working directory.</p>
2913 <p class="Pp">If one or more <var class="Ar">path</var> arguments are
2914 specified, show additional per-file information for tracked files
2915 located at or within these paths. If a <var class="Ar">path</var>
2916 argument corresponds to the work tree's root directory, display
2917 information for all tracked files.</p>
2918 </dd>
2919 </dl>
2920 </section>
2921 <section class="Sh">
2922 <h2 class="Sh" id="ENVIRONMENT"><a class="permalink" href="#ENVIRONMENT">ENVIRONMENT</a></h2>
2923 <dl class="Bl-tag">
2924 <dt id="GOT_AUTHOR"><a class="permalink" href="#GOT_AUTHOR"><code class="Ev">GOT_AUTHOR</code></a></dt>
2925 <dd>The author's name and email address, such as &#x201C;<span class="An">Flan
2926 Hacker</span>
2927 &lt;<a class="Mt" href="mailto:flan_hacker@openbsd.org">flan_hacker@openbsd.org</a>&gt;&#x201D;.
2928 Used by the <code class="Cm">got commit</code>, <code class="Cm">got
2929 import</code>, <code class="Cm">got rebase</code>, <code class="Cm">got
2930 merge</code>, and <code class="Cm">got histedit</code> commands. Because
2931 <a class="Xr" aria-label="git, section 1">git(1)</a> may fail to parse
2932 commits without an email address in author data,
2933 <code class="Nm">got</code> attempts to reject
2934 <code class="Ev">GOT_AUTHOR</code> environment variables with a missing
2935 email address.
2936 <p class="Pp"><code class="Ev">GOT_AUTHOR will be overridden by
2937 configuration settings in</code> <a class="Xr" aria-label="got.conf,
2938 section 5">got.conf(5)</a> or by Git's <code class="Dv">user.name</code>
2939 and <code class="Dv">user.email</code> configuration settings in the
2940 repository's <span class="Pa">.git/config</span> file. The
2941 <code class="Dv">user.name</code> and <code class="Dv">user.email</code>
2942 configuration settings contained in Git's global
2943 <span class="Pa">~/.gitconfig</span> configuration file will only be
2944 used if neither <a class="Xr" aria-label="got.conf, section
2945 5">got.conf(5)</a> nor the <code class="Ev">GOT_AUTHOR</code>
2946 environment variable provide author information.</p>
2947 </dd>
2948 <dt id="GOT_IGNORE_GITCONFIG"><a class="permalink" href="#GOT_IGNORE_GITCONFIG"><code class="Ev">GOT_IGNORE_GITCONFIG</code></a></dt>
2949 <dd>If this variable is set then any remote repository definitions or author
2950 information found in Git configuration files will be ignored.</dd>
2951 <dt id="GOT_LOG_DEFAULT_LIMIT"><a class="permalink" href="#GOT_LOG_DEFAULT_LIMIT"><code class="Ev">GOT_LOG_DEFAULT_LIMIT</code></a></dt>
2952 <dd>The default limit on the number of commits traversed by
2953 <code class="Cm">got log</code>. If set to zero, the limit is unbounded.
2954 This variable will be silently ignored if it is set to a non-numeric
2955 value.</dd>
2956 <dt id="VISUAL"><a class="permalink" href="#VISUAL"><code class="Ev">VISUAL</code></a>,
2957 <code class="Ev">EDITOR</code></dt>
2958 <dd>The editor spawned by <code class="Cm">got commit</code>,
2959 <code class="Cm">got histedit</code>, <code class="Cm">got import</code>,
2960 or <code class="Cm">got tag</code>. If not set, the
2961 <a class="Xr" aria-label="vi, section 1">vi(1)</a> text editor will be
2962 spawned.</dd>
2963 </dl>
2964 </section>
2965 <section class="Sh">
2966 <h2 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h2>
2967 <dl class="Bl-tag Bl-compact">
2968 <dt><span class="Pa">got.conf</span></dt>
2969 <dd>Repository-wide configuration settings for <code class="Nm">got</code>. If
2970 present, a <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a>
2971 configuration file located in the root directory of a Git repository
2972 supersedes any relevant settings in Git's <span class="Pa">config</span>
2973 file.
2974 <p class="Pp"></p>
2975 </dd>
2976 <dt><span class="Pa">.got/got.conf</span></dt>
2977 <dd>Worktree-specific configuration settings for <code class="Nm">got</code>.
2978 If present, a <a class="Xr" aria-label="got.conf, section
2979 5">got.conf(5)</a> configuration file in the <span class="Pa">.got</span>
2980 meta-data directory of a work tree supersedes any relevant settings in the
2981 repository's <a class="Xr" aria-label="got.conf, section
2982 5">got.conf(5)</a> configuration file and Git's
2983 <span class="Pa">config</span> file.</dd>
2984 </dl>
2985 </section>
2986 <section class="Sh">
2987 <h2 class="Sh" id="EXIT_STATUS"><a class="permalink" href="#EXIT_STATUS">EXIT
2988 STATUS</a></h2>
2989 <p class="Pp">The <code class="Nm">got</code> utility exits&#x00A0;0 on success,
2990 and&#x00A0;&gt;0 if an error occurs.</p>
2991 </section>
2992 <section class="Sh">
2993 <h2 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h2>
2994 <p class="Pp">Enable tab-completion of <code class="Nm">got</code> command names
2995 in <a class="Xr" aria-label="ksh, section 1">ksh(1)</a>:</p>
2996 <p class="Pp"></p>
2997 <div class="Bd Bd-indent"><code class="Li">$ set -A complete_got_1 -- $(got -h
2998 2&gt;&amp;1 | sed -n s/commands://p)</code></div>
2999 <p class="Pp">Clone an existing Git repository for use with
3000 <code class="Nm">got</code>:</p>
3001 <p class="Pp"></p>
3002 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/</code></div>
3003 <div class="Bd Bd-indent"><code class="Li">$ got clone
3004 ssh://git@github.com/openbsd/src.git</code></div>
3005 <p class="Pp">Unfortunately, many of the popular Git hosting sites do not offer
3006 anonymous access via SSH. Such sites will require an account to be created,
3007 and a public SSH key to be uploaded to this account, before repository
3008 access via ssh:// URLs will work.</p>
3009 <p class="Pp">Use of HTTP URLs currently requires <a class="Xr" aria-label="git,
3010 section 1">git(1)</a>:</p>
3011 <p class="Pp"></p>
3012 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/</code></div>
3013 <div class="Bd Bd-indent"><code class="Li">$ git clone --bare
3014 https://github.com/openbsd/src.git</code></div>
3015 <p class="Pp">Alternatively, for quick and dirty local testing of
3016 <code class="Nm">got</code> a new Git repository could be created and
3017 populated with files, e.g. from a temporary CVS checkout located at
3018 <span class="Pa">/tmp/src</span>:</p>
3019 <p class="Pp"></p>
3020 <div class="Bd Bd-indent"><code class="Li">$ gotadmin init
3021 /var/git/src.git</code></div>
3022 <div class="Bd Bd-indent"><code class="Li">$ got import -r /var/git/src.git -I
3023 CVS -I obj /tmp/src</code></div>
3024 <p class="Pp">Check out a work tree from the Git repository to /usr/src:</p>
3025 <p class="Pp"></p>
3026 <div class="Bd Bd-indent"><code class="Li">$ got checkout /var/git/src.git
3027 /usr/src</code></div>
3028 <p class="Pp">View local changes in a work tree directory:</p>
3029 <p class="Pp"></p>
3030 <div class="Bd Bd-indent"><code class="Li">$ got diff | less</code></div>
3031 <p class="Pp">In a work tree, display files in a potentially problematic
3032 state:</p>
3033 <p class="Pp"></p>
3034 <div class="Bd Bd-indent"><code class="Li">$ got status -s 'C!~?'</code></div>
3035 <p class="Pp">Interactively revert selected local changes in a work tree
3036 directory:</p>
3037 <p class="Pp"></p>
3038 <div class="Bd Bd-indent"><code class="Li">$ got revert -p
3039 -R&#x00A0;.</code></div>
3040 <p class="Pp">In a work tree or a git repository directory, list all branch
3041 references:</p>
3042 <p class="Pp"></p>
3043 <div class="Bd Bd-indent"><code class="Li">$ got branch -l</code></div>
3044 <p class="Pp">As above, but list the most recently modified branches only:</p>
3045 <p class="Pp"></p>
3046 <div class="Bd Bd-indent"><code class="Li">$ got branch -lt | head</code></div>
3047 <p class="Pp">In a work tree or a git repository directory, create a new branch
3048 called &#x201C;unified-buffer-cache&#x201D; which is forked off the
3049 &#x201C;master&#x201D; branch:</p>
3050 <p class="Pp"></p>
3051 <div class="Bd Bd-indent"><code class="Li">$ got branch -c master
3052 unified-buffer-cache</code></div>
3053 <p class="Pp">Switch an existing work tree to the branch
3054 &#x201C;unified-buffer-cache&#x201D;. Local changes in the work tree will be
3055 preserved and merged if necessary:</p>
3056 <p class="Pp"></p>
3057 <div class="Bd Bd-indent"><code class="Li">$ got update -b
3058 unified-buffer-cache</code></div>
3059 <p class="Pp">Create a new commit from local changes in a work tree directory.
3060 This new commit will become the head commit of the work tree's current
3061 branch:</p>
3062 <p class="Pp"></p>
3063 <div class="Bd Bd-indent"><code class="Li">$ got commit</code></div>
3064 <p class="Pp">In a work tree or a git repository directory, view changes
3065 committed in the 3 most recent commits to the work tree's branch, or the
3066 branch resolved via the repository's HEAD reference, respectively:</p>
3067 <p class="Pp"></p>
3068 <div class="Bd Bd-indent"><code class="Li">$ got log -p -l 3</code></div>
3069 <p class="Pp">As above, but display changes in the order in which
3070 <a class="Xr" aria-label="patch, section 1">patch(1)</a> could apply them in
3071 sequence:</p>
3072 <p class="Pp"></p>
3073 <div class="Bd Bd-indent"><code class="Li">$ got log -p -l 3 -R</code></div>
3074 <p class="Pp">In a work tree or a git repository directory, log the history of a
3075 subdirectory:</p>
3076 <p class="Pp"></p>
3077 <div class="Bd Bd-indent"><code class="Li">$ got log sys/uvm</code></div>
3078 <p class="Pp">While operating inside a work tree, paths are specified relative
3079 to the current working directory, so this command will log the subdirectory
3080 <span class="Pa">sys/uvm</span>:</p>
3081 <p class="Pp"></p>
3082 <div class="Bd Bd-indent"><code class="Li">$ cd sys/uvm &amp;&amp; got
3083 log&#x00A0;.</code></div>
3084 <p class="Pp">And this command has the same effect:</p>
3085 <p class="Pp"></p>
3086 <div class="Bd Bd-indent"><code class="Li">$ cd sys/dev/usb &amp;&amp; got log
3087 ../../uvm</code></div>
3088 <p class="Pp">And this command displays work tree meta-data about all tracked
3089 files:</p>
3090 <p class="Pp"></p>
3091 <div class="Bd Bd-indent"><code class="Li">$ cd /usr/src</code></div>
3092 <div class="Bd Bd-indent"><code class="Li">$ got info&#x00A0;. |
3093 less</code></div>
3094 <p class="Pp">Add new files and remove obsolete files in a work tree
3095 directory:</p>
3096 <p class="Pp"></p>
3097 <div class="Bd Bd-indent"><code class="Li">$ got add
3098 sys/uvm/uvm_ubc.c</code></div>
3099 <div class="Bd Bd-indent"><code class="Li">$ got remove
3100 sys/uvm/uvm_vnode.c</code></div>
3101 <p class="Pp">Create a new commit from local changes in a work tree directory
3102 with a pre-defined log message.</p>
3103 <p class="Pp"></p>
3104 <div class="Bd Bd-indent"><code class="Li">$ got commit -m 'unify the buffer
3105 cache'</code></div>
3106 <p class="Pp">Alternatively, create a new commit from local changes in a work
3107 tree directory with a log message that has been prepared in the file
3108 <span class="Pa">/tmp/msg</span>:</p>
3109 <p class="Pp"></p>
3110 <div class="Bd Bd-indent"><code class="Li">$ got commit -F /tmp/msg</code></div>
3111 <p class="Pp">Update any work tree checked out from the
3112 &#x201C;unified-buffer-cache&#x201D; branch to the latest commit on this
3113 branch:</p>
3114 <p class="Pp"></p>
3115 <div class="Bd Bd-indent"><code class="Li">$ got update</code></div>
3116 <p class="Pp">Roll file content on the unified-buffer-cache branch back by one
3117 commit, and then fetch the rolled-back change into the work tree as a local
3118 change to be amended and perhaps committed again:</p>
3119 <p class="Pp"></p>
3120 <div class="Bd Bd-indent"><code class="Li">$ got backout
3121 unified-buffer-cache</code></div>
3122 <div class="Bd Bd-indent"><code class="Li">$ got commit -m 'roll back
3123 previous'</code></div>
3124 <div class="Bd Bd-indent"><code class="Li">$ # now back out the previous backout
3125 :-)</code></div>
3126 <div class="Bd Bd-indent"><code class="Li">$ got backout
3127 unified-buffer-cache</code></div>
3128 <p class="Pp">Fetch new changes on the remote repository's
3129 &#x201C;master&#x201D; branch, making them visible on the local repository's
3130 &#x201C;origin/master&#x201D; branch:</p>
3131 <p class="Pp"></p>
3132 <div class="Bd Bd-indent"><code class="Li">$ cd /usr/src</code></div>
3133 <div class="Bd Bd-indent"><code class="Li">$ got fetch</code></div>
3134 <p class="Pp">In a repository created with a HTTP URL and <code class="Cm">git
3135 clone --bare</code> the <a class="Xr" aria-label="git-fetch, section
3136 1">git-fetch(1)</a> command must be used instead:</p>
3137 <p class="Pp"></p>
3138 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/src.git</code></div>
3139 <div class="Bd Bd-indent"><code class="Li">$ git fetch origin
3140 master:refs/remotes/origin/master</code></div>
3141 <p class="Pp">Rebase the local &#x201C;master&#x201D; branch to merge the new
3142 changes that are now visible on the &#x201C;origin/master&#x201D;
3143 branch:</p>
3144 <p class="Pp"></p>
3145 <div class="Bd Bd-indent"><code class="Li">$ cd /usr/src</code></div>
3146 <div class="Bd Bd-indent"><code class="Li">$ got update -b
3147 origin/master</code></div>
3148 <div class="Bd Bd-indent"><code class="Li">$ got rebase master</code></div>
3149 <p class="Pp">Rebase the &#x201C;unified-buffer-cache&#x201D; branch on top of
3150 the new head commit of the &#x201C;master&#x201D; branch.</p>
3151 <p class="Pp"></p>
3152 <div class="Bd Bd-indent"><code class="Li">$ got update -b master</code></div>
3153 <div class="Bd Bd-indent"><code class="Li">$ got rebase
3154 unified-buffer-cache</code></div>
3155 <p class="Pp">Create a patch from all changes on the unified-buffer-cache
3156 branch. The patch can be mailed out for review and applied to
3157 <span class="Ux">OpenBSD</span>'s CVS tree:</p>
3158 <p class="Pp"></p>
3159 <div class="Bd Bd-indent"><code class="Li">$ got diff master
3160 unified-buffer-cache &gt; /tmp/ubc.diff</code></div>
3161 <p class="Pp">Edit the entire commit history of the
3162 &#x201C;unified-buffer-cache&#x201D; branch:</p>
3163 <p class="Pp"></p>
3164 <div class="Bd Bd-indent"><code class="Li">$ got update -b
3165 unified-buffer-cache</code></div>
3166 <div class="Bd Bd-indent"><code class="Li">$ got update -c master</code></div>
3167 <div class="Bd Bd-indent"><code class="Li">$ got histedit</code></div>
3168 <p class="Pp">Before working against existing branches in a repository cloned
3169 with <code class="Cm">git clone --bare</code> instead of
3170 <code class="Cm">got clone</code>, a Git &#x201C;refspec&#x201D; must be
3171 configured to map all references in the remote repository into the
3172 &#x201C;refs/remotes&#x201D; namespace of the local repository. This can be
3173 achieved by setting Git's <span class="Pa">remote.origin.fetch</span>
3174 configuration variable to the value
3175 &#x201C;+refs/heads/*:refs/remotes/origin/*&#x201D; with the
3176 <code class="Cm">git config</code> command:</p>
3177 <p class="Pp"></p>
3178 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
3179 <div class="Bd Bd-indent"><code class="Li">$ git config remote.origin.fetch
3180 '+refs/heads/*:refs/remotes/origin/*'</code></div>
3181 <p class="Pp">Additionally, the &#x201C;mirror&#x201D; option must be
3182 disabled:</p>
3183 <p class="Pp"></p>
3184 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/repo</code></div>
3185 <div class="Bd Bd-indent"><code class="Li">$ git config remote.origin.mirror
3186 false</code></div>
3187 <p class="Pp">Alternatively, the following <a class="Xr" aria-label="git-fetch,
3188 section 1">git-fetch(1)</a> configuration item can be added manually to the
3189 Git repository's <span class="Pa">config</span> file:</p>
3190 <p class="Pp"></p>
3191 <div class="Bd Bd-indent"><code class="Li">[remote
3192 &quot;origin&quot;]</code></div>
3193 <div class="Bd Bd-indent"><code class="Li">url = ...</code></div>
3194 <div class="Bd Bd-indent"><code class="Li">fetch =
3195 +refs/heads/*:refs/remotes/origin/*</code></div>
3196 <div class="Bd Bd-indent"><code class="Li">mirror = false</code></div>
3197 <p class="Pp">This configuration leaves the local repository's
3198 &#x201C;refs/heads&#x201D; namespace free for use by local branches checked
3199 out with <code class="Cm">got checkout</code> and, if needed, created with
3200 <code class="Cm">got branch</code>. Branches in the
3201 &#x201C;refs/remotes/origin&#x201D; namespace can now be updated with
3202 incoming changes from the remote repository with <code class="Cm">got
3203 fetch</code> or <a class="Xr" aria-label="git-fetch, section
3204 1">git-fetch(1)</a> without extra command line arguments. Newly fetched
3205 changes can be examined with <code class="Cm">got log</code>.</p>
3206 <p class="Pp">Display changes on the remote repository's version of the
3207 &#x201C;master&#x201D; branch, as of the last time <code class="Cm">got
3208 fetch</code> was run:</p>
3209 <p class="Pp"></p>
3210 <div class="Bd Bd-indent"><code class="Li">$ got log -c origin/master |
3211 less</code></div>
3212 <p class="Pp">As shown here, most commands accept abbreviated reference names
3213 such as &#x201C;origin/master&#x201D; instead of
3214 &#x201C;refs/remotes/origin/master&#x201D;. The latter is only needed in
3215 case of ambiguity.</p>
3216 <p class="Pp"><code class="Cm">got rebase</code> can be used to merge changes
3217 which are visible on the &#x201C;origin/master&#x201D; branch into the
3218 &#x201C;master&#x201D; branch. This will also merge local changes, if any,
3219 with the incoming changes:</p>
3220 <p class="Pp"></p>
3221 <div class="Bd Bd-indent"><code class="Li">$ got update -b
3222 origin/master</code></div>
3223 <div class="Bd Bd-indent"><code class="Li">$ got rebase master</code></div>
3224 <p class="Pp">In order to make changes committed to the
3225 &#x201C;unified-buffer-cache&#x201D; visible on the &#x201C;master&#x201D;
3226 branch, the &#x201C;unified-buffer-cache&#x201D; branch can be rebased onto
3227 the &#x201C;master&#x201D; branch:</p>
3228 <p class="Pp"></p>
3229 <div class="Bd Bd-indent"><code class="Li">$ got update -b master</code></div>
3230 <div class="Bd Bd-indent"><code class="Li">$ got rebase
3231 unified-buffer-cache</code></div>
3232 <p class="Pp">Changes on the &#x201C;unified-buffer-cache&#x201D; branch can now
3233 be made visible on the &#x201C;master&#x201D; branch with
3234 <code class="Cm">got integrate</code>. Because the rebase operation switched
3235 the work tree to the &#x201C;unified-buffer-cache&#x201D; branch, the work
3236 tree must be switched back to the &#x201C;master&#x201D; branch first:</p>
3237 <p class="Pp"></p>
3238 <div class="Bd Bd-indent"><code class="Li">$ got update -b master</code></div>
3239 <div class="Bd Bd-indent"><code class="Li">$ got integrate
3240 unified-buffer-cache</code></div>
3241 <p class="Pp">On the &#x201C;master&#x201D; branch, log messages for local
3242 changes can now be amended with &#x201C;OK&#x201D; by other developers and
3243 any other important new information:</p>
3244 <p class="Pp"></p>
3245 <div class="Bd Bd-indent"><code class="Li">$ got update -c
3246 origin/master</code></div>
3247 <div class="Bd Bd-indent"><code class="Li">$ got histedit -m</code></div>
3248 <p class="Pp">If the remote repository offers write access, local changes on the
3249 &#x201C;master&#x201D; branch can be sent to the remote repository with
3250 <code class="Cm">got send</code>. Usually, <code class="Cm">got send</code>
3251 can be run without further arguments. The arguments shown here match
3252 defaults, provided the work tree's current branch is the
3253 &#x201C;master&#x201D; branch:</p>
3254 <p class="Pp"></p>
3255 <div class="Bd Bd-indent"><code class="Li">$ got send -b master
3256 origin</code></div>
3257 <p class="Pp">If the remote repository requires the HTTPS protocol, the
3258 <a class="Xr" aria-label="git-push, section 1">git-push(1)</a> command must
3259 be used instead:</p>
3260 <p class="Pp"></p>
3261 <div class="Bd Bd-indent"><code class="Li">$ cd /var/git/src.git</code></div>
3262 <div class="Bd Bd-indent"><code class="Li">$ git push origin master</code></div>
3263 <p class="Pp">When making contributions to projects which use the &#x201C;pull
3264 request&#x201D; workflow, SSH protocol repository access needs to be set up
3265 first. Once an account has been created on a Git hosting site it should be
3266 possible to upload a public SSH key for repository access
3267 authentication.</p>
3268 <p class="Pp">The &#x201C;pull request&#x201D; workflow will usually involve two
3269 remote repositories. In the real-life example below, the
3270 &#x201C;origin&#x201D; repository was forked from the
3271 &#x201C;upstream&#x201D; repository by using the Git hosting site's web
3272 interface. The <a class="Xr" aria-label="got.conf, section
3273 5">got.conf(5)</a> file in the local repository describes both remote
3274 repositories:</p>
3275 <div class="Bd Pp Bd-indent Li">
3276 <pre># Jelmers's repository, which accepts pull requests
3277 remote &quot;upstream&quot; {
3278 server git@github.com
3279 protocol ssh
3280 repository &quot;/jelmer/dulwich&quot;
3281 branch { &quot;master&quot; }
3284 # Stefan's fork, used as the default remote repository
3285 remote &quot;origin&quot; {
3286 server git@github.com
3287 protocol ssh
3288 repository &quot;/stspdotname/dulwich&quot;
3289 branch { &quot;master&quot; }
3290 }</pre>
3291 </div>
3292 <p class="Pp">With this configuration, Stefan can create commits on
3293 &#x201C;refs/heads/master&#x201D; and send them to the
3294 &#x201C;origin&#x201D; repository by running:</p>
3295 <p class="Pp"></p>
3296 <div class="Bd Bd-indent"><code class="Li">$ got send -b master
3297 origin</code></div>
3298 <p class="Pp">The changes can now be proposed to Jelmer by opening a pull
3299 request via the Git hosting site's web interface. If Jelmer requests further
3300 changes to be made, additional commits can be created on the
3301 &#x201C;master&#x201D; branch and be added to the pull request by running
3302 <code class="Cd">got send</code> again.</p>
3303 <p class="Pp">If Jelmer prefers additional commits to be
3304 &#x201C;squashed&#x201D; then the following commands can be used to achieve
3305 this:</p>
3306 <p class="Pp"></p>
3307 <div class="Bd Bd-indent"><code class="Li">$ got update -b master</code></div>
3308 <div class="Bd Bd-indent"><code class="Li">$ got update -c
3309 origin/master</code></div>
3310 <div class="Bd Bd-indent"><code class="Li">$ got histedit -f</code></div>
3311 <div class="Bd Bd-indent"><code class="Li">$ got send -f -b master
3312 origin</code></div>
3313 <p class="Pp">In addition to reviewing the pull request in the web user
3314 interface, Jelmer can fetch the pull request's branch into his local
3315 repository and create a local branch which contains the proposed
3316 changes:</p>
3317 <p class="Pp"></p>
3318 <div class="Bd Bd-indent"><code class="Li">$ got fetch -R refs/pull/1046/head
3319 origin</code></div>
3320 <div class="Bd Bd-indent"><code class="Li">$ got branch -c
3321 refs/remotes/origin/pull/1046/head pr1046</code></div>
3322 <p class="Pp">Once Jelmer has accepted the pull request, Stefan can fetch the
3323 merged changes, and possibly several other new changes, by running:</p>
3324 <p class="Pp"></p>
3325 <div class="Bd Bd-indent"><code class="Li">$ got fetch upstream</code></div>
3326 <p class="Pp">The merged changes will now be visible under the reference
3327 &#x201C;refs/remotes/upstream/master&#x201D;. The local
3328 &#x201C;master&#x201D; branch can now be rebased on top of the latest
3329 changes from upstream:</p>
3330 <p class="Pp"></p>
3331 <div class="Bd Bd-indent"><code class="Li">$ got update -b
3332 upstream/master</code></div>
3333 <div class="Bd Bd-indent"><code class="Li">$ got rebase master</code></div>
3334 <p class="Pp">As an alternative to <code class="Cm">got rebase</code>, branches
3335 can be merged with <code class="Cm">got merge</code>:</p>
3336 <p class="Pp"></p>
3337 <div class="Bd Bd-indent"><code class="Li">$ got update -b master</code></div>
3338 <div class="Bd Bd-indent"><code class="Li">$ got merge
3339 upstream/master</code></div>
3340 <p class="Pp">The question of whether to rebase or merge branches is
3341 philosophical. When in doubt, refer to the software project's policies set
3342 by project maintainers.</p>
3343 <p class="Pp">As a final step, the forked repository's copy of the master branch
3344 needs to be kept in sync by sending the new changes there:</p>
3345 <p class="Pp"></p>
3346 <div class="Bd Bd-indent"><code class="Li">$ got send -f -b master
3347 origin</code></div>
3348 <p class="Pp">If multiple pull requests need to be managed in parallel, a
3349 separate branch must be created for each pull request with
3350 <code class="Cm">got branch</code>. Each such branch can then be used as
3351 above, in place of &#x201C;refs/heads/master&#x201D;. Changes for any
3352 accepted pull requests will still appear under
3353 &#x201C;refs/remotes/upstream/master,&#x201D; regardless of which branch was
3354 used in the forked repository to create a pull request.</p>
3355 </section>
3356 <section class="Sh">
3357 <h2 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
3358 ALSO</a></h2>
3359 <p class="Pp"><a class="Xr" aria-label="gotadmin, section 1">gotadmin(1)</a>,
3360 <a class="Xr" aria-label="tog, section 1">tog(1)</a>,
3361 <a class="Xr" aria-label="git-repository, section 5">git-repository(5)</a>,
3362 <a class="Xr" aria-label="got-worktree, section 5">got-worktree(5)</a>,
3363 <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a>,
3364 <a class="Xr" aria-label="gotwebd, section 8">gotwebd(8)</a></p>
3365 </section>
3366 <section class="Sh">
3367 <h2 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h2>
3368 <p class="Pp"><span class="An">Anthony J. Bentley</span>
3369 &lt;<a class="Mt" href="mailto:bentley@openbsd.org">bentley@openbsd.org</a>&gt;
3370 <br/>
3371 <span class="An">Christian Weisgerber</span>
3372 &lt;<a class="Mt" href="mailto:naddy@openbsd.org">naddy@openbsd.org</a>&gt;
3373 <br/>
3374 <span class="An">Hiltjo Posthuma</span>
3375 &lt;<a class="Mt" href="mailto:hiltjo@codemadness.org">hiltjo@codemadness.org</a>&gt;
3376 <br/>
3377 <span class="An">Josh Rickmar</span>
3378 &lt;<a class="Mt" href="mailto:jrick@zettaport.com">jrick@zettaport.com</a>&gt;
3379 <br/>
3380 <span class="An">Joshua Stein</span>
3381 &lt;<a class="Mt" href="mailto:jcs@openbsd.org">jcs@openbsd.org</a>&gt;
3382 <br/>
3383 <span class="An">Klemens Nanni</span>
3384 &lt;<a class="Mt" href="mailto:kn@openbsd.org">kn@openbsd.org</a>&gt;
3385 <br/>
3386 <span class="An">Martin Pieuchot</span>
3387 &lt;<a class="Mt" href="mailto:mpi@openbsd.org">mpi@openbsd.org</a>&gt;
3388 <br/>
3389 <span class="An">Neels Hofmeyr</span>
3390 &lt;<a class="Mt" href="mailto:neels@hofmeyr.de">neels@hofmeyr.de</a>&gt;
3391 <br/>
3392 <span class="An">Omar Polo</span>
3393 &lt;<a class="Mt" href="mailto:op@openbsd.org">op@openbsd.org</a>&gt;
3394 <br/>
3395 <span class="An">Ori Bernstein</span>
3396 &lt;<a class="Mt" href="mailto:ori@openbsd.org">ori@openbsd.org</a>&gt;
3397 <br/>
3398 <span class="An">Sebastien Marie</span>
3399 &lt;<a class="Mt" href="mailto:semarie@openbsd.org">semarie@openbsd.org</a>&gt;
3400 <br/>
3401 <span class="An">Stefan Sperling</span>
3402 &lt;<a class="Mt" href="mailto:stsp@openbsd.org">stsp@openbsd.org</a>&gt;
3403 <br/>
3404 <span class="An">Steven McDonald</span>
3405 &lt;<a class="Mt" href="mailto:steven@steven-mcdonald.id.au">steven@steven-mcdonald.id.au</a>&gt;
3406 <br/>
3407 <span class="An">Theo Buehler</span>
3408 &lt;<a class="Mt" href="mailto:tb@openbsd.org">tb@openbsd.org</a>&gt;
3409 <br/>
3410 <span class="An">Thomas Adam</span>
3411 &lt;<a class="Mt" href="mailto:thomas@xteddy.org">thomas@xteddy.org</a>&gt;
3412 <br/>
3413 <span class="An">Tracey Emery</span>
3414 &lt;<a class="Mt" href="mailto:tracey@traceyemery.net">tracey@traceyemery.net</a>&gt;
3415 <br/>
3416 <span class="An">Yang Zhong</span>
3417 &lt;<a class="Mt" href="mailto:yzhong@freebsdfoundation.org">yzhong@freebsdfoundation.org</a>&gt;</p>
3418 <p class="Pp">Parts of <code class="Nm">got</code>,
3419 <a class="Xr" aria-label="tog, section 1">tog(1)</a>, and
3420 <a class="Xr" aria-label="gotwebd, section 8">gotwebd(8)</a> were derived
3421 from code under copyright by:</p>
3422 <p class="Pp">
3423 <br/>
3424 <span class="An">Caldera International</span>
3425 <br/>
3426 <span class="An">Daniel Hartmeier</span>
3427 <br/>
3428 <span class="An">Esben Norby</span>
3429 <br/>
3430 <span class="An">Henning Brauer</span>
3431 <br/>
3432 <span class="An">H&#x00E5;kan Olsson</span>
3433 <br/>
3434 <span class="An">Ingo Schwarze</span>
3435 <br/>
3436 <span class="An">Jean-Francois Brousseau</span>
3437 <br/>
3438 <span class="An">Joris Vink</span>
3439 <br/>
3440 <span class="An">Jyri J. Virkki</span>
3441 <br/>
3442 <span class="An">Larry Wall</span>
3443 <br/>
3444 <span class="An">Markus Friedl</span>
3445 <br/>
3446 <span class="An">Niall O'Higgins</span>
3447 <br/>
3448 <span class="An">Niklas Hallqvist</span>
3449 <br/>
3450 <span class="An">Ray Lai</span>
3451 <br/>
3452 <span class="An">Ryan McBride</span>
3453 <br/>
3454 <span class="An">Theo de Raadt</span>
3455 <br/>
3456 <span class="An">Todd C. Miller</span>
3457 <br/>
3458 <span class="An">Xavier Santolaria</span></p>
3459 <p class="Pp"><code class="Nm">got</code> contains code contributed to the
3460 public domain by
3461 <br/>
3462 <span class="An">Austin Appleby</span>.</p>
3463 </section>
3464 <section class="Sh">
3465 <h2 class="Sh" id="CAVEATS"><a class="permalink" href="#CAVEATS">CAVEATS</a></h2>
3466 <p class="Pp"><code class="Nm">got</code> is a work-in-progress and some
3467 features remain to be implemented.</p>
3468 <p class="Pp">At present, the user has to fall back on
3469 <a class="Xr" aria-label="git, section 1">git(1)</a> to perform some tasks.
3470 In particular:</p>
3471 <ul class="Bl-bullet">
3472 <li>Reading from remote repositories over HTTP or HTTPS protocols requires
3473 <a class="Xr" aria-label="git-clone, section 1">git-clone(1)</a> and
3474 <a class="Xr" aria-label="git-fetch, section 1">git-fetch(1)</a>.</li>
3475 <li>Writing to remote repositories over HTTP or HTTPS protocols requires
3476 <a class="Xr" aria-label="git-push, section 1">git-push(1)</a>.</li>
3477 <li>The creation of merge commits with more than two parent commits requires
3478 <a class="Xr" aria-label="git-merge, section 1">git-merge(1)</a>.</li>
3479 <li>In situations where files or directories were moved around
3480 <code class="Cm">got</code> will not automatically merge changes to new
3481 locations and <a class="Xr" aria-label="git, section 1">git(1)</a> will
3482 usually produce better results.</li>
3483 </ul>
3484 </section>
3485 </main>
3486 <div class="foot" role="doc-pagefooter" aria-label="Manual footer
3487 line"><span class="foot-left"></span><span class="foot-date">July 19,
3488 2023</span> <span class="foot-os">OpenBSD 7.3</span></div>
3489 </body>
3490 </html>