1 8797b228 2019-08-04 stsp <!DOCTYPE html>
4 63657f42 2022-09-07 stsp <meta charset="utf-8"/>
5 63657f42 2022-09-07 stsp <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6 63657f42 2022-09-07 stsp <link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
7 63657f42 2022-09-07 stsp <title>GOT(1)</title>
9 8797b228 2019-08-04 stsp <!-- This is an automatically generated file. Do not edit.
10 8797b228 2019-08-04 stsp Copyright (c) 2017 Martin Pieuchot
11 8b679b4b 2020-02-17 stsp Copyright (c) 2018, 2019, 2020 Stefan Sperling
13 8797b228 2019-08-04 stsp Permission to use, copy, modify, and distribute this software for any
14 8797b228 2019-08-04 stsp purpose with or without fee is hereby granted, provided that the above
15 8797b228 2019-08-04 stsp copyright notice and this permission notice appear in all copies.
17 8797b228 2019-08-04 stsp THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
18 8797b228 2019-08-04 stsp WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
19 8797b228 2019-08-04 stsp MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
20 8797b228 2019-08-04 stsp ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
21 8797b228 2019-08-04 stsp WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
22 8797b228 2019-08-04 stsp ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
23 8797b228 2019-08-04 stsp OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
26 63657f42 2022-09-07 stsp <div class="head" role="doc-pageheader" aria-label="Manual header
27 63657f42 2022-09-07 stsp line"><span class="head-ltitle">GOT(1)</span> <span class="head-vol">General
28 63657f42 2022-09-07 stsp Commands Manual</span> <span class="head-rtitle">GOT(1)</span></div>
29 63657f42 2022-09-07 stsp <main class="manual-text">
30 8797b228 2019-08-04 stsp <section class="Sh">
31 63657f42 2022-09-07 stsp <h2 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h2>
32 63657f42 2022-09-07 stsp <p class="Pp"><code class="Nm">got</code> —
33 63657f42 2022-09-07 stsp <span class="Nd" role="doc-subtitle">Game of Trees</span></p>
35 8797b228 2019-08-04 stsp <section class="Sh">
36 63657f42 2022-09-07 stsp <h2 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h2>
37 8797b228 2019-08-04 stsp <table class="Nm">
39 8797b228 2019-08-04 stsp <td><code class="Nm">got</code></td>
40 742bb3a1 2022-10-24 stsp <td>[<code class="Fl">-hV</code>] <var class="Ar">command</var>
41 8797b228 2019-08-04 stsp [<var class="Ar">arg ...</var>]</td>
45 8797b228 2019-08-04 stsp <section class="Sh">
46 63657f42 2022-09-07 stsp <h2 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h2>
47 d8e62599 2019-10-21 stsp <p class="Pp"><code class="Nm">got</code> is a version control system which
48 d8e62599 2019-10-21 stsp stores the history of tracked files in a Git repository, as used by the Git
49 d8e62599 2019-10-21 stsp version control system. This repository format is described in
50 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="git-repository, section
51 376d4d52 2022-07-04 stsp 5">git-repository(5)</a>.</p>
52 8797b228 2019-08-04 stsp <p class="Pp"><code class="Nm">got</code> is a “distributed”
53 8797b228 2019-08-04 stsp version control system because every copy of a repository is writeable.
54 8797b228 2019-08-04 stsp Modifications made to files can be synchronized between repositories at any
56 2dbbbc3a 2020-07-23 stsp <p class="Pp" id="work">Files managed by <code class="Nm">got</code> must be
57 2dbbbc3a 2020-07-23 stsp checked out from the repository for modification. Checked out files are
58 2dbbbc3a 2020-07-23 stsp stored in a <a class="permalink" href="#work"><i class="Em">work
59 2dbbbc3a 2020-07-23 stsp tree</i></a> which can be placed at an arbitrary directory in the filesystem
60 2dbbbc3a 2020-07-23 stsp hierarchy. The on-disk format of this work tree is described in
61 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="got-worktree, section 5">got-worktree(5)</a>.</p>
62 56f3f26e 2024-06-03 stsp <p class="Pp">The <code class="Nm">got</code> utility provides global and
63 56f3f26e 2024-06-03 stsp command-specific options. Global options must precede the command name, and
64 56f3f26e 2024-06-03 stsp are as follows:</p>
65 8797b228 2019-08-04 stsp <dl class="Bl-tag">
66 2dbbbc3a 2020-07-23 stsp <dt id="h"><a class="permalink" href="#h"><code class="Fl">-h</code></a></dt>
67 ae520cae 2019-08-05 stsp <dd>Display usage information and exit immediately.</dd>
68 56dd4d48 2021-04-05 stsp <dt id="V"><a class="permalink" href="#V"><code class="Fl">-V</code></a>,
69 8b679b4b 2020-02-17 stsp <code class="Fl">--version</code></dt>
70 8797b228 2019-08-04 stsp <dd>Display program version and exit immediately.</dd>
72 56f3f26e 2024-06-03 stsp <p class="Pp">The <code class="Nm">got</code> utility only provides commands
73 56f3f26e 2024-06-03 stsp needed to perform version control tasks. Commands needed for repository
74 56f3f26e 2024-06-03 stsp maintenance tasks are provided by <a class="Xr" aria-label="gotadmin,
75 56f3f26e 2024-06-03 stsp section 1">gotadmin(1)</a>. Git repository server functionality is provided
76 56f3f26e 2024-06-03 stsp by <a class="Xr" aria-label="gotd, section 8">gotd(8)</a>. A repository
77 56f3f26e 2024-06-03 stsp interface for web browsers is provided by <a class="Xr" aria-label="gotwebd,
78 56f3f26e 2024-06-03 stsp section 8">gotwebd(8)</a>. An interactive repository interface for the
79 56f3f26e 2024-06-03 stsp terminal is provided by <a class="Xr" aria-label="tog, section
80 56f3f26e 2024-06-03 stsp 1">tog(1)</a>.</p>
81 8797b228 2019-08-04 stsp <p class="Pp">The commands for <code class="Nm">got</code> are as follows:</p>
82 8797b228 2019-08-04 stsp <dl class="Bl-tag">
83 56f3f26e 2024-06-03 stsp <dt id="init"><a class="permalink" href="#init"><code class="Cm">init</code></a>
84 b183145b 2024-08-14 op [<code class="Fl">-A</code> <var class="Ar">hashing-algorithm</var>]
85 56f3f26e 2024-06-03 stsp [<code class="Fl">-b</code> <var class="Ar">branch</var>]
86 56f3f26e 2024-06-03 stsp <var class="Ar">repository-path</var></dt>
87 56f3f26e 2024-06-03 stsp <dd>Create a new empty repository at the specified
88 56f3f26e 2024-06-03 stsp <var class="Ar">repository-path</var>.
89 56f3f26e 2024-06-03 stsp <p class="Pp">After <code class="Cm">got init</code>, the new repository
90 56f3f26e 2024-06-03 stsp must be populated before <code class="Cm">got checkout</code> can be
91 56f3f26e 2024-06-03 stsp used. The <code class="Cm">got import</code> command can be used to
92 56f3f26e 2024-06-03 stsp populate the new repository with data from a local directory.
93 56f3f26e 2024-06-03 stsp Alternatively, on a server running <a class="Xr" aria-label="gotd,
94 56f3f26e 2024-06-03 stsp section 8">gotd(8)</a>, the new repository can be made available to
95 56f3f26e 2024-06-03 stsp <a class="Xr" aria-label="got, section 1">got(1)</a> or
96 56f3f26e 2024-06-03 stsp <a class="Xr" aria-label="git, section 1">git(1)</a> clients by adding
97 56f3f26e 2024-06-03 stsp the repository to <a class="Xr" aria-label="gotd.conf, section
98 56f3f26e 2024-06-03 stsp 5">gotd.conf(5)</a> and restarting <a class="Xr" aria-label="gotd,
99 56f3f26e 2024-06-03 stsp section 8">gotd(8)</a>. Clients may then clone the new repository from
100 56f3f26e 2024-06-03 stsp the server, populate the cloned repository, and then populate the new
101 56f3f26e 2024-06-03 stsp repository on the server via <code class="Cm">got send</code> or
102 56f3f26e 2024-06-03 stsp <code class="Cm">git push</code>.</p>
103 56f3f26e 2024-06-03 stsp <p class="Pp">The options for <code class="Cm">got init</code> are as
104 56f3f26e 2024-06-03 stsp follows:</p>
105 56f3f26e 2024-06-03 stsp <dl class="Bl-tag">
106 b183145b 2024-08-14 op <dt id="A"><a class="permalink" href="#A"><code class="Fl">-A</code></a>
107 b183145b 2024-08-14 op <var class="Ar">hashing-algorithm</var></dt>
108 b183145b 2024-08-14 op <dd>Configure the repository's <var class="Ar">hashing-algorithm</var>
109 b183145b 2024-08-14 op used for the computation of Git object IDs. Possible values are
110 b183145b 2024-08-14 op <code class="Cm">sha1</code> (the default) or
111 b183145b 2024-08-14 op <code class="Cm">sha256</code>.</dd>
112 56f3f26e 2024-06-03 stsp <dt id="b"><a class="permalink" href="#b"><code class="Fl">-b</code></a>
113 56f3f26e 2024-06-03 stsp <var class="Ar">branch</var></dt>
114 56f3f26e 2024-06-03 stsp <dd>Make the repository's HEAD reference point to the specified
115 56f3f26e 2024-06-03 stsp <var class="Ar">branch</var> instead of the default branch
116 56f3f26e 2024-06-03 stsp “main”.</dd>
118 56f3f26e 2024-06-03 stsp <p class="Pp">The <code class="Cm">got init</code> command is equivalent to
119 56f3f26e 2024-06-03 stsp <code class="Cm">gotadmin init</code>.</p>
121 63b69821 2021-10-16 stsp <dt id="im"><a class="permalink" href="#import"><code class="Cm" id="import">import</code></a>
122 8797b228 2019-08-04 stsp [<code class="Fl">-b</code> <var class="Ar">branch</var>]
123 63657f42 2022-09-07 stsp [<code class="Fl">-I</code> <var class="Ar">pattern</var>]
124 8797b228 2019-08-04 stsp [<code class="Fl">-m</code> <var class="Ar">message</var>]
125 8797b228 2019-08-04 stsp [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
126 8797b228 2019-08-04 stsp <var class="Ar">directory</var></dt>
128 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
129 46043f6f 2021-11-23 stsp <code class="Cm">im</code>)</code></div>
130 46043f6f 2021-11-23 stsp Create an initial commit in a repository from the file hierarchy within the
131 46043f6f 2021-11-23 stsp specified <var class="Ar">directory</var>. The created commit will not
132 8797b228 2019-08-04 stsp have any parent commits, i.e. it will be a root commit. Also create a new
133 8797b228 2019-08-04 stsp reference which provides a branch name for the newly created commit. Show
134 8797b228 2019-08-04 stsp the path of each imported file to indicate progress.
135 8797b228 2019-08-04 stsp <p class="Pp">The <code class="Cm">got import</code> command requires the
136 c2a52be5 2019-09-08 stsp <code class="Ev">GOT_AUTHOR</code> environment variable to be set,
137 376d4d52 2022-07-04 stsp unless an author has been configured in
138 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
139 376d4d52 2022-07-04 stsp <code class="Dv">user.name</code> and <code class="Dv">user.email</code>
140 376d4d52 2022-07-04 stsp configuration settings can be obtained from the repository's
141 376d4d52 2022-07-04 stsp <span class="Pa">.git/config</span> file or from Git's global
142 376d4d52 2022-07-04 stsp <span class="Pa">~/.gitconfig</span> configuration file.</p>
143 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got import</code> are as
144 8797b228 2019-08-04 stsp follows:</p>
145 8797b228 2019-08-04 stsp <dl class="Bl-tag">
146 56f3f26e 2024-06-03 stsp <dt id="b~2"><a class="permalink" href="#b~2"><code class="Fl">-b</code></a>
147 8797b228 2019-08-04 stsp <var class="Ar">branch</var></dt>
148 3cde8558 2022-09-23 stsp <dd>Create the specified <var class="Ar">branch</var>. If this option is
149 3cde8558 2022-09-23 stsp not specified, a branch corresponding to the repository's HEAD
150 3cde8558 2022-09-23 stsp reference will be used. Use of this option is required if the branch
151 3cde8558 2022-09-23 stsp resolved via the repository's HEAD reference already exists.</dd>
152 63657f42 2022-09-07 stsp <dt id="I"><a class="permalink" href="#I"><code class="Fl">-I</code></a>
153 63657f42 2022-09-07 stsp <var class="Ar">pattern</var></dt>
154 63657f42 2022-09-07 stsp <dd>Ignore files or directories with a name which matches the specified
155 63657f42 2022-09-07 stsp <var class="Ar">pattern</var>. This option may be specified multiple
156 63657f42 2022-09-07 stsp times to build a list of ignore patterns. The
157 63657f42 2022-09-07 stsp <var class="Ar">pattern</var> follows the globbing rules documented in
158 f6a6fa94 2023-02-22 stsp <a class="Xr" aria-label="glob, section 7">glob(7)</a>. Ignore
159 f6a6fa94 2023-02-22 stsp patterns which end with a slash, “/”, will only match
160 f6a6fa94 2023-02-22 stsp directories.</dd>
161 2dbbbc3a 2020-07-23 stsp <dt id="m"><a class="permalink" href="#m"><code class="Fl">-m</code></a>
162 8797b228 2019-08-04 stsp <var class="Ar">message</var></dt>
163 8797b228 2019-08-04 stsp <dd>Use the specified log message when creating the new commit. Without
164 8797b228 2019-08-04 stsp the <code class="Fl">-m</code> option, <code class="Cm">got
165 8797b228 2019-08-04 stsp import</code> opens a temporary file in an editor where a log message
166 461d9094 2023-07-19 stsp can be written. Quitting the editor without saving the file will abort
167 461d9094 2023-07-19 stsp the import operation.</dd>
168 2dbbbc3a 2020-07-23 stsp <dt id="r"><a class="permalink" href="#r"><code class="Fl">-r</code></a>
169 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
170 8797b228 2019-08-04 stsp <dd>Use the repository at the specified path. If not specified, assume the
171 8797b228 2019-08-04 stsp repository is located at or above the current working directory.</dd>
174 63b69821 2021-10-16 stsp <dt id="cl"><a class="permalink" href="#clone"><code class="Cm" id="clone">clone</code></a>
175 63657f42 2022-09-07 stsp [<code class="Fl">-almqv</code>] [<code class="Fl">-b</code>
176 63657f42 2022-09-07 stsp <var class="Ar">branch</var>] [<code class="Fl">-R</code>
177 b213cbf7 2020-03-23 stsp <var class="Ar">reference</var>] <var class="Ar">repository-URL</var>
178 b213cbf7 2020-03-23 stsp [<var class="Ar">directory</var>]</dt>
180 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
181 46043f6f 2021-11-23 stsp <code class="Cm">cl</code>)</code></div>
182 46043f6f 2021-11-23 stsp Clone a Git repository at the specified <var class="Ar">repository-URL</var>
183 46043f6f 2021-11-23 stsp into the specified <var class="Ar">directory</var>. If no
184 b078d5c4 2022-03-23 stsp <var class="Ar">directory</var> is specified, the directory name will be
185 46043f6f 2021-11-23 stsp derived from the name of the cloned repository. <code class="Cm">got
186 46043f6f 2021-11-23 stsp clone</code> will refuse to run if the <var class="Ar">directory</var>
187 46043f6f 2021-11-23 stsp already exists.
188 b213cbf7 2020-03-23 stsp <p class="Pp">The <var class="Ar">repository-URL</var> specifies a protocol
189 b213cbf7 2020-03-23 stsp scheme, a server hostname, an optional port number separated from the
190 b213cbf7 2020-03-23 stsp hostname by a colon, and a path to the repository on the server:
191 b213cbf7 2020-03-23 stsp <a class="Lk" href="scheme://hostname:port/path/to/repository">scheme://hostname:port/path/to/repository</a></p>
192 b213cbf7 2020-03-23 stsp <p class="Pp">The following protocol schemes are supported:</p>
193 b213cbf7 2020-03-23 stsp <dl class="Bl-tag">
194 b213cbf7 2020-03-23 stsp <dt>git</dt>
195 376d4d52 2022-07-04 stsp <dd>The Git protocol as implemented by the
196 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="git-daemon, section 1">git-daemon(1)</a>
197 b213cbf7 2020-03-23 stsp server. Use of this protocol is discouraged since it supports neither
198 b213cbf7 2020-03-23 stsp authentication nor encryption.</dd>
199 bd0bf387 2024-04-23 stsp <dt>ssh</dt>
200 b213cbf7 2020-03-23 stsp <dd>The Git protocol wrapped in an authenticated and encrypted
201 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> tunnel. With this
202 376d4d52 2022-07-04 stsp protocol the hostname may contain an embedded username for
203 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> to use:
204 b213cbf7 2020-03-23 stsp <a class="Mt" href="mailto:user@hostname">user@hostname</a></dd>
205 bd0bf387 2024-04-23 stsp <dt>http</dt>
206 bd0bf387 2024-04-23 stsp <dd>The “smart” Git HTTP protocol. Not compatible with
207 bd0bf387 2024-04-23 stsp servers using the “dumb” Git HTTP protocol.
208 bd0bf387 2024-04-23 stsp <p class="Pp">The “smart” Git HTTP protocol is supported
209 bd0bf387 2024-04-23 stsp by <code class="Cm">got clone</code> and <code class="Cm">got
210 bd0bf387 2024-04-23 stsp fetch</code>, but not by <code class="Cm">got send</code>. Sending
211 dfc34448 2024-05-06 stsp from a repository cloned over HTTP will require use of a
212 dfc34448 2024-05-06 stsp <code class="Ic">send</code> block in
213 bd0bf387 2024-04-23 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> to
214 bd0bf387 2024-04-23 stsp ensure that the “ssh://” protocol will be used by
215 bd0bf387 2024-04-23 stsp <code class="Cm">got send</code>.</p>
216 bd0bf387 2024-04-23 stsp <p class="Pp">Use of this protocol is discouraged since it supports
217 bd0bf387 2024-04-23 stsp neither authentication nor encryption.</p>
219 bd0bf387 2024-04-23 stsp <dt>https</dt>
220 bd0bf387 2024-04-23 stsp <dd>The “smart” Git HTTP protocol wrapped in SSL/TLS.</dd>
222 b213cbf7 2020-03-23 stsp <p class="Pp">Objects in the cloned repository are stored in a pack file
223 b213cbf7 2020-03-23 stsp which is downloaded from the server. This pack file will then be indexed
224 b213cbf7 2020-03-23 stsp to facilitate access to the objects stored within. If any objects in the
225 b213cbf7 2020-03-23 stsp pack file are stored in deltified form, all deltas will be fully
226 b213cbf7 2020-03-23 stsp resolved in order to compute the ID of such objects. This can take some
227 b213cbf7 2020-03-23 stsp time. More details about the pack file format are documented in
228 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="git-repository, section
229 376d4d52 2022-07-04 stsp 5">git-repository(5)</a>.</p>
230 b213cbf7 2020-03-23 stsp <p class="Pp"><code class="Cm">got clone</code> creates a remote repository
231 376d4d52 2022-07-04 stsp entry in the <a class="Xr" aria-label="got.conf, section
232 376d4d52 2022-07-04 stsp 5">got.conf(5)</a> and <span class="Pa">config</span> files of the
233 376d4d52 2022-07-04 stsp cloned repository to store the <var class="Ar">repository-url</var> and
234 376d4d52 2022-07-04 stsp any <var class="Ar">branch</var> or <var class="Ar">reference</var>
235 039953c9 2021-03-22 stsp arguments for future use by <code class="Cm">got fetch</code> or
236 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="git-fetch, section 1">git-fetch(1)</a>.</p>
237 b213cbf7 2020-03-23 stsp <p class="Pp">The options for <code class="Cm">got clone</code> are as
238 b213cbf7 2020-03-23 stsp follows:</p>
239 b213cbf7 2020-03-23 stsp <dl class="Bl-tag">
240 2dbbbc3a 2020-07-23 stsp <dt id="a"><a class="permalink" href="#a"><code class="Fl">-a</code></a></dt>
241 b213cbf7 2020-03-23 stsp <dd>Fetch all branches from the remote repository's
242 039953c9 2021-03-22 stsp “refs/heads/” reference namespace and set
243 376d4d52 2022-07-04 stsp <code class="Cm">fetch_all_branches</code> in the cloned repository's
244 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> file
245 376d4d52 2022-07-04 stsp for future use by <code class="Cm">got fetch</code>. If this option is
246 376d4d52 2022-07-04 stsp not specified, a branch resolved via the remote repository's HEAD
247 376d4d52 2022-07-04 stsp reference will be fetched. Cannot be used together with the
248 376d4d52 2022-07-04 stsp <code class="Fl">-b</code> option.</dd>
249 56f3f26e 2024-06-03 stsp <dt id="b~3"><a class="permalink" href="#b~3"><code class="Fl">-b</code></a>
250 b213cbf7 2020-03-23 stsp <var class="Ar">branch</var></dt>
251 b213cbf7 2020-03-23 stsp <dd>Fetch the specified <var class="Ar">branch</var> from the remote
252 b213cbf7 2020-03-23 stsp repository's “refs/heads/” reference namespace. This
253 b213cbf7 2020-03-23 stsp option may be specified multiple times to build a list of branches to
254 b213cbf7 2020-03-23 stsp fetch. If the branch corresponding to the remote repository's HEAD
255 b213cbf7 2020-03-23 stsp reference is not in this list, the cloned repository's HEAD reference
256 b213cbf7 2020-03-23 stsp will be set to the first branch which was fetched. If this option is
257 b213cbf7 2020-03-23 stsp not specified, a branch resolved via the remote repository's HEAD
258 b213cbf7 2020-03-23 stsp reference will be fetched. Cannot be used together with the
259 b213cbf7 2020-03-23 stsp <code class="Fl">-a</code> option.</dd>
260 2dbbbc3a 2020-07-23 stsp <dt id="l"><a class="permalink" href="#l"><code class="Fl">-l</code></a></dt>
261 b213cbf7 2020-03-23 stsp <dd>List branches and tags available for fetching from the remote
262 b213cbf7 2020-03-23 stsp repository and exit immediately. Cannot be used together with any of
263 039953c9 2021-03-22 stsp the other options except <code class="Fl">-q</code> and
264 039953c9 2021-03-22 stsp <code class="Fl">-v</code>.</dd>
265 2dbbbc3a 2020-07-23 stsp <dt id="m~2"><a class="permalink" href="#m~2"><code class="Fl">-m</code></a></dt>
266 b213cbf7 2020-03-23 stsp <dd>Create the cloned repository as a mirror of the original repository.
267 b213cbf7 2020-03-23 stsp This is useful if the cloned repository will not be used to store
268 a462773e 2020-04-19 stsp locally created commits.
269 376d4d52 2022-07-04 stsp <p class="Pp">The repository's <a class="Xr" aria-label="got.conf,
270 376d4d52 2022-07-04 stsp section 5">got.conf(5)</a> and <span class="Pa">config</span> files
271 376d4d52 2022-07-04 stsp will be set up with the “mirror” option enabled, such
272 376d4d52 2022-07-04 stsp that <code class="Cm">got fetch</code> or
273 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="git-fetch, section 1">git-fetch(1)</a>
274 a462773e 2020-04-19 stsp will write incoming changes directly to branches in the
275 b213cbf7 2020-03-23 stsp “refs/heads/” reference namespace, rather than to
276 b213cbf7 2020-03-23 stsp branches in the “refs/remotes/” namespace. This avoids
277 b213cbf7 2020-03-23 stsp the usual requirement of having to run <code class="Cm">got
278 461d9094 2023-07-19 stsp rebase</code> or <code class="Cm">got merge</code> after
279 461d9094 2023-07-19 stsp <code class="Cm">got fetch</code> in order to make incoming changes
280 461d9094 2023-07-19 stsp appear on branches in the “refs/heads/” namespace. But
281 461d9094 2023-07-19 stsp maintaining custom changes in the cloned repository becomes
282 461d9094 2023-07-19 stsp difficult since such changes will be at risk of being discarded
283 461d9094 2023-07-19 stsp whenever incoming changes are fetched.</p>
285 2dbbbc3a 2020-07-23 stsp <dt id="q"><a class="permalink" href="#q"><code class="Fl">-q</code></a></dt>
286 b213cbf7 2020-03-23 stsp <dd>Suppress progress reporting output. The same option will be passed to
287 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
288 376d4d52 2022-07-04 stsp applicable.</dd>
289 2dbbbc3a 2020-07-23 stsp <dt id="R"><a class="permalink" href="#R"><code class="Fl">-R</code></a>
290 b213cbf7 2020-03-23 stsp <var class="Ar">reference</var></dt>
291 b213cbf7 2020-03-23 stsp <dd>In addition to the branches and tags that will be fetched, fetch an
292 b213cbf7 2020-03-23 stsp arbitrary <var class="Ar">reference</var> from the remote repository's
293 b213cbf7 2020-03-23 stsp “refs/” namespace. This option may be specified multiple
294 b213cbf7 2020-03-23 stsp times to build a list of additional references to fetch. The specified
295 b213cbf7 2020-03-23 stsp <var class="Ar">reference</var> may either be a path to a specific
296 b213cbf7 2020-03-23 stsp reference, or a reference namespace which will cause all references in
297 b213cbf7 2020-03-23 stsp this namespace to be fetched.
298 b213cbf7 2020-03-23 stsp <p class="Pp">Each reference will be mapped into the cloned repository's
299 b213cbf7 2020-03-23 stsp “refs/remotes/” namespace, unless the
300 b213cbf7 2020-03-23 stsp <code class="Fl">-m</code> option is used to mirror references
301 b213cbf7 2020-03-23 stsp directly into the cloned repository's “refs/”
302 b213cbf7 2020-03-23 stsp namespace.</p>
303 b213cbf7 2020-03-23 stsp <p class="Pp"><code class="Cm">got clone</code> will refuse to fetch
304 b213cbf7 2020-03-23 stsp references from the remote repository's
305 b213cbf7 2020-03-23 stsp “refs/remotes/” or “refs/got/”
306 b213cbf7 2020-03-23 stsp namespace.</p>
308 63657f42 2022-09-07 stsp <dt id="v"><a class="permalink" href="#v"><code class="Fl">-v</code></a></dt>
309 63657f42 2022-09-07 stsp <dd>Verbose mode. Causes <code class="Cm">got clone</code> to print
310 63657f42 2022-09-07 stsp debugging messages to standard error output. This option will be
311 63657f42 2022-09-07 stsp passed to <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
312 63657f42 2022-09-07 stsp applicable. Multiple -v options increase the verbosity. The maximum is
316 63b69821 2021-10-16 stsp <dt id="fe"><a class="permalink" href="#fetch"><code class="Cm" id="fetch">fetch</code></a>
317 63657f42 2022-09-07 stsp [<code class="Fl">-adlqtvX</code>] [<code class="Fl">-b</code>
318 63657f42 2022-09-07 stsp <var class="Ar">branch</var>] [<code class="Fl">-R</code>
319 63657f42 2022-09-07 stsp <var class="Ar">reference</var>] [<code class="Fl">-r</code>
320 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var>]
321 63657f42 2022-09-07 stsp [<var class="Ar">remote-repository</var>]</dt>
323 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
324 46043f6f 2021-11-23 stsp <code class="Cm">fe</code>)</code></div>
325 46043f6f 2021-11-23 stsp Fetch new changes from a remote repository. If no
326 b213cbf7 2020-03-23 stsp <var class="Ar">remote-repository</var> is specified,
327 b213cbf7 2020-03-23 stsp “origin” will be used. The remote repository's URL is
328 376d4d52 2022-07-04 stsp obtained from the corresponding entry in
329 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
330 376d4d52 2022-07-04 stsp <span class="Pa">config</span> file of the local repository, as created by
331 376d4d52 2022-07-04 stsp <code class="Cm">got clone</code>.
332 f6a6fa94 2023-02-22 stsp <p class="Pp">By default, any branches configured in
333 f6a6fa94 2023-02-22 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> for the
334 f6a6fa94 2023-02-22 stsp <var class="Ar">remote-repository</var> will be fetched. If
335 f6a6fa94 2023-02-22 stsp <code class="Cm">got fetch</code> is invoked in a work tree then this
336 f6a6fa94 2023-02-22 stsp work tree's current branch will be fetched, too, provided it is present
337 f6a6fa94 2023-02-22 stsp on the server. If no branches to fetch can be found in
338 f6a6fa94 2023-02-22 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or via a
339 f6a6fa94 2023-02-22 stsp work tree, or said branches are not found on the server, a branch
340 f6a6fa94 2023-02-22 stsp resolved via the remote repository's HEAD reference will be fetched.
341 f6a6fa94 2023-02-22 stsp Likewise, if a HEAD reference for the
342 f6a6fa94 2023-02-22 stsp <var class="Ar">remote-repository</var> exists but its target no longer
343 f6a6fa94 2023-02-22 stsp matches the remote HEAD, then the new target branch will be fetched.
344 f6a6fa94 2023-02-22 stsp This default behaviour can be overridden with the
345 f6a6fa94 2023-02-22 stsp <code class="Fl">-a</code> and <code class="Fl">-b</code> options.</p>
346 b213cbf7 2020-03-23 stsp <p class="Pp">New changes will be stored in a separate pack file downloaded
347 b213cbf7 2020-03-23 stsp from the server. Optionally, separate pack files stored in the
348 376d4d52 2022-07-04 stsp repository can be combined with <a class="Xr" aria-label="git-repack,
349 376d4d52 2022-07-04 stsp section 1">git-repack(1)</a>.</p>
350 b213cbf7 2020-03-23 stsp <p class="Pp">By default, branch references in the
351 b213cbf7 2020-03-23 stsp “refs/remotes/” reference namespace will be updated to
352 b213cbf7 2020-03-23 stsp point at the newly fetched commits. The <code class="Cm">got
353 461d9094 2023-07-19 stsp rebase</code> or <code class="Cm">got merge</code> command can then be
354 461d9094 2023-07-19 stsp used to make new changes visible on branches in the
355 461d9094 2023-07-19 stsp “refs/heads/” namespace, merging incoming changes with the
356 461d9094 2023-07-19 stsp changes on those branches as necessary.</p>
357 b213cbf7 2020-03-23 stsp <p class="Pp">If the repository was created as a mirror with
358 b078d5c4 2022-03-23 stsp <code class="Cm">got clone -m</code>, then all branches in the
359 b213cbf7 2020-03-23 stsp “refs/heads/” namespace will be updated directly to match
360 b213cbf7 2020-03-23 stsp the corresponding branches in the remote repository. If those branches
361 b213cbf7 2020-03-23 stsp contained local commits, these commits will no longer be reachable via a
362 b213cbf7 2020-03-23 stsp reference and will therefore be at risk of being discarded by Git's
363 16cd1323 2021-07-26 stsp garbage collector or <code class="Cm">gotadmin cleanup</code>.
364 16cd1323 2021-07-26 stsp Maintaining custom changes in a mirror repository is therefore
365 16cd1323 2021-07-26 stsp discouraged.</p>
366 b213cbf7 2020-03-23 stsp <p class="Pp">In any case, references in the “refs/tags/”
367 b213cbf7 2020-03-23 stsp namespace will always be fetched and mapped directly to local references
368 b213cbf7 2020-03-23 stsp in the same namespace.</p>
369 b213cbf7 2020-03-23 stsp <p class="Pp">The options for <code class="Cm">got fetch</code> are as
370 b213cbf7 2020-03-23 stsp follows:</p>
371 b213cbf7 2020-03-23 stsp <dl class="Bl-tag">
372 2dbbbc3a 2020-07-23 stsp <dt id="a~2"><a class="permalink" href="#a~2"><code class="Fl">-a</code></a></dt>
373 b213cbf7 2020-03-23 stsp <dd>Fetch all branches from the remote repository's
374 039953c9 2021-03-22 stsp “refs/heads/” reference namespace. This option can be
375 039953c9 2021-03-22 stsp enabled by default for specific repositories in
376 f6a6fa94 2023-02-22 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a>. Cannot
377 f6a6fa94 2023-02-22 stsp be used together with the <code class="Fl">-b</code> option.</dd>
378 56f3f26e 2024-06-03 stsp <dt id="b~4"><a class="permalink" href="#b~4"><code class="Fl">-b</code></a>
379 b213cbf7 2020-03-23 stsp <var class="Ar">branch</var></dt>
380 b213cbf7 2020-03-23 stsp <dd>Fetch the specified <var class="Ar">branch</var> from the remote
381 b213cbf7 2020-03-23 stsp repository's “refs/heads/” reference namespace. This
382 b213cbf7 2020-03-23 stsp option may be specified multiple times to build a list of branches to
383 f6a6fa94 2023-02-22 stsp fetch. Cannot be used together with the <code class="Fl">-a</code>
384 f6a6fa94 2023-02-22 stsp option.</dd>
385 2dbbbc3a 2020-07-23 stsp <dt id="d"><a class="permalink" href="#d"><code class="Fl">-d</code></a></dt>
386 b213cbf7 2020-03-23 stsp <dd>Delete branches and tags from the local repository which are no longer
387 b213cbf7 2020-03-23 stsp present in the remote repository. Only references are deleted. Any
388 b213cbf7 2020-03-23 stsp commit, tree, tag, and blob objects belonging to deleted branches or
389 b213cbf7 2020-03-23 stsp tags remain in the repository and may be removed separately with Git's
390 16cd1323 2021-07-26 stsp garbage collector or <code class="Cm">gotadmin cleanup</code>.</dd>
391 2dbbbc3a 2020-07-23 stsp <dt id="l~2"><a class="permalink" href="#l~2"><code class="Fl">-l</code></a></dt>
392 b213cbf7 2020-03-23 stsp <dd>List branches and tags available for fetching from the remote
393 b213cbf7 2020-03-23 stsp repository and exit immediately. Cannot be used together with any of
394 039953c9 2021-03-22 stsp the other options except <code class="Fl">-v</code>,
395 039953c9 2021-03-22 stsp <code class="Fl">-q</code>, and <code class="Fl">-r</code>.</dd>
396 2dbbbc3a 2020-07-23 stsp <dt id="q~2"><a class="permalink" href="#q~2"><code class="Fl">-q</code></a></dt>
397 b213cbf7 2020-03-23 stsp <dd>Suppress progress reporting output. The same option will be passed to
398 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
399 376d4d52 2022-07-04 stsp applicable.</dd>
400 2dbbbc3a 2020-07-23 stsp <dt id="R~2"><a class="permalink" href="#R~2"><code class="Fl">-R</code></a>
401 b213cbf7 2020-03-23 stsp <var class="Ar">reference</var></dt>
402 b213cbf7 2020-03-23 stsp <dd>In addition to the branches and tags that will be fetched, fetch an
403 b213cbf7 2020-03-23 stsp arbitrary <var class="Ar">reference</var> from the remote repository's
404 b213cbf7 2020-03-23 stsp “refs/” namespace. This option may be specified multiple
405 b213cbf7 2020-03-23 stsp times to build a list of additional references to fetch. The specified
406 b213cbf7 2020-03-23 stsp <var class="Ar">reference</var> may either be a path to a specific
407 b213cbf7 2020-03-23 stsp reference, or a reference namespace which will cause all references in
408 b213cbf7 2020-03-23 stsp this namespace to be fetched.
409 b213cbf7 2020-03-23 stsp <p class="Pp">Each reference will be mapped into the local repository's
410 b213cbf7 2020-03-23 stsp “refs/remotes/” namespace, unless the local repository
411 b213cbf7 2020-03-23 stsp was created as a mirror with <code class="Cm">got clone -m</code> in
412 b213cbf7 2020-03-23 stsp which case references will be mapped directly into the local
413 b213cbf7 2020-03-23 stsp repository's “refs/” namespace.</p>
414 a462773e 2020-04-19 stsp <p class="Pp">Once a reference has been fetched, a branch based on it
415 a462773e 2020-04-19 stsp can be created with <code class="Cm">got branch</code> if
416 b213cbf7 2020-03-23 stsp needed.</p>
417 b213cbf7 2020-03-23 stsp <p class="Pp"><code class="Cm">got fetch</code> will refuse to fetch
418 b213cbf7 2020-03-23 stsp references from the remote repository's
419 b213cbf7 2020-03-23 stsp “refs/remotes/” or “refs/got/”
420 b213cbf7 2020-03-23 stsp namespace.</p>
422 63657f42 2022-09-07 stsp <dt id="r~2"><a class="permalink" href="#r~2"><code class="Fl">-r</code></a>
423 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var></dt>
424 63657f42 2022-09-07 stsp <dd>Use the repository at the specified path. If not specified, assume the
425 63657f42 2022-09-07 stsp repository is located at or above the current working directory. If
426 63657f42 2022-09-07 stsp this directory is a <code class="Nm">got</code> work tree, use the
427 63657f42 2022-09-07 stsp repository path associated with this work tree.</dd>
428 63657f42 2022-09-07 stsp <dt id="t"><a class="permalink" href="#t"><code class="Fl">-t</code></a></dt>
429 63657f42 2022-09-07 stsp <dd>Allow existing references in the “refs/tags” namespace
430 63657f42 2022-09-07 stsp to be updated if they have changed on the server. If not specified,
431 63657f42 2022-09-07 stsp only new tag references will be created.</dd>
432 63657f42 2022-09-07 stsp <dt id="v~2"><a class="permalink" href="#v~2"><code class="Fl">-v</code></a></dt>
433 63657f42 2022-09-07 stsp <dd>Verbose mode. Causes <code class="Cm">got fetch</code> to print
434 63657f42 2022-09-07 stsp debugging messages to standard error output. The same option will be
435 63657f42 2022-09-07 stsp passed to <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
436 63657f42 2022-09-07 stsp applicable. Multiple -v options increase the verbosity. The maximum is
438 16cd1323 2021-07-26 stsp <dt id="X"><a class="permalink" href="#X"><code class="Fl">-X</code></a></dt>
439 16cd1323 2021-07-26 stsp <dd>Delete all references which correspond to a particular
440 16cd1323 2021-07-26 stsp <var class="Ar">remote-repository</var> instead of fetching new
441 16cd1323 2021-07-26 stsp changes. This can be useful when a remote repository is being removed
442 376d4d52 2022-07-04 stsp from <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a>.
443 16cd1323 2021-07-26 stsp <p class="Pp">With <code class="Fl">-X</code>, the
444 16cd1323 2021-07-26 stsp <var class="Ar">remote-repository</var> argument is mandatory and no
445 16cd1323 2021-07-26 stsp other options except <code class="Fl">-r</code>,
446 16cd1323 2021-07-26 stsp <code class="Fl">-v</code>, and <code class="Fl">-q</code> are
447 16cd1323 2021-07-26 stsp allowed.</p>
448 16cd1323 2021-07-26 stsp <p class="Pp">Only references are deleted. Any commit, tree, tag, and
449 16cd1323 2021-07-26 stsp blob objects fetched from a remote repository will generally be
450 16cd1323 2021-07-26 stsp stored in pack files and may be removed separately with
451 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="git-repack, section 1">git-repack(1)</a>
452 376d4d52 2022-07-04 stsp and Git's garbage collector.</p>
456 63b69821 2021-10-16 stsp <dt id="co"><a class="permalink" href="#checkout"><code class="Cm" id="checkout">checkout</code></a>
457 63657f42 2022-09-07 stsp [<code class="Fl">-Eq</code>] [<code class="Fl">-b</code>
458 8b679b4b 2020-02-17 stsp <var class="Ar">branch</var>] [<code class="Fl">-c</code>
459 8b679b4b 2020-02-17 stsp <var class="Ar">commit</var>] [<code class="Fl">-p</code>
460 63657f42 2022-09-07 stsp <var class="Ar">path-prefix</var>] <var class="Ar">repository-path</var>
461 8797b228 2019-08-04 stsp [<var class="Ar">work-tree-path</var>]</dt>
463 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
464 46043f6f 2021-11-23 stsp <code class="Cm">co</code>)</code></div>
465 46043f6f 2021-11-23 stsp Copy files from a repository into a new work tree. Show the status of each
466 8b679b4b 2020-02-17 stsp affected file, using the following status codes:
467 8b679b4b 2020-02-17 stsp <table class="Bl-column">
470 8b679b4b 2020-02-17 stsp <td>new file was added</td>
474 8b679b4b 2020-02-17 stsp <td>file already exists in work tree's meta-data</td>
477 8b679b4b 2020-02-17 stsp <p class="Pp">If the <var class="Ar">work tree path</var> is not specified,
478 8b679b4b 2020-02-17 stsp either use the last component of <var class="Ar">repository path</var>,
479 8b679b4b 2020-02-17 stsp or if a <var class="Ar">path prefix</var> was specified use the last
480 8b679b4b 2020-02-17 stsp component of <var class="Ar">path prefix</var>.</p>
481 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got checkout</code> are as
482 8797b228 2019-08-04 stsp follows:</p>
483 8797b228 2019-08-04 stsp <dl class="Bl-tag">
484 56f3f26e 2024-06-03 stsp <dt id="b~5"><a class="permalink" href="#b~5"><code class="Fl">-b</code></a>
485 8797b228 2019-08-04 stsp <var class="Ar">branch</var></dt>
486 8797b228 2019-08-04 stsp <dd>Check out files from a commit on the specified
487 8797b228 2019-08-04 stsp <var class="Ar">branch</var>. If this option is not specified, a
488 8797b228 2019-08-04 stsp branch resolved via the repository's HEAD reference will be used.</dd>
489 2dbbbc3a 2020-07-23 stsp <dt id="c"><a class="permalink" href="#c"><code class="Fl">-c</code></a>
490 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
491 8797b228 2019-08-04 stsp <dd>Check out files from the specified <var class="Ar">commit</var> on the
492 461d9094 2023-07-19 stsp selected branch. If this option is not specified, the most recent
493 461d9094 2023-07-19 stsp commit on the selected branch will be used.
494 461d9094 2023-07-19 stsp <p class="Pp">The expected <var class="Ar">commit</var> argument is a
495 b183145b 2024-08-14 op commit ID, or a reference name or a keyword which will be resolved
496 b183145b 2024-08-14 op to a commit ID. An abbreviated hash argument will be expanded to a
497 b183145b 2024-08-14 op full commit ID automatically, provided the abbreviation is unique.
498 b183145b 2024-08-14 op The keywords ":base" and ":head" resolve to the
499 b183145b 2024-08-14 op repository's HEAD reference, or, if the <code class="Fl">-b</code>
500 b183145b 2024-08-14 op option is used, the head of the checked-out
501 b183145b 2024-08-14 op <var class="Ar">branch</var>. Keywords and reference names may be
502 b183145b 2024-08-14 op appended with ":+" or ":-" modifiers and an
503 b183145b 2024-08-14 op optional integer N to denote the Nth descendant or antecedent by
504 b183145b 2024-08-14 op first parent traversal, respectively; for example,
505 461d9094 2023-07-19 stsp <b class="Sy">:head:-2</b> denotes the work tree branch head's 2nd
506 461d9094 2023-07-19 stsp generation ancestor, and <b class="Sy">foo:-3</b> will denote the
507 461d9094 2023-07-19 stsp 3rd generation ancestor of the commit resolved by the
508 461d9094 2023-07-19 stsp "foo" reference. If an integer does not follow the
509 461d9094 2023-07-19 stsp ":+" or ":-" modifier, a "1" is
510 461d9094 2023-07-19 stsp implicitly appended (e.g., <b class="Sy">:head:-</b> is equivalent
511 461d9094 2023-07-19 stsp to <b class="Sy">:head:-1</b>).</p>
512 ae803b74 2020-03-06 stsp <p class="Pp">If the specified <var class="Ar">commit</var> is not
513 ae803b74 2020-03-06 stsp contained in the selected branch, a different branch which contains
514 ae803b74 2020-03-06 stsp this commit must be specified with the <code class="Fl">-b</code>
515 b078d5c4 2022-03-23 stsp option. If no such branch is known, a new branch must be created for
516 ae803b74 2020-03-06 stsp this commit with <code class="Cm">got branch</code> before
517 ae803b74 2020-03-06 stsp <code class="Cm">got checkout</code> can be used. Checking out work
518 ae803b74 2020-03-06 stsp trees with an unknown branch is intentionally not supported.</p>
520 63657f42 2022-09-07 stsp <dt id="E"><a class="permalink" href="#E"><code class="Fl">-E</code></a></dt>
521 63657f42 2022-09-07 stsp <dd>Proceed with the checkout operation even if the directory at
522 63657f42 2022-09-07 stsp <var class="Ar">work-tree-path</var> is not empty. Existing files will
523 63657f42 2022-09-07 stsp be left intact.</dd>
524 2dbbbc3a 2020-07-23 stsp <dt id="p"><a class="permalink" href="#p"><code class="Fl">-p</code></a>
525 8797b228 2019-08-04 stsp <var class="Ar">path-prefix</var></dt>
526 8797b228 2019-08-04 stsp <dd>Restrict the work tree to a subset of the repository's tree hierarchy.
527 8797b228 2019-08-04 stsp Only files beneath the specified <var class="Ar">path-prefix</var>
528 8797b228 2019-08-04 stsp will be checked out.</dd>
529 4448c231 2021-09-15 stsp <dt id="q~3"><a class="permalink" href="#q~3"><code class="Fl">-q</code></a></dt>
530 4448c231 2021-09-15 stsp <dd>Silence progress output.</dd>
533 63b69821 2021-10-16 stsp <dt id="up"><a class="permalink" href="#update"><code class="Cm" id="update">update</code></a>
534 63657f42 2022-09-07 stsp [<code class="Fl">-q</code>] [<code class="Fl">-b</code>
535 63657f42 2022-09-07 stsp <var class="Ar">branch</var>] [<code class="Fl">-c</code>
536 63657f42 2022-09-07 stsp <var class="Ar">commit</var>] [<var class="Ar">path ...</var>]</dt>
538 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
539 46043f6f 2021-11-23 stsp <code class="Cm">up</code>)</code></div>
540 46043f6f 2021-11-23 stsp Update an existing work tree to a different <var class="Ar">commit</var>.
541 9e67ab87 2020-04-14 stsp Change existing files in the work tree as necessary to match file contents
542 9e67ab87 2020-04-14 stsp of this commit. Preserve any local changes in the work tree and merge them
543 9e67ab87 2020-04-14 stsp with the incoming changes.
544 a462773e 2020-04-19 stsp <p class="Pp">Files which already contain merge conflicts will not be
545 a462773e 2020-04-19 stsp updated to avoid further complications. Such files will be updated when
546 a462773e 2020-04-19 stsp <code class="Cm">got update</code> is run again after merge conflicts
547 b078d5c4 2022-03-23 stsp have been resolved. If the conflicting changes are no longer needed,
548 a462773e 2020-04-19 stsp affected files can be reverted with <code class="Cm">got revert</code>
549 a462773e 2020-04-19 stsp before running <code class="Cm">got update</code> again.</p>
550 9e67ab87 2020-04-14 stsp <p class="Pp">Show the status of each affected file, using the following
551 9e67ab87 2020-04-14 stsp status codes:</p>
552 8797b228 2019-08-04 stsp <table class="Bl-column">
555 8797b228 2019-08-04 stsp <td>file was updated and contained no local changes</td>
559 8797b228 2019-08-04 stsp <td>file was updated and local changes were merged cleanly</td>
563 8797b228 2019-08-04 stsp <td>file was updated and conflicts occurred during merge</td>
567 8797b228 2019-08-04 stsp <td>file was deleted</td>
571 86b2b9f3 2023-03-12 stsp <td>file's deletion was prevented by local modifications</td>
575 8797b228 2019-08-04 stsp <td>new file was added</td>
579 8797b228 2019-08-04 stsp <td>versioned file is obstructed by a non-regular file</td>
583 8797b228 2019-08-04 stsp <td>a missing versioned file was restored</td>
587 a462773e 2020-04-19 stsp <td>file was not updated because it contains merge conflicts</td>
591 1554b334 2020-08-02 stsp <td>changes destined for an unversioned file were not merged</td>
594 8797b228 2019-08-04 stsp <p class="Pp">If no <var class="Ar">path</var> is specified, update the
595 8797b228 2019-08-04 stsp entire work tree. Otherwise, restrict the update operation to files at
596 8797b228 2019-08-04 stsp or within the specified paths. Each path is required to exist in the
597 8797b228 2019-08-04 stsp update operation's target commit. Files in the work tree outside
598 8797b228 2019-08-04 stsp specified paths will remain unchanged and will retain their previously
599 8797b228 2019-08-04 stsp recorded base commit. Some <code class="Nm">got</code> commands may
600 8797b228 2019-08-04 stsp refuse to run while the work tree contains files from multiple base
601 8797b228 2019-08-04 stsp commits. The base commit of such a work tree can be made consistent by
602 8797b228 2019-08-04 stsp running <code class="Cm">got update</code> across the entire work tree.
603 8797b228 2019-08-04 stsp Specifying a <var class="Ar">path</var> is incompatible with the
604 8797b228 2019-08-04 stsp <code class="Fl">-b</code> option.</p>
605 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got update</code> cannot update paths with
606 8797b228 2019-08-04 stsp staged changes. If changes have been staged with <code class="Cm">got
607 91b3da3f 2019-08-18 stsp stage</code>, these changes must first be committed with
608 8797b228 2019-08-04 stsp <code class="Cm">got commit</code> or unstaged with <code class="Cm">got
609 8797b228 2019-08-04 stsp unstage</code>.</p>
610 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got update</code> are as
611 8797b228 2019-08-04 stsp follows:</p>
612 8797b228 2019-08-04 stsp <dl class="Bl-tag">
613 56f3f26e 2024-06-03 stsp <dt id="b~6"><a class="permalink" href="#b~6"><code class="Fl">-b</code></a>
614 8797b228 2019-08-04 stsp <var class="Ar">branch</var></dt>
615 8797b228 2019-08-04 stsp <dd>Switch the work tree's branch reference to the specified
616 8797b228 2019-08-04 stsp <var class="Ar">branch</var> before updating the work tree. This
617 9e67ab87 2020-04-14 stsp option requires that all paths in the work tree are updated.
618 9e67ab87 2020-04-14 stsp <p class="Pp">As usual, any local changes in the work tree will be
619 9e67ab87 2020-04-14 stsp preserved. This can be useful when switching to a newly created
620 9e67ab87 2020-04-14 stsp branch in order to commit existing local changes to this branch.</p>
621 9e67ab87 2020-04-14 stsp <p class="Pp">Any local changes must be dealt with separately in order
622 9e67ab87 2020-04-14 stsp to obtain a work tree with pristine file contents corresponding
623 9e67ab87 2020-04-14 stsp exactly to the specified <var class="Ar">branch</var>. Such changes
624 9e67ab87 2020-04-14 stsp could first be committed to a different branch with
625 9e67ab87 2020-04-14 stsp <code class="Cm">got commit</code>, or could be discarded with
626 9e67ab87 2020-04-14 stsp <code class="Cm">got revert</code>.</p>
628 2dbbbc3a 2020-07-23 stsp <dt id="c~2"><a class="permalink" href="#c~2"><code class="Fl">-c</code></a>
629 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
630 461d9094 2023-07-19 stsp <dd>Update the work tree to the specified <var class="Ar">commit</var>. If
631 461d9094 2023-07-19 stsp this option is not specified, the most recent commit on the work
632 461d9094 2023-07-19 stsp tree's branch will be used.
633 461d9094 2023-07-19 stsp <p class="Pp">The expected <var class="Ar">commit</var> argument is a
634 b183145b 2024-08-14 op commit ID, or a reference name or a keyword which will be resolved
635 b183145b 2024-08-14 op to a commit ID. An abbreviated hash argument will be expanded to a
636 b183145b 2024-08-14 op full commit ID automatically, provided the abbreviation is unique.
637 b183145b 2024-08-14 op The keywords ":base" and ":head" resolve to the
638 b183145b 2024-08-14 op work tree's base commit and branch head, respectively. Keywords and
639 b183145b 2024-08-14 op reference names may be appended with ":+" or
640 b183145b 2024-08-14 op ":-" modifiers and an optional integer N to denote the Nth
641 b183145b 2024-08-14 op descendant or antecedent, respectively, by first parent traversal;
642 b183145b 2024-08-14 op for example, <b class="Sy">:head:-2</b> denotes the work tree branch
643 b183145b 2024-08-14 op head's 2nd generation ancestor, and <b class="Sy">:base:+4</b>
644 b183145b 2024-08-14 op denotes the 4th generation descendant of the work tree's base
645 b183145b 2024-08-14 op commit. Similarly, <b class="Sy">foo:-3</b> will denote the 3rd
646 b183145b 2024-08-14 op generation ancestor of the commit resolved by the "foo"
647 b183145b 2024-08-14 op reference. If an integer does not follow the ":+" or
648 b183145b 2024-08-14 op ":-" modifier, a "1" is implicitly appended
649 b183145b 2024-08-14 op (e.g., <b class="Sy">:head:-</b> is equivalent to
650 b183145b 2024-08-14 op <b class="Sy">:head:-1</b>).</p>
652 4448c231 2021-09-15 stsp <dt id="q~4"><a class="permalink" href="#q~4"><code class="Fl">-q</code></a></dt>
653 4448c231 2021-09-15 stsp <dd>Silence progress output.</dd>
656 63b69821 2021-10-16 stsp <dt id="st"><a class="permalink" href="#status"><code class="Cm" id="status">status</code></a>
657 63657f42 2022-09-07 stsp [<code class="Fl">-I</code>] [<code class="Fl">-S</code>
658 63657f42 2022-09-07 stsp <var class="Ar">status-codes</var>] [<code class="Fl">-s</code>
659 cb0c453b 2021-09-15 stsp <var class="Ar">status-codes</var>] [<var class="Ar">path ...</var>]</dt>
661 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
662 46043f6f 2021-11-23 stsp <code class="Cm">st</code>)</code></div>
663 46043f6f 2021-11-23 stsp Show the current modification status of files in a work tree, using the
664 8797b228 2019-08-04 stsp following status codes:
665 8797b228 2019-08-04 stsp <table class="Bl-column">
668 8797b228 2019-08-04 stsp <td>modified file</td>
672 8797b228 2019-08-04 stsp <td>file scheduled for addition in next commit</td>
676 8797b228 2019-08-04 stsp <td>file scheduled for deletion in next commit</td>
680 8797b228 2019-08-04 stsp <td>modified or added file which contains merge conflicts</td>
684 8797b228 2019-08-04 stsp <td>versioned file was expected on disk but is missing</td>
688 8797b228 2019-08-04 stsp <td>versioned file is obstructed by a non-regular file</td>
692 8797b228 2019-08-04 stsp <td>unversioned item not tracked by <code class="Nm">got</code></td>
696 d8e62599 2019-10-21 stsp <td>modified file modes (executable bit only)</td>
700 ba0a4168 2019-08-26 stsp <td>non-existent <var class="Ar">path</var> specified on the command
704 8797b228 2019-08-04 stsp <p class="Pp">If no <var class="Ar">path</var> is specified, show
705 8797b228 2019-08-04 stsp modifications in the entire work tree. Otherwise, show modifications at
706 8797b228 2019-08-04 stsp or within the specified paths.</p>
707 8797b228 2019-08-04 stsp <p class="Pp">If changes have been staged with <code class="Cm">got
708 8797b228 2019-08-04 stsp stage</code>, staged changes are shown in the second output column,
709 8797b228 2019-08-04 stsp using the following status codes:</p>
710 8797b228 2019-08-04 stsp <table class="Bl-column">
713 8797b228 2019-08-04 stsp <td>file modification is staged</td>
717 8797b228 2019-08-04 stsp <td>file addition is staged</td>
721 8797b228 2019-08-04 stsp <td>file deletion is staged</td>
724 fc62dacd 2019-08-08 stsp <p class="Pp">Changes created on top of staged changes are indicated in the
725 fc62dacd 2019-08-08 stsp first column:</p>
726 8797b228 2019-08-04 stsp <table class="Bl-column">
728 8797b228 2019-08-04 stsp <td>MM</td>
729 fc62dacd 2019-08-08 stsp <td>file was modified after earlier changes have been staged</td>
732 8797b228 2019-08-04 stsp <td>MA</td>
733 fc62dacd 2019-08-08 stsp <td>file was modified after having been staged for addition</td>
736 bd0bf387 2024-04-23 stsp <p class="Pp">If the work tree contains the results of an interrupted
737 bd0bf387 2024-04-23 stsp <code class="Cm">got rebase</code>, <code class="Cm">got
738 bd0bf387 2024-04-23 stsp histedit</code>, or <code class="Cm">got merge</code> operation then
739 bd0bf387 2024-04-23 stsp display a message which shows the branches involved.</p>
740 feee6923 2020-09-17 stsp <p class="Pp">The options for <code class="Cm">got status</code> are as
741 feee6923 2020-09-17 stsp follows:</p>
742 feee6923 2020-09-17 stsp <dl class="Bl-tag">
743 a954aa0a 2021-06-22 stsp <dt id="I~2"><a class="permalink" href="#I~2"><code class="Fl">-I</code></a></dt>
744 a954aa0a 2021-06-22 stsp <dd>Show unversioned files even if they match an ignore pattern.</dd>
745 4448c231 2021-09-15 stsp <dt id="S"><a class="permalink" href="#S"><code class="Fl">-S</code></a>
746 4448c231 2021-09-15 stsp <var class="Ar">status-codes</var></dt>
747 4448c231 2021-09-15 stsp <dd>Suppress the output of files with a modification status matching any
748 4448c231 2021-09-15 stsp of the single-character status codes contained in the
749 4448c231 2021-09-15 stsp <var class="Ar">status-codes</var> argument. Any combination of codes
750 4448c231 2021-09-15 stsp from the above list of possible status codes may be specified. For
751 4448c231 2021-09-15 stsp staged files, status codes displayed in either column will be matched.
752 4448c231 2021-09-15 stsp Cannot be used together with the <code class="Fl">-s</code>
753 4448c231 2021-09-15 stsp option.</dd>
754 63657f42 2022-09-07 stsp <dt id="s"><a class="permalink" href="#s"><code class="Fl">-s</code></a>
755 63657f42 2022-09-07 stsp <var class="Ar">status-codes</var></dt>
756 63657f42 2022-09-07 stsp <dd>Only show files with a modification status matching any of the
757 63657f42 2022-09-07 stsp single-character status codes contained in the
758 63657f42 2022-09-07 stsp <var class="Ar">status-codes</var> argument. Any combination of codes
759 63657f42 2022-09-07 stsp from the above list of possible status codes may be specified. For
760 63657f42 2022-09-07 stsp staged files, status codes displayed in either column will be matched.
761 63657f42 2022-09-07 stsp Cannot be used together with the <code class="Fl">-S</code>
762 63657f42 2022-09-07 stsp option.</dd>
764 376d4d52 2022-07-04 stsp <p class="Pp">For compatibility with <a class="Xr" aria-label="cvs, section
765 376d4d52 2022-07-04 stsp 1">cvs(1)</a> and <a class="Xr" aria-label="git, section 1">git(1)</a>,
766 376d4d52 2022-07-04 stsp <code class="Cm">got status</code> reads <a class="Xr" aria-label="glob,
767 376d4d52 2022-07-04 stsp section 7">glob(7)</a> patterns from <span class="Pa">.cvsignore</span>
768 376d4d52 2022-07-04 stsp and <span class="Pa">.gitignore</span> files in each traversed directory
769 f6a6fa94 2023-02-22 stsp and will not display unversioned files which match these patterns.
770 f6a6fa94 2023-02-22 stsp Ignore patterns which end with a slash, “/”, will only
771 f6a6fa94 2023-02-22 stsp match directories. As an extension to <a class="Xr" aria-label="glob,
772 f6a6fa94 2023-02-22 stsp section 7">glob(7)</a> matching rules, <code class="Cm">got
773 f6a6fa94 2023-02-22 stsp status</code> supports consecutive asterisks, “**”, which
774 f6a6fa94 2023-02-22 stsp will match an arbitrary amount of directories. Unlike
775 f6a6fa94 2023-02-22 stsp <a class="Xr" aria-label="cvs, section 1">cvs(1)</a>,
776 f6a6fa94 2023-02-22 stsp <code class="Cm">got status</code> only supports a single ignore pattern
777 f6a6fa94 2023-02-22 stsp per line. Unlike <a class="Xr" aria-label="git, section 1">git(1)</a>,
778 f6a6fa94 2023-02-22 stsp <code class="Cm">got status</code> does not support negated ignore
779 f6a6fa94 2023-02-22 stsp patterns prefixed with “!”, and gives no special
780 f6a6fa94 2023-02-22 stsp significance to the location of path component separators,
781 376d4d52 2022-07-04 stsp “/”, in a pattern.</p>
783 2dbbbc3a 2020-07-23 stsp <dt id="log"><a class="permalink" href="#log"><code class="Cm">log</code></a>
784 bd0bf387 2024-04-23 stsp [<code class="Fl">-bdPpRst</code>] [<code class="Fl">-C</code>
785 63657f42 2022-09-07 stsp <var class="Ar">number</var>] [<code class="Fl">-c</code>
786 63657f42 2022-09-07 stsp <var class="Ar">commit</var>] [<code class="Fl">-l</code>
787 63657f42 2022-09-07 stsp <var class="Ar">N</var>] [<code class="Fl">-r</code>
788 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var>] [<code class="Fl">-S</code>
789 63657f42 2022-09-07 stsp <var class="Ar">search-pattern</var>] [<code class="Fl">-x</code>
790 a701a2ae 2022-06-17 stsp <var class="Ar">commit</var>] [<var class="Ar">path</var>]</dt>
791 8797b228 2019-08-04 stsp <dd>Display history of a repository. If a <var class="Ar">path</var> is
792 7c3b4ab8 2020-02-25 stsp specified, show only commits which modified this path. If invoked in a
793 7c3b4ab8 2020-02-25 stsp work tree, the <var class="Ar">path</var> is interpreted relative to the
794 7c3b4ab8 2020-02-25 stsp current working directory, and the work tree's path prefix is implicitly
795 7c3b4ab8 2020-02-25 stsp prepended. Otherwise, the path is interpreted relative to the repository
797 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got log</code> are as
798 8797b228 2019-08-04 stsp follows:</p>
799 8797b228 2019-08-04 stsp <dl class="Bl-tag">
800 56f3f26e 2024-06-03 stsp <dt id="b~7"><a class="permalink" href="#b~7"><code class="Fl">-b</code></a></dt>
801 8b679b4b 2020-02-17 stsp <dd>Display individual commits which were merged into the current branch
802 8b679b4b 2020-02-17 stsp from other branches. By default, <code class="Cm">got log</code> shows
803 8b679b4b 2020-02-17 stsp the linear history of the current branch only.</dd>
804 63657f42 2022-09-07 stsp <dt id="C"><a class="permalink" href="#C"><code class="Fl">-C</code></a>
805 63657f42 2022-09-07 stsp <var class="Ar">number</var></dt>
806 63657f42 2022-09-07 stsp <dd>Set the number of context lines shown in diffs with
807 63657f42 2022-09-07 stsp <code class="Fl">-p</code>. By default, 3 lines of context are
808 63657f42 2022-09-07 stsp shown.</dd>
809 2dbbbc3a 2020-07-23 stsp <dt id="c~3"><a class="permalink" href="#c~3"><code class="Fl">-c</code></a>
810 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
811 8797b228 2019-08-04 stsp <dd>Start traversing history at the specified
812 461d9094 2023-07-19 stsp <var class="Ar">commit</var>. If this option is not specified, default
813 461d9094 2023-07-19 stsp to the work tree's current branch if invoked in a work tree, or to the
814 461d9094 2023-07-19 stsp repository's HEAD reference.
815 461d9094 2023-07-19 stsp <p class="Pp" id="bar:+3">The expected <var class="Ar">commit</var>
816 b183145b 2024-08-14 op argument is a commit ID, or a reference name or a keyword which will
817 b183145b 2024-08-14 op be resolved to a commit ID. An abbreviated hash argument will be
818 b183145b 2024-08-14 op expanded to a full commit ID automatically, provided the
819 461d9094 2023-07-19 stsp abbreviation is unique. The keywords ":base" and
820 461d9094 2023-07-19 stsp ":head" resolve to the work tree's base commit and branch
821 461d9094 2023-07-19 stsp head, respectively. The former is only valid if invoked in a work
822 461d9094 2023-07-19 stsp tree, while the latter will resolve to the tip of the work tree's
823 461d9094 2023-07-19 stsp current branch if invoked in a work tree, otherwise it will resolve
824 461d9094 2023-07-19 stsp to the repository's HEAD reference. Keywords and references may be
825 461d9094 2023-07-19 stsp appended with ":+" or ":-" modifiers and an
826 461d9094 2023-07-19 stsp optional integer N to denote the Nth descendant or antecedent,
827 461d9094 2023-07-19 stsp respectively, by first parent traversal; for example,
828 461d9094 2023-07-19 stsp <b class="Sy">:head:-2</b> denotes the HEAD reference's 2nd
829 461d9094 2023-07-19 stsp generation ancestor, and <b class="Sy">:base:+4</b> denotes the 4th
830 461d9094 2023-07-19 stsp generation descendant of the work tree's base commit. Similarly,
831 461d9094 2023-07-19 stsp <a class="permalink" href="#bar:+3"><b class="Sy">bar:+3</b></a>
832 461d9094 2023-07-19 stsp will denote the 3rd generation descendant of the commit resolved by
833 461d9094 2023-07-19 stsp the "bar" reference. A ":+" or ":-"
834 461d9094 2023-07-19 stsp modifier without a trailing integer has an implicit "1"
835 461d9094 2023-07-19 stsp appended (e.g., <b class="Sy">:base:+</b> is equivalent to
836 461d9094 2023-07-19 stsp <b class="Sy">:base:+1</b>).</p>
838 47f19dd5 2023-01-17 stsp <dt id="d~2"><a class="permalink" href="#d~2"><code class="Fl">-d</code></a></dt>
839 47f19dd5 2023-01-17 stsp <dd>Display diffstat of changes introduced in each commit. Cannot be used
840 a8f7f066 2023-08-29 stsp with the <code class="Fl">-s</code> option. Implies the
841 a8f7f066 2023-08-29 stsp <code class="Fl">-P</code> option (diffstat displays a list of changed
842 a8f7f066 2023-08-29 stsp paths).</dd>
843 2dbbbc3a 2020-07-23 stsp <dt id="l~3"><a class="permalink" href="#l~3"><code class="Fl">-l</code></a>
844 8797b228 2019-08-04 stsp <var class="Ar">N</var></dt>
845 91b3da3f 2019-08-18 stsp <dd>Limit history traversal to a given number of commits. If this option
846 91b3da3f 2019-08-18 stsp is not specified, a default limit value of zero is used, which is
847 91b3da3f 2019-08-18 stsp treated as an unbounded limit. The
848 91b3da3f 2019-08-18 stsp <code class="Ev">GOT_LOG_DEFAULT_LIMIT</code> environment variable may
849 91b3da3f 2019-08-18 stsp be set to change this default value.</dd>
850 2dbbbc3a 2020-07-23 stsp <dt id="P"><a class="permalink" href="#P"><code class="Fl">-P</code></a></dt>
851 ec51d4a3 2020-05-05 stsp <dd>Display the list of file paths changed in each commit, using the
852 ec51d4a3 2020-05-05 stsp following status codes:
853 ec51d4a3 2020-05-05 stsp <table class="Bl-column">
856 ec51d4a3 2020-05-05 stsp <td>modified file</td>
860 ec51d4a3 2020-05-05 stsp <td>file was deleted</td>
864 ec51d4a3 2020-05-05 stsp <td>new file was added</td>
868 ec51d4a3 2020-05-05 stsp <td>modified file modes (executable bit only)</td>
871 a701a2ae 2022-06-17 stsp <p class="Pp">Cannot be used with the <code class="Fl">-s</code>
872 a701a2ae 2022-06-17 stsp option.</p>
874 63657f42 2022-09-07 stsp <dt id="p~2"><a class="permalink" href="#p~2"><code class="Fl">-p</code></a></dt>
875 63657f42 2022-09-07 stsp <dd>Display the patch of modifications made in each commit. If a
876 63657f42 2022-09-07 stsp <var class="Ar">path</var> is specified, only show the patch of
877 63657f42 2022-09-07 stsp modifications at or within this path. Cannot be used with the
878 63657f42 2022-09-07 stsp <code class="Fl">-s</code> option.</dd>
879 63657f42 2022-09-07 stsp <dt id="R~3"><a class="permalink" href="#R~3"><code class="Fl">-R</code></a></dt>
880 63657f42 2022-09-07 stsp <dd>Determine a set of commits to display as usual, but display these
881 63657f42 2022-09-07 stsp commits in reverse order.</dd>
882 63657f42 2022-09-07 stsp <dt id="r~3"><a class="permalink" href="#r~3"><code class="Fl">-r</code></a>
883 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var></dt>
884 63657f42 2022-09-07 stsp <dd>Use the repository at the specified path. If not specified, assume the
885 63657f42 2022-09-07 stsp repository is located at or above the current working directory. If
886 63657f42 2022-09-07 stsp this directory is a <code class="Nm">got</code> work tree, use the
887 63657f42 2022-09-07 stsp repository path associated with this work tree.</dd>
888 a701a2ae 2022-06-17 stsp <dt id="S~2"><a class="permalink" href="#S~2"><code class="Fl">-S</code></a>
889 8b679b4b 2020-02-17 stsp <var class="Ar">search-pattern</var></dt>
890 a701a2ae 2022-06-17 stsp <dd>If specified, show only commits with a log message, author name,
891 b183145b 2024-08-14 op committer name, or commit ID matched by the extended regular
892 a701a2ae 2022-06-17 stsp expression <var class="Ar">search-pattern</var>. Lines in committed
893 a701a2ae 2022-06-17 stsp patches will be matched if <code class="Fl">-p</code> is specified.
894 a701a2ae 2022-06-17 stsp File paths changed by a commit will be matched if
895 a701a2ae 2022-06-17 stsp <code class="Fl">-P</code> is specified. Regular expression syntax is
896 376d4d52 2022-07-04 stsp documented in <a class="Xr" aria-label="re_format, section
897 376d4d52 2022-07-04 stsp 7">re_format(7)</a>.</dd>
898 63657f42 2022-09-07 stsp <dt id="s~2"><a class="permalink" href="#s~2"><code class="Fl">-s</code></a></dt>
899 63657f42 2022-09-07 stsp <dd>Display a short one-line summary of each commit, instead of the
900 63657f42 2022-09-07 stsp default history format. Cannot be used together with the
901 63657f42 2022-09-07 stsp <code class="Fl">-p</code> or <code class="Fl">-P</code> option.</dd>
902 bd0bf387 2024-04-23 stsp <dt id="t~2"><a class="permalink" href="#t~2"><code class="Fl">-t</code></a></dt>
903 bd0bf387 2024-04-23 stsp <dd>Display commits in topological order. This option has no effect
904 bd0bf387 2024-04-23 stsp without the <code class="Fl">-b</code> option because a linear history
905 bd0bf387 2024-04-23 stsp is sorted in topological order by definition. Topological sorting is
906 bd0bf387 2024-04-23 stsp disabled by default because the present implementation requires that
907 bd0bf387 2024-04-23 stsp commit history is fully traversed before any output can be shown.</dd>
908 2dbbbc3a 2020-07-23 stsp <dt id="x"><a class="permalink" href="#x"><code class="Fl">-x</code></a>
909 a462773e 2020-04-19 stsp <var class="Ar">commit</var></dt>
910 039953c9 2021-03-22 stsp <dd>Stop traversing commit history immediately after the specified
911 a8f7f066 2023-08-29 stsp <var class="Ar">commit</var> has been traversed. Like
912 a8f7f066 2023-08-29 stsp <code class="Fl">-c</code>, the expected <var class="Ar">commit</var>
913 b183145b 2024-08-14 op argument is a commit ID, or a reference name or a keyword which will
914 b183145b 2024-08-14 op be resolved to a commit ID. This option has no effect if the specified
915 b183145b 2024-08-14 op <var class="Ar">commit</var> is never traversed.</dd>
918 63b69821 2021-10-16 stsp <dt id="di"><a class="permalink" href="#diff"><code class="Cm" id="diff">diff</code></a>
919 47f19dd5 2023-01-17 stsp [<code class="Fl">-adPsw</code>] [<code class="Fl">-C</code>
920 63657f42 2022-09-07 stsp <var class="Ar">number</var>] [<code class="Fl">-c</code>
921 63657f42 2022-09-07 stsp <var class="Ar">commit</var>] [<code class="Fl">-r</code>
922 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var>] [<var class="Ar">object1</var>
923 63657f42 2022-09-07 stsp <var class="Ar">object2</var> | <var class="Ar">path ...</var>]</dt>
925 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
926 46043f6f 2021-11-23 stsp <code class="Cm">di</code>)</code></div>
927 46043f6f 2021-11-23 stsp When invoked within a work tree without any arguments, display all local
928 63b69821 2021-10-16 stsp changes in the work tree. If one or more <var class="Ar">path</var>
929 63b69821 2021-10-16 stsp arguments are specified, only show changes within the specified paths.
930 8797b228 2019-08-04 stsp <p class="Pp">If two arguments are provided, treat each argument as a
931 b183145b 2024-08-14 op reference, a tag name, or an object ID, and display differences between
932 b183145b 2024-08-14 op the corresponding objects. Both objects must be of the same type (blobs,
933 b183145b 2024-08-14 op trees, or commits). An abbreviated hash argument will be expanded to a
934 b183145b 2024-08-14 op full commit ID automatically, provided the abbreviation is unique. If
935 b183145b 2024-08-14 op none of these interpretations produce a valid result or if the
936 b183145b 2024-08-14 op <code class="Fl">-P</code> option is used, and if <code class="Cm">got
937 b183145b 2024-08-14 op diff</code> is running in a work tree, attempt to interpret the two
938 b183145b 2024-08-14 op arguments as paths.</p>
939 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got diff</code> are as
940 8797b228 2019-08-04 stsp follows:</p>
941 8797b228 2019-08-04 stsp <dl class="Bl-tag">
942 1b792db0 2020-12-13 stsp <dt id="a~3"><a class="permalink" href="#a~3"><code class="Fl">-a</code></a></dt>
943 1b792db0 2020-12-13 stsp <dd>Treat file contents as ASCII text even if binary data is
944 1b792db0 2020-12-13 stsp detected.</dd>
945 63657f42 2022-09-07 stsp <dt id="C~2"><a class="permalink" href="#C~2"><code class="Fl">-C</code></a>
946 63657f42 2022-09-07 stsp <var class="Ar">number</var></dt>
947 63657f42 2022-09-07 stsp <dd>Set the number of context lines shown in the diff. By default, 3 lines
948 63657f42 2022-09-07 stsp of context are shown.</dd>
949 63b69821 2021-10-16 stsp <dt id="c~4"><a class="permalink" href="#c~4"><code class="Fl">-c</code></a>
950 63b69821 2021-10-16 stsp <var class="Ar">commit</var></dt>
951 63657f42 2022-09-07 stsp <dd>Show differences between commits in the repository. This option may be
952 63657f42 2022-09-07 stsp used up to two times. When used only once, show differences between
953 63b69821 2021-10-16 stsp the specified <var class="Ar">commit</var> and its first parent
954 63b69821 2021-10-16 stsp commit. When used twice, show differences between the two specified
956 63b69821 2021-10-16 stsp <p class="Pp">If the <code class="Fl">-c</code> option is used, all
957 63b69821 2021-10-16 stsp non-option arguments will be interpreted as paths. If one or more
958 63b69821 2021-10-16 stsp such <var class="Ar">path</var> arguments are provided, only show
959 63b69821 2021-10-16 stsp differences for the specified paths.</p>
960 461d9094 2023-07-19 stsp <p class="Pp" id="baz:+8">The expected <var class="Ar">commit</var>
961 b183145b 2024-08-14 op argument is a commit ID, or a reference name or a keyword which will
962 b183145b 2024-08-14 op be resolved to a commit ID. An abbreviated hash argument will be
963 b183145b 2024-08-14 op expanded to a full commit ID automatically, provided the
964 461d9094 2023-07-19 stsp abbreviation is unique. The keywords ":base" and
965 461d9094 2023-07-19 stsp ":head" resolve to the work tree's base commit and branch
966 461d9094 2023-07-19 stsp head, respectively. The former is only valid if invoked in a work
967 461d9094 2023-07-19 stsp tree, while the latter will resolve to the tip of the work tree's
968 461d9094 2023-07-19 stsp current branch if invoked in a work tree, otherwise it will resolve
969 461d9094 2023-07-19 stsp to the repository's HEAD reference. Keywords and references may be
970 461d9094 2023-07-19 stsp appended with ":+" or ":-" modifiers and an
971 461d9094 2023-07-19 stsp optional integer N to denote the Nth descendant or antecedent,
972 461d9094 2023-07-19 stsp respectively, by first parent traversal; for example,
973 461d9094 2023-07-19 stsp <b class="Sy">:head:-2</b> denotes the HEAD reference's 2nd
974 461d9094 2023-07-19 stsp generation ancestor, and <b class="Sy">:base:+4</b> denotes the 4th
975 461d9094 2023-07-19 stsp generation descendant of the work tree's base commit. Similarly,
976 461d9094 2023-07-19 stsp <a class="permalink" href="#baz:+8"><b class="Sy">baz:+8</b></a>
977 461d9094 2023-07-19 stsp will denote the 8th generation descendant of the commit resolved by
978 461d9094 2023-07-19 stsp the "baz" reference. If an integer does not follow the
979 461d9094 2023-07-19 stsp ":+" or ":-" modifier, a "1" is
980 461d9094 2023-07-19 stsp implicitly appended (e.g., <b class="Sy">:head:-</b> is equivalent
981 461d9094 2023-07-19 stsp to <b class="Sy">:head:-1</b>).</p>
982 63b69821 2021-10-16 stsp <p class="Pp">Cannot be used together with the
983 63b69821 2021-10-16 stsp <code class="Fl">-P</code> option.</p>
985 47f19dd5 2023-01-17 stsp <dt id="d~3"><a class="permalink" href="#d~3"><code class="Fl">-d</code></a></dt>
986 47f19dd5 2023-01-17 stsp <dd>Display diffstat of changes before the actual diff by annotating each
987 47f19dd5 2023-01-17 stsp file path or blob hash being diffed with the total number of lines
988 47f19dd5 2023-01-17 stsp added and removed. A summary line will display the total number of
989 47f19dd5 2023-01-17 stsp changes across all files.</dd>
990 63657f42 2022-09-07 stsp <dt id="P~2"><a class="permalink" href="#P~2"><code class="Fl">-P</code></a></dt>
991 63657f42 2022-09-07 stsp <dd>Interpret all arguments as paths only. This option can be used to
992 63657f42 2022-09-07 stsp resolve ambiguity in cases where paths look like tag names, reference
993 63657f42 2022-09-07 stsp names, or object IDs. This option is only valid when
994 63657f42 2022-09-07 stsp <code class="Cm">got diff</code> is invoked in a work tree.</dd>
995 2dbbbc3a 2020-07-23 stsp <dt id="r~4"><a class="permalink" href="#r~4"><code class="Fl">-r</code></a>
996 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
997 8797b228 2019-08-04 stsp <dd>Use the repository at the specified path. If not specified, assume the
998 8797b228 2019-08-04 stsp repository is located at or above the current working directory. If
999 8797b228 2019-08-04 stsp this directory is a <code class="Nm">got</code> work tree, use the
1000 8797b228 2019-08-04 stsp repository path associated with this work tree.</dd>
1001 feee6923 2020-09-17 stsp <dt id="s~3"><a class="permalink" href="#s~3"><code class="Fl">-s</code></a></dt>
1002 8797b228 2019-08-04 stsp <dd>Show changes staged with <code class="Cm">got stage</code> instead of
1003 a462773e 2020-04-19 stsp showing local changes in the work tree. This option is only valid when
1004 8797b228 2019-08-04 stsp <code class="Cm">got diff</code> is invoked in a work tree.</dd>
1005 2dbbbc3a 2020-07-23 stsp <dt id="w"><a class="permalink" href="#w"><code class="Fl">-w</code></a></dt>
1006 d8e62599 2019-10-21 stsp <dd>Ignore whitespace-only changes.</dd>
1009 63b69821 2021-10-16 stsp <dt id="bl"><a class="permalink" href="#blame"><code class="Cm" id="blame">blame</code></a>
1010 8797b228 2019-08-04 stsp [<code class="Fl">-c</code> <var class="Ar">commit</var>]
1011 8797b228 2019-08-04 stsp [<code class="Fl">-r</code> <var class="Ar">repository-path</var>]
1012 8797b228 2019-08-04 stsp <var class="Ar">path</var></dt>
1014 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
1015 46043f6f 2021-11-23 stsp <code class="Cm">bl</code>)</code></div>
1016 46043f6f 2021-11-23 stsp Display line-by-line history of a file at the specified path.
1017 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got blame</code> are as
1018 8797b228 2019-08-04 stsp follows:</p>
1019 8797b228 2019-08-04 stsp <dl class="Bl-tag">
1020 63b69821 2021-10-16 stsp <dt id="c~5"><a class="permalink" href="#c~5"><code class="Fl">-c</code></a>
1021 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
1022 8797b228 2019-08-04 stsp <dd>Start traversing history at the specified
1023 b183145b 2024-08-14 op <var class="Ar">commit</var>. The expected argument is a commit ID, or
1024 b183145b 2024-08-14 op a reference name or a keyword which will be resolved to a commit ID.
1025 b183145b 2024-08-14 op An abbreviated hash argument will be expanded to a full commit ID
1026 b183145b 2024-08-14 op automatically, provided the abbreviation is unique. The keywords
1027 b183145b 2024-08-14 op ":base" and ":head" resolve to the work tree's
1028 b183145b 2024-08-14 op base commit and branch head, respectively. The former is only valid if
1029 b183145b 2024-08-14 op invoked in a work tree, while the latter will resolve to the tip of
1030 b183145b 2024-08-14 op the work tree's current branch if invoked in a work tree, otherwise it
1031 b183145b 2024-08-14 op will resolve to the repository's HEAD reference. Keywords and
1032 b183145b 2024-08-14 op references may be appended with ":+" or ":-"
1033 461d9094 2023-07-19 stsp modifiers and an optional integer N to denote the Nth descendant or
1034 461d9094 2023-07-19 stsp antecedent by first parent traversal, respectively; for example,
1035 461d9094 2023-07-19 stsp <b class="Sy">:head:-2</b> denotes the work tree branch head's 2nd
1036 461d9094 2023-07-19 stsp generation ancestor, and <b class="Sy">:base:+4</b> denotes the 4th
1037 461d9094 2023-07-19 stsp generation descendant of the work tree's base commit. Similarly,
1038 461d9094 2023-07-19 stsp <a class="permalink" href="#xyz:-5"><b class="Sy" id="xyz:-5">xyz:-5</b></a>
1039 461d9094 2023-07-19 stsp will denote the 5th generation ancestor of the commit resolved by the
1040 461d9094 2023-07-19 stsp "xyz" reference. A ":+" or ":-" modifier
1041 461d9094 2023-07-19 stsp without a trailing integer has an implicit "1" appended
1042 461d9094 2023-07-19 stsp (e.g., <b class="Sy">:base:+</b> is equivalent to
1043 461d9094 2023-07-19 stsp <b class="Sy">:base:+1</b>).</dd>
1044 2dbbbc3a 2020-07-23 stsp <dt id="r~5"><a class="permalink" href="#r~5"><code class="Fl">-r</code></a>
1045 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
1046 8797b228 2019-08-04 stsp <dd>Use the repository at the specified path. If not specified, assume the
1047 8797b228 2019-08-04 stsp repository is located at or above the current working directory. If
1048 8797b228 2019-08-04 stsp this directory is a <code class="Nm">got</code> work tree, use the
1049 8797b228 2019-08-04 stsp repository path associated with this work tree.</dd>
1052 63b69821 2021-10-16 stsp <dt id="tr"><a class="permalink" href="#tree"><code class="Cm" id="tree">tree</code></a>
1053 63657f42 2022-09-07 stsp [<code class="Fl">-iR</code>] [<code class="Fl">-c</code>
1054 63657f42 2022-09-07 stsp <var class="Ar">commit</var>] [<code class="Fl">-r</code>
1055 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var>] [<var class="Ar">path</var>]</dt>
1057 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
1058 46043f6f 2021-11-23 stsp <code class="Cm">tr</code>)</code></div>
1059 46043f6f 2021-11-23 stsp Display a listing of files and directories at the specified directory path
1060 8797b228 2019-08-04 stsp in the repository. Entries shown in this listing may carry one of the
1061 8797b228 2019-08-04 stsp following trailing annotations:
1062 8797b228 2019-08-04 stsp <table class="Bl-column">
1064 e8022e04 2019-08-13 stsp <td>@</td>
1065 e8022e04 2019-08-13 stsp <td>entry is a symbolic link</td>
1068 8797b228 2019-08-04 stsp <td>/</td>
1069 8797b228 2019-08-04 stsp <td>entry is a directory</td>
1072 8797b228 2019-08-04 stsp <td>*</td>
1073 8797b228 2019-08-04 stsp <td>entry is an executable file</td>
1076 ba0a4168 2019-08-26 stsp <td>$</td>
1077 ba0a4168 2019-08-26 stsp <td>entry is a Git submodule</td>
1080 2dbbbc3a 2020-07-23 stsp <p class="Pp">Symbolic link entries are also annotated with the target path
1081 2dbbbc3a 2020-07-23 stsp of the link.</p>
1082 8797b228 2019-08-04 stsp <p class="Pp">If no <var class="Ar">path</var> is specified, list the
1083 8797b228 2019-08-04 stsp repository path corresponding to the current directory of the work tree,
1084 8797b228 2019-08-04 stsp or the root directory of the repository if there is no work tree.</p>
1085 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got tree</code> are as
1086 8797b228 2019-08-04 stsp follows:</p>
1087 8797b228 2019-08-04 stsp <dl class="Bl-tag">
1088 63b69821 2021-10-16 stsp <dt id="c~6"><a class="permalink" href="#c~6"><code class="Fl">-c</code></a>
1089 8797b228 2019-08-04 stsp <var class="Ar">commit</var></dt>
1090 8797b228 2019-08-04 stsp <dd>List files and directories as they appear in the specified
1091 461d9094 2023-07-19 stsp <var class="Ar">commit</var>.
1092 b183145b 2024-08-14 op <p class="Pp" id="spam:-3">The expected argument is a commit ID, or a
1093 b183145b 2024-08-14 op reference name or a keyword which will be resolved to a commit ID.
1094 b183145b 2024-08-14 op An abbreviated hash argument will be expanded to a full commit ID
1095 b183145b 2024-08-14 op automatically, provided the abbreviation is unique. The keywords
1096 b183145b 2024-08-14 op ":base" and ":head" resolve to the work tree's
1097 b183145b 2024-08-14 op base commit and branch head, respectively. The former is only valid
1098 b183145b 2024-08-14 op if invoked in a work tree, while the latter will resolve to the tip
1099 b183145b 2024-08-14 op of the work tree's current branch if invoked in a work tree,
1100 461d9094 2023-07-19 stsp otherwise it will resolve to the repository's HEAD reference.
1101 461d9094 2023-07-19 stsp Keywords and references may be appended with ":+" or
1102 461d9094 2023-07-19 stsp ":-" modifiers and an optional integer N to denote the Nth
1103 461d9094 2023-07-19 stsp descendant or antecedent by first parent traversal, respectively;
1104 461d9094 2023-07-19 stsp for example, <b class="Sy">:head:-2</b> denotes the work tree branch
1105 461d9094 2023-07-19 stsp head's 2nd generation ancestor, and <b class="Sy">:base:+4</b>
1106 461d9094 2023-07-19 stsp denotes the 4th generation descendant of the work tree's base
1107 461d9094 2023-07-19 stsp commit. Similarly,
1108 461d9094 2023-07-19 stsp <a class="permalink" href="#spam:-3"><b class="Sy">spam:-3</b></a>
1109 461d9094 2023-07-19 stsp will denote the 3rd generation ancestor of the commit resolved by
1110 461d9094 2023-07-19 stsp the "spam" reference. A ":+" or ":-"
1111 461d9094 2023-07-19 stsp modifier without a trailing integer has an implicit "1"
1112 461d9094 2023-07-19 stsp appended (e.g., <b class="Sy">:base:+</b> is equivalent to
1113 461d9094 2023-07-19 stsp <b class="Sy">:base:+1</b>).</p>
1115 63657f42 2022-09-07 stsp <dt id="i"><a class="permalink" href="#i"><code class="Fl">-i</code></a></dt>
1116 63657f42 2022-09-07 stsp <dd>Show object IDs of files (blob objects) and directories (tree
1117 63657f42 2022-09-07 stsp objects).</dd>
1118 63657f42 2022-09-07 stsp <dt id="R~4"><a class="permalink" href="#R~4"><code class="Fl">-R</code></a></dt>
1119 63657f42 2022-09-07 stsp <dd>Recurse into sub-directories in the repository.</dd>
1120 2dbbbc3a 2020-07-23 stsp <dt id="r~6"><a class="permalink" href="#r~6"><code class="Fl">-r</code></a>
1121 8797b228 2019-08-04 stsp <var class="Ar">repository-path</var></dt>
1122 8797b228 2019-08-04 stsp <dd>Use the repository at the specified path. If not specified, assume the
1123 8797b228 2019-08-04 stsp repository is located at or above the current working directory. If
1124 8797b228 2019-08-04 stsp this directory is a <code class="Nm">got</code> work tree, use the
1125 8797b228 2019-08-04 stsp repository path associated with this work tree.</dd>
1128 2dbbbc3a 2020-07-23 stsp <dt id="ref"><a class="permalink" href="#ref"><code class="Cm">ref</code></a>
1129 63657f42 2022-09-07 stsp [<code class="Fl">-dlt</code>] [<code class="Fl">-c</code>
1130 63657f42 2022-09-07 stsp <var class="Ar">object</var>] [<code class="Fl">-r</code>
1131 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var>] [<code class="Fl">-s</code>
1132 63657f42 2022-09-07 stsp <var class="Ar">reference</var>] [<var class="Ar">name</var>]</dt>
1133 8797b228 2019-08-04 stsp <dd>Manage references in a repository.
1134 b213cbf7 2020-03-23 stsp <p class="Pp">References may be listed, created, deleted, and changed. When
1135 b213cbf7 2020-03-23 stsp creating, deleting, or changing a reference the specified
1136 b213cbf7 2020-03-23 stsp <var class="Ar">name</var> must be an absolute reference name, i.e. it
1137 b213cbf7 2020-03-23 stsp must begin with “refs/”.</p>
1138 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got ref</code> are as
1139 8797b228 2019-08-04 stsp follows:</p>
1140 8797b228 2019-08-04 stsp <dl class="Bl-tag">
1141 63b69821 2021-10-16 stsp <dt id="c~7"><a class="permalink" href="#c~7"><code class="Fl">-c</code></a>
1142 b213cbf7 2020-03-23 stsp <var class="Ar">object</var></dt>
1143 b213cbf7 2020-03-23 stsp <dd>Create a reference or change an existing reference. The reference with
1144 b213cbf7 2020-03-23 stsp the specified <var class="Ar">name</var> will point at the specified
1145 461d9094 2023-07-19 stsp <var class="Ar">object</var>.
1146 461d9094 2023-07-19 stsp <p class="Pp" id="tagged:-3">The expected <var class="Ar">object</var>
1147 b183145b 2024-08-14 op argument is an object ID or an existing reference or tag name or a
1148 b183145b 2024-08-14 op keyword which will be resolved to the ID of a corresponding commit,
1149 b183145b 2024-08-14 op tree, tag, or blob object. An abbreviated hash argument will be
1150 b183145b 2024-08-14 op expanded to a full commit ID automatically, provided the
1151 461d9094 2023-07-19 stsp abbreviation is unique. The keywords ":base" and
1152 461d9094 2023-07-19 stsp ":head" resolve to the work tree's base commit and branch
1153 461d9094 2023-07-19 stsp head, respectively. The former is only valid if invoked in a work
1154 461d9094 2023-07-19 stsp tree, while the latter will resolve to the tip of the work tree's
1155 461d9094 2023-07-19 stsp current branch if invoked in a work tree, otherwise it will resolve
1156 461d9094 2023-07-19 stsp to the repository's HEAD reference. Keywords and reference names may
1157 461d9094 2023-07-19 stsp be appended with ":+" or ":-" modifiers and an
1158 461d9094 2023-07-19 stsp optional integer N to denote the Nth descendant or antecedent by
1159 461d9094 2023-07-19 stsp first parent traversal, respectively; for example,
1160 461d9094 2023-07-19 stsp <b class="Sy">:head:-2</b> denotes the work tree branch head's 2nd
1161 461d9094 2023-07-19 stsp generation ancestor, and
1162 461d9094 2023-07-19 stsp <a class="permalink" href="#tagged:-3"><b class="Sy">tagged:-3</b></a>
1163 461d9094 2023-07-19 stsp will denote the 3rd generation ancestor of the commit resolved by
1164 461d9094 2023-07-19 stsp the "tagged" reference. If an integer does not follow the
1165 461d9094 2023-07-19 stsp ":+" or ":-" modifier, a "1" is
1166 461d9094 2023-07-19 stsp implicitly appended (e.g., <b class="Sy">:head:-</b> is equivalent
1167 461d9094 2023-07-19 stsp to <b class="Sy">:head:-1</b>).</p>
1168 461d9094 2023-07-19 stsp <p class="Pp">Cannot be used together with any other options except
1169 461d9094 2023-07-19 stsp <code class="Fl">-r</code>.</p>
1171 47f19dd5 2023-01-17 stsp <dt id="d~4"><a class="permalink" href="#d~4"><code class="Fl">-d</code></a></dt>
1172 63657f42 2022-09-07 stsp <dd>Delete the reference with the specified <var class="Ar">name</var>
1173 63657f42 2022-09-07 stsp from the repository. Any commit, tree, tag, and blob objects belonging
1174 63657f42 2022-09-07 stsp to deleted references remain in the repository and may be removed
1175 63657f42 2022-09-07 stsp separately with Git's garbage collector or <code class="Cm">gotadmin
1176 63657f42 2022-09-07 stsp cleanup</code>. Cannot be used together with any other options except
1177 63657f42 2022-09-07 stsp <code class="Fl">-r</code>.</dd>
1178 63657f42 2022-09-07 stsp <dt id="l~4"><a class="permalink" href="#l~4"><code class="Fl">-l</code></a></dt>
1179 63657f42 2022-09-07 stsp <dd>List references in the repository. If no <var class="Ar">name</var> is
1180 63657f42 2022-09-07 stsp specified, list all existing references in the repository. If
1181 63657f42 2022-09-07 stsp <var class="Ar">name</var> is a reference namespace, list all
1182 63657f42 2022-09-07 stsp references in this namespace. Otherwise, show only the reference with
1183 63657f42 2022-09-07 stsp the given <var class="Ar">name</var>. Cannot be used together with any
1184 63657f42 2022-09-07 stsp other options except <code class="Fl">-r</code> and
1185 63657f42 2022-09-07 stsp <code class="Fl">-t</code>.</dd>
1186 63657f42 2022-09-07 stsp <dt id="r~7"><a class="permalink" href="#r~7"><code class="Fl">-r</code></a>
1187 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var></dt>
1188 63657f42 2022-09-07 stsp <dd>Use the repository at the specified path. If not specified, assume the
1189 63657f42 2022-09-07 stsp repository is located at or above the current working directory. If
1190 63657f42 2022-09-07 stsp this directory is a <code class="Nm">got</code> work tree, use the
1191 63657f42 2022-09-07 stsp repository path associated with this work tree.</dd>
1192 feee6923 2020-09-17 stsp <dt id="s~4"><a class="permalink" href="#s~4"><code class="Fl">-s</code></a>
1193 b213cbf7 2020-03-23 stsp <var class="Ar">reference</var></dt>
1194 b213cbf7 2020-03-23 stsp <dd>Create a symbolic reference, or change an existing symbolic reference.
1195 b213cbf7 2020-03-23 stsp The symbolic reference with the specified <var class="Ar">name</var>
1196 b213cbf7 2020-03-23 stsp will point at the specified <var class="Ar">reference</var> which must
1197 b213cbf7 2020-03-23 stsp already exist in the repository. Care should be taken not to create
1198 b213cbf7 2020-03-23 stsp loops between references when this option is used. Cannot be used
1199 b213cbf7 2020-03-23 stsp together with any other options except
1200 b213cbf7 2020-03-23 stsp <code class="Fl">-r</code>.</dd>
1201 bd0bf387 2024-04-23 stsp <dt id="t~3"><a class="permalink" href="#t~3"><code class="Fl">-t</code></a></dt>
1202 63657f42 2022-09-07 stsp <dd>Sort listed references by modification time (most recently modified
1203 63657f42 2022-09-07 stsp first) instead of sorting by lexicographical order. Use of this option
1204 63657f42 2022-09-07 stsp requires the <code class="Fl">-l</code> option to be used as
1205 63657f42 2022-09-07 stsp well.</dd>
1208 63b69821 2021-10-16 stsp <dt id="br"><a class="permalink" href="#branch"><code class="Cm" id="branch">branch</code></a>
1209 63657f42 2022-09-07 stsp [<code class="Fl">-lnt</code>] [<code class="Fl">-c</code>
1210 63657f42 2022-09-07 stsp <var class="Ar">commit</var>] [<code class="Fl">-d</code>
1211 63657f42 2022-09-07 stsp <var class="Ar">name</var>] [<code class="Fl">-r</code>
1212 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var>] [<var class="Ar">name</var>]</dt>
1214 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
1215 46043f6f 2021-11-23 stsp <code class="Cm">br</code>)</code></div>
1216 46043f6f 2021-11-23 stsp Create, list, or delete branches.
1217 039953c9 2021-03-22 stsp <p class="Pp">Local branches are managed via references which live in the
1218 8797b228 2019-08-04 stsp “refs/heads/” reference namespace. The
1219 def5be4a 2021-08-31 stsp <code class="Cm">got branch</code> command creates references in this
1220 def5be4a 2021-08-31 stsp namespace only.</p>
1221 b078d5c4 2022-03-23 stsp <p class="Pp">When deleting branches, the specified
1222 def5be4a 2021-08-31 stsp <var class="Ar">name</var> is searched in the “refs/heads”
1223 b078d5c4 2022-03-23 stsp reference namespace first. If no corresponding branch is found, the
1224 def5be4a 2021-08-31 stsp “refs/remotes” namespace will be searched next.</p>
1225 2b499410 2019-10-06 stsp <p class="Pp">If invoked in a work tree without any arguments, print the
1226 7c3b4ab8 2020-02-25 stsp name of the work tree's current branch.</p>
1227 7c3b4ab8 2020-02-25 stsp <p class="Pp">If a <var class="Ar">name</var> argument is passed, attempt to
1228 7c3b4ab8 2020-02-25 stsp create a branch reference with the given name. By default the new branch
1229 7c3b4ab8 2020-02-25 stsp reference will point at the latest commit on the work tree's current
1230 7c3b4ab8 2020-02-25 stsp branch if invoked in a work tree, and otherwise to a commit resolved via
1231 7c3b4ab8 2020-02-25 stsp the repository's HEAD reference.</p>
1232 7c3b4ab8 2020-02-25 stsp <p class="Pp">If invoked in a work tree, once the branch was created
1233 7c3b4ab8 2020-02-25 stsp successfully switch the work tree's head reference to the newly created
1234 7c3b4ab8 2020-02-25 stsp branch and update files across the entire work tree, just like
1235 7c3b4ab8 2020-02-25 stsp <code class="Cm">got update -b</code> <var class="Ar">name</var> would
1236 7c3b4ab8 2020-02-25 stsp do. Show the status of each affected file, using the following status
1237 7c3b4ab8 2020-02-25 stsp codes:</p>
1238 7c3b4ab8 2020-02-25 stsp <table class="Bl-column">
1240 7c3b4ab8 2020-02-25 stsp <td>U</td>
1241 7c3b4ab8 2020-02-25 stsp <td>file was updated and contained no local changes</td>
1244 7c3b4ab8 2020-02-25 stsp <td>G</td>
1245 7c3b4ab8 2020-02-25 stsp <td>file was updated and local changes were merged cleanly</td>
1248 7c3b4ab8 2020-02-25 stsp <td>C</td>
1249 7c3b4ab8 2020-02-25 stsp <td>file was updated and conflicts occurred during merge</td>
1252 7c3b4ab8 2020-02-25 stsp <td>D</td>
1253 7c3b4ab8 2020-02-25 stsp <td>file was deleted</td>
1256 7c3b4ab8 2020-02-25 stsp <td>A</td>
1257 7c3b4ab8 2020-02-25 stsp <td>new file was added</td>
1260 7c3b4ab8 2020-02-25 stsp <td>~</td>
1261 7c3b4ab8 2020-02-25 stsp <td>versioned file is obstructed by a non-regular file</td>
1264 7c3b4ab8 2020-02-25 stsp <td>!</td>
1265 7c3b4ab8 2020-02-25 stsp <td>a missing versioned file was restored</td>
1268 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got branch</code> are as
1269 8797b228 2019-08-04 stsp follows:</p>
1270 8797b228 2019-08-04 stsp <dl class="Bl-tag">
1271 63b69821 2021-10-16 stsp <dt id="c~8"><a class="permalink" href="#c~8"><code class="Fl">-c</code></a>
1272 cc85973b 2019-11-27 stsp <var class="Ar">commit</var></dt>
1273 cc85973b 2019-11-27 stsp <dd>Make a newly created branch reference point at the specified
1274 b183145b 2024-08-14 op <var class="Ar">commit</var>. The expected argument is a commit ID, or
1275 b183145b 2024-08-14 op a reference name or keyword which will be resolved to a commit ID. An
1276 b183145b 2024-08-14 op abbreviated hash argument will be expanded to a full commit ID
1277 b183145b 2024-08-14 op automatically, provided the abbreviation is unique. The keywords
1278 b183145b 2024-08-14 op ":base" and ":head" resolve to the work tree's
1279 b183145b 2024-08-14 op base commit and branch head, respectively. The former is only valid if
1280 b183145b 2024-08-14 op invoked in a work tree, while the latter will resolve to the tip of
1281 b183145b 2024-08-14 op the work tree's current branch if invoked in a work tree, otherwise it
1282 b183145b 2024-08-14 op will resolve to the repository's HEAD reference. Keywords and
1283 b183145b 2024-08-14 op references may be appended with ":+" or ":-"
1284 461d9094 2023-07-19 stsp modifiers and an optional integer N to denote the Nth descendant or
1285 461d9094 2023-07-19 stsp antecedent by first parent traversal, respectively; for example,
1286 461d9094 2023-07-19 stsp <b class="Sy">:head:-2</b> denotes the work tree branch head's 2nd
1287 461d9094 2023-07-19 stsp generation ancestor, and <b class="Sy">:base:+4</b> denotes the 4th
1288 461d9094 2023-07-19 stsp generation descendant of the work tree's base commit. Similarly,
1289 461d9094 2023-07-19 stsp <a class="permalink" href="#foobar:+3"><b class="Sy" id="foobar:+3">foobar:+3</b></a>
1290 461d9094 2023-07-19 stsp will denote the 3rd generation descendant of the commit resolved by
1291 461d9094 2023-07-19 stsp the "foobar" reference. A ":+" or ":-"
1292 461d9094 2023-07-19 stsp modifier without a trailing integer has an implicit "1"
1293 461d9094 2023-07-19 stsp appended (e.g., <b class="Sy">:base:+</b> is equivalent to
1294 461d9094 2023-07-19 stsp <b class="Sy">:base:+1</b>).</dd>
1295 47f19dd5 2023-01-17 stsp <dt id="d~5"><a class="permalink" href="#d~5"><code class="Fl">-d</code></a>
1296 63657f42 2022-09-07 stsp <var class="Ar">name</var></dt>
1297 63657f42 2022-09-07 stsp <dd>Delete the branch with the specified <var class="Ar">name</var> from
1298 63657f42 2022-09-07 stsp the “refs/heads” or “refs/remotes”
1299 63657f42 2022-09-07 stsp reference namespace.
1300 63657f42 2022-09-07 stsp <p class="Pp">Only the branch reference is deleted. Any commit, tree,
1301 63657f42 2022-09-07 stsp and blob objects belonging to the branch remain in the repository
1302 63657f42 2022-09-07 stsp and may be removed separately with Git's garbage collector or
1303 63657f42 2022-09-07 stsp <code class="Cm">gotadmin cleanup</code>.</p>
1305 2dbbbc3a 2020-07-23 stsp <dt id="l~5"><a class="permalink" href="#l~5"><code class="Fl">-l</code></a></dt>
1306 039953c9 2021-03-22 stsp <dd>List all existing branches in the repository, including copies of
1307 039953c9 2021-03-22 stsp remote repositories' branches in the “refs/remotes/”
1308 039953c9 2021-03-22 stsp reference namespace.
1309 039953c9 2021-03-22 stsp <p class="Pp">If invoked in a work tree, the work tree's current branch
1310 461d9094 2023-07-19 stsp is shown with one of the following annotations:</p>
1311 8797b228 2019-08-04 stsp <table class="Bl-column">
1313 8797b228 2019-08-04 stsp <td>*</td>
1314 a8f7f066 2023-08-29 stsp <td>work tree's base commit and the base commit of all tracked files
1315 a8f7f066 2023-08-29 stsp matches the branch tip</td>
1318 8797b228 2019-08-04 stsp <td>~</td>
1319 a8f7f066 2023-08-29 stsp <td>work tree comprises mixed commits or its base commit is
1320 a8f7f066 2023-08-29 stsp out-of-date</td>
1324 63657f42 2022-09-07 stsp <dt id="n"><a class="permalink" href="#n"><code class="Fl">-n</code></a></dt>
1325 63657f42 2022-09-07 stsp <dd>Do not switch and update the work tree after creating a new
1326 63657f42 2022-09-07 stsp branch.</dd>
1327 63657f42 2022-09-07 stsp <dt id="r~8"><a class="permalink" href="#r~8"><code class="Fl">-r</code></a>
1328 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var></dt>
1329 63657f42 2022-09-07 stsp <dd>Use the repository at the specified path. If not specified, assume the
1330 63657f42 2022-09-07 stsp repository is located at or above the current working directory. If
1331 63657f42 2022-09-07 stsp this directory is a <code class="Nm">got</code> work tree, use the
1332 63657f42 2022-09-07 stsp repository path associated with this work tree.</dd>
1333 bd0bf387 2024-04-23 stsp <dt id="t~4"><a class="permalink" href="#t~4"><code class="Fl">-t</code></a></dt>
1334 46043f6f 2021-11-23 stsp <dd>Sort listed branches by modification time (most recently modified
1335 46043f6f 2021-11-23 stsp first) instead of sorting by lexicographical order. Branches in the
1336 46043f6f 2021-11-23 stsp “refs/heads/” reference namespace are listed before
1337 46043f6f 2021-11-23 stsp branches in “refs/remotes/” regardless. Use of this
1338 46043f6f 2021-11-23 stsp option requires the <code class="Fl">-l</code> option to be used as
1339 46043f6f 2021-11-23 stsp well.</dd>
1342 2dbbbc3a 2020-07-23 stsp <dt id="tag"><a class="permalink" href="#tag"><code class="Cm">tag</code></a>
1343 63657f42 2022-09-07 stsp [<code class="Fl">-lVv</code>] [<code class="Fl">-c</code>
1344 63657f42 2022-09-07 stsp <var class="Ar">commit</var>] [<code class="Fl">-m</code>
1345 63657f42 2022-09-07 stsp <var class="Ar">message</var>] [<code class="Fl">-r</code>
1346 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var>] [<code class="Fl">-s</code>
1347 63657f42 2022-09-07 stsp <var class="Ar">signer-id</var>] <var class="Ar">name</var></dt>
1348 f447d26b 2019-08-23 stsp <dd>Manage tags in a repository.
1349 f447d26b 2019-08-23 stsp <p class="Pp">Tags are managed via references which live in the
1350 f447d26b 2019-08-23 stsp “refs/tags/” reference namespace. The <code class="Cm">got
1351 f447d26b 2019-08-23 stsp tag</code> command operates on references in this namespace only.
1352 f447d26b 2019-08-23 stsp References in this namespace point at tag objects which contain a
1353 f447d26b 2019-08-23 stsp pointer to another object, a tag message, as well as author and
1354 f447d26b 2019-08-23 stsp timestamp information.</p>
1355 7c3b4ab8 2020-02-25 stsp <p class="Pp">Attempt to create a tag with the given
1356 7c3b4ab8 2020-02-25 stsp <var class="Ar">name</var>, and make this tag point at the given
1357 7c3b4ab8 2020-02-25 stsp <var class="Ar">commit</var>. If no commit is specified, default to the
1358 7c3b4ab8 2020-02-25 stsp latest commit on the work tree's current branch if invoked in a work
1359 7c3b4ab8 2020-02-25 stsp tree, and to a commit resolved via the repository's HEAD reference
1360 7c3b4ab8 2020-02-25 stsp otherwise.</p>
1361 f447d26b 2019-08-23 stsp <p class="Pp">The options for <code class="Cm">got tag</code> are as
1362 f447d26b 2019-08-23 stsp follows:</p>
1363 f447d26b 2019-08-23 stsp <dl class="Bl-tag">
1364 63b69821 2021-10-16 stsp <dt id="c~9"><a class="permalink" href="#c~9"><code class="Fl">-c</code></a>
1365 7c3b4ab8 2020-02-25 stsp <var class="Ar">commit</var></dt>
1366 7c3b4ab8 2020-02-25 stsp <dd>Make the newly created tag reference point at the specified
1367 7c3b4ab8 2020-02-25 stsp <var class="Ar">commit</var>. The expected
1368 b183145b 2024-08-14 op <var class="Ar">commit</var> argument is a commit ID, or a reference
1369 b183145b 2024-08-14 op or keyword which will be resolved to a commit ID. An abbreviated hash
1370 b183145b 2024-08-14 op argument will be expanded to a full commit ID automatically, provided
1371 b183145b 2024-08-14 op the abbreviation is unique. The keywords ":base" and
1372 b183145b 2024-08-14 op ":head" resolve to the work tree's base commit and branch
1373 b183145b 2024-08-14 op head, respectively. The former is only valid if invoked in a work
1374 b183145b 2024-08-14 op tree, while the latter will resolve to the tip of the work tree's
1375 b183145b 2024-08-14 op current branch if invoked in a work tree, otherwise it will resolve to
1376 b183145b 2024-08-14 op the repository's HEAD reference. Keywords and references may be
1377 b183145b 2024-08-14 op appended with ":+" or ":-" modifiers and an
1378 b183145b 2024-08-14 op optional integer N to denote the Nth descendant or antecedent by first
1379 b183145b 2024-08-14 op parent traversal, respectively; for example,
1380 461d9094 2023-07-19 stsp <b class="Sy">:head:-2</b> denotes the work tree branch head's 2nd
1381 461d9094 2023-07-19 stsp generation ancestor, and <b class="Sy">:base:+4</b> denotes the 4th
1382 461d9094 2023-07-19 stsp generation descendant of the work tree's base commit. Similarly,
1383 461d9094 2023-07-19 stsp <a class="permalink" href="#eggs:-3"><b class="Sy" id="eggs:-3">eggs:-3</b></a>
1384 461d9094 2023-07-19 stsp will denote the 3rd generation ancestor of the commit resolved by the
1385 461d9094 2023-07-19 stsp "eggs" reference. A ":+" or ":-"
1386 461d9094 2023-07-19 stsp modifier without a trailing integer has an implicit "1"
1387 461d9094 2023-07-19 stsp appended (e.g., <b class="Sy">:base:+</b> is equivalent to
1388 461d9094 2023-07-19 stsp <b class="Sy">:base:+1</b>).</dd>
1389 63657f42 2022-09-07 stsp <dt id="l~6"><a class="permalink" href="#l~6"><code class="Fl">-l</code></a></dt>
1390 63657f42 2022-09-07 stsp <dd>List all existing tags in the repository instead of creating a new
1391 63657f42 2022-09-07 stsp tag. If a <var class="Ar">name</var> argument is passed, show only the
1392 63657f42 2022-09-07 stsp tag with the given <var class="Ar">name</var>.</dd>
1393 2dbbbc3a 2020-07-23 stsp <dt id="m~3"><a class="permalink" href="#m~3"><code class="Fl">-m</code></a>
1394 f447d26b 2019-08-23 stsp <var class="Ar">message</var></dt>
1395 7c3b4ab8 2020-02-25 stsp <dd>Use the specified tag message when creating the new tag. Without the
1396 cc85973b 2019-11-27 stsp <code class="Fl">-m</code> option, <code class="Cm">got tag</code>
1397 f447d26b 2019-08-23 stsp opens a temporary file in an editor where a tag message can be
1398 461d9094 2023-07-19 stsp written. Quitting the editor without saving the file will abort the
1399 461d9094 2023-07-19 stsp tag operation.</dd>
1400 2dbbbc3a 2020-07-23 stsp <dt id="r~9"><a class="permalink" href="#r~9"><code class="Fl">-r</code></a>
1401 f447d26b 2019-08-23 stsp <var class="Ar">repository-path</var></dt>
1402 f447d26b 2019-08-23 stsp <dd>Use the repository at the specified path. If not specified, assume the
1403 f447d26b 2019-08-23 stsp repository is located at or above the current working directory. If
1404 f447d26b 2019-08-23 stsp this directory is a <code class="Nm">got</code> work tree, use the
1405 f447d26b 2019-08-23 stsp repository path associated with this work tree.</dd>
1406 376d4d52 2022-07-04 stsp <dt id="s~5"><a class="permalink" href="#s~5"><code class="Fl">-s</code></a>
1407 376d4d52 2022-07-04 stsp <var class="Ar">signer-id</var></dt>
1408 376d4d52 2022-07-04 stsp <dd>While creating a new tag, sign this tag with the identity given in
1409 376d4d52 2022-07-04 stsp <var class="Ar">signer-id</var>.
1410 376d4d52 2022-07-04 stsp <p class="Pp">For SSH-based signatures, <var class="Ar">signer-id</var>
1411 376d4d52 2022-07-04 stsp is the path to a file which may refer to either a private SSH key,
1412 376d4d52 2022-07-04 stsp or a public SSH key with the private half available via
1413 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="ssh-agent, section 1">ssh-agent(1)</a>.
1414 376d4d52 2022-07-04 stsp <code class="Cm">got tag</code> will sign the tag object by invoking
1415 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="ssh-keygen, section 1">ssh-keygen(1)</a>
1416 63657f42 2022-09-07 stsp with the <code class="Fl">-Y</code> <code class="Cm">sign</code>
1417 376d4d52 2022-07-04 stsp command, using the signature namespace “git” for
1418 376d4d52 2022-07-04 stsp compatibility with <a class="Xr" aria-label="git, section
1419 376d4d52 2022-07-04 stsp 1">git(1)</a>.</p>
1421 376d4d52 2022-07-04 stsp <dt id="V~2"><a class="permalink" href="#V~2"><code class="Fl">-V</code></a></dt>
1422 376d4d52 2022-07-04 stsp <dd>Verify tag object signatures. If a <var class="Ar">name</var> is
1423 376d4d52 2022-07-04 stsp specified, show and verify the tag object with the provided name.
1424 376d4d52 2022-07-04 stsp Otherwise, list all tag objects and verify signatures where present.
1425 376d4d52 2022-07-04 stsp <p class="Pp"><code class="Cm">got tag</code> verifies SSH-based
1426 376d4d52 2022-07-04 stsp signatures by invoking <a class="Xr" aria-label="ssh-keygen, section
1427 376d4d52 2022-07-04 stsp 1">ssh-keygen(1)</a> with the options <code class="Fl">-Y</code>
1428 63657f42 2022-09-07 stsp <code class="Cm">verify</code> <code class="Fl">-f</code>
1429 376d4d52 2022-07-04 stsp <var class="Ar">allowed_signers</var>. A path to the
1430 376d4d52 2022-07-04 stsp <var class="Ar">allowed_signers</var> file must be set in
1431 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a>,
1432 376d4d52 2022-07-04 stsp otherwise verification is impossible.</p>
1434 63657f42 2022-09-07 stsp <dt id="v~3"><a class="permalink" href="#v~3"><code class="Fl">-v</code></a></dt>
1435 63657f42 2022-09-07 stsp <dd>Verbose mode. During SSH signature creation and verification this
1436 63657f42 2022-09-07 stsp option will be passed to <a class="Xr" aria-label="ssh-keygen, section
1437 63657f42 2022-09-07 stsp 1">ssh-keygen(1)</a>. Multiple -v options increase the verbosity. The
1438 63657f42 2022-09-07 stsp maximum is 3.</dd>
1440 f447d26b 2019-08-23 stsp <p class="Pp">By design, the <code class="Cm">got tag</code> command will
1441 f447d26b 2019-08-23 stsp not delete tags or change existing tags. If a tag must be deleted, the
1442 f447d26b 2019-08-23 stsp <code class="Cm">got ref</code> command may be used to delete a tag's
1443 f447d26b 2019-08-23 stsp reference. This should only be done if the tag has not already been
1444 f447d26b 2019-08-23 stsp copied to another repository.</p>
1446 2dbbbc3a 2020-07-23 stsp <dt id="add"><a class="permalink" href="#add"><code class="Cm">add</code></a>
1447 63657f42 2022-09-07 stsp [<code class="Fl">-IR</code>] <var class="Ar">path ...</var></dt>
1448 8797b228 2019-08-04 stsp <dd>Schedule unversioned files in a work tree for addition to the repository
1449 16cd1323 2021-07-26 stsp in the next commit. By default, files which match a <code class="Cm">got
1450 16cd1323 2021-07-26 stsp status</code> ignore pattern will not be added.
1451 41ae98c9 2023-06-23 stsp <p class="Pp">If a <var class="Ar">path</var> mentioned in the command line
1452 41ae98c9 2023-06-23 stsp is not an unversioned file then <code class="Cm">got add</code> may
1453 41ae98c9 2023-06-23 stsp raise an error. To avoid unnecessary errors from paths picked up by file
1454 41ae98c9 2023-06-23 stsp globbing patterns in the shell, paths in the argument list will be
1455 41ae98c9 2023-06-23 stsp silently ignored if they are not reported by <code class="Cm">got
1456 41ae98c9 2023-06-23 stsp status</code> at all, or if they are reported with one of the following
1457 41ae98c9 2023-06-23 stsp status codes and do not have changes staged via <code class="Cm">got
1458 41ae98c9 2023-06-23 stsp stage</code>:</p>
1459 41ae98c9 2023-06-23 stsp <table class="Bl-column">
1461 41ae98c9 2023-06-23 stsp <td>M</td>
1462 41ae98c9 2023-06-23 stsp <td>modified file</td>
1465 41ae98c9 2023-06-23 stsp <td>A</td>
1466 41ae98c9 2023-06-23 stsp <td>file scheduled for addition in next commit</td>
1469 41ae98c9 2023-06-23 stsp <td>C</td>
1470 41ae98c9 2023-06-23 stsp <td>modified or added file which contains merge conflicts</td>
1473 41ae98c9 2023-06-23 stsp <td>m</td>
1474 41ae98c9 2023-06-23 stsp <td>modified file modes (executable bit only)</td>
1477 cc85973b 2019-11-27 stsp <p class="Pp">The options for <code class="Cm">got add</code> are as
1478 cc85973b 2019-11-27 stsp follows:</p>
1479 cc85973b 2019-11-27 stsp <dl class="Bl-tag">
1480 63657f42 2022-09-07 stsp <dt id="I~3"><a class="permalink" href="#I~3"><code class="Fl">-I</code></a></dt>
1481 63657f42 2022-09-07 stsp <dd>Add files even if they match a <code class="Cm">got status</code>
1482 63657f42 2022-09-07 stsp ignore pattern.</dd>
1483 2dbbbc3a 2020-07-23 stsp <dt id="R~5"><a class="permalink" href="#R~5"><code class="Fl">-R</code></a></dt>
1484 cc85973b 2019-11-27 stsp <dd>Permit recursion into directories. If this option is not specified,
1485 cc85973b 2019-11-27 stsp <code class="Cm">got add</code> will refuse to run if a specified
1486 cc85973b 2019-11-27 stsp <var class="Ar">path</var> is a directory.</dd>
1489 63b69821 2021-10-16 stsp <dt id="rm"><a class="permalink" href="#remove"><code class="Cm" id="remove">remove</code></a>
1490 63657f42 2022-09-07 stsp [<code class="Fl">-fkR</code>] [<code class="Fl">-s</code>
1491 feee6923 2020-09-17 stsp <var class="Ar">status-codes</var>] <var class="Ar">path ...</var></dt>
1493 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
1494 46043f6f 2021-11-23 stsp <code class="Cm">rm</code>)</code></div>
1495 46043f6f 2021-11-23 stsp Remove versioned files from a work tree and schedule them for deletion from
1496 46043f6f 2021-11-23 stsp the repository in the next commit.
1497 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got remove</code> are as
1498 8797b228 2019-08-04 stsp follows:</p>
1499 8797b228 2019-08-04 stsp <dl class="Bl-tag">
1500 2dbbbc3a 2020-07-23 stsp <dt id="f"><a class="permalink" href="#f"><code class="Fl">-f</code></a></dt>
1501 b078d5c4 2022-03-23 stsp <dd>Perform the operation even if a file contains local modifications, and
1502 b078d5c4 2022-03-23 stsp do not raise an error if a specified <var class="Ar">path</var> does
1503 b078d5c4 2022-03-23 stsp not exist on disk.</dd>
1504 2dbbbc3a 2020-07-23 stsp <dt id="k"><a class="permalink" href="#k"><code class="Fl">-k</code></a></dt>
1505 8b679b4b 2020-02-17 stsp <dd>Keep affected files on disk.</dd>
1506 2dbbbc3a 2020-07-23 stsp <dt id="R~6"><a class="permalink" href="#R~6"><code class="Fl">-R</code></a></dt>
1507 8b679b4b 2020-02-17 stsp <dd>Permit recursion into directories. If this option is not specified,
1508 8b679b4b 2020-02-17 stsp <code class="Cm">got remove</code> will refuse to run if a specified
1509 8b679b4b 2020-02-17 stsp <var class="Ar">path</var> is a directory.</dd>
1510 376d4d52 2022-07-04 stsp <dt id="s~6"><a class="permalink" href="#s~6"><code class="Fl">-s</code></a>
1511 feee6923 2020-09-17 stsp <var class="Ar">status-codes</var></dt>
1512 feee6923 2020-09-17 stsp <dd>Only delete files with a modification status matching one of the
1513 feee6923 2020-09-17 stsp single-character status codes contained in the
1514 feee6923 2020-09-17 stsp <var class="Ar">status-codes</var> argument. The following status
1515 feee6923 2020-09-17 stsp codes may be specified:
1516 feee6923 2020-09-17 stsp <table class="Bl-column">
1518 feee6923 2020-09-17 stsp <td>M</td>
1519 feee6923 2020-09-17 stsp <td>modified file (this implies the <code class="Fl">-f</code>
1520 feee6923 2020-09-17 stsp option)</td>
1523 feee6923 2020-09-17 stsp <td>!</td>
1524 feee6923 2020-09-17 stsp <td>versioned file expected on disk but missing</td>
1530 b078d5c4 2022-03-23 stsp <dt id="pa"><a class="permalink" href="#patch"><code class="Cm" id="patch">patch</code></a>
1531 63657f42 2022-09-07 stsp [<code class="Fl">-nR</code>] [<code class="Fl">-c</code>
1532 63657f42 2022-09-07 stsp <var class="Ar">commit</var>] [<code class="Fl">-p</code>
1533 63657f42 2022-09-07 stsp <var class="Ar">strip-count</var>] [<var class="Ar">patchfile</var>]</dt>
1535 b078d5c4 2022-03-23 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
1536 b078d5c4 2022-03-23 stsp <code class="Cm">pa</code>)</code></div>
1537 b078d5c4 2022-03-23 stsp Apply changes from <var class="Ar">patchfile</var> to files in a work tree.
1538 b078d5c4 2022-03-23 stsp Files added or removed by a patch will be scheduled for addition or
1539 b078d5c4 2022-03-23 stsp removal in the work tree.
1540 b078d5c4 2022-03-23 stsp <p class="Pp">The patch must be in the unified diff format as produced by
1541 376d4d52 2022-07-04 stsp <code class="Cm">got diff</code>, <a class="Xr" aria-label="git-diff,
1542 376d4d52 2022-07-04 stsp section 1">git-diff(1)</a>, or by <a class="Xr" aria-label="diff,
1543 376d4d52 2022-07-04 stsp section 1">diff(1)</a> and <a class="Xr" aria-label="cvs, section
1544 376d4d52 2022-07-04 stsp 1">cvs(1)</a> diff when invoked with their <code class="Fl">-u</code>
1545 376d4d52 2022-07-04 stsp options. If no <var class="Ar">patchfile</var> argument is provided,
1546 376d4d52 2022-07-04 stsp read unified diff data from standard input instead.</p>
1547 b078d5c4 2022-03-23 stsp <p class="Pp">If the <var class="Ar">patchfile</var> contains multiple
1548 b078d5c4 2022-03-23 stsp patches, then attempt to apply each of them in sequence.</p>
1549 b078d5c4 2022-03-23 stsp <p class="Pp">Show the status of each affected file, using the following
1550 b078d5c4 2022-03-23 stsp status codes:</p>
1551 b078d5c4 2022-03-23 stsp <table class="Bl-column">
1553 b078d5c4 2022-03-23 stsp <td>M</td>
1554 b078d5c4 2022-03-23 stsp <td>file was modified</td>
1557 376d4d52 2022-07-04 stsp <td>G</td>
1558 376d4d52 2022-07-04 stsp <td>file was merged using a merge-base found in the repository</td>
1561 376d4d52 2022-07-04 stsp <td>C</td>
1562 376d4d52 2022-07-04 stsp <td>file was merged and conflicts occurred during merge</td>
1565 b078d5c4 2022-03-23 stsp <td>D</td>
1566 b078d5c4 2022-03-23 stsp <td>file was deleted</td>
1569 b078d5c4 2022-03-23 stsp <td>A</td>
1570 b078d5c4 2022-03-23 stsp <td>file was added</td>
1573 b078d5c4 2022-03-23 stsp <td>#</td>
1574 b078d5c4 2022-03-23 stsp <td>failed to patch the file</td>
1577 b078d5c4 2022-03-23 stsp <p class="Pp">If a change does not match at its exact line number, attempt
1578 b078d5c4 2022-03-23 stsp to apply it somewhere else in the file if a good spot can be found.
1579 b078d5c4 2022-03-23 stsp Otherwise, the patch will fail to apply.</p>
1580 b078d5c4 2022-03-23 stsp <p class="Pp"><code class="Nm">got</code> <code class="Cm">patch</code> will
1581 b078d5c4 2022-03-23 stsp refuse to apply a patch if certain preconditions are not met. Files to
1582 b078d5c4 2022-03-23 stsp be deleted must already be under version control, and must not have been
1583 b078d5c4 2022-03-23 stsp scheduled for deletion already. Files to be added must not yet be under
1584 b078d5c4 2022-03-23 stsp version control and must not already be present on disk. Files to be
1585 b078d5c4 2022-03-23 stsp modified must already be under version control and may not contain
1586 b078d5c4 2022-03-23 stsp conflict markers.</p>
1587 b078d5c4 2022-03-23 stsp <p class="Pp">If an error occurs, the <code class="Cm">patch</code>
1588 b078d5c4 2022-03-23 stsp operation will be aborted. Any changes made to the work tree up to this
1589 b078d5c4 2022-03-23 stsp point will be left behind. Such changes can be viewed with
1590 b078d5c4 2022-03-23 stsp <code class="Cm">got diff</code> and can be reverted with
1591 b078d5c4 2022-03-23 stsp <code class="Cm">got revert</code> if needed.</p>
1592 b078d5c4 2022-03-23 stsp <p class="Pp">The options for <code class="Cm">got patch</code> are as
1593 b078d5c4 2022-03-23 stsp follows:</p>
1594 b078d5c4 2022-03-23 stsp <dl class="Bl-tag">
1595 63657f42 2022-09-07 stsp <dt id="c~10"><a class="permalink" href="#c~10"><code class="Fl">-c</code></a>
1596 63657f42 2022-09-07 stsp <var class="Ar">commit</var></dt>
1597 63657f42 2022-09-07 stsp <dd>Attempt to locate files within the specified
1598 63657f42 2022-09-07 stsp <var class="Ar">commit</var> for use as a merge-base for 3-way merges.
1599 63657f42 2022-09-07 stsp <p class="Pp">If the <code class="Fl">-c</code> option is not used then
1600 63657f42 2022-09-07 stsp <code class="Cm">got patch</code> will attempt to locate merge-bases
1601 63657f42 2022-09-07 stsp via object IDs found in <var class="Ar">patchfile</var> meta-data,
1602 63657f42 2022-09-07 stsp such as produced by <code class="Cm">got diff</code> or
1603 63657f42 2022-09-07 stsp <a class="Xr" aria-label="git-diff, section 1">git-diff(1)</a>. Use
1604 63657f42 2022-09-07 stsp of the <code class="Fl">-c</code> option is only recommended in the
1605 63657f42 2022-09-07 stsp absence of such meta-data.</p>
1606 461d9094 2023-07-19 stsp <p class="Pp">Ideally, the specified <var class="Ar">commit</var> should
1607 461d9094 2023-07-19 stsp contain versions of files which the changes contained in the
1608 461d9094 2023-07-19 stsp <var class="Ar">patchfile</var> were based on. Files will be located
1609 461d9094 2023-07-19 stsp by path, relative to the repository root. If the
1610 461d9094 2023-07-19 stsp <code class="Fl">-p</code> option is used then leading path
1611 461d9094 2023-07-19 stsp components will be stripped before paths are looked up in the
1612 461d9094 2023-07-19 stsp repository.</p>
1613 63657f42 2022-09-07 stsp <p class="Pp">In case no merge-base is available for a file, changes
1614 63657f42 2022-09-07 stsp will be applied without doing a 3-way merge. Changes which do not
1615 63657f42 2022-09-07 stsp apply cleanly may then be rejected entirely, rather than producing
1616 63657f42 2022-09-07 stsp merge conflicts in the patched target file.</p>
1617 461d9094 2023-07-19 stsp <p class="Pp" id="flan:+3">The expected <var class="Ar">commit</var>
1618 b183145b 2024-08-14 op argument is a commit ID, or a reference name or a keyword which will
1619 b183145b 2024-08-14 op be resolved to a commit ID. An abbreviated hash argument will be
1620 b183145b 2024-08-14 op expanded to a full commit ID automatically, provided the
1621 461d9094 2023-07-19 stsp abbreviation is unique. The keywords ":base" and
1622 461d9094 2023-07-19 stsp ":head" resolve to the work tree's base commit and branch
1623 461d9094 2023-07-19 stsp head, respectively. Keywords and references may be appended with
1624 461d9094 2023-07-19 stsp ":+" or ":-" modifiers and an optional integer N
1625 461d9094 2023-07-19 stsp to denote the Nth descendant or antecedent by first parent
1626 461d9094 2023-07-19 stsp traversal, respectively; for example, <b class="Sy">:head:-2</b>
1627 461d9094 2023-07-19 stsp denotes the work tree branch head's 2nd generation ancestor, and
1628 461d9094 2023-07-19 stsp <b class="Sy">:base:+4</b> denotes the 4th generation descendant of
1629 461d9094 2023-07-19 stsp the work tree's base commit. Similarly,
1630 461d9094 2023-07-19 stsp <a class="permalink" href="#flan:+3"><b class="Sy">flan:+3</b></a>
1631 461d9094 2023-07-19 stsp will denote the 3rd generation descendant of the commit resolved by
1632 461d9094 2023-07-19 stsp the "flan" reference. A ":+" or ":-"
1633 461d9094 2023-07-19 stsp modifier without a trailing integer has an implicit "1"
1634 461d9094 2023-07-19 stsp appended (e.g., <b class="Sy">:base:+</b> is equivalent to
1635 461d9094 2023-07-19 stsp <b class="Sy">:base:+1</b>).</p>
1637 b078d5c4 2022-03-23 stsp <dt id="n~2"><a class="permalink" href="#n~2"><code class="Fl">-n</code></a></dt>
1638 b078d5c4 2022-03-23 stsp <dd>Do not make any modifications to the work tree. This can be used to
1639 b078d5c4 2022-03-23 stsp check whether a patch would apply without issues. If the
1640 b078d5c4 2022-03-23 stsp <var class="Ar">patchfile</var> contains diffs that affect the same
1641 b078d5c4 2022-03-23 stsp file multiple times, the results displayed may be incorrect.</dd>
1642 15ba8349 2022-04-24 stsp <dt id="p~3"><a class="permalink" href="#p~3"><code class="Fl">-p</code></a>
1643 15ba8349 2022-04-24 stsp <var class="Ar">strip-count</var></dt>
1644 15ba8349 2022-04-24 stsp <dd>Specify the number of leading path components to strip from paths
1645 15ba8349 2022-04-24 stsp parsed from <var class="Ar">patchfile</var>. If the
1646 15ba8349 2022-04-24 stsp <code class="Fl">-p</code> option is not used, ‘a/’ and
1647 15ba8349 2022-04-24 stsp ‘b/’ path prefixes generated by
1648 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="git-diff, section 1">git-diff(1)</a> will be
1649 376d4d52 2022-07-04 stsp recognized and stripped automatically.</dd>
1650 15ba8349 2022-04-24 stsp <dt id="R~7"><a class="permalink" href="#R~7"><code class="Fl">-R</code></a></dt>
1651 15ba8349 2022-04-24 stsp <dd>Reverse the patch before applying it.</dd>
1654 63b69821 2021-10-16 stsp <dt id="rv"><a class="permalink" href="#revert"><code class="Cm" id="revert">revert</code></a>
1655 63657f42 2022-09-07 stsp [<code class="Fl">-pR</code>] [<code class="Fl">-F</code>
1656 63657f42 2022-09-07 stsp <var class="Ar">response-script</var>] <var class="Ar">path ...</var></dt>
1658 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
1659 46043f6f 2021-11-23 stsp <code class="Cm">rv</code>)</code></div>
1660 46043f6f 2021-11-23 stsp Revert any local changes in files at the specified paths in a work tree.
1661 a462773e 2020-04-19 stsp File contents will be overwritten with those contained in the work tree's
1662 a462773e 2020-04-19 stsp base commit. There is no way to bring discarded changes back after
1663 8797b228 2019-08-04 stsp <code class="Cm">got revert</code>!
1664 b078d5c4 2022-03-23 stsp <p class="Pp">If a file was added with <code class="Cm">got add</code>, it
1665 8797b228 2019-08-04 stsp will become an unversioned file again. If a file was deleted with
1666 b078d5c4 2022-03-23 stsp <code class="Cm">got remove</code>, it will be restored.</p>
1667 7da3b7f6 2019-08-08 stsp <p class="Pp">The options for <code class="Cm">got revert</code> are as
1668 7da3b7f6 2019-08-08 stsp follows:</p>
1669 7da3b7f6 2019-08-08 stsp <dl class="Bl-tag">
1670 63657f42 2022-09-07 stsp <dt id="F"><a class="permalink" href="#F"><code class="Fl">-F</code></a>
1671 63657f42 2022-09-07 stsp <var class="Ar">response-script</var></dt>
1672 63657f42 2022-09-07 stsp <dd>With the <code class="Fl">-p</code> option, read “y”,
1673 63657f42 2022-09-07 stsp “n”, and “q” responses line-by-line from
1674 63657f42 2022-09-07 stsp the specified <var class="Ar">response-script</var> file instead of
1675 63657f42 2022-09-07 stsp prompting interactively.</dd>
1676 15ba8349 2022-04-24 stsp <dt id="p~4"><a class="permalink" href="#p~4"><code class="Fl">-p</code></a></dt>
1677 7da3b7f6 2019-08-08 stsp <dd>Instead of reverting all changes in files, interactively select or
1678 7da3b7f6 2019-08-08 stsp reject changes to revert based on “y” (revert change),
1679 7da3b7f6 2019-08-08 stsp “n” (keep change), and “q” (quit reverting
1680 7da3b7f6 2019-08-08 stsp this file) responses. If a file is in modified status, individual
1681 7da3b7f6 2019-08-08 stsp patches derived from the modified file content can be reverted. Files
1682 7da3b7f6 2019-08-08 stsp in added or deleted status may only be reverted in their
1683 7da3b7f6 2019-08-08 stsp entirety.</dd>
1684 15ba8349 2022-04-24 stsp <dt id="R~8"><a class="permalink" href="#R~8"><code class="Fl">-R</code></a></dt>
1685 7da3b7f6 2019-08-08 stsp <dd>Permit recursion into directories. If this option is not specified,
1686 7da3b7f6 2019-08-08 stsp <code class="Cm">got revert</code> will refuse to run if a specified
1687 7da3b7f6 2019-08-08 stsp <var class="Ar">path</var> is a directory.</dd>
1690 63b69821 2021-10-16 stsp <dt id="ci"><a class="permalink" href="#commit"><code class="Cm" id="commit">commit</code></a>
1691 f6a6fa94 2023-02-22 stsp [<code class="Fl">-CNnS</code>] [<code class="Fl">-A</code>
1692 63657f42 2022-09-07 stsp <var class="Ar">author</var>] [<code class="Fl">-F</code>
1693 63657f42 2022-09-07 stsp <var class="Ar">path</var>] [<code class="Fl">-m</code>
1694 63657f42 2022-09-07 stsp <var class="Ar">message</var>] [<var class="Ar">path ...</var>]</dt>
1696 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
1697 46043f6f 2021-11-23 stsp <code class="Cm">ci</code>)</code></div>
1698 46043f6f 2021-11-23 stsp Create a new commit in the repository from changes in a work tree and use
1699 8797b228 2019-08-04 stsp this commit as the new base commit for the work tree. If no
1700 8797b228 2019-08-04 stsp <var class="Ar">path</var> is specified, commit all changes in the work
1701 8797b228 2019-08-04 stsp tree. Otherwise, commit changes at or within the specified paths.
1702 8797b228 2019-08-04 stsp <p class="Pp">If changes have been explicitly staged for commit with
1703 4967d3c2 2019-08-12 stsp <code class="Cm">got stage</code>, only commit staged changes and reject
1704 8797b228 2019-08-04 stsp any specified paths which have not been staged.</p>
1705 039953c9 2021-03-22 stsp <p class="Pp"><code class="Cm">got commit</code> opens a temporary file in
1706 039953c9 2021-03-22 stsp an editor where a log message can be written unless the
1707 039953c9 2021-03-22 stsp <code class="Fl">-m</code> option is used or the
1708 039953c9 2021-03-22 stsp <code class="Fl">-F</code> and <code class="Fl">-N</code> options are
1709 461d9094 2023-07-19 stsp used together. Quitting the editor without saving the file will abort
1710 461d9094 2023-07-19 stsp the commit operation.</p>
1711 8797b228 2019-08-04 stsp <p class="Pp">Show the status of each affected file, using the following
1712 8797b228 2019-08-04 stsp status codes:</p>
1713 8797b228 2019-08-04 stsp <table class="Bl-column">
1715 8797b228 2019-08-04 stsp <td>M</td>
1716 8797b228 2019-08-04 stsp <td>modified file</td>
1719 8797b228 2019-08-04 stsp <td>D</td>
1720 8797b228 2019-08-04 stsp <td>file was deleted</td>
1723 8797b228 2019-08-04 stsp <td>A</td>
1724 8797b228 2019-08-04 stsp <td>new file was added</td>
1727 d8e62599 2019-10-21 stsp <td>m</td>
1728 d8e62599 2019-10-21 stsp <td>modified file modes (executable bit only)</td>
1731 ae520cae 2019-08-05 stsp <p class="Pp">Files which are not part of the new commit will retain their
1732 ae520cae 2019-08-05 stsp previously recorded base commit. Some <code class="Nm">got</code>
1733 ae520cae 2019-08-05 stsp commands may refuse to run while the work tree contains files from
1734 ae520cae 2019-08-05 stsp multiple base commits. The base commit of such a work tree can be made
1735 ae520cae 2019-08-05 stsp consistent by running <code class="Cm">got update</code> across the
1736 ae520cae 2019-08-05 stsp entire work tree.</p>
1737 8797b228 2019-08-04 stsp <p class="Pp">The <code class="Cm">got commit</code> command requires the
1738 c2a52be5 2019-09-08 stsp <code class="Ev">GOT_AUTHOR</code> environment variable to be set,
1739 376d4d52 2022-07-04 stsp unless an author has been configured in
1740 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
1741 376d4d52 2022-07-04 stsp <code class="Dv">user.name</code> and <code class="Dv">user.email</code>
1742 376d4d52 2022-07-04 stsp configuration settings can be obtained from the repository's
1743 376d4d52 2022-07-04 stsp <span class="Pa">.git/config</span> file or from Git's global
1744 376d4d52 2022-07-04 stsp <span class="Pa">~/.gitconfig</span> configuration file.</p>
1745 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got commit</code> are as
1746 8797b228 2019-08-04 stsp follows:</p>
1747 8797b228 2019-08-04 stsp <dl class="Bl-tag">
1748 b183145b 2024-08-14 op <dt id="A~2"><a class="permalink" href="#A~2"><code class="Fl">-A</code></a>
1749 63657f42 2022-09-07 stsp <var class="Ar">author</var></dt>
1750 63657f42 2022-09-07 stsp <dd>Set author information in the newly created commit to
1751 63657f42 2022-09-07 stsp <var class="Ar">author</var>. This is useful when committing changes
1752 f6a6fa94 2023-02-22 stsp on behalf of someone else. The <var class="Ar">author</var> argument
1753 f6a6fa94 2023-02-22 stsp must use the same format as the <code class="Ev">GOT_AUTHOR</code>
1754 f6a6fa94 2023-02-22 stsp environment variable.
1755 63657f42 2022-09-07 stsp <p class="Pp">In addition to storing author information, the newly
1756 63657f42 2022-09-07 stsp created commit object will retain “committer”
1757 63657f42 2022-09-07 stsp information which is obtained, as usual, from the
1758 63657f42 2022-09-07 stsp <code class="Ev">GOT_AUTHOR</code> environment variable, or
1759 63657f42 2022-09-07 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a>, or
1760 63657f42 2022-09-07 stsp Git configuration settings.</p>
1762 f6a6fa94 2023-02-22 stsp <dt id="C~3"><a class="permalink" href="#C~3"><code class="Fl">-C</code></a></dt>
1763 f6a6fa94 2023-02-22 stsp <dd>Allow committing files in conflicted status.
1764 f6a6fa94 2023-02-22 stsp <p class="Pp">Committing files with conflict markers should generally be
1765 f6a6fa94 2023-02-22 stsp avoided. Cases where conflict markers must be stored in the
1766 f6a6fa94 2023-02-22 stsp repository for some legitimate reason should be very rare. There are
1767 f6a6fa94 2023-02-22 stsp usually ways to avoid storing conflict markers verbatim by applying
1768 f6a6fa94 2023-02-22 stsp appropriate programming tricks.</p>
1770 039953c9 2021-03-22 stsp <dt id="F~2"><a class="permalink" href="#F~2"><code class="Fl">-F</code></a>
1771 039953c9 2021-03-22 stsp <var class="Ar">path</var></dt>
1772 039953c9 2021-03-22 stsp <dd>Use the prepared log message stored in the file found at
1773 039953c9 2021-03-22 stsp <var class="Ar">path</var> when creating the new commit.
1774 039953c9 2021-03-22 stsp <code class="Cm">got commit</code> opens a temporary file in an editor
1775 039953c9 2021-03-22 stsp where the prepared log message can be reviewed and edited further if
1776 039953c9 2021-03-22 stsp needed. Cannot be used together with the <code class="Fl">-m</code>
1777 039953c9 2021-03-22 stsp option.</dd>
1778 2dbbbc3a 2020-07-23 stsp <dt id="m~4"><a class="permalink" href="#m~4"><code class="Fl">-m</code></a>
1779 8797b228 2019-08-04 stsp <var class="Ar">message</var></dt>
1780 039953c9 2021-03-22 stsp <dd>Use the specified log message when creating the new commit. Cannot be
1781 039953c9 2021-03-22 stsp used together with the <code class="Fl">-F</code> option.</dd>
1782 039953c9 2021-03-22 stsp <dt id="N"><a class="permalink" href="#N"><code class="Fl">-N</code></a></dt>
1783 039953c9 2021-03-22 stsp <dd>This option prevents <code class="Cm">got commit</code> from opening
1784 039953c9 2021-03-22 stsp the commit message in an editor. It has no effect unless it is used
1785 039953c9 2021-03-22 stsp together with the <code class="Fl">-F</code> option and is intended
1786 039953c9 2021-03-22 stsp for non-interactive use such as scripting.</dd>
1787 fd9580e1 2022-11-03 stsp <dt id="n~3"><a class="permalink" href="#n~3"><code class="Fl">-n</code></a></dt>
1788 fd9580e1 2022-11-03 stsp <dd>This option prevents <code class="Cm">got commit</code> from
1789 fd9580e1 2022-11-03 stsp generating a diff of the to-be-committed changes in a temporary file
1790 fd9580e1 2022-11-03 stsp which can be viewed while editing a commit message.</dd>
1791 a701a2ae 2022-06-17 stsp <dt id="S~3"><a class="permalink" href="#S~3"><code class="Fl">-S</code></a></dt>
1792 1554b334 2020-08-02 stsp <dd>Allow the addition of symbolic links which point outside of the path
1793 1554b334 2020-08-02 stsp space that is under version control. By default, <code class="Cm">got
1794 1554b334 2020-08-02 stsp commit</code> will reject such symbolic links due to safety concerns.
1795 1554b334 2020-08-02 stsp As a precaution, <code class="Nm">got</code> may decide to represent
1796 1554b334 2020-08-02 stsp such a symbolic link as a regular file which contains the link's
1797 1554b334 2020-08-02 stsp target path, rather than creating an actual symbolic link which points
1798 1554b334 2020-08-02 stsp outside of the work tree. Use of this option is discouraged because
1799 1554b334 2020-08-02 stsp external mechanisms such as “make obj” are better suited
1800 1554b334 2020-08-02 stsp for managing symbolic links to paths not under version control.</dd>
1802 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got commit</code> will refuse to run if
1803 8797b228 2019-08-04 stsp certain preconditions are not met. If the work tree's current branch is
1804 8797b228 2019-08-04 stsp not in the “refs/heads/” reference namespace, new commits
1805 8797b228 2019-08-04 stsp may not be created on this branch. Local changes may only be committed
1806 8797b228 2019-08-04 stsp if they are based on file content found in the most recent commit on the
1807 8797b228 2019-08-04 stsp work tree's branch. If a path is found to be out of date,
1808 8797b228 2019-08-04 stsp <code class="Cm">got update</code> must be used first in order to merge
1809 8797b228 2019-08-04 stsp local changes with changes made in the repository.</p>
1811 63b69821 2021-10-16 stsp <dt id="se"><a class="permalink" href="#send"><code class="Cm" id="send">send</code></a>
1812 63657f42 2022-09-07 stsp [<code class="Fl">-afqTv</code>] [<code class="Fl">-b</code>
1813 def5be4a 2021-08-31 stsp <var class="Ar">branch</var>] [<code class="Fl">-d</code>
1814 63657f42 2022-09-07 stsp <var class="Ar">branch</var>] [<code class="Fl">-r</code>
1815 63657f42 2022-09-07 stsp <var class="Ar">repository-path</var>] [<code class="Fl">-t</code>
1816 63657f42 2022-09-07 stsp <var class="Ar">tag</var>] [<var class="Ar">remote-repository</var>]</dt>
1818 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
1819 46043f6f 2021-11-23 stsp <code class="Cm">se</code>)</code></div>
1820 46043f6f 2021-11-23 stsp Send new changes to a remote repository. If no
1821 def5be4a 2021-08-31 stsp <var class="Ar">remote-repository</var> is specified,
1822 def5be4a 2021-08-31 stsp “origin” will be used. The remote repository's URL is
1823 376d4d52 2022-07-04 stsp obtained from the corresponding entry in
1824 376d4d52 2022-07-04 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
1825 376d4d52 2022-07-04 stsp <span class="Pa">config</span> file of the local repository, as created by
1826 376d4d52 2022-07-04 stsp <code class="Cm">got clone</code>.
1827 def5be4a 2021-08-31 stsp <p class="Pp">All objects corresponding to new changes will be written to a
1828 def5be4a 2021-08-31 stsp temporary pack file which is then uploaded to the server. Upon success,
1829 def5be4a 2021-08-31 stsp references in the “refs/remotes/” reference namespace of
1830 def5be4a 2021-08-31 stsp the local repository will be updated to point at the commits which have
1831 def5be4a 2021-08-31 stsp been sent.</p>
1832 def5be4a 2021-08-31 stsp <p class="Pp">By default, changes will only be sent if they are based on
1833 def5be4a 2021-08-31 stsp up-to-date copies of relevant branches in the remote repository. If any
1834 def5be4a 2021-08-31 stsp changes to be sent are based on out-of-date copies or would otherwise
1835 def5be4a 2021-08-31 stsp break linear history of existing branches, new changes must be fetched
1836 def5be4a 2021-08-31 stsp from the server with <code class="Cm">got fetch</code> and local
1837 def5be4a 2021-08-31 stsp branches must be rebased with <code class="Cm">got rebase</code> before
1838 def5be4a 2021-08-31 stsp <code class="Cm">got send</code> can succeed. The
1839 def5be4a 2021-08-31 stsp <code class="Fl">-f</code> option can be used to make exceptions to
1840 def5be4a 2021-08-31 stsp these requirements.</p>
1841 def5be4a 2021-08-31 stsp <p class="Pp">The options for <code class="Cm">got send</code> are as
1842 def5be4a 2021-08-31 stsp follows:</p>
1843 def5be4a 2021-08-31 stsp <dl class="Bl-tag">
1844 def5be4a 2021-08-31 stsp <dt id="a~4"><a class="permalink" href="#a~4"><code class="Fl">-a</code></a></dt>
1845 def5be4a 2021-08-31 stsp <dd>Send all branches from the local repository's
1846 def5be4a 2021-08-31 stsp “refs/heads/” reference namespace. The
1847 def5be4a 2021-08-31 stsp <code class="Fl">-a</code> option is equivalent to listing all
1848 def5be4a 2021-08-31 stsp branches with multiple <code class="Fl">-b</code> options. Cannot be
1849 def5be4a 2021-08-31 stsp used together with the <code class="Fl">-b</code> option.</dd>
1850 56f3f26e 2024-06-03 stsp <dt id="b~8"><a class="permalink" href="#b~8"><code class="Fl">-b</code></a>
1851 def5be4a 2021-08-31 stsp <var class="Ar">branch</var></dt>
1852 def5be4a 2021-08-31 stsp <dd>Send the specified <var class="Ar">branch</var> from the local
1853 def5be4a 2021-08-31 stsp repository's “refs/heads/” reference namespace. This
1854 def5be4a 2021-08-31 stsp option may be specified multiple times to build a list of branches to
1855 def5be4a 2021-08-31 stsp send. If this option is not specified, default to the work tree's
1856 def5be4a 2021-08-31 stsp current branch if invoked in a work tree, or to the repository's HEAD
1857 def5be4a 2021-08-31 stsp reference. Cannot be used together with the <code class="Fl">-a</code>
1858 def5be4a 2021-08-31 stsp option.</dd>
1859 47f19dd5 2023-01-17 stsp <dt id="d~6"><a class="permalink" href="#d~6"><code class="Fl">-d</code></a>
1860 def5be4a 2021-08-31 stsp <var class="Ar">branch</var></dt>
1861 def5be4a 2021-08-31 stsp <dd>Delete the specified <var class="Ar">branch</var> from the remote
1862 def5be4a 2021-08-31 stsp repository's “refs/heads/” reference namespace. This
1863 def5be4a 2021-08-31 stsp option may be specified multiple times to build a list of branches to
1865 def5be4a 2021-08-31 stsp <p class="Pp">Only references are deleted. Any commit, tree, tag, and
1866 def5be4a 2021-08-31 stsp blob objects belonging to deleted branches may become subject to
1867 def5be4a 2021-08-31 stsp deletion by Git's garbage collector running on the server.</p>
1868 def5be4a 2021-08-31 stsp <p class="Pp">Requesting deletion of branches results in an error if the
1869 def5be4a 2021-08-31 stsp server does not support this feature or disallows the deletion of
1870 def5be4a 2021-08-31 stsp branches based on its configuration.</p>
1872 def5be4a 2021-08-31 stsp <dt id="f~2"><a class="permalink" href="#f~2"><code class="Fl">-f</code></a></dt>
1873 def5be4a 2021-08-31 stsp <dd>Attempt to force the server to overwrite existing branches or tags in
1874 461d9094 2023-07-19 stsp the remote repository, even when <code class="Cm">got fetch</code>
1875 461d9094 2023-07-19 stsp followed by <code class="Cm">got rebase</code> or <code class="Cm">got
1876 461d9094 2023-07-19 stsp merge</code> would usually be required before changes can be sent. The
1877 461d9094 2023-07-19 stsp server may reject forced requests regardless, depending on its
1878 461d9094 2023-07-19 stsp configuration.
1879 def5be4a 2021-08-31 stsp <p class="Pp">Any commit, tree, tag, and blob objects belonging to
1880 def5be4a 2021-08-31 stsp overwritten branches or tags may become subject to deletion by Git's
1881 def5be4a 2021-08-31 stsp garbage collector running on the server.</p>
1882 def5be4a 2021-08-31 stsp <p class="Pp">The “refs/tags” reference namespace is
1883 def5be4a 2021-08-31 stsp globally shared between all repositories. Use of the
1884 def5be4a 2021-08-31 stsp <code class="Fl">-f</code> option to overwrite tags is discouraged
1885 def5be4a 2021-08-31 stsp because it can lead to inconsistencies between the tags present in
1886 def5be4a 2021-08-31 stsp different repositories. In general, creating a new tag with a
1887 def5be4a 2021-08-31 stsp different name is recommended instead of overwriting an existing
1889 def5be4a 2021-08-31 stsp <p class="Pp">Use of the <code class="Fl">-f</code> option is
1890 def5be4a 2021-08-31 stsp particularly discouraged if changes being sent are based on an
1891 def5be4a 2021-08-31 stsp out-of-date copy of a branch in the remote repository. Instead of
1892 def5be4a 2021-08-31 stsp using the <code class="Fl">-f</code> option, new changes should be
1893 def5be4a 2021-08-31 stsp fetched with <code class="Cm">got fetch</code> and local branches
1894 461d9094 2023-07-19 stsp should be rebased with <code class="Cm">got rebase</code> or merged
1895 461d9094 2023-07-19 stsp with <code class="Cm">got merge</code>, followed by another attempt
1896 461d9094 2023-07-19 stsp to send the changes.</p>
1897 def5be4a 2021-08-31 stsp <p class="Pp">The <code class="Fl">-f</code> option should only be
1898 def5be4a 2021-08-31 stsp needed in situations where the remote repository's copy of a branch
1899 def5be4a 2021-08-31 stsp or tag is known to be out-of-date and is considered disposable. The
1900 def5be4a 2021-08-31 stsp risks of creating inconsistencies between different repositories
1901 def5be4a 2021-08-31 stsp should also be taken into account.</p>
1903 63657f42 2022-09-07 stsp <dt id="q~5"><a class="permalink" href="#q~5"><code class="Fl">-q</code></a></dt>
1904 63657f42 2022-09-07 stsp <dd>Suppress progress reporting output. The same option will be passed to
1905 63657f42 2022-09-07 stsp <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
1906 63657f42 2022-09-07 stsp applicable.</dd>
1907 def5be4a 2021-08-31 stsp <dt id="r~10"><a class="permalink" href="#r~10"><code class="Fl">-r</code></a>
1908 def5be4a 2021-08-31 stsp <var class="Ar">repository-path</var></dt>
1909 def5be4a 2021-08-31 stsp <dd>Use the repository at the specified path. If not specified, assume the
1910 def5be4a 2021-08-31 stsp repository is located at or above the current working directory. If
1911 def5be4a 2021-08-31 stsp this directory is a <code class="Nm">got</code> work tree, use the
1912 def5be4a 2021-08-31 stsp repository path associated with this work tree.</dd>
1913 63657f42 2022-09-07 stsp <dt id="T"><a class="permalink" href="#T"><code class="Fl">-T</code></a></dt>
1914 63657f42 2022-09-07 stsp <dd>Attempt to send all tags from the local repository's
1915 63657f42 2022-09-07 stsp “refs/tags/” reference namespace. The
1916 63657f42 2022-09-07 stsp <code class="Fl">-T</code> option is equivalent to listing all tags
1917 63657f42 2022-09-07 stsp with multiple <code class="Fl">-t</code> options. Cannot be used
1918 63657f42 2022-09-07 stsp together with the <code class="Fl">-t</code> option.</dd>
1919 bd0bf387 2024-04-23 stsp <dt id="t~5"><a class="permalink" href="#t~5"><code class="Fl">-t</code></a>
1920 def5be4a 2021-08-31 stsp <var class="Ar">tag</var></dt>
1921 def5be4a 2021-08-31 stsp <dd>Send the specified <var class="Ar">tag</var> from the local
1922 def5be4a 2021-08-31 stsp repository's “refs/tags/” reference namespace, in
1923 def5be4a 2021-08-31 stsp addition to any branches that are being sent. The
1924 def5be4a 2021-08-31 stsp <code class="Fl">-t</code> option may be specified multiple times to
1925 def5be4a 2021-08-31 stsp build a list of tags to send. No tags will be sent if the
1926 def5be4a 2021-08-31 stsp <code class="Fl">-t</code> option is not used.
1927 def5be4a 2021-08-31 stsp <p class="Pp">Raise an error if the specified <var class="Ar">tag</var>
1928 def5be4a 2021-08-31 stsp already exists in the remote repository, unless the
1929 def5be4a 2021-08-31 stsp <code class="Fl">-f</code> option is used to overwrite the server's
1930 def5be4a 2021-08-31 stsp copy of the tag. In general, creating a new tag with a different
1931 def5be4a 2021-08-31 stsp name is recommended instead of overwriting an existing tag.</p>
1932 def5be4a 2021-08-31 stsp <p class="Pp">Cannot be used together with the
1933 def5be4a 2021-08-31 stsp <code class="Fl">-T</code> option.</p>
1935 376d4d52 2022-07-04 stsp <dt id="v~4"><a class="permalink" href="#v~4"><code class="Fl">-v</code></a></dt>
1936 def5be4a 2021-08-31 stsp <dd>Verbose mode. Causes <code class="Cm">got send</code> to print
1937 def5be4a 2021-08-31 stsp debugging messages to standard error output. The same option will be
1938 376d4d52 2022-07-04 stsp passed to <a class="Xr" aria-label="ssh, section 1">ssh(1)</a> if
1939 376d4d52 2022-07-04 stsp applicable. Multiple -v options increase the verbosity. The maximum is
1943 63b69821 2021-10-16 stsp <dt id="cy"><a class="permalink" href="#cherrypick"><code class="Cm" id="cherrypick">cherrypick</code></a>
1944 7985a487 2023-01-30 stsp [<code class="Fl">-lX</code>] [<var class="Ar">commit</var>]</dt>
1946 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
1947 46043f6f 2021-11-23 stsp <code class="Cm">cy</code>)</code></div>
1948 46043f6f 2021-11-23 stsp Merge changes from a single <var class="Ar">commit</var> into the work tree.
1949 46043f6f 2021-11-23 stsp The specified <var class="Ar">commit</var> should be on a different branch
1950 461d9094 2023-07-19 stsp than the work tree's base commit.
1951 b183145b 2024-08-14 op <p class="Pp" id="barbaz:+3">The expected argument is a commit ID, or a
1952 b183145b 2024-08-14 op reference name or keyword which will be resolved to a commit ID. An
1953 b183145b 2024-08-14 op abbreviated hash argument will be expanded to a full commit ID
1954 461d9094 2023-07-19 stsp automatically, provided the abbreviation is unique. The keywords
1955 461d9094 2023-07-19 stsp ":base" and ":head" resolve to the work tree's base
1956 461d9094 2023-07-19 stsp commit and branch head, respectively. Keywords and references may be
1957 461d9094 2023-07-19 stsp appended with ":+" or ":-" modifiers and an optional
1958 461d9094 2023-07-19 stsp integer N to denote the Nth descendant or antecedent by first parent
1959 461d9094 2023-07-19 stsp traversal, respectively; for example, <b class="Sy">:head:-2</b> denotes
1960 461d9094 2023-07-19 stsp the work tree branch head's 2nd generation ancestor, and
1961 461d9094 2023-07-19 stsp <b class="Sy">:base:+4</b> denotes the 4th generation descendant of the
1962 461d9094 2023-07-19 stsp work tree's base commit. Similarly,
1963 461d9094 2023-07-19 stsp <a class="permalink" href="#barbaz:+3"><b class="Sy">barbaz:+3</b></a>
1964 461d9094 2023-07-19 stsp will denote the 3rd generation descendant of the commit resolved by the
1965 461d9094 2023-07-19 stsp "barbaz" reference. A ":+" or ":-"
1966 461d9094 2023-07-19 stsp modifier without a trailing integer has an implicit "1"
1967 461d9094 2023-07-19 stsp appended (e.g., <b class="Sy">:base:+</b> is equivalent to
1968 461d9094 2023-07-19 stsp <b class="Sy">:base:+1</b>).</p>
1969 8797b228 2019-08-04 stsp <p class="Pp">Show the status of each affected file, using the following
1970 8797b228 2019-08-04 stsp status codes:</p>
1971 8797b228 2019-08-04 stsp <table class="Bl-column">
1973 8797b228 2019-08-04 stsp <td>G</td>
1974 8797b228 2019-08-04 stsp <td>file was merged</td>
1977 8797b228 2019-08-04 stsp <td>C</td>
1978 8797b228 2019-08-04 stsp <td>file was merged and conflicts occurred during merge</td>
1981 8797b228 2019-08-04 stsp <td>!</td>
1982 8797b228 2019-08-04 stsp <td>changes destined for a missing file were not merged</td>
1985 8797b228 2019-08-04 stsp <td>D</td>
1986 8797b228 2019-08-04 stsp <td>file was deleted</td>
1989 8797b228 2019-08-04 stsp <td>d</td>
1990 417cb057 2021-10-03 stsp <td>file's deletion was prevented by local modifications</td>
1993 8797b228 2019-08-04 stsp <td>A</td>
1994 8797b228 2019-08-04 stsp <td>new file was added</td>
1997 8797b228 2019-08-04 stsp <td>~</td>
1998 8797b228 2019-08-04 stsp <td>changes destined for a non-regular file were not merged</td>
2001 1554b334 2020-08-02 stsp <td>?</td>
2002 1554b334 2020-08-02 stsp <td>changes destined for an unversioned file were not merged</td>
2005 8797b228 2019-08-04 stsp <p class="Pp">The merged changes will appear as local changes in the work
2006 8797b228 2019-08-04 stsp tree, which may be viewed with <code class="Cm">got diff</code>, amended
2007 91b3da3f 2019-08-18 stsp manually or with further <code class="Cm">got cherrypick</code>
2008 7985a487 2023-01-30 stsp commands, committed with <code class="Cm">got commit</code>.</p>
2009 7985a487 2023-01-30 stsp <p class="Pp">If invoked in a work tree where no
2010 7985a487 2023-01-30 stsp <code class="Cm">rebase</code>, <code class="Cm">histedit</code>, or
2011 7985a487 2023-01-30 stsp <code class="Cm">merge</code> operation is taking place,
2012 7985a487 2023-01-30 stsp <code class="Cm">got cherrypick</code> creates a record of commits which
2013 7985a487 2023-01-30 stsp have been merged into the work tree. When a file changed by
2014 7985a487 2023-01-30 stsp <code class="Cm">got cherrypick</code> is committed with
2015 7985a487 2023-01-30 stsp <code class="Cm">got commit</code>, the log messages of relevant merged
2016 f6a6fa94 2023-02-22 stsp commits will then appear in the editor, where the messages should be
2017 f6a6fa94 2023-02-22 stsp further adjusted to convey the reasons for cherrypicking the changes.
2018 f6a6fa94 2023-02-22 stsp Upon exiting the editor, if the time stamp of the log message file is
2019 f6a6fa94 2023-02-22 stsp unchanged or the log message is empty, <code class="Cm">got
2020 f6a6fa94 2023-02-22 stsp commit</code> will fail with an unmodified or empty log message
2021 f6a6fa94 2023-02-22 stsp error.</p>
2022 f6a6fa94 2023-02-22 stsp <p class="Pp">If all the changes in all files touched by a given commit are
2023 f6a6fa94 2023-02-22 stsp discarded, e.g. with <code class="Cm">got revert</code>, this commit's
2024 f6a6fa94 2023-02-22 stsp log message record will also disappear.</p>
2025 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got cherrypick</code> will refuse to run if
2026 8797b228 2019-08-04 stsp certain preconditions are not met. If the work tree contains multiple
2027 b078d5c4 2022-03-23 stsp base commits, it must first be updated to a single base commit with
2028 1e80276a 2021-09-03 stsp <code class="Cm">got update</code>. If any relevant files already
2029 1e80276a 2021-09-03 stsp contain merge conflicts, these conflicts must be resolved first.</p>
2030 7985a487 2023-01-30 stsp <p class="Pp">The options for <code class="Nm">got</code>
2031 7985a487 2023-01-30 stsp <code class="Cm">cherrypick</code> are as follows:</p>
2032 7985a487 2023-01-30 stsp <dl class="Bl-tag">
2033 7985a487 2023-01-30 stsp <dt id="l~7"><a class="permalink" href="#l~7"><code class="Fl">-l</code></a></dt>
2034 7985a487 2023-01-30 stsp <dd>Display a list of commit log messages recorded by cherrypick
2035 7985a487 2023-01-30 stsp operations, represented by references in the
2036 7985a487 2023-01-30 stsp “refs/got/worktree” reference namespace. If a
2037 7985a487 2023-01-30 stsp <var class="Ar">commit</var> is specified, only show the log message
2038 7985a487 2023-01-30 stsp of the specified commit.
2039 7985a487 2023-01-30 stsp <p class="Pp">If invoked in a work tree, only log messages recorded by
2040 7985a487 2023-01-30 stsp cherrypick operations in the current work tree will be displayed.
2041 7985a487 2023-01-30 stsp Otherwise, all commit log messages will be displayed irrespective of
2042 7985a487 2023-01-30 stsp the work tree in which they were created. This option cannot be used
2043 7985a487 2023-01-30 stsp with <code class="Fl">-X</code>.</p>
2045 7985a487 2023-01-30 stsp <dt id="X~2"><a class="permalink" href="#X~2"><code class="Fl">-X</code></a></dt>
2046 7985a487 2023-01-30 stsp <dd>Delete log messages created by previous cherrypick operations,
2047 7985a487 2023-01-30 stsp represented by references in the “refs/got/worktree”
2048 7985a487 2023-01-30 stsp reference namespace. If a <var class="Ar">commit</var> is specified,
2049 7985a487 2023-01-30 stsp only delete the log message of the specified commit.
2050 7985a487 2023-01-30 stsp <p class="Pp">If invoked in a work tree, only log messages recorded by
2051 7985a487 2023-01-30 stsp cherrypick operations in the current work tree will be deleted.
2052 7985a487 2023-01-30 stsp Otherwise, all commit log messages will be deleted irrespective of
2053 7985a487 2023-01-30 stsp the work tree in which they were created. This option cannot be used
2054 7985a487 2023-01-30 stsp with <code class="Fl">-l</code>.</p>
2057 7985a487 2023-01-30 stsp <p class="Pp"></p>
2059 63b69821 2021-10-16 stsp <dt id="bo"><a class="permalink" href="#backout"><code class="Cm" id="backout">backout</code></a>
2060 7985a487 2023-01-30 stsp [<code class="Fl">-lX</code>] [<var class="Ar">commit</var>]</dt>
2062 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
2063 46043f6f 2021-11-23 stsp <code class="Cm">bo</code>)</code></div>
2064 46043f6f 2021-11-23 stsp Reverse-merge changes from a single <var class="Ar">commit</var> into the
2065 1e80276a 2021-09-03 stsp work tree. The specified <var class="Ar">commit</var> should be on the
2066 461d9094 2023-07-19 stsp same branch as the work tree's base commit.
2067 b183145b 2024-08-14 op <p class="Pp" id="wip:+5">The expected argument is a commit ID, or a
2068 b183145b 2024-08-14 op reference name or keyword which will be resolved to a commit ID. An
2069 b183145b 2024-08-14 op abbreviated hash argument will be expanded to a full commit ID
2070 461d9094 2023-07-19 stsp automatically, provided the abbreviation is unique. The keywords
2071 461d9094 2023-07-19 stsp ":base" and ":head" resolve to the work tree's base
2072 461d9094 2023-07-19 stsp commit and branch head, respectively. Keywords and references may be
2073 461d9094 2023-07-19 stsp appended with ":+" or ":-" modifiers and an optional
2074 461d9094 2023-07-19 stsp integer N to denote the Nth descendant or antecedent by first parent
2075 461d9094 2023-07-19 stsp traversal, respectively; for example, <b class="Sy">:head:-2</b> denotes
2076 461d9094 2023-07-19 stsp the work tree branch head's 2nd generation ancestor, and
2077 461d9094 2023-07-19 stsp <b class="Sy">:base:+4</b> denotes the 4th generation descendant of the
2078 461d9094 2023-07-19 stsp work tree's base commit. Similarly,
2079 461d9094 2023-07-19 stsp <a class="permalink" href="#wip:+5"><b class="Sy">wip:+5</b></a> will
2080 461d9094 2023-07-19 stsp denote the 5th generation descendant of the commit resolved by the
2081 461d9094 2023-07-19 stsp "wip" reference. A ":+" or ":-" modifier
2082 461d9094 2023-07-19 stsp without a trailing integer has an implicit "1" appended (e.g.,
2083 461d9094 2023-07-19 stsp <b class="Sy">:base:+</b> is equivalent to
2084 461d9094 2023-07-19 stsp <b class="Sy">:base:+1</b>).</p>
2085 8797b228 2019-08-04 stsp <p class="Pp">Show the status of each affected file, using the following
2086 8797b228 2019-08-04 stsp status codes:</p>
2087 8797b228 2019-08-04 stsp <table class="Bl-column">
2089 8797b228 2019-08-04 stsp <td>G</td>
2090 8797b228 2019-08-04 stsp <td>file was merged</td>
2093 8797b228 2019-08-04 stsp <td>C</td>
2094 8797b228 2019-08-04 stsp <td>file was merged and conflicts occurred during merge</td>
2097 8797b228 2019-08-04 stsp <td>!</td>
2098 8797b228 2019-08-04 stsp <td>changes destined for a missing file were not merged</td>
2101 8797b228 2019-08-04 stsp <td>D</td>
2102 8797b228 2019-08-04 stsp <td>file was deleted</td>
2105 8797b228 2019-08-04 stsp <td>d</td>
2106 417cb057 2021-10-03 stsp <td>file's deletion was prevented by local modifications</td>
2109 8797b228 2019-08-04 stsp <td>A</td>
2110 8797b228 2019-08-04 stsp <td>new file was added</td>
2113 8797b228 2019-08-04 stsp <td>~</td>
2114 8797b228 2019-08-04 stsp <td>changes destined for a non-regular file were not merged</td>
2117 1554b334 2020-08-02 stsp <td>?</td>
2118 1554b334 2020-08-02 stsp <td>changes destined for an unversioned file were not merged</td>
2121 8797b228 2019-08-04 stsp <p class="Pp">The reverse-merged changes will appear as local changes in the
2122 8797b228 2019-08-04 stsp work tree, which may be viewed with <code class="Cm">got diff</code>,
2123 8797b228 2019-08-04 stsp amended manually or with further <code class="Cm">got backout</code>
2124 7985a487 2023-01-30 stsp commands, committed with <code class="Cm">got commit</code>.</p>
2125 7985a487 2023-01-30 stsp <p class="Pp">If invoked in a work tree where no
2126 7985a487 2023-01-30 stsp <code class="Cm">rebase</code>, <code class="Cm">histedit</code>, or
2127 7985a487 2023-01-30 stsp <code class="Cm">merge</code> operation is taking place,
2128 7985a487 2023-01-30 stsp <code class="Cm">got backout</code> creates a record of commits which
2129 7985a487 2023-01-30 stsp have been reverse-merged into the work tree. When a file changed by
2130 7985a487 2023-01-30 stsp <code class="Cm">got backout</code> is committed with
2131 7985a487 2023-01-30 stsp <code class="Cm">got commit</code>, the log messages of relevant
2132 7985a487 2023-01-30 stsp reverse-merged commits will then appear in the editor, where the
2133 f6a6fa94 2023-02-22 stsp messages should be further adjusted to convey the reasons for backing
2134 f6a6fa94 2023-02-22 stsp out the changes. Upon exiting the editor, if the time stamp of the log
2135 f6a6fa94 2023-02-22 stsp message file is unchanged or the log message is empty,
2136 f6a6fa94 2023-02-22 stsp <code class="Cm">got commit</code> will fail with an unmodified or empty
2137 f6a6fa94 2023-02-22 stsp log message error.</p>
2138 f6a6fa94 2023-02-22 stsp <p class="Pp">If all the changes in all files touched by a given commit are
2139 f6a6fa94 2023-02-22 stsp discarded, e.g. with <code class="Cm">got revert</code>, this commit's
2140 f6a6fa94 2023-02-22 stsp log message record will also disappear.</p>
2141 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got backout</code> will refuse to run if
2142 8797b228 2019-08-04 stsp certain preconditions are not met. If the work tree contains multiple
2143 b078d5c4 2022-03-23 stsp base commits, it must first be updated to a single base commit with
2144 1e80276a 2021-09-03 stsp <code class="Cm">got update</code>. If any relevant files already
2145 1e80276a 2021-09-03 stsp contain merge conflicts, these conflicts must be resolved first.</p>
2146 7985a487 2023-01-30 stsp <p class="Pp">The options for <code class="Nm">got</code>
2147 7985a487 2023-01-30 stsp <code class="Cm">backout</code> are as follows:</p>
2148 7985a487 2023-01-30 stsp <dl class="Bl-tag">
2149 7985a487 2023-01-30 stsp <dt id="l~8"><a class="permalink" href="#l~8"><code class="Fl">-l</code></a></dt>
2150 7985a487 2023-01-30 stsp <dd>Display a list of commit log messages recorded by backout operations,
2151 7985a487 2023-01-30 stsp represented by references in the “refs/got/worktree”
2152 7985a487 2023-01-30 stsp reference namespace. If a <var class="Ar">commit</var> is specified,
2153 7985a487 2023-01-30 stsp only show the log message of the specified commit.
2154 7985a487 2023-01-30 stsp <p class="Pp">If invoked in a work tree, only log messages recorded by
2155 7985a487 2023-01-30 stsp backout operations in the current work tree will be displayed.
2156 7985a487 2023-01-30 stsp Otherwise, all commit log messages will be displayed irrespective of
2157 7985a487 2023-01-30 stsp the work tree in which they were created. This option cannot be used
2158 7985a487 2023-01-30 stsp with <code class="Fl">-X</code>.</p>
2160 7985a487 2023-01-30 stsp <dt id="X~3"><a class="permalink" href="#X~3"><code class="Fl">-X</code></a></dt>
2161 7985a487 2023-01-30 stsp <dd>Delete log messages created by previous backout operations,
2162 7985a487 2023-01-30 stsp represented by references in the “refs/got/worktree”
2163 7985a487 2023-01-30 stsp reference namespace. If a <var class="Ar">commit</var> is specified,
2164 7985a487 2023-01-30 stsp only delete the log message of the specified commit.
2165 7985a487 2023-01-30 stsp <p class="Pp">If invoked in a work tree, only log messages recorded by
2166 7985a487 2023-01-30 stsp backout operations in the current work tree will be deleted.
2167 7985a487 2023-01-30 stsp Otherwise, all commit log messages will be deleted irrespective of
2168 7985a487 2023-01-30 stsp the work tree in which they were created. This option cannot be used
2169 7985a487 2023-01-30 stsp with <code class="Fl">-l</code>.</p>
2172 7985a487 2023-01-30 stsp <p class="Pp"></p>
2174 63b69821 2021-10-16 stsp <dt id="rb"><a class="permalink" href="#rebase"><code class="Cm" id="rebase">rebase</code></a>
2175 f6a6fa94 2023-02-22 stsp [<code class="Fl">-aCclX</code>] [<var class="Ar">branch</var>]</dt>
2177 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
2178 46043f6f 2021-11-23 stsp <code class="Cm">rb</code>)</code></div>
2179 46043f6f 2021-11-23 stsp Rebase commits on the specified <var class="Ar">branch</var> onto the tip of
2180 46043f6f 2021-11-23 stsp the current branch of the work tree. The <var class="Ar">branch</var> must
2181 46043f6f 2021-11-23 stsp share common ancestry with the work tree's current branch. Rebasing begins
2182 46043f6f 2021-11-23 stsp with the first descendant commit of the youngest common ancestor commit
2183 46043f6f 2021-11-23 stsp shared by the specified <var class="Ar">branch</var> and the work tree's
2184 46043f6f 2021-11-23 stsp current branch, and stops once the tip commit of the specified
2185 8797b228 2019-08-04 stsp <var class="Ar">branch</var> has been rebased.
2186 7c3b4ab8 2020-02-25 stsp <p class="Pp">When <code class="Cm">got rebase</code> is used as intended,
2187 a43c0256 2020-02-25 stsp the specified <var class="Ar">branch</var> represents a local commit
2188 a43c0256 2020-02-25 stsp history and may already contain changes that are not yet visible in any
2189 a43c0256 2020-02-25 stsp other repositories. The work tree's current branch, which must be set
2190 a43c0256 2020-02-25 stsp with <code class="Cm">got update -b</code> before starting the
2191 a43c0256 2020-02-25 stsp <code class="Cm">rebase</code> operation, represents a branch from a
2192 a43c0256 2020-02-25 stsp remote repository which shares a common history with the specified
2193 a43c0256 2020-02-25 stsp <var class="Ar">branch</var> but has progressed, and perhaps diverged,
2194 a43c0256 2020-02-25 stsp due to commits added to the remote repository.</p>
2195 8797b228 2019-08-04 stsp <p class="Pp">Rebased commits are accumulated on a temporary branch which
2196 8797b228 2019-08-04 stsp the work tree will remain switched to throughout the entire rebase
2197 8797b228 2019-08-04 stsp operation. Commits on this branch represent the same changes with the
2198 8797b228 2019-08-04 stsp same log messages as their counterparts on the original
2199 8797b228 2019-08-04 stsp <var class="Ar">branch</var>, but with different commit IDs. Once
2200 8797b228 2019-08-04 stsp rebasing has completed successfully, the temporary branch becomes the
2201 8797b228 2019-08-04 stsp new version of the specified <var class="Ar">branch</var> and the work
2202 63657f42 2022-09-07 stsp tree is automatically switched to it. If author information is available
2203 63657f42 2022-09-07 stsp via the <code class="Ev">GOT_AUTHOR</code> environment variable,
2204 63657f42 2022-09-07 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
2205 63657f42 2022-09-07 stsp <code class="Dv">user.name</code> and <code class="Dv">user.email</code>
2206 63657f42 2022-09-07 stsp configuration settings, this author information will be used to identify
2207 63657f42 2022-09-07 stsp the “committer” of rebased commits.</p>
2208 039953c9 2021-03-22 stsp <p class="Pp">Old commits in their pre-rebase state are automatically backed
2209 039953c9 2021-03-22 stsp up in the “refs/got/backup/rebase” reference namespace. As
2210 039953c9 2021-03-22 stsp long as these references are not removed older versions of rebased
2211 039953c9 2021-03-22 stsp commits will remain in the repository and can be viewed with the
2212 039953c9 2021-03-22 stsp <code class="Cm">got rebase -l</code> command. Removal of these
2213 039953c9 2021-03-22 stsp references makes objects which become unreachable via any reference
2214 16cd1323 2021-07-26 stsp subject to removal by Git's garbage collector or
2215 16cd1323 2021-07-26 stsp <code class="Cm">gotadmin cleanup</code>.</p>
2216 8797b228 2019-08-04 stsp <p class="Pp">While rebasing commits, show the status of each affected file,
2217 8797b228 2019-08-04 stsp using the following status codes:</p>
2218 8797b228 2019-08-04 stsp <table class="Bl-column">
2220 8797b228 2019-08-04 stsp <td>G</td>
2221 8797b228 2019-08-04 stsp <td>file was merged</td>
2224 8797b228 2019-08-04 stsp <td>C</td>
2225 8797b228 2019-08-04 stsp <td>file was merged and conflicts occurred during merge</td>
2228 8797b228 2019-08-04 stsp <td>!</td>
2229 8797b228 2019-08-04 stsp <td>changes destined for a missing file were not merged</td>
2232 8797b228 2019-08-04 stsp <td>D</td>
2233 8797b228 2019-08-04 stsp <td>file was deleted</td>
2236 8797b228 2019-08-04 stsp <td>d</td>
2237 417cb057 2021-10-03 stsp <td>file's deletion was prevented by local modifications</td>
2240 8797b228 2019-08-04 stsp <td>A</td>
2241 8797b228 2019-08-04 stsp <td>new file was added</td>
2244 8797b228 2019-08-04 stsp <td>~</td>
2245 8797b228 2019-08-04 stsp <td>changes destined for a non-regular file were not merged</td>
2248 1554b334 2020-08-02 stsp <td>?</td>
2249 1554b334 2020-08-02 stsp <td>changes destined for an unversioned file were not merged</td>
2252 b078d5c4 2022-03-23 stsp <p class="Pp">If merge conflicts occur, the rebase operation is interrupted
2253 417cb057 2021-10-03 stsp and may be continued once conflicts have been resolved. If any files
2254 417cb057 2021-10-03 stsp with destined changes are found to be missing or unversioned, or if
2255 417cb057 2021-10-03 stsp files could not be deleted due to differences in deleted content, the
2256 417cb057 2021-10-03 stsp rebase operation will be interrupted to prevent potentially incomplete
2257 417cb057 2021-10-03 stsp changes from being committed to the repository without user
2258 417cb057 2021-10-03 stsp intervention. The work tree may be modified as desired and the rebase
2259 417cb057 2021-10-03 stsp operation can be continued once the changes present in the work tree are
2260 417cb057 2021-10-03 stsp considered complete. Alternatively, the rebase operation may be aborted
2261 417cb057 2021-10-03 stsp which will leave <var class="Ar">branch</var> unmodified and the work
2262 417cb057 2021-10-03 stsp tree switched back to its original branch.</p>
2263 8797b228 2019-08-04 stsp <p class="Pp">If a merge conflict is resolved in a way which renders the
2264 8797b228 2019-08-04 stsp merged change into a no-op change, the corresponding commit will be
2265 8797b228 2019-08-04 stsp elided when the rebase operation continues.</p>
2266 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got rebase</code> will refuse to run if
2267 63657f42 2022-09-07 stsp certain preconditions are not met. If the <var class="Ar">branch</var>
2268 63657f42 2022-09-07 stsp is not in the “refs/heads/” reference namespace, the
2269 63657f42 2022-09-07 stsp branch may not be rebased. If the work tree is not yet fully updated to
2270 63657f42 2022-09-07 stsp the tip commit of its branch, then the work tree must first be updated
2271 63657f42 2022-09-07 stsp with <code class="Cm">got update</code>. If changes have been staged
2272 63657f42 2022-09-07 stsp with <code class="Cm">got stage</code>, these changes must first be
2273 63657f42 2022-09-07 stsp committed with <code class="Cm">got commit</code> or unstaged with
2274 8797b228 2019-08-04 stsp <code class="Cm">got unstage</code>. If the work tree contains local
2275 8797b228 2019-08-04 stsp changes, these changes must first be committed with <code class="Cm">got
2276 8797b228 2019-08-04 stsp commit</code> or reverted with <code class="Cm">got revert</code>. If
2277 8797b228 2019-08-04 stsp the <var class="Ar">branch</var> contains changes to files outside of
2278 8797b228 2019-08-04 stsp the work tree's path prefix, the work tree cannot be used to rebase this
2279 8797b228 2019-08-04 stsp branch.</p>
2280 47f19dd5 2023-01-17 stsp <p class="Pp">The <code class="Cm">got update</code>, <code class="Cm">got
2281 47f19dd5 2023-01-17 stsp integrate</code>, <code class="Cm">got merge</code>,
2282 47f19dd5 2023-01-17 stsp <code class="Cm">got commit</code>, and <code class="Cm">got
2283 47f19dd5 2023-01-17 stsp histedit</code> commands will refuse to run while a rebase operation is
2284 47f19dd5 2023-01-17 stsp in progress. Other commands which manipulate the work tree may be used
2285 47f19dd5 2023-01-17 stsp for conflict resolution purposes.</p>
2286 46043f6f 2021-11-23 stsp <p class="Pp">If the specified <var class="Ar">branch</var> is already based
2287 b078d5c4 2022-03-23 stsp on the work tree's current branch, then no commits need to be rebased
2288 b078d5c4 2022-03-23 stsp and <code class="Cm">got rebase</code> will simply switch the work tree
2289 b078d5c4 2022-03-23 stsp to the specified <var class="Ar">branch</var> and update files in the
2290 b078d5c4 2022-03-23 stsp work tree accordingly.</p>
2291 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got rebase</code> are as
2292 8797b228 2019-08-04 stsp follows:</p>
2293 8797b228 2019-08-04 stsp <dl class="Bl-tag">
2294 def5be4a 2021-08-31 stsp <dt id="a~5"><a class="permalink" href="#a~5"><code class="Fl">-a</code></a></dt>
2295 8797b228 2019-08-04 stsp <dd>Abort an interrupted rebase operation. If this option is used, no
2296 9b0c768d 2019-08-08 stsp other command-line arguments are allowed.</dd>
2297 f6a6fa94 2023-02-22 stsp <dt id="C~4"><a class="permalink" href="#C~4"><code class="Fl">-C</code></a></dt>
2298 f6a6fa94 2023-02-22 stsp <dd>Allow a rebase operation to continue with files in conflicted status.
2299 f6a6fa94 2023-02-22 stsp This option should generally be avoided, and can only be used with the
2300 f6a6fa94 2023-02-22 stsp <code class="Fl">-c</code> option.</dd>
2301 63657f42 2022-09-07 stsp <dt id="c~11"><a class="permalink" href="#c~11"><code class="Fl">-c</code></a></dt>
2302 8797b228 2019-08-04 stsp <dd>Continue an interrupted rebase operation. If this option is used, no
2303 461d9094 2023-07-19 stsp other command-line arguments are allowed except
2304 461d9094 2023-07-19 stsp <code class="Fl">-C</code>.</dd>
2305 7985a487 2023-01-30 stsp <dt id="l~9"><a class="permalink" href="#l~9"><code class="Fl">-l</code></a></dt>
2306 039953c9 2021-03-22 stsp <dd>Show a list of past rebase operations, represented by references in
2307 039953c9 2021-03-22 stsp the “refs/got/backup/rebase” reference namespace.
2308 039953c9 2021-03-22 stsp <p class="Pp">Display the author, date, and log message of each backed
2309 039953c9 2021-03-22 stsp up commit, the object ID of the corresponding post-rebase commit,
2310 039953c9 2021-03-22 stsp and the object ID of their common ancestor commit. Given these
2311 039953c9 2021-03-22 stsp object IDs, the <code class="Cm">got log</code> command with the
2312 039953c9 2021-03-22 stsp <code class="Fl">-c</code> and <code class="Fl">-x</code> options
2313 039953c9 2021-03-22 stsp can be used to examine the history of either version of the branch,
2314 039953c9 2021-03-22 stsp and the <code class="Cm">got branch</code> command with the
2315 039953c9 2021-03-22 stsp <code class="Fl">-c</code> option can be used to create a new branch
2316 039953c9 2021-03-22 stsp from a pre-rebase state if desired.</p>
2317 039953c9 2021-03-22 stsp <p class="Pp">If a <var class="Ar">branch</var> is specified, only show
2318 039953c9 2021-03-22 stsp commits which at some point in time represented this branch.
2319 039953c9 2021-03-22 stsp Otherwise, list all backed up commits for any branches.</p>
2320 039953c9 2021-03-22 stsp <p class="Pp">If this option is used, <code class="Cm">got rebase</code>
2321 039953c9 2021-03-22 stsp does not require a work tree. None of the other options can be used
2322 039953c9 2021-03-22 stsp together with <code class="Fl">-l</code>.</p>
2324 7985a487 2023-01-30 stsp <dt id="X~4"><a class="permalink" href="#X~4"><code class="Fl">-X</code></a></dt>
2325 16cd1323 2021-07-26 stsp <dd>Delete backups created by past rebase operations, represented by
2326 16cd1323 2021-07-26 stsp references in the “refs/got/backup/rebase” reference
2327 16cd1323 2021-07-26 stsp namespace.
2328 16cd1323 2021-07-26 stsp <p class="Pp">If a <var class="Ar">branch</var> is specified, only
2329 16cd1323 2021-07-26 stsp delete backups which at some point in time represented this branch.
2330 16cd1323 2021-07-26 stsp Otherwise, delete all references found within
2331 16cd1323 2021-07-26 stsp “refs/got/backup/rebase”.</p>
2332 16cd1323 2021-07-26 stsp <p class="Pp">Any commit, tree, tag, and blob objects belonging to
2333 16cd1323 2021-07-26 stsp deleted backups remain in the repository and may be removed
2334 16cd1323 2021-07-26 stsp separately with Git's garbage collector or <code class="Cm">gotadmin
2335 16cd1323 2021-07-26 stsp cleanup</code>.</p>
2336 16cd1323 2021-07-26 stsp <p class="Pp">If this option is used, <code class="Cm">got rebase</code>
2337 16cd1323 2021-07-26 stsp does not require a work tree. None of the other options can be used
2338 16cd1323 2021-07-26 stsp together with <code class="Fl">-X</code>.</p>
2342 63b69821 2021-10-16 stsp <dt id="he"><a class="permalink" href="#histedit"><code class="Cm" id="histedit">histedit</code></a>
2343 f6a6fa94 2023-02-22 stsp [<code class="Fl">-aCcdeflmX</code>] [<code class="Fl">-F</code>
2344 63657f42 2022-09-07 stsp <var class="Ar">histedit-script</var>] [<var class="Ar">branch</var>]</dt>
2346 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
2347 46043f6f 2021-11-23 stsp <code class="Cm">he</code>)</code></div>
2348 46043f6f 2021-11-23 stsp Edit commit history between the work tree's current base commit and the tip
2349 46043f6f 2021-11-23 stsp commit of the work tree's current branch.
2350 63657f42 2022-09-07 stsp <p class="Pp">The <code class="Cm">got histedit</code> command requires the
2351 63657f42 2022-09-07 stsp <code class="Ev">GOT_AUTHOR</code> environment variable to be set,
2352 63657f42 2022-09-07 stsp unless an author has been configured in
2353 63657f42 2022-09-07 stsp <a class="Xr" aria-label="got.conf, section 5">got.conf(5)</a> or Git's
2354 63657f42 2022-09-07 stsp <code class="Dv">user.name</code> and <code class="Dv">user.email</code>
2355 63657f42 2022-09-07 stsp configuration settings can be obtained from the repository's
2356 63657f42 2022-09-07 stsp <span class="Pa">.git/config</span> file or from Git's global
2357 63657f42 2022-09-07 stsp <span class="Pa">~/.gitconfig</span> configuration file.</p>
2358 b078d5c4 2022-03-23 stsp <p class="Pp">Before starting a <code class="Cm">histedit</code> operation,
2359 7c3b4ab8 2020-02-25 stsp the work tree's current branch must be set with <code class="Cm">got
2360 7c3b4ab8 2020-02-25 stsp update -b</code> to the branch which should be edited, unless this
2361 7c3b4ab8 2020-02-25 stsp branch is already the current branch of the work tree. The tip of this
2362 7c3b4ab8 2020-02-25 stsp branch represents the upper bound (inclusive) of commits touched by the
2363 7c3b4ab8 2020-02-25 stsp <code class="Cm">histedit</code> operation.</p>
2364 7c3b4ab8 2020-02-25 stsp <p class="Pp">Furthermore, the work tree's base commit must be set with
2365 7c3b4ab8 2020-02-25 stsp <code class="Cm">got update -c</code> to a point in this branch's commit
2366 7c3b4ab8 2020-02-25 stsp history where editing should begin. This commit represents the lower
2367 7c3b4ab8 2020-02-25 stsp bound (non-inclusive) of commits touched by the
2368 7c3b4ab8 2020-02-25 stsp <code class="Cm">histedit</code> operation.</p>
2369 8797b228 2019-08-04 stsp <p class="Pp">Editing of commit history is controlled via a
2370 7c3b4ab8 2020-02-25 stsp <var class="Ar">histedit script</var> which can be written in an editor
2371 7c3b4ab8 2020-02-25 stsp based on a template, passed on the command line, or generated with the
2372 297acb86 2023-03-07 stsp <code class="Fl">-d</code>, <code class="Fl">-e</code>,
2373 461d9094 2023-07-19 stsp <code class="Fl">-f</code>, or <code class="Fl">-m</code> options.
2374 461d9094 2023-07-19 stsp Quitting the editor without saving the file will abort the histedit
2375 461d9094 2023-07-19 stsp operation.</p>
2376 7c3b4ab8 2020-02-25 stsp <p class="Pp">The format of the histedit script is line-based. Each line in
2377 7c3b4ab8 2020-02-25 stsp the script begins with a command name, followed by whitespace and an
2378 b183145b 2024-08-14 op argument. For most commands, the expected argument is a commit ID. Any
2379 b183145b 2024-08-14 op remaining text on the line is ignored. Lines which begin with the
2380 b183145b 2024-08-14 op ‘#’ character are ignored entirely.</p>
2381 51683866 2022-07-14 stsp <p class="Pp">The available histedit script commands are as follows:</p>
2382 8797b228 2019-08-04 stsp <table class="Bl-column">
2383 51683866 2022-07-14 stsp <tr id="pick">
2384 51683866 2022-07-14 stsp <td><a class="permalink" href="#pick"><code class="Cm">pick</code></a>
2385 51683866 2022-07-14 stsp <var class="Ar">commit</var></td>
2386 8797b228 2019-08-04 stsp <td>Use the specified commit as it is.</td>
2388 51683866 2022-07-14 stsp <tr id="edit">
2389 51683866 2022-07-14 stsp <td><a class="permalink" href="#edit"><code class="Cm">edit</code></a>
2390 51683866 2022-07-14 stsp <var class="Ar">commit</var></td>
2391 297acb86 2023-03-07 stsp <td>Apply the changes from the specified commit, but then interrupt the
2392 297acb86 2023-03-07 stsp histedit operation for amending, without creating a commit. While the
2393 297acb86 2023-03-07 stsp histedit operation is interrupted arbitrary files may be edited, and
2394 297acb86 2023-03-07 stsp commands which manipulate the work tree can be used freely. The
2395 297acb86 2023-03-07 stsp <code class="Cm">got add</code> and <code class="Cm">got remove</code>
2396 297acb86 2023-03-07 stsp commands can be used to add new files or remove existing ones. The
2397 297acb86 2023-03-07 stsp <code class="Cm">got revert -p</code> command can be used to eliminate
2398 297acb86 2023-03-07 stsp arbitrary changes from files in the work tree. The
2399 297acb86 2023-03-07 stsp <code class="Cm">got stage -p</code> command may be used to prepare a
2400 297acb86 2023-03-07 stsp subset of changes for inclusion in the next commit. Finally, the
2401 297acb86 2023-03-07 stsp <code class="Cm">got commit</code> command can be used to insert
2402 297acb86 2023-03-07 stsp arbitrary commits into the edited history. Regular editing of history
2403 297acb86 2023-03-07 stsp must eventually be resumed by running <code class="Cm">got histedit
2404 297acb86 2023-03-07 stsp -c</code>.</td>
2406 51683866 2022-07-14 stsp <tr id="fold">
2407 51683866 2022-07-14 stsp <td><a class="permalink" href="#fold"><code class="Cm">fold</code></a>
2408 51683866 2022-07-14 stsp <var class="Ar">commit</var></td>
2409 8797b228 2019-08-04 stsp <td>Combine the specified commit with the next commit listed further
2410 8797b228 2019-08-04 stsp below that will be used.</td>
2412 51683866 2022-07-14 stsp <tr id="drop">
2413 51683866 2022-07-14 stsp <td><a class="permalink" href="#drop"><code class="Cm">drop</code></a>
2414 51683866 2022-07-14 stsp <var class="Ar">commit</var></td>
2415 8797b228 2019-08-04 stsp <td>Remove this commit from the edited history.</td>
2417 51683866 2022-07-14 stsp <tr id="mesg">
2418 51683866 2022-07-14 stsp <td><a class="permalink" href="#mesg"><code class="Cm">mesg</code></a>
2419 c8cf51c9 2023-11-29 stsp <var class="Ar">commit</var></td>
2420 c8cf51c9 2023-11-29 stsp <td>Open an editor to create a new log message for this commit.</td>
2423 8797b228 2019-08-04 stsp <p class="Pp">Every commit in the history being edited must be mentioned in
2424 8797b228 2019-08-04 stsp the script. Lines may be re-ordered to change the order of commits in
2425 ae803b74 2020-03-06 stsp the edited history. No commit may be listed more than once.</p>
2426 8797b228 2019-08-04 stsp <p class="Pp">Edited commits are accumulated on a temporary branch which the
2427 8797b228 2019-08-04 stsp work tree will remain switched to throughout the entire histedit
2428 8797b228 2019-08-04 stsp operation. Once history editing has completed successfully, the
2429 8797b228 2019-08-04 stsp temporary branch becomes the new version of the work tree's branch and
2430 8797b228 2019-08-04 stsp the work tree is automatically switched to it.</p>
2431 039953c9 2021-03-22 stsp <p class="Pp">Old commits in their pre-histedit state are automatically
2432 039953c9 2021-03-22 stsp backed up in the “refs/got/backup/histedit” reference
2433 039953c9 2021-03-22 stsp namespace. As long as these references are not removed older versions of
2434 039953c9 2021-03-22 stsp edited commits will remain in the repository and can be viewed with the
2435 039953c9 2021-03-22 stsp <code class="Cm">got histedit -l</code> command. Removal of these
2436 039953c9 2021-03-22 stsp references makes objects which become unreachable via any reference
2437 16cd1323 2021-07-26 stsp subject to removal by Git's garbage collector or
2438 16cd1323 2021-07-26 stsp <code class="Cm">gotadmin cleanup</code>.</p>
2439 8797b228 2019-08-04 stsp <p class="Pp">While merging commits, show the status of each affected file,
2440 8797b228 2019-08-04 stsp using the following status codes:</p>
2441 8797b228 2019-08-04 stsp <table class="Bl-column">
2443 8797b228 2019-08-04 stsp <td>G</td>
2444 8797b228 2019-08-04 stsp <td>file was merged</td>
2447 8797b228 2019-08-04 stsp <td>C</td>
2448 8797b228 2019-08-04 stsp <td>file was merged and conflicts occurred during merge</td>
2451 8797b228 2019-08-04 stsp <td>!</td>
2452 8797b228 2019-08-04 stsp <td>changes destined for a missing file were not merged</td>
2455 8797b228 2019-08-04 stsp <td>D</td>
2456 8797b228 2019-08-04 stsp <td>file was deleted</td>
2459 8797b228 2019-08-04 stsp <td>d</td>
2460 417cb057 2021-10-03 stsp <td>file's deletion was prevented by local modifications</td>
2463 8797b228 2019-08-04 stsp <td>A</td>
2464 8797b228 2019-08-04 stsp <td>new file was added</td>
2467 8797b228 2019-08-04 stsp <td>~</td>
2468 8797b228 2019-08-04 stsp <td>changes destined for a non-regular file were not merged</td>
2471 1554b334 2020-08-02 stsp <td>?</td>
2472 1554b334 2020-08-02 stsp <td>changes destined for an unversioned file were not merged</td>
2475 b078d5c4 2022-03-23 stsp <p class="Pp">If merge conflicts occur, the histedit operation is
2476 b078d5c4 2022-03-23 stsp interrupted and may be continued once conflicts have been resolved. If
2477 b078d5c4 2022-03-23 stsp any files with destined changes are found to be missing or unversioned,
2478 b078d5c4 2022-03-23 stsp or if files could not be deleted due to differences in deleted content,
2479 b078d5c4 2022-03-23 stsp the histedit operation will be interrupted to prevent potentially
2480 b078d5c4 2022-03-23 stsp incomplete changes from being committed to the repository without user
2481 417cb057 2021-10-03 stsp intervention. The work tree may be modified as desired and the histedit
2482 417cb057 2021-10-03 stsp operation can be continued once the changes present in the work tree are
2483 417cb057 2021-10-03 stsp considered complete. Alternatively, the histedit operation may be
2484 417cb057 2021-10-03 stsp aborted which will leave the work tree switched back to its original
2485 417cb057 2021-10-03 stsp branch.</p>
2486 8797b228 2019-08-04 stsp <p class="Pp">If a merge conflict is resolved in a way which renders the
2487 8797b228 2019-08-04 stsp merged change into a no-op change, the corresponding commit will be
2488 8797b228 2019-08-04 stsp elided when the histedit operation continues.</p>
2489 8797b228 2019-08-04 stsp <p class="Pp"><code class="Cm">got histedit</code> will refuse to run if
2490 8797b228 2019-08-04 stsp certain preconditions are not met. If the work tree's current branch is
2491 8797b228 2019-08-04 stsp not in the “refs/heads/” reference namespace, the history
2492 8797b228 2019-08-04 stsp of the branch may not be edited. If the work tree contains multiple base
2493 b078d5c4 2022-03-23 stsp commits, it must first be updated to a single base commit with
2494 8797b228 2019-08-04 stsp <code class="Cm">got update</code>. If changes have been staged with
2495 91b3da3f 2019-08-18 stsp <code class="Cm">got stage</code>, these changes must first be committed
2496 8797b228 2019-08-04 stsp with <code class="Cm">got commit</code> or unstaged with
2497 8797b228 2019-08-04 stsp <code class="Cm">got unstage</code>. If the work tree contains local
2498 8797b228 2019-08-04 stsp changes, these changes must first be committed with <code class="Cm">got
2499 8797b228 2019-08-04 stsp commit</code> or reverted with <code class="Cm">got revert</code>. If
2500 8797b228 2019-08-04 stsp the edited history contains changes to files outside of the work tree's
2501 8797b228 2019-08-04 stsp path prefix, the work tree cannot be used to edit the history of this
2502 8797b228 2019-08-04 stsp branch.</p>
2503 7c3b4ab8 2020-02-25 stsp <p class="Pp">The <code class="Cm">got update</code>, <code class="Cm">got
2504 47f19dd5 2023-01-17 stsp rebase</code>, <code class="Cm">got merge</code>, and
2505 47f19dd5 2023-01-17 stsp <code class="Cm">got integrate</code> commands will refuse to run while
2506 47f19dd5 2023-01-17 stsp a histedit operation is in progress. Other commands which manipulate the
2507 47f19dd5 2023-01-17 stsp work tree may be used, and the <code class="Cm">got commit</code>
2508 47f19dd5 2023-01-17 stsp command may be used to commit arbitrary changes to the temporary branch
2509 47f19dd5 2023-01-17 stsp while the histedit operation is interrupted.</p>
2510 8797b228 2019-08-04 stsp <p class="Pp">The options for <code class="Cm">got histedit</code> are as
2511 8797b228 2019-08-04 stsp follows:</p>
2512 8797b228 2019-08-04 stsp <dl class="Bl-tag">
2513 def5be4a 2021-08-31 stsp <dt id="a~6"><a class="permalink" href="#a~6"><code class="Fl">-a</code></a></dt>
2514 8797b228 2019-08-04 stsp <dd>Abort an interrupted histedit operation. If this option is used, no
2515 9b0c768d 2019-08-08 stsp other command-line arguments are allowed.</dd>
2516 f6a6fa94 2023-02-22 stsp <dt id="C~5"><a class="permalink" href="#C~5"><code class="Fl">-C</code></a></dt>
2517 f6a6fa94 2023-02-22 stsp <dd>Allow a histedit operation to continue with files in conflicted
2518 f6a6fa94 2023-02-22 stsp status. This option should generally be avoided, and can only be used
2519 f6a6fa94 2023-02-22 stsp with the <code class="Fl">-c</code> option.</dd>
2520 63657f42 2022-09-07 stsp <dt id="c~12"><a class="permalink" href="#c~12"><code class="Fl">-c</code></a></dt>
2521 8797b228 2019-08-04 stsp <dd>Continue an interrupted histedit operation. If this option is used, no
2522 461d9094 2023-07-19 stsp other command-line arguments are allowed except
2523 461d9094 2023-07-19 stsp <code class="Fl">-C</code>.</dd>
2524 f6a6fa94 2023-02-22 stsp <dt id="d~7"><a class="permalink" href="#d~7"><code class="Fl">-d</code></a></dt>
2525 f6a6fa94 2023-02-22 stsp <dd>Drop all commits. This option is a quick equivalent to a histedit
2526 f6a6fa94 2023-02-22 stsp script which drops all commits. The <code class="Fl">-d</code> option
2527 f6a6fa94 2023-02-22 stsp can only be used when starting a new histedit operation. If this
2528 f6a6fa94 2023-02-22 stsp option is used, no other command-line arguments are allowed.</dd>
2529 417cb057 2021-10-03 stsp <dt id="e"><a class="permalink" href="#e"><code class="Fl">-e</code></a></dt>
2530 417cb057 2021-10-03 stsp <dd>Interrupt the histedit operation for editing after merging each
2531 417cb057 2021-10-03 stsp commit. This option is a quick equivalent to a histedit script which
2532 417cb057 2021-10-03 stsp uses the <code class="Cm">edit</code> command for all commits. The
2533 417cb057 2021-10-03 stsp <code class="Fl">-e</code> option can only be used when starting a new
2534 417cb057 2021-10-03 stsp histedit operation. If this option is used, no other command-line
2535 417cb057 2021-10-03 stsp arguments are allowed.</dd>
2536 039953c9 2021-03-22 stsp <dt id="F~3"><a class="permalink" href="#F~3"><code class="Fl">-F</code></a>
2537 7c3b4ab8 2020-02-25 stsp <var class="Ar">histedit-script</var></dt>
2538 7c3b4ab8 2020-02-25 stsp <dd>Use the specified <var class="Ar">histedit-script</var> instead of
2539 7c3b4ab8 2020-02-25 stsp opening a temporary file in an editor where a histedit script can be
2540 7c3b4ab8 2020-02-25 stsp written.</dd>
2541 63657f42 2022-09-07 stsp <dt id="f~3"><a class="permalink" href="#f~3"><code class="Fl">-f</code></a></dt>
2542 63657f42 2022-09-07 stsp <dd>Fold all commits into a single commit. This option is a quick
2543 63657f42 2022-09-07 stsp equivalent to a histedit script which folds all commits, combining
2544 63657f42 2022-09-07 stsp them all into one commit. The <code class="Fl">-f</code> option can
2545 7c3b4ab8 2020-02-25 stsp only be used when starting a new histedit operation. If this option is
2546 7c3b4ab8 2020-02-25 stsp used, no other command-line arguments are allowed.</dd>
2547 7985a487 2023-01-30 stsp <dt id="l~10"><a class="permalink" href="#l~10"><code class="Fl">-l</code></a></dt>
2548 039953c9 2021-03-22 stsp <dd>Show a list of past histedit operations, represented by references in
2549 039953c9 2021-03-22 stsp the “refs/got/backup/histedit” reference namespace.
2550 039953c9 2021-03-22 stsp <p class="Pp">Display the author, date, and log message of each backed
2551 039953c9 2021-03-22 stsp up commit, the object ID of the corresponding post-histedit commit,
2552 039953c9 2021-03-22 stsp and the object ID of their common ancestor commit. Given these
2553 039953c9 2021-03-22 stsp object IDs, the <code class="Cm">got log</code> command with the
2554 039953c9 2021-03-22 stsp <code class="Fl">-c</code> and <code class="Fl">-x</code> options
2555 039953c9 2021-03-22 stsp can be used to examine the history of either version of the branch,
2556 039953c9 2021-03-22 stsp and the <code class="Cm">got branch</code> command with the
2557 039953c9 2021-03-22 stsp <code class="Fl">-c</code> option can be used to create a new branch
2558 039953c9 2021-03-22 stsp from a pre-histedit state if desired.</p>
2559 039953c9 2021-03-22 stsp <p class="Pp">If a <var class="Ar">branch</var> is specified, only show
2560 039953c9 2021-03-22 stsp commits which at some point in time represented this branch.
2561 039953c9 2021-03-22 stsp Otherwise, list all backed up commits for any branches.</p>
2562 039953c9 2021-03-22 stsp <p class="Pp">If this option is used, <code class="Cm">got
2563 039953c9 2021-03-22 stsp histedit</code> does not require a work tree. None of the other
2564 039953c9 2021-03-22 stsp options can be used together with <code class="Fl">-l</code>.</p>
2566 63657f42 2022-09-07 stsp <dt id="m~5"><a class="permalink" href="#m~5"><code class="Fl">-m</code></a></dt>
2567 63657f42 2022-09-07 stsp <dd>Edit log messages only. This option is a quick equivalent to a
2568 63657f42 2022-09-07 stsp histedit script which edits only log messages but otherwise leaves
2569 63657f42 2022-09-07 stsp every picked commit as-is. The <code class="Fl">-m</code> option can
2570 63657f42 2022-09-07 stsp only be used when starting a new histedit operation. If this option is
2571 63657f42 2022-09-07 stsp used, no other command-line arguments are allowed.</dd>
2572 7985a487 2023-01-30 stsp <dt id="X~5"><a class="permalink" href="#X~5"><code class="Fl">-X</code></a></dt>
2573 16cd1323 2021-07-26 stsp <dd>Delete backups created by past histedit operations, represented by
2574 16cd1323 2021-07-26 stsp references in the “refs/got/backup/histedit” reference
2575 16cd1323 2021-07-26 stsp namespace.
2576 16cd1323 2021-07-26 stsp <p class="Pp">If a <var class="Ar">branch</var> is specified, only
2577 16cd1323 2021-07-26 stsp delete backups which at some point in time represented this branch.
2578 16cd1323 2021-07-26 stsp Otherwise, delete all references found within
2579 16cd1323 2021-07-26 stsp “refs/got/backup/histedit”.</p>
2580 16cd1323 2021-07-26 stsp <p class="Pp">Any commit, tree, tag, and blob objects belonging to
2581 16cd1323 2021-07-26 stsp deleted backups remain in the repository and may be removed
2582 16cd1323 2021-07-26 stsp separately with Git's garbage collector or <code class="Cm">gotadmin
2583 16cd1323 2021-07-26 stsp cleanup</code>.</p>
2584 16cd1323 2021-07-26 stsp <p class="Pp">If this option is used, <code class="Cm">got
2585 16cd1323 2021-07-26 stsp histedit</code> does not require a work tree. None of the other
2586 16cd1323 2021-07-26 stsp options can be used together with <code class="Fl">-X</code>.</p>
2590 63b69821 2021-10-16 stsp <dt id="ig"><a class="permalink" href="#integrate"><code class="Cm" id="integrate">integrate</code></a>
2591 d8e62599 2019-10-21 stsp <var class="Ar">branch</var></dt>
2593 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
2594 46043f6f 2021-11-23 stsp <code class="Cm">ig</code>)</code></div>
2595 46043f6f 2021-11-23 stsp Integrate the specified <var class="Ar">branch</var> into the work tree's
2596 d8e62599 2019-10-21 stsp current branch. Files in the work tree are updated to match the contents
2597 d8e62599 2019-10-21 stsp on the integrated <var class="Ar">branch</var>, and the reference of the
2598 d8e62599 2019-10-21 stsp work tree's branch is changed to point at the head commit of the
2599 d8e62599 2019-10-21 stsp integrated <var class="Ar">branch</var>.
2600 d8e62599 2019-10-21 stsp <p class="Pp">Both branches can be considered equivalent after integration
2601 d8e62599 2019-10-21 stsp since they will be pointing at the same commit. Both branches remain
2602 d8e62599 2019-10-21 stsp available for future work, if desired. In case the integrated
2603 d8e62599 2019-10-21 stsp <var class="Ar">branch</var> is no longer needed it may be deleted with
2604 d8e62599 2019-10-21 stsp <code class="Cm">got branch -d</code>.</p>
2605 d8e62599 2019-10-21 stsp <p class="Pp">Show the status of each affected file, using the following
2606 d8e62599 2019-10-21 stsp status codes:</p>
2607 d8e62599 2019-10-21 stsp <table class="Bl-column">
2609 d8e62599 2019-10-21 stsp <td>U</td>
2610 d8e62599 2019-10-21 stsp <td>file was updated</td>
2613 d8e62599 2019-10-21 stsp <td>D</td>
2614 d8e62599 2019-10-21 stsp <td>file was deleted</td>
2617 d8e62599 2019-10-21 stsp <td>A</td>
2618 d8e62599 2019-10-21 stsp <td>new file was added</td>
2621 d8e62599 2019-10-21 stsp <td>~</td>
2622 d8e62599 2019-10-21 stsp <td>versioned file is obstructed by a non-regular file</td>
2625 d8e62599 2019-10-21 stsp <td>!</td>
2626 d8e62599 2019-10-21 stsp <td>a missing versioned file was restored</td>
2629 d8e62599 2019-10-21 stsp <p class="Pp"><code class="Cm">got integrate</code> will refuse to run if
2630 d8e62599 2019-10-21 stsp certain preconditions are not met. Most importantly, the
2631 d8e62599 2019-10-21 stsp <var class="Ar">branch</var> must have been rebased onto the work tree's
2632 d8e62599 2019-10-21 stsp current branch with <code class="Cm">got rebase</code> before it can be
2633 d8e62599 2019-10-21 stsp integrated, in order to linearize commit history and resolve merge
2634 b078d5c4 2022-03-23 stsp conflicts. If the work tree contains multiple base commits, it must
2635 b078d5c4 2022-03-23 stsp first be updated to a single base commit with <code class="Cm">got
2636 d8e62599 2019-10-21 stsp update</code>. If changes have been staged with <code class="Cm">got
2637 d8e62599 2019-10-21 stsp stage</code>, these changes must first be committed with
2638 d8e62599 2019-10-21 stsp <code class="Cm">got commit</code> or unstaged with <code class="Cm">got
2639 d8e62599 2019-10-21 stsp unstage</code>. If the work tree contains local changes, these changes
2640 d8e62599 2019-10-21 stsp must first be committed with <code class="Cm">got commit</code> or
2641 d8e62599 2019-10-21 stsp reverted with <code class="Cm">got revert</code>.</p>
2643 63b69821 2021-10-16 stsp <dt id="mg"><a class="permalink" href="#merge"><code class="Cm" id="merge">merge</code></a>
2644 461d9094 2023-07-19 stsp [<code class="Fl">-aCcMn</code>] [<var class="Ar">branch</var>]</dt>
2646 63b69821 2021-10-16 stsp <div class="Bd Bd-indent"><code class="Li">(alias:
2647 46043f6f 2021-11-23 stsp <code class="Cm">mg</code>)</code></div>
2648 41ae98c9 2023-06-23 stsp Merge the specified <var class="Ar">branch</var> into the current branch of
2649 c8cf51c9 2023-11-29 stsp the work tree. If the branches have diverged, merge changes into the work
2650 c8cf51c9 2023-11-29 stsp tree and create a merge commit. Otherwise, if the specified
2651 c8cf51c9 2023-11-29 stsp <var class="Ar">branch</var> is already based on the work tree's current
2652 c8cf51c9 2023-11-29 stsp branch, make the work tree's current branch equivalent to the specified
2653 c8cf51c9 2023-11-29 stsp <var class="Ar">branch</var> and update files in the work tree
2654 c8cf51c9 2023-11-29 stsp accordingly.
2655 417cb057 2021-10-03 stsp <p class="Pp">Merge commits are commits based on multiple parent commits.
2656 c8cf51c9 2023-11-29 stsp The tip commit of the work tree's current branch will be used as the
2657 c8cf51c9 2023-11-29 stsp first parent. The tip commit of the specified
2658 c8cf51c9 2023-11-29 stsp <var class="Ar">branch</var> will be used as the second parent. The work
2659 c8cf51c9 2023-11-29 stsp tree's current branch must be in the “refs/heads/”
2660 c8cf51c9 2023-11-29 stsp reference namespace and can be set with <code class="Cm">got update
2661 c8cf51c9 2023-11-29 stsp -b</code> before starting the <code class="Cm">merge</code>
2662 c8cf51c9 2023-11-29 stsp operation.</p>
2663 417cb057 2021-10-03 stsp <p class="Pp">No ancestral relationship between the two branches is
2664 417cb057 2021-10-03 stsp required. If the two branches have already been merged previously, only
2665 417cb057 2021-10-03 stsp new changes will be merged.</p>
2666 417cb057 2021-10-03 stsp <p class="Pp">It is not possible to create merge commits with more than two