Blame


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