Blame


1 5c860e29 2018-03-12 stsp .\"
2 5c860e29 2018-03-12 stsp .\" Copyright (c) 2017 Martin Pieuchot
3 5aa81393 2020-01-06 stsp .\" Copyright (c) 2018, 2019, 2020 Stefan Sperling
4 5c860e29 2018-03-12 stsp .\"
5 5c860e29 2018-03-12 stsp .\" Permission to use, copy, modify, and distribute this software for any
6 5c860e29 2018-03-12 stsp .\" purpose with or without fee is hereby granted, provided that the above
7 5c860e29 2018-03-12 stsp .\" copyright notice and this permission notice appear in all copies.
8 5c860e29 2018-03-12 stsp .\"
9 5c860e29 2018-03-12 stsp .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 5c860e29 2018-03-12 stsp .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 5c860e29 2018-03-12 stsp .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 5c860e29 2018-03-12 stsp .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 5c860e29 2018-03-12 stsp .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 5c860e29 2018-03-12 stsp .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 5c860e29 2018-03-12 stsp .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 5c860e29 2018-03-12 stsp .\"
17 5c860e29 2018-03-12 stsp .Dd $Mdocdate$
18 5c860e29 2018-03-12 stsp .Dt GOT 1
19 5c860e29 2018-03-12 stsp .Os
20 5c860e29 2018-03-12 stsp .Sh NAME
21 5c860e29 2018-03-12 stsp .Nm got
22 8e13c46f 2019-08-05 stsp .Nd Game of Trees
23 5c860e29 2018-03-12 stsp .Sh SYNOPSIS
24 0bb8a95e 2018-03-12 stsp .Nm
25 0a58e722 2022-10-04 thomas .Op Fl hV
26 5c860e29 2018-03-12 stsp .Ar command
27 5c860e29 2018-03-12 stsp .Op Ar arg ...
28 5c860e29 2018-03-12 stsp .Sh DESCRIPTION
29 5c860e29 2018-03-12 stsp .Nm
30 4dfb2f0f 2019-03-26 stsp is a version control system which stores the history of tracked files
31 4dfb2f0f 2019-03-26 stsp in a Git repository, as used by the Git version control system.
32 285dc8a4 2018-03-13 stsp This repository format is described in
33 5e5560e1 2018-08-01 stsp .Xr git-repository 5 .
34 285dc8a4 2018-03-13 stsp .Pp
35 4129c201 2018-03-13 stsp .Nm
36 4129c201 2018-03-13 stsp is a
37 ae73e26f 2019-03-26 stsp .Dq distributed
38 4129c201 2018-03-13 stsp version control system because every copy of a repository is writeable.
39 4129c201 2018-03-13 stsp Modifications made to files can be synchronized between repositories
40 97925469 2018-03-17 stsp at any time.
41 4129c201 2018-03-13 stsp .Pp
42 285dc8a4 2018-03-13 stsp Files managed by
43 285dc8a4 2018-03-13 stsp .Nm
44 4129c201 2018-03-13 stsp must be checked out from the repository for modification.
45 285dc8a4 2018-03-13 stsp Checked out files are stored in a
46 285dc8a4 2018-03-13 stsp .Em work tree
47 c5867b47 2018-03-13 stsp which can be placed at an arbitrary directory in the filesystem hierarchy.
48 fb2921d0 2019-03-26 stsp The on-disk format of this work tree is described in
49 285dc8a4 2018-03-13 stsp .Xr got-worktree 5 .
50 285dc8a4 2018-03-13 stsp .Pp
51 285dc8a4 2018-03-13 stsp .Nm
52 285dc8a4 2018-03-13 stsp provides global and command-specific options.
53 bc3056e3 2019-08-18 stsp Global options must precede the command name, and are as follows:
54 1b6b95a8 2018-03-12 stsp .Bl -tag -width tenletters
55 1b6b95a8 2018-03-12 stsp .It Fl h
56 fef8a0d3 2019-08-04 stsp Display usage information and exit immediately.
57 1795b260 2021-04-02 kn .It Fl V , -version
58 53ccebc2 2019-07-30 stsp Display program version and exit immediately.
59 1b6b95a8 2018-03-12 stsp .El
60 1b6b95a8 2018-03-12 stsp .Pp
61 38e11793 2018-06-13 stsp The commands for
62 38e11793 2018-06-13 stsp .Nm
63 38e11793 2018-06-13 stsp are as follows:
64 0bb8a95e 2018-03-12 stsp .Bl -tag -width checkout
65 e8aa341a 2021-10-08 thomas .Tg im
66 56c96eff 2022-08-30 thomas .It Xo
67 56c96eff 2022-08-30 thomas .Cm import
68 56c96eff 2022-08-30 thomas .Op Fl b Ar branch
69 56c96eff 2022-08-30 thomas .Op Fl I Ar pattern
70 56c96eff 2022-08-30 thomas .Op Fl m Ar message
71 56c96eff 2022-08-30 thomas .Op Fl r Ar repository-path
72 56c96eff 2022-08-30 thomas .Ar directory
73 56c96eff 2022-08-30 thomas .Xc
74 d912d125 2021-11-04 thomas .Dl Pq alias: Cm im
75 3ce1b845 2019-07-15 stsp Create an initial commit in a repository from the file hierarchy
76 3ce1b845 2019-07-15 stsp within the specified
77 3ce1b845 2019-07-15 stsp .Ar directory .
78 3ce1b845 2019-07-15 stsp The created commit will not have any parent commits, i.e. it will be a
79 3ce1b845 2019-07-15 stsp root commit.
80 3ce1b845 2019-07-15 stsp Also create a new reference which provides a branch name for the newly
81 3ce1b845 2019-07-15 stsp created commit.
82 21a44f98 2019-07-15 stsp Show the path of each imported file to indicate progress.
83 3ce1b845 2019-07-15 stsp .Pp
84 21a44f98 2019-07-15 stsp The
85 21a44f98 2019-07-15 stsp .Cm got import
86 21a44f98 2019-07-15 stsp command requires the
87 21a44f98 2019-07-15 stsp .Ev GOT_AUTHOR
88 aba9c984 2019-09-08 stsp environment variable to be set,
89 257add31 2020-09-09 stsp unless an author has been configured in
90 257add31 2020-09-09 stsp .Xr got.conf 5
91 257add31 2020-09-09 stsp or Git's
92 aba9c984 2019-09-08 stsp .Dv user.name
93 aba9c984 2019-09-08 stsp and
94 709ae9eb 2019-09-08 stsp .Dv user.email
95 709ae9eb 2019-09-08 stsp configuration settings can be obtained from the repository's
96 aba9c984 2019-09-08 stsp .Pa .git/config
97 c9956ddf 2019-09-08 stsp file or from Git's global
98 c9956ddf 2019-09-08 stsp .Pa ~/.gitconfig
99 c9956ddf 2019-09-08 stsp configuration file.
100 3ce1b845 2019-07-15 stsp .Pp
101 3ce1b845 2019-07-15 stsp The options for
102 3ce1b845 2019-07-15 stsp .Cm got import
103 3ce1b845 2019-07-15 stsp are as follows:
104 3ce1b845 2019-07-15 stsp .Bl -tag -width Ds
105 3ce1b845 2019-07-15 stsp .It Fl b Ar branch
106 3ce1b845 2019-07-15 stsp Create the specified
107 e9424ba1 2022-09-20 thomas .Ar branch .
108 e9424ba1 2022-09-20 thomas If this option is not specified, a branch corresponding to the repository's
109 e9424ba1 2022-09-20 thomas HEAD reference will be used.
110 e9424ba1 2022-09-20 thomas Use of this option is required if the branch resolved via the repository's
111 e9424ba1 2022-09-20 thomas HEAD reference already exists.
112 d6506a3d 2022-08-16 thomas .It Fl I Ar pattern
113 d6506a3d 2022-08-16 thomas Ignore files or directories with a name which matches the specified
114 d6506a3d 2022-08-16 thomas .Ar pattern .
115 d6506a3d 2022-08-16 thomas This option may be specified multiple times to build a list of ignore patterns.
116 d6506a3d 2022-08-16 thomas The
117 d6506a3d 2022-08-16 thomas .Ar pattern
118 d6506a3d 2022-08-16 thomas follows the globbing rules documented in
119 d6506a3d 2022-08-16 thomas .Xr glob 7 .
120 e012cf94 2023-02-07 thomas Ignore patterns which end with a slash,
121 e012cf94 2023-02-07 thomas .Dq / ,
122 e012cf94 2023-02-07 thomas will only match directories.
123 3ce1b845 2019-07-15 stsp .It Fl m Ar message
124 3ce1b845 2019-07-15 stsp Use the specified log message when creating the new commit.
125 3ce1b845 2019-07-15 stsp Without the
126 3ce1b845 2019-07-15 stsp .Fl m
127 3ce1b845 2019-07-15 stsp option,
128 3ce1b845 2019-07-15 stsp .Cm got import
129 3ce1b845 2019-07-15 stsp opens a temporary file in an editor where a log message can be written.
130 bccae03f 2023-07-17 thomas Quitting the editor without saving the file will abort the import operation.
131 3ce1b845 2019-07-15 stsp .It Fl r Ar repository-path
132 3ce1b845 2019-07-15 stsp Use the repository at the specified path.
133 3ce1b845 2019-07-15 stsp If not specified, assume the repository is located at or above the current
134 3ce1b845 2019-07-15 stsp working directory.
135 3ce1b845 2019-07-15 stsp .El
136 e8aa341a 2021-10-08 thomas .Tg cl
137 56c96eff 2022-08-30 thomas .It Xo
138 56c96eff 2022-08-30 thomas .Cm clone
139 56c96eff 2022-08-30 thomas .Op Fl almqv
140 56c96eff 2022-08-30 thomas .Op Fl b Ar branch
141 56c96eff 2022-08-30 thomas .Op Fl R Ar reference
142 56c96eff 2022-08-30 thomas .Ar repository-URL
143 56c96eff 2022-08-30 thomas .Op Ar directory
144 56c96eff 2022-08-30 thomas .Xc
145 d912d125 2021-11-04 thomas .Dl Pq alias: Cm cl
146 2ab43947 2020-03-18 stsp Clone a Git repository at the specified
147 2ab43947 2020-03-18 stsp .Ar repository-URL
148 2ab43947 2020-03-18 stsp into the specified
149 3493b628 2020-03-20 stsp .Ar directory .
150 2ab43947 2020-03-18 stsp If no
151 3493b628 2020-03-20 stsp .Ar directory
152 4b06140e 2022-03-22 thomas is specified, the directory name will be derived from the name of the
153 2ab43947 2020-03-18 stsp cloned repository.
154 2ab43947 2020-03-18 stsp .Cm got clone
155 2ab43947 2020-03-18 stsp will refuse to run if the
156 3493b628 2020-03-20 stsp .Ar directory
157 2ab43947 2020-03-18 stsp already exists.
158 2ab43947 2020-03-18 stsp .Pp
159 2ab43947 2020-03-18 stsp The
160 2ab43947 2020-03-18 stsp .Ar repository-URL
161 619eb6dd 2020-03-20 stsp specifies a protocol scheme, a server hostname, an optional port number
162 619eb6dd 2020-03-20 stsp separated from the hostname by a colon, and a path to the repository on
163 619eb6dd 2020-03-20 stsp the server:
164 619eb6dd 2020-03-20 stsp .Lk scheme://hostname:port/path/to/repository
165 2ab43947 2020-03-18 stsp .Pp
166 2ab43947 2020-03-18 stsp The following protocol schemes are supported:
167 2ab43947 2020-03-18 stsp .Bl -tag -width git+ssh
168 2ab43947 2020-03-18 stsp .It git
169 2ab43947 2020-03-18 stsp The Git protocol as implemented by the
170 2ab43947 2020-03-18 stsp .Xr git-daemon 1
171 2ab43947 2020-03-18 stsp server.
172 10c073e7 2020-03-20 stsp Use of this protocol is discouraged since it supports neither authentication
173 10c073e7 2020-03-20 stsp nor encryption.
174 2ab43947 2020-03-18 stsp .It git+ssh
175 2ab43947 2020-03-18 stsp The Git protocol wrapped in an authenticated and encrypted
176 2ab43947 2020-03-18 stsp .Xr ssh 1
177 2ab43947 2020-03-18 stsp tunnel.
178 2ab43947 2020-03-18 stsp With this protocol the hostname may contain an embedded username for
179 2ab43947 2020-03-18 stsp .Xr ssh 1
180 2ab43947 2020-03-18 stsp to use:
181 2ab43947 2020-03-18 stsp .Mt user@hostname
182 2ab43947 2020-03-18 stsp .It ssh
183 2ab43947 2020-03-18 stsp Short alias for git+ssh.
184 2ab43947 2020-03-18 stsp .El
185 89c3c67b 2020-03-20 stsp .Pp
186 89c3c67b 2020-03-20 stsp Objects in the cloned repository are stored in a pack file which is downloaded
187 89c3c67b 2020-03-20 stsp from the server.
188 89c3c67b 2020-03-20 stsp This pack file will then be indexed to facilitate access to the objects stored
189 89c3c67b 2020-03-20 stsp within.
190 89c3c67b 2020-03-20 stsp If any objects in the pack file are stored in deltified form, all deltas will
191 89c3c67b 2020-03-20 stsp be fully resolved in order to compute the ID of such objects.
192 89c3c67b 2020-03-20 stsp This can take some time.
193 010f7279 2020-03-20 stsp More details about the pack file format are documented in
194 010f7279 2020-03-20 stsp .Xr git-repository 5 .
195 2ab43947 2020-03-18 stsp .Pp
196 7848a0e1 2020-03-19 stsp .Cm got clone
197 7848a0e1 2020-03-19 stsp creates a remote repository entry in the
198 257add31 2020-09-09 stsp .Xr got.conf 5
199 257add31 2020-09-09 stsp and
200 7848a0e1 2020-03-19 stsp .Pa config
201 257add31 2020-09-09 stsp files of the cloned repository to store the
202 7848a0e1 2020-03-19 stsp .Ar repository-url
203 99495ddb 2021-01-10 stsp and any
204 15d3c221 2021-01-05 stsp .Ar branch
205 99495ddb 2021-01-10 stsp or
206 99495ddb 2021-01-10 stsp .Ar reference
207 132af4a5 2021-01-05 stsp arguments for future use by
208 7848a0e1 2020-03-19 stsp .Cm got fetch
209 fc24bb3a 2020-03-21 stsp or
210 7848a0e1 2020-03-19 stsp .Xr git-fetch 1 .
211 7848a0e1 2020-03-19 stsp .Pp
212 2ab43947 2020-03-18 stsp The options for
213 2ab43947 2020-03-18 stsp .Cm got clone
214 2ab43947 2020-03-18 stsp are as follows:
215 2ab43947 2020-03-18 stsp .Bl -tag -width Ds
216 659e7fbd 2020-03-20 stsp .It Fl a
217 1d4b192f 2020-03-21 stsp Fetch all branches from the remote repository's
218 1d4b192f 2020-03-21 stsp .Dq refs/heads/
219 5aa20203 2021-01-05 stsp reference namespace and set
220 25eb5847 2022-07-03 thomas .Cm fetch_all_branches
221 5aa20203 2021-01-05 stsp in the cloned repository's
222 5aa20203 2021-01-05 stsp .Xr got.conf 5
223 5aa20203 2021-01-05 stsp file for future use by
224 5aa20203 2021-01-05 stsp .Cm got fetch .
225 4ba14133 2020-03-20 stsp If this option is not specified, a branch resolved via the remote
226 4ba14133 2020-03-20 stsp repository's HEAD reference will be fetched.
227 4ba14133 2020-03-20 stsp Cannot be used together with the
228 4ba14133 2020-03-20 stsp .Fl b
229 4ba14133 2020-03-20 stsp option.
230 4ba14133 2020-03-20 stsp .It Fl b Ar branch
231 4ba14133 2020-03-20 stsp Fetch the specified
232 4ba14133 2020-03-20 stsp .Ar branch
233 1d4b192f 2020-03-21 stsp from the remote repository's
234 1d4b192f 2020-03-21 stsp .Dq refs/heads/
235 1d4b192f 2020-03-21 stsp reference namespace.
236 4ba14133 2020-03-20 stsp This option may be specified multiple times to build a list of branches
237 4ba14133 2020-03-20 stsp to fetch.
238 4ba14133 2020-03-20 stsp If the branch corresponding to the remote repository's HEAD reference is not
239 4ba14133 2020-03-20 stsp in this list, the cloned repository's HEAD reference will be set to the first
240 4ba14133 2020-03-20 stsp branch which was fetched.
241 4ba14133 2020-03-20 stsp If this option is not specified, a branch resolved via the remote
242 4ba14133 2020-03-20 stsp repository's HEAD reference will be fetched.
243 4ba14133 2020-03-20 stsp Cannot be used together with the
244 4ba14133 2020-03-20 stsp .Fl a
245 4ba14133 2020-03-20 stsp option.
246 41b0de12 2020-03-21 stsp .It Fl l
247 a18cccf9 2020-03-21 stsp List branches and tags available for fetching from the remote repository
248 41b0de12 2020-03-21 stsp and exit immediately.
249 41b0de12 2020-03-21 stsp Cannot be used together with any of the other options except
250 a5a46be2 2021-01-27 stsp .Fl q
251 a5a46be2 2021-01-27 stsp and
252 41b0de12 2020-03-21 stsp .Fl v .
253 469dd726 2020-03-20 stsp .It Fl m
254 469dd726 2020-03-20 stsp Create the cloned repository as a mirror of the original repository.
255 469dd726 2020-03-20 stsp This is useful if the cloned repository will not be used to store
256 bd81cfb7 2020-04-19 stsp locally created commits.
257 469dd726 2020-03-20 stsp .Pp
258 469dd726 2020-03-20 stsp The repository's
259 257add31 2020-09-09 stsp .Xr got.conf 5
260 257add31 2020-09-09 stsp and
261 469dd726 2020-03-20 stsp .Pa config
262 257add31 2020-09-09 stsp files will be set up with the
263 469dd726 2020-03-20 stsp .Dq mirror
264 469dd726 2020-03-20 stsp option enabled, such that
265 469dd726 2020-03-20 stsp .Cm got fetch
266 469dd726 2020-03-20 stsp or
267 469dd726 2020-03-20 stsp .Xr git-fetch 1
268 bd81cfb7 2020-04-19 stsp will write incoming changes directly to branches in the
269 469dd726 2020-03-20 stsp .Dq refs/heads/
270 469dd726 2020-03-20 stsp reference namespace, rather than to branches in the
271 469dd726 2020-03-20 stsp .Dq refs/remotes/
272 469dd726 2020-03-20 stsp namespace.
273 469dd726 2020-03-20 stsp This avoids the usual requirement of having to run
274 469dd726 2020-03-20 stsp .Cm got rebase
275 1a70a207 2023-07-05 thomas or
276 1a70a207 2023-07-05 thomas .Cm got merge
277 469dd726 2020-03-20 stsp after
278 469dd726 2020-03-20 stsp .Cm got fetch
279 bd81cfb7 2020-04-19 stsp in order to make incoming changes appear on branches in the
280 bd81cfb7 2020-04-19 stsp .Dq refs/heads/
281 bd81cfb7 2020-04-19 stsp namespace.
282 bd81cfb7 2020-04-19 stsp But maintaining custom changes in the cloned repository becomes difficult
283 bd81cfb7 2020-04-19 stsp since such changes will be at risk of being discarded whenever incoming
284 498ef124 2020-03-21 stsp changes are fetched.
285 2ab43947 2020-03-18 stsp .It Fl q
286 2ab43947 2020-03-18 stsp Suppress progress reporting output.
287 2ab43947 2020-03-18 stsp The same option will be passed to
288 2ab43947 2020-03-18 stsp .Xr ssh 1
289 2ab43947 2020-03-18 stsp if applicable.
290 0e4002ca 2020-03-21 stsp .It Fl R Ar reference
291 0e4002ca 2020-03-21 stsp In addition to the branches and tags that will be fetched, fetch an arbitrary
292 0e4002ca 2020-03-21 stsp .Ar reference
293 0e4002ca 2020-03-21 stsp from the remote repository's
294 0e4002ca 2020-03-21 stsp .Dq refs/
295 0e4002ca 2020-03-21 stsp namespace.
296 0e4002ca 2020-03-21 stsp This option may be specified multiple times to build a list of additional
297 0e4002ca 2020-03-21 stsp references to fetch.
298 71f12362 2020-03-21 stsp The specified
299 71f12362 2020-03-21 stsp .Ar reference
300 a18cccf9 2020-03-21 stsp may either be a path to a specific reference, or a reference namespace
301 71f12362 2020-03-21 stsp which will cause all references in this namespace to be fetched.
302 0e4002ca 2020-03-21 stsp .Pp
303 71f12362 2020-03-21 stsp Each reference will be mapped into the cloned repository's
304 0e4002ca 2020-03-21 stsp .Dq refs/remotes/
305 0e4002ca 2020-03-21 stsp namespace, unless the
306 0e4002ca 2020-03-21 stsp .Fl m
307 0e4002ca 2020-03-21 stsp option is used to mirror references directly into the cloned repository's
308 0e4002ca 2020-03-21 stsp .Dq refs/
309 0e4002ca 2020-03-21 stsp namespace.
310 0e4002ca 2020-03-21 stsp .Pp
311 0e4002ca 2020-03-21 stsp .Cm got clone
312 0e4002ca 2020-03-21 stsp will refuse to fetch references from the remote repository's
313 0e4002ca 2020-03-21 stsp .Dq refs/remotes/
314 0e4002ca 2020-03-21 stsp or
315 0e4002ca 2020-03-21 stsp .Dq refs/got/
316 0e4002ca 2020-03-21 stsp namespace.
317 d6506a3d 2022-08-16 thomas .It Fl v
318 d6506a3d 2022-08-16 thomas Verbose mode.
319 d6506a3d 2022-08-16 thomas Causes
320 d6506a3d 2022-08-16 thomas .Cm got clone
321 d6506a3d 2022-08-16 thomas to print debugging messages to standard error output.
322 d6506a3d 2022-08-16 thomas This option will be passed to
323 d6506a3d 2022-08-16 thomas .Xr ssh 1
324 d6506a3d 2022-08-16 thomas if applicable.
325 d6506a3d 2022-08-16 thomas Multiple -v options increase the verbosity.
326 d6506a3d 2022-08-16 thomas The maximum is 3.
327 2ab43947 2020-03-18 stsp .El
328 e8aa341a 2021-10-08 thomas .Tg fe
329 56c96eff 2022-08-30 thomas .It Xo
330 56c96eff 2022-08-30 thomas .Cm fetch
331 56c96eff 2022-08-30 thomas .Op Fl adlqtvX
332 56c96eff 2022-08-30 thomas .Op Fl b Ar branch
333 56c96eff 2022-08-30 thomas .Op Fl R Ar reference
334 56c96eff 2022-08-30 thomas .Op Fl r Ar repository-path
335 56c96eff 2022-08-30 thomas .Op Ar remote-repository
336 56c96eff 2022-08-30 thomas .Xc
337 d912d125 2021-11-04 thomas .Dl Pq alias: Cm fe
338 7848a0e1 2020-03-19 stsp Fetch new changes from a remote repository.
339 7848a0e1 2020-03-19 stsp If no
340 4ba14133 2020-03-20 stsp .Ar remote-repository
341 4ba14133 2020-03-20 stsp is specified,
342 7848a0e1 2020-03-19 stsp .Dq origin
343 7848a0e1 2020-03-19 stsp will be used.
344 50b0790e 2020-09-11 stsp The remote repository's URL is obtained from the corresponding entry in
345 257add31 2020-09-09 stsp .Xr got.conf 5
346 50b0790e 2020-09-11 stsp or Git's
347 7848a0e1 2020-03-19 stsp .Pa config
348 f8ab0c60 2020-03-20 stsp file of the local repository, as created by
349 7848a0e1 2020-03-19 stsp .Cm got clone .
350 7848a0e1 2020-03-19 stsp .Pp
351 8d0dceb3 2023-02-07 thomas By default, any branches configured in
352 8d0dceb3 2023-02-07 thomas .Xr got.conf 5
353 8d0dceb3 2023-02-07 thomas for the
354 7917d6d5 2023-02-17 thomas .Ar remote-repository
355 8d0dceb3 2023-02-07 thomas will be fetched.
356 8d0dceb3 2023-02-07 thomas If
357 8d0dceb3 2023-02-07 thomas .Cm got fetch
358 8d0dceb3 2023-02-07 thomas is invoked in a work tree then this work tree's current branch will be
359 8d0dceb3 2023-02-07 thomas fetched, too, provided it is present on the server.
360 7917d6d5 2023-02-17 thomas If no branches to fetch can be found in
361 7917d6d5 2023-02-17 thomas .Xr got.conf 5
362 7917d6d5 2023-02-17 thomas or via a work tree, or said branches are not found on the server, a branch
363 7917d6d5 2023-02-17 thomas resolved via the remote repository's HEAD reference will be fetched.
364 7abf1863 2023-02-20 thomas Likewise, if a HEAD reference for the
365 7abf1863 2023-02-20 thomas .Ar remote-repository
366 7abf1863 2023-02-20 thomas exists but its target no longer matches the remote HEAD, then
367 7abf1863 2023-02-20 thomas the new target branch will be fetched.
368 8d0dceb3 2023-02-07 thomas This default behaviour can be overridden with the
369 8d0dceb3 2023-02-07 thomas .Fl a
370 8d0dceb3 2023-02-07 thomas and
371 8d0dceb3 2023-02-07 thomas .Fl b
372 8d0dceb3 2023-02-07 thomas options.
373 8d0dceb3 2023-02-07 thomas .Pp
374 89c3c67b 2020-03-20 stsp New changes will be stored in a separate pack file downloaded from the server.
375 89c3c67b 2020-03-20 stsp Optionally, separate pack files stored in the repository can be combined with
376 89c3c67b 2020-03-20 stsp .Xr git-repack 1 .
377 89c3c67b 2020-03-20 stsp .Pp
378 498ef124 2020-03-21 stsp By default, branch references in the
379 7848a0e1 2020-03-19 stsp .Dq refs/remotes/
380 498ef124 2020-03-21 stsp reference namespace will be updated to point at the newly fetched commits.
381 498ef124 2020-03-21 stsp The
382 498ef124 2020-03-21 stsp .Cm got rebase
383 1a70a207 2023-07-05 thomas or
384 1a70a207 2023-07-05 thomas .Cm got merge
385 bd81cfb7 2020-04-19 stsp command can then be used to make new changes visible on branches in the
386 7848a0e1 2020-03-19 stsp .Dq refs/heads/
387 bd81cfb7 2020-04-19 stsp namespace, merging incoming changes with the changes on those branches
388 bd81cfb7 2020-04-19 stsp as necessary.
389 7848a0e1 2020-03-19 stsp .Pp
390 498ef124 2020-03-21 stsp If the repository was created as a mirror with
391 4b06140e 2022-03-22 thomas .Cm got clone -m ,
392 498ef124 2020-03-21 stsp then all branches in the
393 469dd726 2020-03-20 stsp .Dq refs/heads/
394 498ef124 2020-03-21 stsp namespace will be updated directly to match the corresponding branches in
395 498ef124 2020-03-21 stsp the remote repository.
396 175367bd 2020-03-20 stsp If those branches contained local commits, these commits will no longer be
397 175367bd 2020-03-20 stsp reachable via a reference and will therefore be at risk of being discarded
398 e6786710 2021-07-03 stsp by Git's garbage collector or
399 e6786710 2021-07-03 stsp .Cm gotadmin cleanup .
400 bd81cfb7 2020-04-19 stsp Maintaining custom changes in a mirror repository is therefore discouraged.
401 469dd726 2020-03-20 stsp .Pp
402 db6d8ad8 2020-03-21 stsp In any case, references in the
403 7848a0e1 2020-03-19 stsp .Dq refs/tags/
404 db6d8ad8 2020-03-21 stsp namespace will always be fetched and mapped directly to local references
405 db6d8ad8 2020-03-21 stsp in the same namespace.
406 7848a0e1 2020-03-19 stsp .Pp
407 7848a0e1 2020-03-19 stsp The options for
408 7848a0e1 2020-03-19 stsp .Cm got fetch
409 7848a0e1 2020-03-19 stsp are as follows:
410 7848a0e1 2020-03-19 stsp .Bl -tag -width Ds
411 659e7fbd 2020-03-20 stsp .It Fl a
412 1d4b192f 2020-03-21 stsp Fetch all branches from the remote repository's
413 1d4b192f 2020-03-21 stsp .Dq refs/heads/
414 1d4b192f 2020-03-21 stsp reference namespace.
415 0c8b29c5 2021-01-05 stsp This option can be enabled by default for specific repositories in
416 0c8b29c5 2021-01-05 stsp .Xr got.conf 5 .
417 4ba14133 2020-03-20 stsp Cannot be used together with the
418 4ba14133 2020-03-20 stsp .Fl b
419 4ba14133 2020-03-20 stsp option.
420 4ba14133 2020-03-20 stsp .It Fl b Ar branch
421 4ba14133 2020-03-20 stsp Fetch the specified
422 4ba14133 2020-03-20 stsp .Ar branch
423 1d4b192f 2020-03-21 stsp from the remote repository's
424 1d4b192f 2020-03-21 stsp .Dq refs/heads/
425 1d4b192f 2020-03-21 stsp reference namespace.
426 4ba14133 2020-03-20 stsp This option may be specified multiple times to build a list of branches
427 4ba14133 2020-03-20 stsp to fetch.
428 4ba14133 2020-03-20 stsp Cannot be used together with the
429 4ba14133 2020-03-20 stsp .Fl a
430 4ba14133 2020-03-20 stsp option.
431 f21ec2f0 2020-03-21 stsp .It Fl d
432 f21ec2f0 2020-03-21 stsp Delete branches and tags from the local repository which are no longer
433 f21ec2f0 2020-03-21 stsp present in the remote repository.
434 f21ec2f0 2020-03-21 stsp Only references are deleted.
435 239821eb 2020-03-21 stsp Any commit, tree, tag, and blob objects belonging to deleted branches or
436 f21ec2f0 2020-03-21 stsp tags remain in the repository and may be removed separately with
437 e6786710 2021-07-03 stsp Git's garbage collector or
438 e6786710 2021-07-03 stsp .Cm gotadmin cleanup .
439 41b0de12 2020-03-21 stsp .It Fl l
440 41b0de12 2020-03-21 stsp List branches and tags available for fetching from the remote repository
441 41b0de12 2020-03-21 stsp and exit immediately.
442 41b0de12 2020-03-21 stsp Cannot be used together with any of the other options except
443 612392ee 2021-01-05 stsp .Fl v ,
444 612392ee 2021-01-05 stsp .Fl q ,
445 41b0de12 2020-03-21 stsp and
446 41b0de12 2020-03-21 stsp .Fl r .
447 7848a0e1 2020-03-19 stsp .It Fl q
448 7848a0e1 2020-03-19 stsp Suppress progress reporting output.
449 7848a0e1 2020-03-19 stsp The same option will be passed to
450 7848a0e1 2020-03-19 stsp .Xr ssh 1
451 7848a0e1 2020-03-19 stsp if applicable.
452 0e4002ca 2020-03-21 stsp .It Fl R Ar reference
453 0e4002ca 2020-03-21 stsp In addition to the branches and tags that will be fetched, fetch an arbitrary
454 0e4002ca 2020-03-21 stsp .Ar reference
455 0e4002ca 2020-03-21 stsp from the remote repository's
456 0e4002ca 2020-03-21 stsp .Dq refs/
457 0e4002ca 2020-03-21 stsp namespace.
458 0e4002ca 2020-03-21 stsp This option may be specified multiple times to build a list of additional
459 0e4002ca 2020-03-21 stsp references to fetch.
460 71f12362 2020-03-21 stsp The specified
461 71f12362 2020-03-21 stsp .Ar reference
462 a18cccf9 2020-03-21 stsp may either be a path to a specific reference, or a reference namespace
463 71f12362 2020-03-21 stsp which will cause all references in this namespace to be fetched.
464 0e4002ca 2020-03-21 stsp .Pp
465 0e4002ca 2020-03-21 stsp Each reference will be mapped into the local repository's
466 0e4002ca 2020-03-21 stsp .Dq refs/remotes/
467 0e4002ca 2020-03-21 stsp namespace, unless the local repository was created as a mirror with
468 a18cccf9 2020-03-21 stsp .Cm got clone -m
469 a18cccf9 2020-03-21 stsp in which case references will be mapped directly into the local repository's
470 a18cccf9 2020-03-21 stsp .Dq refs/
471 a18cccf9 2020-03-21 stsp namespace.
472 a18cccf9 2020-03-21 stsp .Pp
473 bd81cfb7 2020-04-19 stsp Once a reference has been fetched, a branch based on it can be created with
474 0e4002ca 2020-03-21 stsp .Cm got branch
475 0e4002ca 2020-03-21 stsp if needed.
476 0e4002ca 2020-03-21 stsp .Pp
477 0e4002ca 2020-03-21 stsp .Cm got fetch
478 0e4002ca 2020-03-21 stsp will refuse to fetch references from the remote repository's
479 0e4002ca 2020-03-21 stsp .Dq refs/remotes/
480 0e4002ca 2020-03-21 stsp or
481 0e4002ca 2020-03-21 stsp .Dq refs/got/
482 0e4002ca 2020-03-21 stsp namespace.
483 d6506a3d 2022-08-16 thomas .It Fl r Ar repository-path
484 d6506a3d 2022-08-16 thomas Use the repository at the specified path.
485 d6506a3d 2022-08-16 thomas If not specified, assume the repository is located at or above the current
486 d6506a3d 2022-08-16 thomas working directory.
487 d6506a3d 2022-08-16 thomas If this directory is a
488 d6506a3d 2022-08-16 thomas .Nm
489 d6506a3d 2022-08-16 thomas work tree, use the repository path associated with this work tree.
490 d6506a3d 2022-08-16 thomas .It Fl t
491 d6506a3d 2022-08-16 thomas Allow existing references in the
492 d6506a3d 2022-08-16 thomas .Dq refs/tags
493 d6506a3d 2022-08-16 thomas namespace to be updated if they have changed on the server.
494 d6506a3d 2022-08-16 thomas If not specified, only new tag references will be created.
495 d6506a3d 2022-08-16 thomas .It Fl v
496 d6506a3d 2022-08-16 thomas Verbose mode.
497 d6506a3d 2022-08-16 thomas Causes
498 d6506a3d 2022-08-16 thomas .Cm got fetch
499 d6506a3d 2022-08-16 thomas to print debugging messages to standard error output.
500 d6506a3d 2022-08-16 thomas The same option will be passed to
501 d6506a3d 2022-08-16 thomas .Xr ssh 1
502 d6506a3d 2022-08-16 thomas if applicable.
503 d6506a3d 2022-08-16 thomas Multiple -v options increase the verbosity.
504 d6506a3d 2022-08-16 thomas The maximum is 3.
505 161728eb 2021-07-24 stsp .It Fl X
506 161728eb 2021-07-24 stsp Delete all references which correspond to a particular
507 161728eb 2021-07-24 stsp .Ar remote-repository
508 161728eb 2021-07-24 stsp instead of fetching new changes.
509 161728eb 2021-07-24 stsp This can be useful when a remote repository is being removed from
510 161728eb 2021-07-24 stsp .Xr got.conf 5 .
511 161728eb 2021-07-24 stsp .Pp
512 161728eb 2021-07-24 stsp With
513 161728eb 2021-07-24 stsp .Fl X ,
514 161728eb 2021-07-24 stsp the
515 161728eb 2021-07-24 stsp .Ar remote-repository
516 161728eb 2021-07-24 stsp argument is mandatory and no other options except
517 161728eb 2021-07-24 stsp .Fl r ,
518 161728eb 2021-07-24 stsp .Fl v ,
519 161728eb 2021-07-24 stsp and
520 161728eb 2021-07-24 stsp .Fl q
521 161728eb 2021-07-24 stsp are allowed.
522 161728eb 2021-07-24 stsp .Pp
523 161728eb 2021-07-24 stsp Only references are deleted.
524 161728eb 2021-07-24 stsp Any commit, tree, tag, and blob objects fetched from a remote repository
525 161728eb 2021-07-24 stsp will generally be stored in pack files and may be removed separately with
526 161728eb 2021-07-24 stsp .Xr git-repack 1
527 161728eb 2021-07-24 stsp and Git's garbage collector.
528 7848a0e1 2020-03-19 stsp .El
529 e8aa341a 2021-10-08 thomas .Tg co
530 56c96eff 2022-08-30 thomas .It Xo
531 56c96eff 2022-08-30 thomas .Cm checkout
532 56c96eff 2022-08-30 thomas .Op Fl Eq
533 56c96eff 2022-08-30 thomas .Op Fl b Ar branch
534 56c96eff 2022-08-30 thomas .Op Fl c Ar commit
535 56c96eff 2022-08-30 thomas .Op Fl p Ar path-prefix
536 56c96eff 2022-08-30 thomas .Ar repository-path
537 56c96eff 2022-08-30 thomas .Op Ar work-tree-path
538 56c96eff 2022-08-30 thomas .Xc
539 d912d125 2021-11-04 thomas .Dl Pq alias: Cm co
540 0bb8a95e 2018-03-12 stsp Copy files from a repository into a new work tree.
541 bb51a5b4 2020-01-13 stsp Show the status of each affected file, using the following status codes:
542 bb51a5b4 2020-01-13 stsp .Bl -column YXZ description
543 bb51a5b4 2020-01-13 stsp .It A Ta new file was added
544 bb51a5b4 2020-01-13 stsp .It E Ta file already exists in work tree's meta-data
545 bb51a5b4 2020-01-13 stsp .El
546 bb51a5b4 2020-01-13 stsp .Pp
547 5d7c1dab 2018-04-01 stsp If the
548 5d7c1dab 2018-04-01 stsp .Ar work tree path
549 c844a238 2019-02-06 stsp is not specified, either use the last component of
550 5d7c1dab 2018-04-01 stsp .Ar repository path ,
551 5d7c1dab 2018-04-01 stsp or if a
552 5d7c1dab 2018-04-01 stsp .Ar path prefix
553 c844a238 2019-02-06 stsp was specified use the last component of
554 5d7c1dab 2018-04-01 stsp .Ar path prefix .
555 38e11793 2018-06-13 stsp .Pp
556 38e11793 2018-06-13 stsp The options for
557 38e11793 2018-06-13 stsp .Cm got checkout
558 38e11793 2018-06-13 stsp are as follows:
559 38e11793 2018-06-13 stsp .Bl -tag -width Ds
560 08573d5b 2019-05-14 stsp .It Fl b Ar branch
561 3c575567 2019-07-28 stsp Check out files from a commit on the specified
562 08573d5b 2019-05-14 stsp .Ar branch .
563 08573d5b 2019-05-14 stsp If this option is not specified, a branch resolved via the repository's HEAD
564 08573d5b 2019-05-14 stsp reference will be used.
565 8069f636 2019-01-12 stsp .It Fl c Ar commit
566 8069f636 2019-01-12 stsp Check out files from the specified
567 3c575567 2019-07-28 stsp .Ar commit
568 3c575567 2019-07-28 stsp on the selected branch.
569 482b0b83 2023-07-19 thomas If this option is not specified, the most recent commit on the selected
570 482b0b83 2023-07-19 thomas branch will be used.
571 482b0b83 2023-07-19 thomas .Pp
572 482b0b83 2023-07-19 thomas The expected
573 482b0b83 2023-07-19 thomas .Ar commit
574 a290e4b4 2023-07-19 thomas argument is a commit ID SHA1 hash, or a reference name or a keyword
575 a290e4b4 2023-07-19 thomas which will be resolved to a commit ID.
576 0e1b0230 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
577 0e1b0230 2019-07-07 stsp automatically, provided the abbreviation is unique.
578 a290e4b4 2023-07-19 thomas The keywords
579 fb885120 2023-07-19 thomas .Qq :base
580 fb885120 2023-07-19 thomas and
581 fb885120 2023-07-19 thomas .Qq :head
582 a290e4b4 2023-07-19 thomas resolve to the repository's HEAD reference, or, if the
583 fb885120 2023-07-19 thomas .Fl b
584 fb885120 2023-07-19 thomas option is used, the head of the checked-out
585 fb885120 2023-07-19 thomas .Ar branch .
586 fb885120 2023-07-19 thomas Keywords and reference names may be appended with
587 fb885120 2023-07-19 thomas .Qq :+
588 fb885120 2023-07-19 thomas or
589 fb885120 2023-07-19 thomas .Qq :-
590 fb885120 2023-07-19 thomas modifiers and an optional integer N to denote the
591 fb885120 2023-07-19 thomas Nth descendant or antecedent by first parent traversal, respectively;
592 fb885120 2023-07-19 thomas for example,
593 fb885120 2023-07-19 thomas .Sy :head:-2
594 fb885120 2023-07-19 thomas denotes the work tree branch head's 2nd generation ancestor, and
595 fb885120 2023-07-19 thomas .Sy foo:-3
596 fb885120 2023-07-19 thomas will denote the 3rd generation ancestor of the commit resolved by the
597 fb885120 2023-07-19 thomas .Qq foo
598 fb885120 2023-07-19 thomas reference.
599 fb885120 2023-07-19 thomas If an integer does not follow the
600 fb885120 2023-07-19 thomas .Qq :+
601 fb885120 2023-07-19 thomas or
602 fb885120 2023-07-19 thomas .Qq :-
603 fb885120 2023-07-19 thomas modifier, a
604 fb885120 2023-07-19 thomas .Qq 1
605 fb885120 2023-07-19 thomas is implicitly appended
606 fb885120 2023-07-19 thomas .Po e.g.,
607 fb885120 2023-07-19 thomas .Sy :head:-
608 fb885120 2023-07-19 thomas is equivalent to
609 fb885120 2023-07-19 thomas .Sy :head:-1
610 fb885120 2023-07-19 thomas .Pc .
611 4b6c9460 2020-03-05 stsp .Pp
612 4b6c9460 2020-03-05 stsp If the specified
613 4b6c9460 2020-03-05 stsp .Ar commit
614 4b6c9460 2020-03-05 stsp is not contained in the selected branch, a different branch which contains
615 4b6c9460 2020-03-05 stsp this commit must be specified with the
616 4b6c9460 2020-03-05 stsp .Fl b
617 4b6c9460 2020-03-05 stsp option.
618 4b06140e 2022-03-22 thomas If no such branch is known, a new branch must be created for this
619 4b6c9460 2020-03-05 stsp commit with
620 4b6c9460 2020-03-05 stsp .Cm got branch
621 4b6c9460 2020-03-05 stsp before
622 4b6c9460 2020-03-05 stsp .Cm got checkout
623 4b6c9460 2020-03-05 stsp can be used.
624 4b6c9460 2020-03-05 stsp Checking out work trees with an unknown branch is intentionally not supported.
625 d6506a3d 2022-08-16 thomas .It Fl E
626 d6506a3d 2022-08-16 thomas Proceed with the checkout operation even if the directory at
627 d6506a3d 2022-08-16 thomas .Ar work-tree-path
628 d6506a3d 2022-08-16 thomas is not empty.
629 d6506a3d 2022-08-16 thomas Existing files will be left intact.
630 38e11793 2018-06-13 stsp .It Fl p Ar path-prefix
631 38e11793 2018-06-13 stsp Restrict the work tree to a subset of the repository's tree hierarchy.
632 38e11793 2018-06-13 stsp Only files beneath the specified
633 38e11793 2018-06-13 stsp .Ar path-prefix
634 38e11793 2018-06-13 stsp will be checked out.
635 4ad4a1ec 2021-09-13 tracey .It Fl q
636 4ad4a1ec 2021-09-13 tracey Silence progress output.
637 38e11793 2018-06-13 stsp .El
638 e8aa341a 2021-10-08 thomas .Tg up
639 56c96eff 2022-08-30 thomas .It Xo
640 56c96eff 2022-08-30 thomas .Cm update
641 56c96eff 2022-08-30 thomas .Op Fl q
642 56c96eff 2022-08-30 thomas .Op Fl b Ar branch
643 56c96eff 2022-08-30 thomas .Op Fl c Ar commit
644 56c96eff 2022-08-30 thomas .Op Ar path ...
645 56c96eff 2022-08-30 thomas .Xc
646 d912d125 2021-11-04 thomas .Dl Pq alias: Cm up
647 4f331d3a 2020-04-01 stsp Update an existing work tree to a different
648 4f331d3a 2020-04-01 stsp .Ar commit .
649 4f331d3a 2020-04-01 stsp Change existing files in the work tree as necessary to match file contents
650 4f331d3a 2020-04-01 stsp of this commit.
651 4f331d3a 2020-04-01 stsp Preserve any local changes in the work tree and merge them with the
652 4f331d3a 2020-04-01 stsp incoming changes.
653 4f331d3a 2020-04-01 stsp .Pp
654 5036ab18 2020-04-18 stsp Files which already contain merge conflicts will not be updated to avoid
655 5036ab18 2020-04-18 stsp further complications.
656 5036ab18 2020-04-18 stsp Such files will be updated when
657 5036ab18 2020-04-18 stsp .Cm got update
658 5036ab18 2020-04-18 stsp is run again after merge conflicts have been resolved.
659 4b06140e 2022-03-22 thomas If the conflicting changes are no longer needed, affected files can be
660 5036ab18 2020-04-18 stsp reverted with
661 5036ab18 2020-04-18 stsp .Cm got revert
662 5036ab18 2020-04-18 stsp before running
663 5036ab18 2020-04-18 stsp .Cm got update
664 5036ab18 2020-04-18 stsp again.
665 5036ab18 2020-04-18 stsp .Pp
666 7f838b36 2019-02-08 stsp Show the status of each affected file, using the following status codes:
667 7f838b36 2019-02-08 stsp .Bl -column YXZ description
668 7f838b36 2019-02-08 stsp .It U Ta file was updated and contained no local changes
669 7f838b36 2019-02-08 stsp .It G Ta file was updated and local changes were merged cleanly
670 7f838b36 2019-02-08 stsp .It C Ta file was updated and conflicts occurred during merge
671 7f838b36 2019-02-08 stsp .It D Ta file was deleted
672 9f323212 2023-03-10 thomas .It d Ta file's deletion was prevented by local modifications
673 7f838b36 2019-02-08 stsp .It A Ta new file was added
674 1dd86744 2019-08-12 anthony .It \(a~ Ta versioned file is obstructed by a non-regular file
675 a378724f 2019-02-10 stsp .It ! Ta a missing versioned file was restored
676 5036ab18 2020-04-18 stsp .It # Ta file was not updated because it contains merge conflicts
677 3b9f0f87 2020-07-23 stsp .It ? Ta changes destined for an unversioned file were not merged
678 7f838b36 2019-02-08 stsp .El
679 7f838b36 2019-02-08 stsp .Pp
680 f2ea84fa 2019-07-27 stsp If no
681 c4cdcb68 2019-04-03 stsp .Ar path
682 f2ea84fa 2019-07-27 stsp is specified, update the entire work tree.
683 f2ea84fa 2019-07-27 stsp Otherwise, restrict the update operation to files at or within the
684 f2ea84fa 2019-07-27 stsp specified paths.
685 f2ea84fa 2019-07-27 stsp Each path is required to exist in the update operation's target commit.
686 f2ea84fa 2019-07-27 stsp Files in the work tree outside specified paths will remain unchanged and
687 f2ea84fa 2019-07-27 stsp will retain their previously recorded base commit.
688 f2cf8fbb 2019-04-04 stsp Some
689 f2cf8fbb 2019-04-04 stsp .Nm
690 f2cf8fbb 2019-04-04 stsp commands may refuse to run while the work tree contains files from
691 c4cdcb68 2019-04-03 stsp multiple base commits.
692 f2cf8fbb 2019-04-04 stsp The base commit of such a work tree can be made consistent by running
693 47ec7be7 2019-05-12 stsp .Cm got update
694 47ec7be7 2019-05-12 stsp across the entire work tree.
695 024e9686 2019-05-14 stsp Specifying a
696 024e9686 2019-05-14 stsp .Ar path
697 024e9686 2019-05-14 stsp is incompatible with the
698 024e9686 2019-05-14 stsp .Fl b
699 024e9686 2019-05-14 stsp option.
700 7f838b36 2019-02-08 stsp .Pp
701 4ed9f614 2019-08-04 stsp .Cm got update
702 4ed9f614 2019-08-04 stsp cannot update paths with staged changes.
703 4ed9f614 2019-08-04 stsp If changes have been staged with
704 4ed9f614 2019-08-04 stsp .Cm got stage ,
705 bc3056e3 2019-08-18 stsp these changes must first be committed with
706 4ed9f614 2019-08-04 stsp .Cm got commit
707 4ed9f614 2019-08-04 stsp or unstaged with
708 4ed9f614 2019-08-04 stsp .Cm got unstage .
709 4ed9f614 2019-08-04 stsp .Pp
710 507dc3bb 2018-12-29 stsp The options for
711 507dc3bb 2018-12-29 stsp .Cm got update
712 507dc3bb 2018-12-29 stsp are as follows:
713 507dc3bb 2018-12-29 stsp .Bl -tag -width Ds
714 024e9686 2019-05-14 stsp .It Fl b Ar branch
715 024e9686 2019-05-14 stsp Switch the work tree's branch reference to the specified
716 024e9686 2019-05-14 stsp .Ar branch
717 024e9686 2019-05-14 stsp before updating the work tree.
718 024e9686 2019-05-14 stsp This option requires that all paths in the work tree are updated.
719 4f331d3a 2020-04-01 stsp .Pp
720 4f331d3a 2020-04-01 stsp As usual, any local changes in the work tree will be preserved.
721 4f331d3a 2020-04-01 stsp This can be useful when switching to a newly created branch in order
722 4f331d3a 2020-04-01 stsp to commit existing local changes to this branch.
723 4f331d3a 2020-04-01 stsp .Pp
724 4f331d3a 2020-04-01 stsp Any local changes must be dealt with separately in order to obtain a
725 4f331d3a 2020-04-01 stsp work tree with pristine file contents corresponding exactly to the specified
726 4f331d3a 2020-04-01 stsp .Ar branch .
727 4f331d3a 2020-04-01 stsp Such changes could first be committed to a different branch with
728 4f331d3a 2020-04-01 stsp .Cm got commit ,
729 4f331d3a 2020-04-01 stsp or could be discarded with
730 4f331d3a 2020-04-01 stsp .Cm got revert .
731 507dc3bb 2018-12-29 stsp .It Fl c Ar commit
732 507dc3bb 2018-12-29 stsp Update the work tree to the specified
733 507dc3bb 2018-12-29 stsp .Ar commit .
734 482b0b83 2023-07-19 thomas If this option is not specified, the most recent commit on the work tree's
735 482b0b83 2023-07-19 thomas branch will be used.
736 482b0b83 2023-07-19 thomas .Pp
737 482b0b83 2023-07-19 thomas The expected
738 482b0b83 2023-07-19 thomas .Ar commit
739 a290e4b4 2023-07-19 thomas argument is a commit ID SHA1 hash, or a reference name or a keyword
740 a290e4b4 2023-07-19 thomas which will be resolved to a commit ID.
741 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
742 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
743 a290e4b4 2023-07-19 thomas The keywords
744 9139e004 2023-07-17 thomas .Qq :base
745 9139e004 2023-07-17 thomas and
746 9139e004 2023-07-17 thomas .Qq :head
747 a290e4b4 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
748 9139e004 2023-07-17 thomas Keywords and reference names may be appended with
749 9139e004 2023-07-17 thomas .Qq :+
750 9139e004 2023-07-17 thomas or
751 9139e004 2023-07-17 thomas .Qq :-
752 9139e004 2023-07-17 thomas modifiers and an optional integer N to denote the
753 9139e004 2023-07-17 thomas Nth descendant or antecedent, respectively, by first parent traversal;
754 9139e004 2023-07-17 thomas for example,
755 9139e004 2023-07-17 thomas .Sy :head:-2
756 1b990074 2023-07-17 thomas denotes the work tree branch head's 2nd generation ancestor, and
757 9139e004 2023-07-17 thomas .Sy :base:+4
758 9139e004 2023-07-17 thomas denotes the 4th generation descendant of the work tree's base commit.
759 9139e004 2023-07-17 thomas Similarly,
760 9139e004 2023-07-17 thomas .Sy foo:-3
761 9139e004 2023-07-17 thomas will denote the 3rd generation ancestor of the commit resolved by the
762 9139e004 2023-07-17 thomas .Qq foo
763 9139e004 2023-07-17 thomas reference.
764 9139e004 2023-07-17 thomas If an integer does not follow the
765 9139e004 2023-07-17 thomas .Qq :+
766 9139e004 2023-07-17 thomas or
767 9139e004 2023-07-17 thomas .Qq :-
768 9139e004 2023-07-17 thomas modifier, a
769 9139e004 2023-07-17 thomas .Qq 1
770 9139e004 2023-07-17 thomas is implicitly appended
771 9139e004 2023-07-17 thomas .Po e.g.,
772 9139e004 2023-07-17 thomas .Sy :head:-
773 9139e004 2023-07-17 thomas is equivalent to
774 9139e004 2023-07-17 thomas .Sy :head:-1
775 9139e004 2023-07-17 thomas .Pc .
776 4ad4a1ec 2021-09-13 tracey .It Fl q
777 4ad4a1ec 2021-09-13 tracey Silence progress output.
778 507dc3bb 2018-12-29 stsp .El
779 e8aa341a 2021-10-08 thomas .Tg st
780 56c96eff 2022-08-30 thomas .It Xo
781 56c96eff 2022-08-30 thomas .Cm status
782 56c96eff 2022-08-30 thomas .Op Fl I
783 56c96eff 2022-08-30 thomas .Op Fl S Ar status-codes
784 56c96eff 2022-08-30 thomas .Op Fl s Ar status-codes
785 56c96eff 2022-08-30 thomas .Op Ar path ...
786 56c96eff 2022-08-30 thomas .Xc
787 d912d125 2021-11-04 thomas .Dl Pq alias: Cm st
788 6cd959e6 2019-03-26 stsp Show the current modification status of files in a work tree,
789 6bad629b 2019-02-04 stsp using the following status codes:
790 6bad629b 2019-02-04 stsp .Bl -column YXZ description
791 6bad629b 2019-02-04 stsp .It M Ta modified file
792 079890a9 2019-03-26 stsp .It A Ta file scheduled for addition in next commit
793 079890a9 2019-03-26 stsp .It D Ta file scheduled for deletion in next commit
794 7154f6ce 2019-03-27 stsp .It C Ta modified or added file which contains merge conflicts
795 6bad629b 2019-02-04 stsp .It ! Ta versioned file was expected on disk but is missing
796 1dd86744 2019-08-12 anthony .It \(a~ Ta versioned file is obstructed by a non-regular file
797 6bad629b 2019-02-04 stsp .It ? Ta unversioned item not tracked by
798 6bad629b 2019-02-04 stsp .Nm
799 1ebedb77 2019-10-19 stsp .It m Ta modified file modes (executable bit only)
800 2a06fe5f 2019-08-24 stsp .It N Ta non-existent
801 2a06fe5f 2019-08-24 stsp .Ar path
802 2a06fe5f 2019-08-24 stsp specified on the command line
803 6bad629b 2019-02-04 stsp .El
804 6bad629b 2019-02-04 stsp .Pp
805 72ea6654 2019-07-27 stsp If no
806 927df6b7 2019-02-10 stsp .Ar path
807 72ea6654 2019-07-27 stsp is specified, show modifications in the entire work tree.
808 72ea6654 2019-07-27 stsp Otherwise, show modifications at or within the specified paths.
809 4ed9f614 2019-08-04 stsp .Pp
810 4ed9f614 2019-08-04 stsp If changes have been staged with
811 4ed9f614 2019-08-04 stsp .Cm got stage ,
812 4ed9f614 2019-08-04 stsp staged changes are shown in the second output column, using the following
813 4ed9f614 2019-08-04 stsp status codes:
814 4ed9f614 2019-08-04 stsp .Bl -column YXZ description
815 4ed9f614 2019-08-04 stsp .It M Ta file modification is staged
816 4ed9f614 2019-08-04 stsp .It A Ta file addition is staged
817 4ed9f614 2019-08-04 stsp .It D Ta file deletion is staged
818 4ed9f614 2019-08-04 stsp .El
819 4ed9f614 2019-08-04 stsp .Pp
820 95ac67f0 2019-08-08 stsp Changes created on top of staged changes are indicated in the first column:
821 4ed9f614 2019-08-04 stsp .Bl -column YXZ description
822 95ac67f0 2019-08-08 stsp .It MM Ta file was modified after earlier changes have been staged
823 95ac67f0 2019-08-08 stsp .It MA Ta file was modified after having been staged for addition
824 4ed9f614 2019-08-04 stsp .El
825 6841da00 2019-08-08 stsp .Pp
826 081470ac 2020-08-13 stsp The options for
827 081470ac 2020-08-13 stsp .Cm got status
828 081470ac 2020-08-13 stsp are as follows:
829 081470ac 2020-08-13 stsp .Bl -tag -width Ds
830 f6343036 2021-06-22 stsp .It Fl I
831 f6343036 2021-06-22 stsp Show unversioned files even if they match an ignore pattern.
832 d6506a3d 2022-08-16 thomas .It Fl S Ar status-codes
833 d6506a3d 2022-08-16 thomas Suppress the output of files with a modification status matching any of the
834 00357e4d 2021-09-14 tracey single-character status codes contained in the
835 00357e4d 2021-09-14 tracey .Ar status-codes
836 00357e4d 2021-09-14 tracey argument.
837 00357e4d 2021-09-14 tracey Any combination of codes from the above list of possible status codes
838 00357e4d 2021-09-14 tracey may be specified.
839 00357e4d 2021-09-14 tracey For staged files, status codes displayed in either column will be matched.
840 b043307b 2021-09-14 stsp Cannot be used together with the
841 d6506a3d 2022-08-16 thomas .Fl s
842 b043307b 2021-09-14 stsp option.
843 d6506a3d 2022-08-16 thomas .It Fl s Ar status-codes
844 d6506a3d 2022-08-16 thomas Only show files with a modification status matching any of the
845 081470ac 2020-08-13 stsp single-character status codes contained in the
846 081470ac 2020-08-13 stsp .Ar status-codes
847 081470ac 2020-08-13 stsp argument.
848 081470ac 2020-08-13 stsp Any combination of codes from the above list of possible status codes
849 081470ac 2020-08-13 stsp may be specified.
850 081470ac 2020-08-13 stsp For staged files, status codes displayed in either column will be matched.
851 b043307b 2021-09-14 stsp Cannot be used together with the
852 d6506a3d 2022-08-16 thomas .Fl S
853 b043307b 2021-09-14 stsp option.
854 081470ac 2020-08-13 stsp .El
855 081470ac 2020-08-13 stsp .Pp
856 6841da00 2019-08-08 stsp For compatibility with
857 bd8de430 2019-10-04 stsp .Xr cvs 1
858 bd8de430 2019-10-04 stsp and
859 bd8de430 2019-10-04 stsp .Xr git 1 ,
860 6841da00 2019-08-08 stsp .Cm got status
861 bd8de430 2019-10-04 stsp reads
862 bd8de430 2019-10-04 stsp .Xr glob 7
863 bd8de430 2019-10-04 stsp patterns from
864 6841da00 2019-08-08 stsp .Pa .cvsignore
865 bd8de430 2019-10-04 stsp and
866 bd8de430 2019-10-04 stsp .Pa .gitignore
867 6841da00 2019-08-08 stsp files in each traversed directory and will not display unversioned files
868 bd8de430 2019-10-04 stsp which match these patterns.
869 1b5d300f 2023-02-20 thomas Ignore patterns which end with a slash,
870 1b5d300f 2023-02-20 thomas .Dq / ,
871 1b5d300f 2023-02-20 thomas will only match directories.
872 bd8de430 2019-10-04 stsp As an extension to
873 6841da00 2019-08-08 stsp .Xr glob 7
874 bd8de430 2019-10-04 stsp matching rules,
875 bd8de430 2019-10-04 stsp .Cm got status
876 bd8de430 2019-10-04 stsp supports consecutive asterisks,
877 bd8de430 2019-10-04 stsp .Dq ** ,
878 bd8de430 2019-10-04 stsp which will match an arbitrary amount of directories.
879 6841da00 2019-08-08 stsp Unlike
880 6841da00 2019-08-08 stsp .Xr cvs 1 ,
881 6841da00 2019-08-08 stsp .Cm got status
882 6841da00 2019-08-08 stsp only supports a single ignore pattern per line.
883 bd8de430 2019-10-04 stsp Unlike
884 bd8de430 2019-10-04 stsp .Xr git 1 ,
885 bd8de430 2019-10-04 stsp .Cm got status
886 bd8de430 2019-10-04 stsp does not support negated ignore patterns prefixed with
887 bd8de430 2019-10-04 stsp .Dq \&! ,
888 bd8de430 2019-10-04 stsp and gives no special significance to the location of path component separators,
889 bd8de430 2019-10-04 stsp .Dq / ,
890 bd8de430 2019-10-04 stsp in a pattern.
891 56c96eff 2022-08-30 thomas .It Xo
892 56c96eff 2022-08-30 thomas .Cm log
893 f3ad4b0a 2023-01-07 thomas .Op Fl bdPpRs
894 56c96eff 2022-08-30 thomas .Op Fl C Ar number
895 56c96eff 2022-08-30 thomas .Op Fl c Ar commit
896 56c96eff 2022-08-30 thomas .Op Fl l Ar N
897 56c96eff 2022-08-30 thomas .Op Fl r Ar repository-path
898 56c96eff 2022-08-30 thomas .Op Fl S Ar search-pattern
899 56c96eff 2022-08-30 thomas .Op Fl x Ar commit
900 56c96eff 2022-08-30 thomas .Op Ar path
901 56c96eff 2022-08-30 thomas .Xc
902 38e11793 2018-06-13 stsp Display history of a repository.
903 04ca23f4 2018-07-16 stsp If a
904 04ca23f4 2018-07-16 stsp .Ar path
905 04ca23f4 2018-07-16 stsp is specified, show only commits which modified this path.
906 dc990cbf 2020-02-22 stsp If invoked in a work tree, the
907 dc990cbf 2020-02-22 stsp .Ar path
908 dc990cbf 2020-02-22 stsp is interpreted relative to the current working directory,
909 dc990cbf 2020-02-22 stsp and the work tree's path prefix is implicitly prepended.
910 dc990cbf 2020-02-22 stsp Otherwise, the path is interpreted relative to the repository root.
911 38e11793 2018-06-13 stsp .Pp
912 38e11793 2018-06-13 stsp The options for
913 38e11793 2018-06-13 stsp .Cm got log
914 38e11793 2018-06-13 stsp are as follows:
915 38e11793 2018-06-13 stsp .Bl -tag -width Ds
916 48c8c60d 2020-01-27 stsp .It Fl b
917 1137e0ae 2020-01-27 stsp Display individual commits which were merged into the current branch
918 1137e0ae 2020-01-27 stsp from other branches.
919 48c8c60d 2020-01-27 stsp By default,
920 48c8c60d 2020-01-27 stsp .Cm got log
921 48c8c60d 2020-01-27 stsp shows the linear history of the current branch only.
922 d6506a3d 2022-08-16 thomas .It Fl C Ar number
923 d6506a3d 2022-08-16 thomas Set the number of context lines shown in diffs with
924 d6506a3d 2022-08-16 thomas .Fl p .
925 d6506a3d 2022-08-16 thomas By default, 3 lines of context are shown.
926 38e11793 2018-06-13 stsp .It Fl c Ar commit
927 38e11793 2018-06-13 stsp Start traversing history at the specified
928 38e11793 2018-06-13 stsp .Ar commit .
929 482b0b83 2023-07-19 thomas If this option is not specified, default to the work tree's current branch
930 482b0b83 2023-07-19 thomas if invoked in a work tree, or to the repository's HEAD reference.
931 482b0b83 2023-07-19 thomas .Pp
932 482b0b83 2023-07-19 thomas The expected
933 482b0b83 2023-07-19 thomas .Ar commit
934 a290e4b4 2023-07-19 thomas argument is a commit ID SHA1 hash, or a reference name or a keyword
935 a290e4b4 2023-07-19 thomas which will be resolved to a commit ID.
936 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
937 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
938 a290e4b4 2023-07-19 thomas The keywords
939 9139e004 2023-07-17 thomas .Qq :base
940 9139e004 2023-07-17 thomas and
941 9139e004 2023-07-17 thomas .Qq :head
942 a290e4b4 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
943 9139e004 2023-07-17 thomas The former is only valid if invoked in a work tree, while the latter will
944 9139e004 2023-07-17 thomas resolve to the tip of the work tree's current branch if invoked in a
945 9139e004 2023-07-17 thomas work tree, otherwise it will resolve to the repository's HEAD reference.
946 9139e004 2023-07-17 thomas Keywords and references may be appended with
947 9139e004 2023-07-17 thomas .Qq :+
948 9139e004 2023-07-17 thomas or
949 9139e004 2023-07-17 thomas .Qq :-
950 9139e004 2023-07-17 thomas modifiers and an optional integer N to denote the
951 9139e004 2023-07-17 thomas Nth descendant or antecedent, respectively, by first parent traversal;
952 9139e004 2023-07-17 thomas for example,
953 9139e004 2023-07-17 thomas .Sy :head:-2
954 9139e004 2023-07-17 thomas denotes the HEAD reference's 2nd generation ancestor, and
955 9139e004 2023-07-17 thomas .Sy :base:+4
956 9139e004 2023-07-17 thomas denotes the 4th generation descendant of the work tree's base commit.
957 9139e004 2023-07-17 thomas Similarly,
958 9139e004 2023-07-17 thomas .Sy bar:+3
959 9139e004 2023-07-17 thomas will denote the 3rd generation descendant of the commit resolved by the
960 9139e004 2023-07-17 thomas .Qq bar
961 9139e004 2023-07-17 thomas reference.
962 9139e004 2023-07-17 thomas A
963 9139e004 2023-07-17 thomas .Qq :+
964 9139e004 2023-07-17 thomas or
965 9139e004 2023-07-17 thomas .Qq :-
966 9139e004 2023-07-17 thomas modifier without a trailing integer has an implicit
967 9139e004 2023-07-17 thomas .Qq 1
968 9139e004 2023-07-17 thomas appended
969 9139e004 2023-07-17 thomas .Po e.g.,
970 9139e004 2023-07-17 thomas .Sy :base:+
971 9139e004 2023-07-17 thomas is equivalent to
972 9139e004 2023-07-17 thomas .Sy :base:+1
973 9139e004 2023-07-17 thomas .Pc .
974 772fcad5 2023-01-07 thomas .It Fl d
975 be97ab03 2023-01-19 thomas Display diffstat of changes introduced in each commit.
976 772fcad5 2023-01-07 thomas Cannot be used with the
977 772fcad5 2023-01-07 thomas .Fl s
978 772fcad5 2023-01-07 thomas option.
979 6238ee32 2018-06-13 stsp .It Fl l Ar N
980 6238ee32 2018-06-13 stsp Limit history traversal to a given number of commits.
981 b1ebc001 2019-08-13 stsp If this option is not specified, a default limit value of zero is used,
982 b1ebc001 2019-08-13 stsp which is treated as an unbounded limit.
983 b1ebc001 2019-08-13 stsp The
984 b1ebc001 2019-08-13 stsp .Ev GOT_LOG_DEFAULT_LIMIT
985 b1ebc001 2019-08-13 stsp environment variable may be set to change this default value.
986 0208f208 2020-05-05 stsp .It Fl P
987 0208f208 2020-05-05 stsp Display the list of file paths changed in each commit, using the following
988 0208f208 2020-05-05 stsp status codes:
989 0208f208 2020-05-05 stsp .Bl -column YXZ description
990 0208f208 2020-05-05 stsp .It M Ta modified file
991 0208f208 2020-05-05 stsp .It D Ta file was deleted
992 0208f208 2020-05-05 stsp .It A Ta new file was added
993 0208f208 2020-05-05 stsp .It m Ta modified file modes (executable bit only)
994 0208f208 2020-05-05 stsp .El
995 e2f45bc4 2022-06-13 thomas .Pp
996 2f7ada20 2022-06-13 thomas Cannot be used with the
997 2f7ada20 2022-06-13 thomas .Fl s
998 2f7ada20 2022-06-13 thomas option.
999 d6506a3d 2022-08-16 thomas .It Fl p
1000 d6506a3d 2022-08-16 thomas Display the patch of modifications made in each commit.
1001 d6506a3d 2022-08-16 thomas If a
1002 d6506a3d 2022-08-16 thomas .Ar path
1003 d6506a3d 2022-08-16 thomas is specified, only show the patch of modifications at or within this path.
1004 d6506a3d 2022-08-16 thomas Cannot be used with the
1005 d6506a3d 2022-08-16 thomas .Fl s
1006 2f7ada20 2022-06-13 thomas option.
1007 d6506a3d 2022-08-16 thomas .It Fl R
1008 d6506a3d 2022-08-16 thomas Determine a set of commits to display as usual, but display these commits
1009 d6506a3d 2022-08-16 thomas in reverse order.
1010 d6506a3d 2022-08-16 thomas .It Fl r Ar repository-path
1011 d6506a3d 2022-08-16 thomas Use the repository at the specified path.
1012 d6506a3d 2022-08-16 thomas If not specified, assume the repository is located at or above the current
1013 d6506a3d 2022-08-16 thomas working directory.
1014 d6506a3d 2022-08-16 thomas If this directory is a
1015 d6506a3d 2022-08-16 thomas .Nm
1016 d6506a3d 2022-08-16 thomas work tree, use the repository path associated with this work tree.
1017 2f7ada20 2022-06-13 thomas .It Fl S Ar search-pattern
1018 4fe9456b 2022-06-13 thomas If specified, show only commits with a log message, author name,
1019 4fe9456b 2022-06-13 thomas committer name, or ID SHA1 hash matched by the extended regular
1020 4fe9456b 2022-06-13 thomas expression
1021 6841bf13 2019-11-29 kn .Ar search-pattern .
1022 314444e4 2022-06-13 thomas Lines in committed patches will be matched if
1023 314444e4 2022-06-13 thomas .Fl p
1024 314444e4 2022-06-13 thomas is specified.
1025 314444e4 2022-06-13 thomas File paths changed by a commit will be matched if
1026 314444e4 2022-06-13 thomas .Fl P
1027 314444e4 2022-06-13 thomas is specified.
1028 6841bf13 2019-11-29 kn Regular expression syntax is documented in
1029 6841bf13 2019-11-29 kn .Xr re_format 7 .
1030 d6506a3d 2022-08-16 thomas .It Fl s
1031 d6506a3d 2022-08-16 thomas Display a short one-line summary of each commit, instead of the default
1032 d6506a3d 2022-08-16 thomas history format.
1033 d6506a3d 2022-08-16 thomas Cannot be used together with the
1034 d6506a3d 2022-08-16 thomas .Fl p
1035 d6506a3d 2022-08-16 thomas or
1036 d6506a3d 2022-08-16 thomas .Fl P
1037 d6506a3d 2022-08-16 thomas option.
1038 d1fe46f9 2020-04-18 stsp .It Fl x Ar commit
1039 4e20a648 2021-03-21 jrick Stop traversing commit history immediately after the specified
1040 d1fe46f9 2020-04-18 stsp .Ar commit
1041 52ab7958 2020-04-18 stsp has been traversed.
1042 ef153826 2023-08-08 thomas Like
1043 ef153826 2023-08-08 thomas .Fl c ,
1044 ef153826 2023-08-08 thomas the expected
1045 ef153826 2023-08-08 thomas .Ar commit
1046 ef153826 2023-08-08 thomas argument is a commit ID SHA1 hash, or a reference name or a keyword
1047 ef153826 2023-08-08 thomas which will be resolved to a commit ID.
1048 d1fe46f9 2020-04-18 stsp This option has no effect if the specified
1049 d1fe46f9 2020-04-18 stsp .Ar commit
1050 d1fe46f9 2020-04-18 stsp is never traversed.
1051 38e11793 2018-06-13 stsp .El
1052 e8aa341a 2021-10-08 thomas .Tg di
1053 56c96eff 2022-08-30 thomas .It Xo
1054 56c96eff 2022-08-30 thomas .Cm diff
1055 53d03f97 2023-01-10 thomas .Op Fl adPsw
1056 56c96eff 2022-08-30 thomas .Op Fl C Ar number
1057 56c96eff 2022-08-30 thomas .Op Fl c Ar commit
1058 56c96eff 2022-08-30 thomas .Op Fl r Ar repository-path
1059 56c96eff 2022-08-30 thomas .Op Ar object1 Ar object2 | Ar path ...
1060 56c96eff 2022-08-30 thomas .Xc
1061 d912d125 2021-11-04 thomas .Dl Pq alias: Cm di
1062 30f6c0c6 2021-10-08 thomas When invoked within a work tree without any arguments, display all
1063 bd81cfb7 2020-04-19 stsp local changes in the work tree.
1064 30f6c0c6 2021-10-08 thomas If one or more
1065 927df6b7 2019-02-10 stsp .Ar path
1066 30f6c0c6 2021-10-08 thomas arguments are specified, only show changes within the specified paths.
1067 927df6b7 2019-02-10 stsp .Pp
1068 d24820bf 2019-08-11 stsp If two arguments are provided, treat each argument as a reference, a tag
1069 d24820bf 2019-08-11 stsp name, or an object ID SHA1 hash, and display differences between the
1070 d24820bf 2019-08-11 stsp corresponding objects.
1071 3f8b7d6a 2018-04-01 stsp Both objects must be of the same type (blobs, trees, or commits).
1072 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
1073 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
1074 30f6c0c6 2021-10-08 thomas If none of these interpretations produce a valid result or if the
1075 30f6c0c6 2021-10-08 thomas .Fl P
1076 30f6c0c6 2021-10-08 thomas option is used,
1077 30f6c0c6 2021-10-08 thomas and if
1078 30f6c0c6 2021-10-08 thomas .Cm got diff
1079 30f6c0c6 2021-10-08 thomas is running in a work tree, attempt to interpret the two arguments as paths.
1080 c0cc5c62 2018-10-18 stsp .Pp
1081 c0cc5c62 2018-10-18 stsp The options for
1082 c0cc5c62 2018-10-18 stsp .Cm got diff
1083 c0cc5c62 2018-10-18 stsp are as follows:
1084 c0cc5c62 2018-10-18 stsp .Bl -tag -width Ds
1085 64453f7e 2020-11-21 stsp .It Fl a
1086 64453f7e 2020-11-21 stsp Treat file contents as ASCII text even if binary data is detected.
1087 d6506a3d 2022-08-16 thomas .It Fl C Ar number
1088 d6506a3d 2022-08-16 thomas Set the number of context lines shown in the diff.
1089 d6506a3d 2022-08-16 thomas By default, 3 lines of context are shown.
1090 cc8021af 2021-10-12 thomas .It Fl c Ar commit
1091 cc8021af 2021-10-12 thomas Show differences between commits in the repository.
1092 d6506a3d 2022-08-16 thomas This option may be used up to two times.
1093 cc8021af 2021-10-12 thomas When used only once, show differences between the specified
1094 cc8021af 2021-10-12 thomas .Ar commit
1095 cc8021af 2021-10-12 thomas and its first parent commit.
1096 cc8021af 2021-10-12 thomas When used twice, show differences between the two specified commits.
1097 cc8021af 2021-10-12 thomas .Pp
1098 482b0b83 2023-07-19 thomas If the
1099 482b0b83 2023-07-19 thomas .Fl c
1100 482b0b83 2023-07-19 thomas option is used, all non-option arguments will be interpreted as paths.
1101 482b0b83 2023-07-19 thomas If one or more such
1102 482b0b83 2023-07-19 thomas .Ar path
1103 482b0b83 2023-07-19 thomas arguments are provided, only show differences for the specified paths.
1104 482b0b83 2023-07-19 thomas .Pp
1105 482b0b83 2023-07-19 thomas The expected
1106 482b0b83 2023-07-19 thomas .Ar commit
1107 a290e4b4 2023-07-19 thomas argument is a commit ID SHA1 hash, or a reference name or a keyword
1108 a290e4b4 2023-07-19 thomas which will be resolved to a commit ID.
1109 cc8021af 2021-10-12 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
1110 cc8021af 2021-10-12 thomas automatically, provided the abbreviation is unique.
1111 a290e4b4 2023-07-19 thomas The keywords
1112 9139e004 2023-07-17 thomas .Qq :base
1113 9139e004 2023-07-17 thomas and
1114 9139e004 2023-07-17 thomas .Qq :head
1115 a290e4b4 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
1116 9139e004 2023-07-17 thomas The former is only valid if invoked in a work tree, while the latter will
1117 9139e004 2023-07-17 thomas resolve to the tip of the work tree's current branch if invoked in a
1118 9139e004 2023-07-17 thomas work tree, otherwise it will resolve to the repository's HEAD reference.
1119 9139e004 2023-07-17 thomas Keywords and references may be appended with
1120 9139e004 2023-07-17 thomas .Qq :+
1121 9139e004 2023-07-17 thomas or
1122 9139e004 2023-07-17 thomas .Qq :-
1123 9139e004 2023-07-17 thomas modifiers and an optional integer N to denote the
1124 9139e004 2023-07-17 thomas Nth descendant or antecedent, respectively, by first parent traversal;
1125 9139e004 2023-07-17 thomas for example,
1126 9139e004 2023-07-17 thomas .Sy :head:-2
1127 9139e004 2023-07-17 thomas denotes the HEAD reference's 2nd generation ancestor, and
1128 9139e004 2023-07-17 thomas .Sy :base:+4
1129 9139e004 2023-07-17 thomas denotes the 4th generation descendant of the work tree's base commit.
1130 9139e004 2023-07-17 thomas Similarly,
1131 9139e004 2023-07-17 thomas .Sy baz:+8
1132 9139e004 2023-07-17 thomas will denote the 8th generation descendant of the commit resolved by the
1133 9139e004 2023-07-17 thomas .Qq baz
1134 9139e004 2023-07-17 thomas reference.
1135 9139e004 2023-07-17 thomas If an integer does not follow the
1136 9139e004 2023-07-17 thomas .Qq :+
1137 9139e004 2023-07-17 thomas or
1138 9139e004 2023-07-17 thomas .Qq :-
1139 9139e004 2023-07-17 thomas modifier, a
1140 9139e004 2023-07-17 thomas .Qq 1
1141 9139e004 2023-07-17 thomas is implicitly appended
1142 9139e004 2023-07-17 thomas .Po e.g.,
1143 9139e004 2023-07-17 thomas .Sy :head:-
1144 9139e004 2023-07-17 thomas is equivalent to
1145 9139e004 2023-07-17 thomas .Sy :head:-1
1146 9139e004 2023-07-17 thomas .Pc .
1147 cc8021af 2021-10-12 thomas .Pp
1148 cc8021af 2021-10-12 thomas Cannot be used together with the
1149 cc8021af 2021-10-12 thomas .Fl P
1150 cc8021af 2021-10-12 thomas option.
1151 53d03f97 2023-01-10 thomas .It Fl d
1152 53d03f97 2023-01-10 thomas Display diffstat of changes before the actual diff by annotating each file path
1153 53d03f97 2023-01-10 thomas or blob hash being diffed with the total number of lines added and removed.
1154 53d03f97 2023-01-10 thomas A summary line will display the total number of changes across all files.
1155 d6506a3d 2022-08-16 thomas .It Fl P
1156 d6506a3d 2022-08-16 thomas Interpret all arguments as paths only.
1157 d6506a3d 2022-08-16 thomas This option can be used to resolve ambiguity in cases where paths
1158 d6506a3d 2022-08-16 thomas look like tag names, reference names, or object IDs.
1159 d6506a3d 2022-08-16 thomas This option is only valid when
1160 d6506a3d 2022-08-16 thomas .Cm got diff
1161 d6506a3d 2022-08-16 thomas is invoked in a work tree.
1162 b72f483a 2019-02-05 stsp .It Fl r Ar repository-path
1163 b72f483a 2019-02-05 stsp Use the repository at the specified path.
1164 b72f483a 2019-02-05 stsp If not specified, assume the repository is located at or above the current
1165 b72f483a 2019-02-05 stsp working directory.
1166 b72f483a 2019-02-05 stsp If this directory is a
1167 b72f483a 2019-02-05 stsp .Nm
1168 b72f483a 2019-02-05 stsp work tree, use the repository path associated with this work tree.
1169 4ed9f614 2019-08-04 stsp .It Fl s
1170 4ed9f614 2019-08-04 stsp Show changes staged with
1171 4ed9f614 2019-08-04 stsp .Cm got stage
1172 bd81cfb7 2020-04-19 stsp instead of showing local changes in the work tree.
1173 30f6c0c6 2021-10-08 thomas This option is only valid when
1174 30f6c0c6 2021-10-08 thomas .Cm got diff
1175 30f6c0c6 2021-10-08 thomas is invoked in a work tree.
1176 63035f9f 2019-10-06 stsp .It Fl w
1177 63035f9f 2019-10-06 stsp Ignore whitespace-only changes.
1178 c0cc5c62 2018-10-18 stsp .El
1179 e8aa341a 2021-10-08 thomas .Tg bl
1180 56c96eff 2022-08-30 thomas .It Xo
1181 56c96eff 2022-08-30 thomas .Cm blame
1182 56c96eff 2022-08-30 thomas .Op Fl c Ar commit
1183 56c96eff 2022-08-30 thomas .Op Fl r Ar repository-path
1184 56c96eff 2022-08-30 thomas .Ar path
1185 56c96eff 2022-08-30 thomas .Xc
1186 d912d125 2021-11-04 thomas .Dl Pq alias: Cm bl
1187 1ff8e573 2018-08-02 stsp Display line-by-line history of a file at the specified path.
1188 1ff8e573 2018-08-02 stsp .Pp
1189 1ff8e573 2018-08-02 stsp The options for
1190 1ff8e573 2018-08-02 stsp .Cm got blame
1191 1ff8e573 2018-08-02 stsp are as follows:
1192 1ff8e573 2018-08-02 stsp .Bl -tag -width Ds
1193 1ff8e573 2018-08-02 stsp .It Fl c Ar commit
1194 1ff8e573 2018-08-02 stsp Start traversing history at the specified
1195 1ff8e573 2018-08-02 stsp .Ar commit .
1196 9f625d2d 2023-07-19 thomas The expected argument is a commit ID SHA1 hash, or a reference name
1197 9f625d2d 2023-07-19 thomas or a keyword which will be resolved to a commit ID.
1198 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
1199 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
1200 9f625d2d 2023-07-19 thomas The keywords
1201 3795e2b6 2023-07-19 thomas .Qq :base
1202 3795e2b6 2023-07-19 thomas and
1203 3795e2b6 2023-07-19 thomas .Qq :head
1204 9f625d2d 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
1205 3795e2b6 2023-07-19 thomas The former is only valid if invoked in a work tree, while the latter will
1206 3795e2b6 2023-07-19 thomas resolve to the tip of the work tree's current branch if invoked in a
1207 3795e2b6 2023-07-19 thomas work tree, otherwise it will resolve to the repository's HEAD reference.
1208 3795e2b6 2023-07-19 thomas Keywords and references may be appended with
1209 3795e2b6 2023-07-19 thomas .Qq :+
1210 3795e2b6 2023-07-19 thomas or
1211 3795e2b6 2023-07-19 thomas .Qq :-
1212 3795e2b6 2023-07-19 thomas modifiers and an optional integer N to denote the
1213 3795e2b6 2023-07-19 thomas Nth descendant or antecedent by first parent traversal, respectively;
1214 3795e2b6 2023-07-19 thomas for example,
1215 3795e2b6 2023-07-19 thomas .Sy :head:-2
1216 3795e2b6 2023-07-19 thomas denotes the work tree branch head's 2nd generation ancestor, and
1217 3795e2b6 2023-07-19 thomas .Sy :base:+4
1218 3795e2b6 2023-07-19 thomas denotes the 4th generation descendant of the work tree's base commit.
1219 3795e2b6 2023-07-19 thomas Similarly,
1220 3795e2b6 2023-07-19 thomas .Sy xyz:-5
1221 3795e2b6 2023-07-19 thomas will denote the 5th generation ancestor of the commit resolved by the
1222 3795e2b6 2023-07-19 thomas .Qq xyz
1223 3795e2b6 2023-07-19 thomas reference.
1224 3795e2b6 2023-07-19 thomas A
1225 3795e2b6 2023-07-19 thomas .Qq :+
1226 3795e2b6 2023-07-19 thomas or
1227 3795e2b6 2023-07-19 thomas .Qq :-
1228 3795e2b6 2023-07-19 thomas modifier without a trailing integer has an implicit
1229 3795e2b6 2023-07-19 thomas .Qq 1
1230 3795e2b6 2023-07-19 thomas appended
1231 3795e2b6 2023-07-19 thomas .Po e.g.,
1232 3795e2b6 2023-07-19 thomas .Sy :base:+
1233 3795e2b6 2023-07-19 thomas is equivalent to
1234 3795e2b6 2023-07-19 thomas .Sy :base:+1
1235 3795e2b6 2023-07-19 thomas .Pc .
1236 1ff8e573 2018-08-02 stsp .It Fl r Ar repository-path
1237 1ff8e573 2018-08-02 stsp Use the repository at the specified path.
1238 1ff8e573 2018-08-02 stsp If not specified, assume the repository is located at or above the current
1239 1ff8e573 2018-08-02 stsp working directory.
1240 0c06baac 2019-02-05 stsp If this directory is a
1241 0c06baac 2019-02-05 stsp .Nm
1242 0c06baac 2019-02-05 stsp work tree, use the repository path associated with this work tree.
1243 5c860e29 2018-03-12 stsp .El
1244 e8aa341a 2021-10-08 thomas .Tg tr
1245 56c96eff 2022-08-30 thomas .It Xo
1246 56c96eff 2022-08-30 thomas .Cm tree
1247 56c96eff 2022-08-30 thomas .Op Fl iR
1248 56c96eff 2022-08-30 thomas .Op Fl c Ar commit
1249 56c96eff 2022-08-30 thomas .Op Fl r Ar repository-path
1250 56c96eff 2022-08-30 thomas .Op Ar path
1251 56c96eff 2022-08-30 thomas .Xc
1252 d912d125 2021-11-04 thomas .Dl Pq alias: Cm tr
1253 5de5890b 2018-10-18 stsp Display a listing of files and directories at the specified
1254 5de5890b 2018-10-18 stsp directory path in the repository.
1255 db0c2996 2019-02-10 stsp Entries shown in this listing may carry one of the following trailing
1256 db0c2996 2019-02-10 stsp annotations:
1257 db0c2996 2019-02-10 stsp .Bl -column YXZ description
1258 848d6979 2019-08-12 stsp .It @ Ta entry is a symbolic link
1259 db0c2996 2019-02-10 stsp .It / Ta entry is a directory
1260 db0c2996 2019-02-10 stsp .It * Ta entry is an executable file
1261 63c5ca5d 2019-08-24 stsp .It $ Ta entry is a Git submodule
1262 db0c2996 2019-02-10 stsp .El
1263 0d6c6ee3 2020-05-20 stsp .Pp
1264 0d6c6ee3 2020-05-20 stsp Symbolic link entries are also annotated with the target path of the link.
1265 db0c2996 2019-02-10 stsp .Pp
1266 0c849583 2019-02-05 stsp If no
1267 0c849583 2019-02-05 stsp .Ar path
1268 0c849583 2019-02-05 stsp is specified, list the repository path corresponding to the current
1269 0c849583 2019-02-05 stsp directory of the work tree, or the root directory of the repository
1270 0c849583 2019-02-05 stsp if there is no work tree.
1271 5de5890b 2018-10-18 stsp .Pp
1272 5de5890b 2018-10-18 stsp The options for
1273 5de5890b 2018-10-18 stsp .Cm got tree
1274 5de5890b 2018-10-18 stsp are as follows:
1275 5de5890b 2018-10-18 stsp .Bl -tag -width Ds
1276 5de5890b 2018-10-18 stsp .It Fl c Ar commit
1277 5de5890b 2018-10-18 stsp List files and directories as they appear in the specified
1278 5de5890b 2018-10-18 stsp .Ar commit .
1279 9f625d2d 2023-07-19 thomas .Pp
1280 9f625d2d 2023-07-19 thomas The expected argument is a commit ID SHA1 hash, or a reference name
1281 9f625d2d 2023-07-19 thomas or a keyword which will be resolved to a commit ID.
1282 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
1283 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
1284 9f625d2d 2023-07-19 thomas The keywords
1285 3795e2b6 2023-07-19 thomas .Qq :base
1286 3795e2b6 2023-07-19 thomas and
1287 3795e2b6 2023-07-19 thomas .Qq :head
1288 9f625d2d 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
1289 3795e2b6 2023-07-19 thomas The former is only valid if invoked in a work tree, while the latter will
1290 3795e2b6 2023-07-19 thomas resolve to the tip of the work tree's current branch if invoked in a
1291 3795e2b6 2023-07-19 thomas work tree, otherwise it will resolve to the repository's HEAD reference.
1292 3795e2b6 2023-07-19 thomas Keywords and references may be appended with
1293 3795e2b6 2023-07-19 thomas .Qq :+
1294 3795e2b6 2023-07-19 thomas or
1295 3795e2b6 2023-07-19 thomas .Qq :-
1296 3795e2b6 2023-07-19 thomas modifiers and an optional integer N to denote the
1297 3795e2b6 2023-07-19 thomas Nth descendant or antecedent by first parent traversal, respectively;
1298 3795e2b6 2023-07-19 thomas for example,
1299 3795e2b6 2023-07-19 thomas .Sy :head:-2
1300 3795e2b6 2023-07-19 thomas denotes the work tree branch head's 2nd generation ancestor, and
1301 3795e2b6 2023-07-19 thomas .Sy :base:+4
1302 3795e2b6 2023-07-19 thomas denotes the 4th generation descendant of the work tree's base commit.
1303 3795e2b6 2023-07-19 thomas Similarly,
1304 3795e2b6 2023-07-19 thomas .Sy spam:-3
1305 3795e2b6 2023-07-19 thomas will denote the 3rd generation ancestor of the commit resolved by the
1306 3795e2b6 2023-07-19 thomas .Qq spam
1307 3795e2b6 2023-07-19 thomas reference.
1308 3795e2b6 2023-07-19 thomas A
1309 3795e2b6 2023-07-19 thomas .Qq :+
1310 3795e2b6 2023-07-19 thomas or
1311 3795e2b6 2023-07-19 thomas .Qq :-
1312 3795e2b6 2023-07-19 thomas modifier without a trailing integer has an implicit
1313 3795e2b6 2023-07-19 thomas .Qq 1
1314 3795e2b6 2023-07-19 thomas appended
1315 3795e2b6 2023-07-19 thomas .Po e.g.,
1316 3795e2b6 2023-07-19 thomas .Sy :base:+
1317 3795e2b6 2023-07-19 thomas is equivalent to
1318 3795e2b6 2023-07-19 thomas .Sy :base:+1
1319 3795e2b6 2023-07-19 thomas .Pc .
1320 d6506a3d 2022-08-16 thomas .It Fl i
1321 d6506a3d 2022-08-16 thomas Show object IDs of files (blob objects) and directories (tree objects).
1322 d6506a3d 2022-08-16 thomas .It Fl R
1323 d6506a3d 2022-08-16 thomas Recurse into sub-directories in the repository.
1324 5de5890b 2018-10-18 stsp .It Fl r Ar repository-path
1325 5de5890b 2018-10-18 stsp Use the repository at the specified path.
1326 5de5890b 2018-10-18 stsp If not specified, assume the repository is located at or above the current
1327 5de5890b 2018-10-18 stsp working directory.
1328 0c849583 2019-02-05 stsp If this directory is a
1329 0c849583 2019-02-05 stsp .Nm
1330 0c849583 2019-02-05 stsp work tree, use the repository path associated with this work tree.
1331 d0eebce4 2019-03-11 stsp .El
1332 56c96eff 2022-08-30 thomas .It Xo
1333 56c96eff 2022-08-30 thomas .Cm ref
1334 56c96eff 2022-08-30 thomas .Op Fl dlt
1335 b6b86fd1 2022-08-30 thomas .Op Fl c Ar object
1336 56c96eff 2022-08-30 thomas .Op Fl r Ar repository-path
1337 56c96eff 2022-08-30 thomas .Op Fl s Ar reference
1338 56c96eff 2022-08-30 thomas .Op Ar name
1339 56c96eff 2022-08-30 thomas .Xc
1340 d0eebce4 2019-03-11 stsp Manage references in a repository.
1341 d0eebce4 2019-03-11 stsp .Pp
1342 e31abbf2 2020-03-22 stsp References may be listed, created, deleted, and changed.
1343 e31abbf2 2020-03-22 stsp When creating, deleting, or changing a reference the specified
1344 e31abbf2 2020-03-22 stsp .Ar name
1345 e31abbf2 2020-03-22 stsp must be an absolute reference name, i.e. it must begin with
1346 f16e4044 2019-10-09 stsp .Dq refs/ .
1347 e31abbf2 2020-03-22 stsp .Pp
1348 d0eebce4 2019-03-11 stsp The options for
1349 d0eebce4 2019-03-11 stsp .Cm got ref
1350 d0eebce4 2019-03-11 stsp are as follows:
1351 d0eebce4 2019-03-11 stsp .Bl -tag -width Ds
1352 d6506a3d 2022-08-16 thomas .It Fl c Ar object
1353 d6506a3d 2022-08-16 thomas Create a reference or change an existing reference.
1354 d6506a3d 2022-08-16 thomas The reference with the specified
1355 d6506a3d 2022-08-16 thomas .Ar name
1356 d6506a3d 2022-08-16 thomas will point at the specified
1357 d6506a3d 2022-08-16 thomas .Ar object .
1358 3795e2b6 2023-07-19 thomas .Pp
1359 d6506a3d 2022-08-16 thomas The expected
1360 d6506a3d 2022-08-16 thomas .Ar object
1361 3795e2b6 2023-07-19 thomas argument is an ID SHA1 hash or an existing reference or tag name
1362 3795e2b6 2023-07-19 thomas or a keyword which will be resolved to the ID of a corresponding commit,
1363 3795e2b6 2023-07-19 thomas tree, tag, or blob object.
1364 3795e2b6 2023-07-19 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
1365 3795e2b6 2023-07-19 thomas automatically, provided the abbreviation is unique.
1366 3795e2b6 2023-07-19 thomas The keywords
1367 3795e2b6 2023-07-19 thomas .Qq :base
1368 3795e2b6 2023-07-19 thomas and
1369 3795e2b6 2023-07-19 thomas .Qq :head
1370 3795e2b6 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
1371 3795e2b6 2023-07-19 thomas The former is only valid if invoked in a work tree, while the latter will
1372 3795e2b6 2023-07-19 thomas resolve to the tip of the work tree's current branch if invoked in a
1373 3795e2b6 2023-07-19 thomas work tree, otherwise it will resolve to the repository's HEAD reference.
1374 3795e2b6 2023-07-19 thomas Keywords and reference names may be appended with
1375 3795e2b6 2023-07-19 thomas .Qq :+
1376 3795e2b6 2023-07-19 thomas or
1377 3795e2b6 2023-07-19 thomas .Qq :-
1378 3795e2b6 2023-07-19 thomas modifiers and an optional integer N to denote the
1379 3795e2b6 2023-07-19 thomas Nth descendant or antecedent by first parent traversal, respectively;
1380 3795e2b6 2023-07-19 thomas for example,
1381 3795e2b6 2023-07-19 thomas .Sy :head:-2
1382 3795e2b6 2023-07-19 thomas denotes the work tree branch head's 2nd generation ancestor, and
1383 3795e2b6 2023-07-19 thomas .Sy tagged:-3
1384 3795e2b6 2023-07-19 thomas will denote the 3rd generation ancestor of the commit resolved by the
1385 3795e2b6 2023-07-19 thomas .Qq tagged
1386 3795e2b6 2023-07-19 thomas reference.
1387 3795e2b6 2023-07-19 thomas If an integer does not follow the
1388 3795e2b6 2023-07-19 thomas .Qq :+
1389 3795e2b6 2023-07-19 thomas or
1390 3795e2b6 2023-07-19 thomas .Qq :-
1391 3795e2b6 2023-07-19 thomas modifier, a
1392 3795e2b6 2023-07-19 thomas .Qq 1
1393 3795e2b6 2023-07-19 thomas is implicitly appended
1394 3795e2b6 2023-07-19 thomas .Po e.g.,
1395 3795e2b6 2023-07-19 thomas .Sy :head:-
1396 3795e2b6 2023-07-19 thomas is equivalent to
1397 3795e2b6 2023-07-19 thomas .Sy :head:-1
1398 3795e2b6 2023-07-19 thomas .Pc .
1399 3795e2b6 2023-07-19 thomas .Pp
1400 d6506a3d 2022-08-16 thomas Cannot be used together with any other options except
1401 d6506a3d 2022-08-16 thomas .Fl r .
1402 d6506a3d 2022-08-16 thomas .It Fl d
1403 d6506a3d 2022-08-16 thomas Delete the reference with the specified
1404 d6506a3d 2022-08-16 thomas .Ar name
1405 d6506a3d 2022-08-16 thomas from the repository.
1406 d6506a3d 2022-08-16 thomas Any commit, tree, tag, and blob objects belonging to deleted references
1407 d6506a3d 2022-08-16 thomas remain in the repository and may be removed separately with
1408 d6506a3d 2022-08-16 thomas Git's garbage collector or
1409 d6506a3d 2022-08-16 thomas .Cm gotadmin cleanup .
1410 d6506a3d 2022-08-16 thomas Cannot be used together with any other options except
1411 d6506a3d 2022-08-16 thomas .Fl r .
1412 d0eebce4 2019-03-11 stsp .It Fl l
1413 b2070a3f 2020-03-22 stsp List references in the repository.
1414 b2070a3f 2020-03-22 stsp If no
1415 b2070a3f 2020-03-22 stsp .Ar name
1416 b2070a3f 2020-03-22 stsp is specified, list all existing references in the repository.
1417 b2070a3f 2020-03-22 stsp If
1418 b2070a3f 2020-03-22 stsp .Ar name
1419 b2070a3f 2020-03-22 stsp is a reference namespace, list all references in this namespace.
1420 b2070a3f 2020-03-22 stsp Otherwise, show only the reference with the given
1421 b2070a3f 2020-03-22 stsp .Ar name .
1422 e31abbf2 2020-03-22 stsp Cannot be used together with any other options except
1423 2bf0fa54 2021-11-20 thomas .Fl r
1424 2bf0fa54 2021-11-20 thomas and
1425 2bf0fa54 2021-11-20 thomas .Fl t .
1426 d6506a3d 2022-08-16 thomas .It Fl r Ar repository-path
1427 d6506a3d 2022-08-16 thomas Use the repository at the specified path.
1428 d6506a3d 2022-08-16 thomas If not specified, assume the repository is located at or above the current
1429 d6506a3d 2022-08-16 thomas working directory.
1430 d6506a3d 2022-08-16 thomas If this directory is a
1431 d6506a3d 2022-08-16 thomas .Nm
1432 d6506a3d 2022-08-16 thomas work tree, use the repository path associated with this work tree.
1433 e31abbf2 2020-03-22 stsp .It Fl s Ar reference
1434 e31abbf2 2020-03-22 stsp Create a symbolic reference, or change an existing symbolic reference.
1435 e31abbf2 2020-03-22 stsp The symbolic reference with the specified
1436 e31abbf2 2020-03-22 stsp .Ar name
1437 e31abbf2 2020-03-22 stsp will point at the specified
1438 e31abbf2 2020-03-22 stsp .Ar reference
1439 e31abbf2 2020-03-22 stsp which must already exist in the repository.
1440 d1c1ae5f 2019-08-12 stsp Care should be taken not to create loops between references when
1441 d1c1ae5f 2019-08-12 stsp this option is used.
1442 e31abbf2 2020-03-22 stsp Cannot be used together with any other options except
1443 e31abbf2 2020-03-22 stsp .Fl r .
1444 d6506a3d 2022-08-16 thomas .It Fl t
1445 d6506a3d 2022-08-16 thomas Sort listed references by modification time (most recently modified first)
1446 d6506a3d 2022-08-16 thomas instead of sorting by lexicographical order.
1447 d6506a3d 2022-08-16 thomas Use of this option requires the
1448 d6506a3d 2022-08-16 thomas .Fl l
1449 d6506a3d 2022-08-16 thomas option to be used as well.
1450 4e759de4 2019-06-26 stsp .El
1451 e8aa341a 2021-10-08 thomas .Tg br
1452 56c96eff 2022-08-30 thomas .It Xo
1453 56c96eff 2022-08-30 thomas .Cm branch
1454 56c96eff 2022-08-30 thomas .Op Fl lnt
1455 56c96eff 2022-08-30 thomas .Op Fl c Ar commit
1456 56c96eff 2022-08-30 thomas .Op Fl d Ar name
1457 56c96eff 2022-08-30 thomas .Op Fl r Ar repository-path
1458 56c96eff 2022-08-30 thomas .Op Ar name
1459 56c96eff 2022-08-30 thomas .Xc
1460 d912d125 2021-11-04 thomas .Dl Pq alias: Cm br
1461 da76fce2 2020-02-24 stsp Create, list, or delete branches.
1462 4e759de4 2019-06-26 stsp .Pp
1463 34d4e04c 2021-02-08 stsp Local branches are managed via references which live in the
1464 4e759de4 2019-06-26 stsp .Dq refs/heads/
1465 4e759de4 2019-06-26 stsp reference namespace.
1466 4e759de4 2019-06-26 stsp The
1467 4e759de4 2019-06-26 stsp .Cm got branch
1468 2f1457c6 2021-08-27 stsp command creates references in this namespace only.
1469 2f1457c6 2021-08-27 stsp .Pp
1470 4b06140e 2022-03-22 thomas When deleting branches, the specified
1471 2f1457c6 2021-08-27 stsp .Ar name
1472 2f1457c6 2021-08-27 stsp is searched in the
1473 2f1457c6 2021-08-27 stsp .Dq refs/heads
1474 2f1457c6 2021-08-27 stsp reference namespace first.
1475 4b06140e 2022-03-22 thomas If no corresponding branch is found, the
1476 2f1457c6 2021-08-27 stsp .Dq refs/remotes
1477 2f1457c6 2021-08-27 stsp namespace will be searched next.
1478 4e759de4 2019-06-26 stsp .Pp
1479 ad89fa31 2019-10-04 stsp If invoked in a work tree without any arguments, print the name of the
1480 ad89fa31 2019-10-04 stsp work tree's current branch.
1481 da76fce2 2020-02-24 stsp .Pp
1482 a74f7e83 2019-11-10 stsp If a
1483 a74f7e83 2019-11-10 stsp .Ar name
1484 a74f7e83 2019-11-10 stsp argument is passed, attempt to create a branch reference with the given name.
1485 a74f7e83 2019-11-10 stsp By default the new branch reference will point at the latest commit on the
1486 a74f7e83 2019-11-10 stsp work tree's current branch if invoked in a work tree, and otherwise to a commit
1487 a74f7e83 2019-11-10 stsp resolved via the repository's HEAD reference.
1488 4e759de4 2019-06-26 stsp .Pp
1489 da76fce2 2020-02-24 stsp If invoked in a work tree, once the branch was created successfully
1490 da76fce2 2020-02-24 stsp switch the work tree's head reference to the newly created branch and
1491 da76fce2 2020-02-24 stsp update files across the entire work tree, just like
1492 da76fce2 2020-02-24 stsp .Cm got update -b Ar name
1493 da76fce2 2020-02-24 stsp would do.
1494 da76fce2 2020-02-24 stsp Show the status of each affected file, using the following status codes:
1495 da76fce2 2020-02-24 stsp .Bl -column YXZ description
1496 da76fce2 2020-02-24 stsp .It U Ta file was updated and contained no local changes
1497 da76fce2 2020-02-24 stsp .It G Ta file was updated and local changes were merged cleanly
1498 da76fce2 2020-02-24 stsp .It C Ta file was updated and conflicts occurred during merge
1499 da76fce2 2020-02-24 stsp .It D Ta file was deleted
1500 da76fce2 2020-02-24 stsp .It A Ta new file was added
1501 da76fce2 2020-02-24 stsp .It \(a~ Ta versioned file is obstructed by a non-regular file
1502 da76fce2 2020-02-24 stsp .It ! Ta a missing versioned file was restored
1503 da76fce2 2020-02-24 stsp .El
1504 da76fce2 2020-02-24 stsp .Pp
1505 4e759de4 2019-06-26 stsp The options for
1506 4e759de4 2019-06-26 stsp .Cm got branch
1507 4e759de4 2019-06-26 stsp are as follows:
1508 4e759de4 2019-06-26 stsp .Bl -tag -width Ds
1509 a74f7e83 2019-11-10 stsp .It Fl c Ar commit
1510 a74f7e83 2019-11-10 stsp Make a newly created branch reference point at the specified
1511 a74f7e83 2019-11-10 stsp .Ar commit .
1512 a290e4b4 2023-07-19 thomas The expected argument is a commit ID SHA1 hash, or a reference name or keyword
1513 a290e4b4 2023-07-19 thomas which will be resolved to a commit ID.
1514 a290e4b4 2023-07-19 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
1515 a290e4b4 2023-07-19 thomas automatically, provided the abbreviation is unique.
1516 a290e4b4 2023-07-19 thomas The keywords
1517 fb885120 2023-07-19 thomas .Qq :base
1518 fb885120 2023-07-19 thomas and
1519 fb885120 2023-07-19 thomas .Qq :head
1520 a290e4b4 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
1521 fb885120 2023-07-19 thomas The former is only valid if invoked in a work tree, while the latter will
1522 fb885120 2023-07-19 thomas resolve to the tip of the work tree's current branch if invoked in a
1523 fb885120 2023-07-19 thomas work tree, otherwise it will resolve to the repository's HEAD reference.
1524 fb885120 2023-07-19 thomas Keywords and references may be appended with
1525 fb885120 2023-07-19 thomas .Qq :+
1526 fb885120 2023-07-19 thomas or
1527 fb885120 2023-07-19 thomas .Qq :-
1528 fb885120 2023-07-19 thomas modifiers and an optional integer N to denote the
1529 fb885120 2023-07-19 thomas Nth descendant or antecedent by first parent traversal, respectively;
1530 fb885120 2023-07-19 thomas for example,
1531 fb885120 2023-07-19 thomas .Sy :head:-2
1532 fb885120 2023-07-19 thomas denotes the work tree branch head's 2nd generation ancestor, and
1533 fb885120 2023-07-19 thomas .Sy :base:+4
1534 fb885120 2023-07-19 thomas denotes the 4th generation descendant of the work tree's base commit.
1535 fb885120 2023-07-19 thomas Similarly,
1536 fb885120 2023-07-19 thomas .Sy foobar:+3
1537 fb885120 2023-07-19 thomas will denote the 3rd generation descendant of the commit resolved by the
1538 fb885120 2023-07-19 thomas .Qq foobar
1539 fb885120 2023-07-19 thomas reference.
1540 fb885120 2023-07-19 thomas A
1541 fb885120 2023-07-19 thomas .Qq :+
1542 fb885120 2023-07-19 thomas or
1543 fb885120 2023-07-19 thomas .Qq :-
1544 fb885120 2023-07-19 thomas modifier without a trailing integer has an implicit
1545 fb885120 2023-07-19 thomas .Qq 1
1546 fb885120 2023-07-19 thomas appended
1547 fb885120 2023-07-19 thomas .Po e.g.,
1548 fb885120 2023-07-19 thomas .Sy :base:+
1549 fb885120 2023-07-19 thomas is equivalent to
1550 fb885120 2023-07-19 thomas .Sy :base:+1
1551 fb885120 2023-07-19 thomas .Pc .
1552 d6506a3d 2022-08-16 thomas .It Fl d Ar name
1553 d6506a3d 2022-08-16 thomas Delete the branch with the specified
1554 d6506a3d 2022-08-16 thomas .Ar name
1555 d6506a3d 2022-08-16 thomas from the
1556 d6506a3d 2022-08-16 thomas .Dq refs/heads
1557 d6506a3d 2022-08-16 thomas or
1558 d6506a3d 2022-08-16 thomas .Dq refs/remotes
1559 d6506a3d 2022-08-16 thomas reference namespace.
1560 d6506a3d 2022-08-16 thomas .Pp
1561 d6506a3d 2022-08-16 thomas Only the branch reference is deleted.
1562 d6506a3d 2022-08-16 thomas Any commit, tree, and blob objects belonging to the branch
1563 d6506a3d 2022-08-16 thomas remain in the repository and may be removed separately with
1564 d6506a3d 2022-08-16 thomas Git's garbage collector or
1565 d6506a3d 2022-08-16 thomas .Cm gotadmin cleanup .
1566 4e759de4 2019-06-26 stsp .It Fl l
1567 34d4e04c 2021-02-08 stsp List all existing branches in the repository, including copies of remote
1568 34d4e04c 2021-02-08 stsp repositories' branches in the
1569 34d4e04c 2021-02-08 stsp .Dq refs/remotes/
1570 34d4e04c 2021-02-08 stsp reference namespace.
1571 34d4e04c 2021-02-08 stsp .Pp
1572 ba882ee3 2019-07-11 stsp If invoked in a work tree, the work tree's current branch is shown
1573 87c986b7 2023-07-05 thomas with one of the following annotations:
1574 ba882ee3 2019-07-11 stsp .Bl -column YXZ description
1575 44d79efa 2023-07-23 thomas .It * Ta work tree's base commit and the base commit of all tracked files
1576 44d79efa 2023-07-23 thomas matches the branch tip
1577 44d79efa 2023-07-23 thomas .It \(a~ Ta work tree comprises mixed commits or its base commit is out-of-date
1578 ba882ee3 2019-07-11 stsp .El
1579 d6506a3d 2022-08-16 thomas .It Fl n
1580 d6506a3d 2022-08-16 thomas Do not switch and update the work tree after creating a new branch.
1581 d6506a3d 2022-08-16 thomas .It Fl r Ar repository-path
1582 d6506a3d 2022-08-16 thomas Use the repository at the specified path.
1583 d6506a3d 2022-08-16 thomas If not specified, assume the repository is located at or above the current
1584 d6506a3d 2022-08-16 thomas working directory.
1585 d6506a3d 2022-08-16 thomas If this directory is a
1586 d6506a3d 2022-08-16 thomas .Nm
1587 d6506a3d 2022-08-16 thomas work tree, use the repository path associated with this work tree.
1588 a0b48eaf 2021-11-20 thomas .It Fl t
1589 a0b48eaf 2021-11-20 thomas Sort listed branches by modification time (most recently modified first)
1590 a0b48eaf 2021-11-20 thomas instead of sorting by lexicographical order.
1591 a0b48eaf 2021-11-20 thomas Branches in the
1592 a0b48eaf 2021-11-20 thomas .Dq refs/heads/
1593 a0b48eaf 2021-11-20 thomas reference namespace are listed before branches in
1594 a0b48eaf 2021-11-20 thomas .Dq refs/remotes/
1595 a0b48eaf 2021-11-20 thomas regardless.
1596 a0b48eaf 2021-11-20 thomas Use of this option requires the
1597 a0b48eaf 2021-11-20 thomas .Fl l
1598 a0b48eaf 2021-11-20 thomas option to be used as well.
1599 5de5890b 2018-10-18 stsp .El
1600 56c96eff 2022-08-30 thomas .It Xo
1601 56c96eff 2022-08-30 thomas .Cm tag
1602 56c96eff 2022-08-30 thomas .Op Fl lVv
1603 56c96eff 2022-08-30 thomas .Op Fl c Ar commit
1604 56c96eff 2022-08-30 thomas .Op Fl m Ar message
1605 56c96eff 2022-08-30 thomas .Op Fl r Ar repository-path
1606 56c96eff 2022-08-30 thomas .Op Fl s Ar signer-id
1607 56c96eff 2022-08-30 thomas .Ar name
1608 56c96eff 2022-08-30 thomas .Xc
1609 8e7bd50a 2019-08-22 stsp Manage tags in a repository.
1610 8e7bd50a 2019-08-22 stsp .Pp
1611 8e7bd50a 2019-08-22 stsp Tags are managed via references which live in the
1612 8e7bd50a 2019-08-22 stsp .Dq refs/tags/
1613 8e7bd50a 2019-08-22 stsp reference namespace.
1614 8e7bd50a 2019-08-22 stsp The
1615 8e7bd50a 2019-08-22 stsp .Cm got tag
1616 8e7bd50a 2019-08-22 stsp command operates on references in this namespace only.
1617 b3cd068e 2019-08-22 stsp References in this namespace point at tag objects which contain a pointer
1618 b3cd068e 2019-08-22 stsp to another object, a tag message, as well as author and timestamp information.
1619 8e7bd50a 2019-08-22 stsp .Pp
1620 80106605 2020-02-24 stsp Attempt to create a tag with the given
1621 8e7bd50a 2019-08-22 stsp .Ar name ,
1622 8e7bd50a 2019-08-22 stsp and make this tag point at the given
1623 8e7bd50a 2019-08-22 stsp .Ar commit .
1624 8e7bd50a 2019-08-22 stsp If no commit is specified, default to the latest commit on the work tree's
1625 8e7bd50a 2019-08-22 stsp current branch if invoked in a work tree, and to a commit resolved via
1626 8e7bd50a 2019-08-22 stsp the repository's HEAD reference otherwise.
1627 8e7bd50a 2019-08-22 stsp .Pp
1628 8e7bd50a 2019-08-22 stsp The options for
1629 8e7bd50a 2019-08-22 stsp .Cm got tag
1630 8e7bd50a 2019-08-22 stsp are as follows:
1631 8e7bd50a 2019-08-22 stsp .Bl -tag -width Ds
1632 80106605 2020-02-24 stsp .It Fl c Ar commit
1633 80106605 2020-02-24 stsp Make the newly created tag reference point at the specified
1634 80106605 2020-02-24 stsp .Ar commit .
1635 80106605 2020-02-24 stsp The expected
1636 80106605 2020-02-24 stsp .Ar commit
1637 9f625d2d 2023-07-19 thomas argument is a commit ID SHA1 hash, or a reference or keyword
1638 9f625d2d 2023-07-19 thomas which will be resolved to a commit ID.
1639 80106605 2020-02-24 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
1640 80106605 2020-02-24 stsp automatically, provided the abbreviation is unique.
1641 9f625d2d 2023-07-19 thomas The keywords
1642 3795e2b6 2023-07-19 thomas .Qq :base
1643 3795e2b6 2023-07-19 thomas and
1644 3795e2b6 2023-07-19 thomas .Qq :head
1645 9f625d2d 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
1646 3795e2b6 2023-07-19 thomas The former is only valid if invoked in a work tree, while the latter will
1647 3795e2b6 2023-07-19 thomas resolve to the tip of the work tree's current branch if invoked in a
1648 3795e2b6 2023-07-19 thomas work tree, otherwise it will resolve to the repository's HEAD reference.
1649 3795e2b6 2023-07-19 thomas Keywords and references may be appended with
1650 3795e2b6 2023-07-19 thomas .Qq :+
1651 3795e2b6 2023-07-19 thomas or
1652 3795e2b6 2023-07-19 thomas .Qq :-
1653 3795e2b6 2023-07-19 thomas modifiers and an optional integer N to denote the
1654 3795e2b6 2023-07-19 thomas Nth descendant or antecedent by first parent traversal, respectively;
1655 3795e2b6 2023-07-19 thomas for example,
1656 3795e2b6 2023-07-19 thomas .Sy :head:-2
1657 3795e2b6 2023-07-19 thomas denotes the work tree branch head's 2nd generation ancestor, and
1658 3795e2b6 2023-07-19 thomas .Sy :base:+4
1659 3795e2b6 2023-07-19 thomas denotes the 4th generation descendant of the work tree's base commit.
1660 3795e2b6 2023-07-19 thomas Similarly,
1661 3795e2b6 2023-07-19 thomas .Sy eggs:-3
1662 3795e2b6 2023-07-19 thomas will denote the 3rd generation ancestor of the commit resolved by the
1663 3795e2b6 2023-07-19 thomas .Qq eggs
1664 3795e2b6 2023-07-19 thomas reference.
1665 3795e2b6 2023-07-19 thomas A
1666 3795e2b6 2023-07-19 thomas .Qq :+
1667 3795e2b6 2023-07-19 thomas or
1668 3795e2b6 2023-07-19 thomas .Qq :-
1669 3795e2b6 2023-07-19 thomas modifier without a trailing integer has an implicit
1670 3795e2b6 2023-07-19 thomas .Qq 1
1671 3795e2b6 2023-07-19 thomas appended
1672 3795e2b6 2023-07-19 thomas .Po e.g.,
1673 3795e2b6 2023-07-19 thomas .Sy :base:+
1674 3795e2b6 2023-07-19 thomas is equivalent to
1675 3795e2b6 2023-07-19 thomas .Sy :base:+1
1676 3795e2b6 2023-07-19 thomas .Pc .
1677 d6506a3d 2022-08-16 thomas .It Fl l
1678 d6506a3d 2022-08-16 thomas List all existing tags in the repository instead of creating a new tag.
1679 d6506a3d 2022-08-16 thomas If a
1680 d6506a3d 2022-08-16 thomas .Ar name
1681 d6506a3d 2022-08-16 thomas argument is passed, show only the tag with the given
1682 d6506a3d 2022-08-16 thomas .Ar name .
1683 8e7bd50a 2019-08-22 stsp .It Fl m Ar message
1684 80106605 2020-02-24 stsp Use the specified tag message when creating the new tag.
1685 8e7bd50a 2019-08-22 stsp Without the
1686 8e7bd50a 2019-08-22 stsp .Fl m
1687 8e7bd50a 2019-08-22 stsp option,
1688 3a62228f 2019-11-08 stsp .Cm got tag
1689 8e7bd50a 2019-08-22 stsp opens a temporary file in an editor where a tag message can be written.
1690 bccae03f 2023-07-17 thomas Quitting the editor without saving the file will abort the tag operation.
1691 8e7bd50a 2019-08-22 stsp .It Fl r Ar repository-path
1692 8e7bd50a 2019-08-22 stsp Use the repository at the specified path.
1693 8e7bd50a 2019-08-22 stsp If not specified, assume the repository is located at or above the current
1694 8e7bd50a 2019-08-22 stsp working directory.
1695 8e7bd50a 2019-08-22 stsp If this directory is a
1696 8e7bd50a 2019-08-22 stsp .Nm
1697 8e7bd50a 2019-08-22 stsp work tree, use the repository path associated with this work tree.
1698 839dd04f 2022-07-04 thomas .It Fl s Ar signer-id
1699 839dd04f 2022-07-04 thomas While creating a new tag, sign this tag with the identity given in
1700 839dd04f 2022-07-04 thomas .Ar signer-id .
1701 839dd04f 2022-07-04 thomas .Pp
1702 839dd04f 2022-07-04 thomas For SSH-based signatures,
1703 839dd04f 2022-07-04 thomas .Ar signer-id
1704 839dd04f 2022-07-04 thomas is the path to a file which may refer to either a private SSH key,
1705 839dd04f 2022-07-04 thomas or a public SSH key with the private half available via
1706 839dd04f 2022-07-04 thomas .Xr ssh-agent 1 .
1707 839dd04f 2022-07-04 thomas .Cm got tag
1708 839dd04f 2022-07-04 thomas will sign the tag object by invoking
1709 839dd04f 2022-07-04 thomas .Xr ssh-keygen 1
1710 839dd04f 2022-07-04 thomas with the
1711 b6bfeb85 2022-08-16 thomas .Fl Y Cm sign
1712 839dd04f 2022-07-04 thomas command, using the signature namespace
1713 839dd04f 2022-07-04 thomas .Dq git
1714 839dd04f 2022-07-04 thomas for compatibility with
1715 839dd04f 2022-07-04 thomas .Xr git 1 .
1716 839dd04f 2022-07-04 thomas .It Fl V
1717 839dd04f 2022-07-04 thomas Verify tag object signatures.
1718 839dd04f 2022-07-04 thomas If a
1719 839dd04f 2022-07-04 thomas .Ar name
1720 839dd04f 2022-07-04 thomas is specified, show and verify the tag object with the provided name.
1721 839dd04f 2022-07-04 thomas Otherwise, list all tag objects and verify signatures where present.
1722 839dd04f 2022-07-04 thomas .Pp
1723 839dd04f 2022-07-04 thomas .Cm got tag
1724 839dd04f 2022-07-04 thomas verifies SSH-based signatures by invoking
1725 839dd04f 2022-07-04 thomas .Xr ssh-keygen 1
1726 839dd04f 2022-07-04 thomas with the options
1727 b6bfeb85 2022-08-16 thomas .Fl Y Cm verify Fl f Ar allowed_signers .
1728 839dd04f 2022-07-04 thomas A path to the
1729 839dd04f 2022-07-04 thomas .Ar allowed_signers
1730 839dd04f 2022-07-04 thomas file must be set in
1731 839dd04f 2022-07-04 thomas .Xr got.conf 5 ,
1732 839dd04f 2022-07-04 thomas otherwise verification is impossible.
1733 d6506a3d 2022-08-16 thomas .It Fl v
1734 d6506a3d 2022-08-16 thomas Verbose mode.
1735 d6506a3d 2022-08-16 thomas During SSH signature creation and verification this option will be passed to
1736 d6506a3d 2022-08-16 thomas .Xr ssh-keygen 1 .
1737 d6506a3d 2022-08-16 thomas Multiple -v options increase the verbosity.
1738 d6506a3d 2022-08-16 thomas The maximum is 3.
1739 8e7bd50a 2019-08-22 stsp .El
1740 8e7bd50a 2019-08-22 stsp .Pp
1741 8e7bd50a 2019-08-22 stsp By design, the
1742 8e7bd50a 2019-08-22 stsp .Cm got tag
1743 8e7bd50a 2019-08-22 stsp command will not delete tags or change existing tags.
1744 8e7bd50a 2019-08-22 stsp If a tag must be deleted, the
1745 8e7bd50a 2019-08-22 stsp .Cm got ref
1746 8e7bd50a 2019-08-22 stsp command may be used to delete a tag's reference.
1747 8e7bd50a 2019-08-22 stsp This should only be done if the tag has not already been copied to
1748 8e7bd50a 2019-08-22 stsp another repository.
1749 56c96eff 2022-08-30 thomas .It Xo
1750 56c96eff 2022-08-30 thomas .Cm add
1751 56c96eff 2022-08-30 thomas .Op Fl IR
1752 56c96eff 2022-08-30 thomas .Ar path ...
1753 56c96eff 2022-08-30 thomas .Xc
1754 8125ddca 2019-05-11 stsp Schedule unversioned files in a work tree for addition to the
1755 d00136be 2019-03-26 stsp repository in the next commit.
1756 ff56836b 2021-07-08 stsp By default, files which match a
1757 ff56836b 2021-07-08 stsp .Cm got status
1758 ff56836b 2021-07-08 stsp ignore pattern will not be added.
1759 4e68cba3 2019-11-23 stsp .Pp
1760 b21ebdb0 2023-06-22 thomas If a
1761 b21ebdb0 2023-06-22 thomas .Ar path
1762 b21ebdb0 2023-06-22 thomas mentioned in the command line is not an unversioned file then
1763 b21ebdb0 2023-06-22 thomas .Cm got add
1764 b21ebdb0 2023-06-22 thomas may raise an error.
1765 b21ebdb0 2023-06-22 thomas To avoid unnecessary errors from paths picked up by file globbing patterns
1766 b21ebdb0 2023-06-22 thomas in the shell, paths in the argument list will be silently ignored if they
1767 b21ebdb0 2023-06-22 thomas are not reported by
1768 b21ebdb0 2023-06-22 thomas .Cm got status
1769 b21ebdb0 2023-06-22 thomas at all, or if they are reported with one of the following status codes
1770 b21ebdb0 2023-06-22 thomas and do not have changes staged via
1771 b21ebdb0 2023-06-22 thomas .Cm got stage :
1772 b21ebdb0 2023-06-22 thomas .Bl -column YXZ description
1773 b21ebdb0 2023-06-22 thomas .It M Ta modified file
1774 b21ebdb0 2023-06-22 thomas .It A Ta file scheduled for addition in next commit
1775 b21ebdb0 2023-06-22 thomas .It C Ta modified or added file which contains merge conflicts
1776 b21ebdb0 2023-06-22 thomas .It m Ta modified file modes (executable bit only)
1777 b21ebdb0 2023-06-22 thomas .El
1778 b21ebdb0 2023-06-22 thomas .Pp
1779 4e68cba3 2019-11-23 stsp The options for
1780 4e68cba3 2019-11-23 stsp .Cm got add
1781 4e68cba3 2019-11-23 stsp are as follows:
1782 4e68cba3 2019-11-23 stsp .Bl -tag -width Ds
1783 d6506a3d 2022-08-16 thomas .It Fl I
1784 d6506a3d 2022-08-16 thomas Add files even if they match a
1785 d6506a3d 2022-08-16 thomas .Cm got status
1786 d6506a3d 2022-08-16 thomas ignore pattern.
1787 4e68cba3 2019-11-23 stsp .It Fl R
1788 4e68cba3 2019-11-23 stsp Permit recursion into directories.
1789 4e68cba3 2019-11-23 stsp If this option is not specified,
1790 4e68cba3 2019-11-23 stsp .Cm got add
1791 4e68cba3 2019-11-23 stsp will refuse to run if a specified
1792 4e68cba3 2019-11-23 stsp .Ar path
1793 4e68cba3 2019-11-23 stsp is a directory.
1794 4e68cba3 2019-11-23 stsp .El
1795 e8aa341a 2021-10-08 thomas .Tg rm
1796 56c96eff 2022-08-30 thomas .It Xo
1797 56c96eff 2022-08-30 thomas .Cm remove
1798 56c96eff 2022-08-30 thomas .Op Fl fkR
1799 56c96eff 2022-08-30 thomas .Op Fl s Ar status-codes
1800 56c96eff 2022-08-30 thomas .Ar path ...
1801 56c96eff 2022-08-30 thomas .Xc
1802 d912d125 2021-11-04 thomas .Dl Pq alias: Cm rm
1803 17ed4618 2019-06-02 stsp Remove versioned files from a work tree and schedule them for deletion
1804 2ec1f75b 2019-03-26 stsp from the repository in the next commit.
1805 2ec1f75b 2019-03-26 stsp .Pp
1806 2ec1f75b 2019-03-26 stsp The options for
1807 86d25a1b 2019-07-11 stsp .Cm got remove
1808 2ec1f75b 2019-03-26 stsp are as follows:
1809 2ec1f75b 2019-03-26 stsp .Bl -tag -width Ds
1810 2ec1f75b 2019-03-26 stsp .It Fl f
1811 d64cc78a 2022-01-25 thomas Perform the operation even if a file contains local modifications,
1812 d64cc78a 2022-01-25 thomas and do not raise an error if a specified
1813 d64cc78a 2022-01-25 thomas .Ar path
1814 d64cc78a 2022-01-25 thomas does not exist on disk.
1815 70e3e7f5 2019-12-13 tracey .It Fl k
1816 70e3e7f5 2019-12-13 tracey Keep affected files on disk.
1817 f2a9dc41 2019-12-13 tracey .It Fl R
1818 f2a9dc41 2019-12-13 tracey Permit recursion into directories.
1819 f2a9dc41 2019-12-13 tracey If this option is not specified,
1820 f2a9dc41 2019-12-13 tracey .Cm got remove
1821 f2a9dc41 2019-12-13 tracey will refuse to run if a specified
1822 f2a9dc41 2019-12-13 tracey .Ar path
1823 f2a9dc41 2019-12-13 tracey is a directory.
1824 766841c2 2020-08-13 stsp .It Fl s Ar status-codes
1825 766841c2 2020-08-13 stsp Only delete files with a modification status matching one of the
1826 766841c2 2020-08-13 stsp single-character status codes contained in the
1827 766841c2 2020-08-13 stsp .Ar status-codes
1828 766841c2 2020-08-13 stsp argument.
1829 766841c2 2020-08-13 stsp The following status codes may be specified:
1830 766841c2 2020-08-13 stsp .Bl -column YXZ description
1831 766841c2 2020-08-13 stsp .It M Ta modified file (this implies the
1832 766841c2 2020-08-13 stsp .Fl f
1833 766841c2 2020-08-13 stsp option)
1834 766841c2 2020-08-13 stsp .It ! Ta versioned file expected on disk but missing
1835 766841c2 2020-08-13 stsp .El
1836 d0eebce4 2019-03-11 stsp .El
1837 069bbb86 2022-03-07 thomas .Tg pa
1838 56c96eff 2022-08-30 thomas .It Xo
1839 56c96eff 2022-08-30 thomas .Cm patch
1840 56c96eff 2022-08-30 thomas .Op Fl nR
1841 56c96eff 2022-08-30 thomas .Op Fl c Ar commit
1842 56c96eff 2022-08-30 thomas .Op Fl p Ar strip-count
1843 56c96eff 2022-08-30 thomas .Op Ar patchfile
1844 56c96eff 2022-08-30 thomas .Xc
1845 069bbb86 2022-03-07 thomas .Dl Pq alias: Cm pa
1846 069bbb86 2022-03-07 thomas Apply changes from
1847 069bbb86 2022-03-07 thomas .Ar patchfile
1848 07f74738 2022-03-13 thomas to files in a work tree.
1849 443c08c9 2022-03-13 thomas Files added or removed by a patch will be scheduled for addition or removal in
1850 443c08c9 2022-03-13 thomas the work tree.
1851 07f74738 2022-03-13 thomas .Pp
1852 07f74738 2022-03-13 thomas The patch must be in the unified diff format as produced by
1853 07f74738 2022-03-13 thomas .Cm got diff ,
1854 99e34129 2022-03-22 thomas .Xr git-diff 1 ,
1855 4929098b 2022-03-13 thomas or by
1856 07f74738 2022-03-13 thomas .Xr diff 1
1857 3eb4f629 2022-03-22 thomas and
1858 3eb4f629 2022-03-22 thomas .Xr cvs 1
1859 6f7394ad 2022-03-22 thomas diff when invoked with their
1860 07f74738 2022-03-13 thomas .Fl u
1861 6f7394ad 2022-03-22 thomas options.
1862 07f74738 2022-03-13 thomas If no
1863 069bbb86 2022-03-07 thomas .Ar patchfile
1864 07f74738 2022-03-13 thomas argument is provided, read unified diff data from standard input instead.
1865 07f74738 2022-03-13 thomas .Pp
1866 07f74738 2022-03-13 thomas If the
1867 07f74738 2022-03-13 thomas .Ar patchfile
1868 4b06140e 2022-03-22 thomas contains multiple patches, then attempt to apply each of them in sequence.
1869 069bbb86 2022-03-07 thomas .Pp
1870 4929098b 2022-03-13 thomas Show the status of each affected file, using the following status codes:
1871 069bbb86 2022-03-07 thomas .Bl -column XYZ description
1872 07f74738 2022-03-13 thomas .It M Ta file was modified
1873 762b8e82 2022-06-23 thomas .It G Ta file was merged using a merge-base found in the repository
1874 762b8e82 2022-06-23 thomas .It C Ta file was merged and conflicts occurred during merge
1875 07f74738 2022-03-13 thomas .It D Ta file was deleted
1876 07f74738 2022-03-13 thomas .It A Ta file was added
1877 49114f01 2022-03-22 thomas .It # Ta failed to patch the file
1878 069bbb86 2022-03-07 thomas .El
1879 069bbb86 2022-03-07 thomas .Pp
1880 07f74738 2022-03-13 thomas If a change does not match at its exact line number, attempt to
1881 4929098b 2022-03-13 thomas apply it somewhere else in the file if a good spot can be found.
1882 4929098b 2022-03-13 thomas Otherwise, the patch will fail to apply.
1883 2cfc25ac 2022-03-13 thomas .Pp
1884 2cfc25ac 2022-03-13 thomas .Nm
1885 2cfc25ac 2022-03-13 thomas .Cm patch
1886 2cfc25ac 2022-03-13 thomas will refuse to apply a patch if certain preconditions are not met.
1887 4929098b 2022-03-13 thomas Files to be deleted must already be under version control, and must
1888 4929098b 2022-03-13 thomas not have been scheduled for deletion already.
1889 4929098b 2022-03-13 thomas Files to be added must not yet be under version control and must not
1890 4929098b 2022-03-13 thomas already be present on disk.
1891 4929098b 2022-03-13 thomas Files to be modified must already be under version control and may not
1892 4929098b 2022-03-13 thomas contain conflict markers.
1893 2cfc25ac 2022-03-13 thomas .Pp
1894 2cfc25ac 2022-03-13 thomas If an error occurs, the
1895 2cfc25ac 2022-03-13 thomas .Cm patch
1896 2cfc25ac 2022-03-13 thomas operation will be aborted.
1897 2cfc25ac 2022-03-13 thomas Any changes made to the work tree up to this point will be left behind.
1898 07f74738 2022-03-13 thomas Such changes can be viewed with
1899 2cfc25ac 2022-03-13 thomas .Cm got diff
1900 2cfc25ac 2022-03-13 thomas and can be reverted with
1901 2cfc25ac 2022-03-13 thomas .Cm got revert
1902 2cfc25ac 2022-03-13 thomas if needed.
1903 bfc91212 2022-03-13 thomas .Pp
1904 bfc91212 2022-03-13 thomas The options for
1905 bfc91212 2022-03-13 thomas .Cm got patch
1906 bfc91212 2022-03-13 thomas are as follows:
1907 bfc91212 2022-03-13 thomas .Bl -tag -width Ds
1908 7d8bcb99 2022-07-28 thomas .It Fl c Ar commit
1909 82a8b7ec 2022-08-06 thomas Attempt to locate files within the specified
1910 7d8bcb99 2022-07-28 thomas .Ar commit
1911 82a8b7ec 2022-08-06 thomas for use as a merge-base for 3-way merges.
1912 482b0b83 2023-07-19 thomas .Pp
1913 482b0b83 2023-07-19 thomas If the
1914 482b0b83 2023-07-19 thomas .Fl c
1915 482b0b83 2023-07-19 thomas option is not used then
1916 482b0b83 2023-07-19 thomas .Cm got patch
1917 482b0b83 2023-07-19 thomas will attempt to locate merge-bases via object IDs found in
1918 482b0b83 2023-07-19 thomas .Ar patchfile
1919 482b0b83 2023-07-19 thomas meta-data, such as produced by
1920 482b0b83 2023-07-19 thomas .Cm got diff
1921 482b0b83 2023-07-19 thomas or
1922 482b0b83 2023-07-19 thomas .Xr git-diff 1 .
1923 482b0b83 2023-07-19 thomas Use of the
1924 482b0b83 2023-07-19 thomas .Fl c
1925 482b0b83 2023-07-19 thomas option is only recommended in the absence of such meta-data.
1926 482b0b83 2023-07-19 thomas .Pp
1927 482b0b83 2023-07-19 thomas Ideally, the specified
1928 482b0b83 2023-07-19 thomas .Ar commit
1929 482b0b83 2023-07-19 thomas should contain versions of files which the changes contained in the
1930 482b0b83 2023-07-19 thomas .Ar patchfile
1931 482b0b83 2023-07-19 thomas were based on.
1932 482b0b83 2023-07-19 thomas Files will be located by path, relative to the repository root.
1933 482b0b83 2023-07-19 thomas If the
1934 482b0b83 2023-07-19 thomas .Fl p
1935 482b0b83 2023-07-19 thomas option is used then leading path components will be stripped
1936 482b0b83 2023-07-19 thomas before paths are looked up in the repository.
1937 482b0b83 2023-07-19 thomas .Pp
1938 482b0b83 2023-07-19 thomas In case no merge-base is available for a file, changes will be applied
1939 482b0b83 2023-07-19 thomas without doing a 3-way merge.
1940 482b0b83 2023-07-19 thomas Changes which do not apply cleanly may then be rejected entirely, rather
1941 482b0b83 2023-07-19 thomas than producing merge conflicts in the patched target file.
1942 482b0b83 2023-07-19 thomas .Pp
1943 fb885120 2023-07-19 thomas The expected
1944 fb885120 2023-07-19 thomas .Ar commit
1945 a290e4b4 2023-07-19 thomas argument is a commit ID SHA1 hash, or a reference name or a keyword
1946 a290e4b4 2023-07-19 thomas which will be resolved to a commit ID.
1947 fb885120 2023-07-19 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
1948 fb885120 2023-07-19 thomas automatically, provided the abbreviation is unique.
1949 a290e4b4 2023-07-19 thomas The keywords
1950 fb885120 2023-07-19 thomas .Qq :base
1951 fb885120 2023-07-19 thomas and
1952 fb885120 2023-07-19 thomas .Qq :head
1953 a290e4b4 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
1954 fb885120 2023-07-19 thomas Keywords and references may be appended with
1955 fb885120 2023-07-19 thomas .Qq :+
1956 fb885120 2023-07-19 thomas or
1957 fb885120 2023-07-19 thomas .Qq :-
1958 fb885120 2023-07-19 thomas modifiers and an optional integer N to denote the
1959 fb885120 2023-07-19 thomas Nth descendant or antecedent by first parent traversal, respectively;
1960 fb885120 2023-07-19 thomas for example,
1961 fb885120 2023-07-19 thomas .Sy :head:-2
1962 fb885120 2023-07-19 thomas denotes the work tree branch head's 2nd generation ancestor, and
1963 fb885120 2023-07-19 thomas .Sy :base:+4
1964 fb885120 2023-07-19 thomas denotes the 4th generation descendant of the work tree's base commit.
1965 fb885120 2023-07-19 thomas Similarly,
1966 fb885120 2023-07-19 thomas .Sy flan:+3
1967 fb885120 2023-07-19 thomas will denote the 3rd generation descendant of the commit resolved by the
1968 fb885120 2023-07-19 thomas .Qq flan
1969 fb885120 2023-07-19 thomas reference.
1970 fb885120 2023-07-19 thomas A
1971 fb885120 2023-07-19 thomas .Qq :+
1972 fb885120 2023-07-19 thomas or
1973 fb885120 2023-07-19 thomas .Qq :-
1974 fb885120 2023-07-19 thomas modifier without a trailing integer has an implicit
1975 fb885120 2023-07-19 thomas .Qq 1
1976 fb885120 2023-07-19 thomas appended
1977 fb885120 2023-07-19 thomas .Po e.g.,
1978 fb885120 2023-07-19 thomas .Sy :base:+
1979 fb885120 2023-07-19 thomas is equivalent to
1980 fb885120 2023-07-19 thomas .Sy :base:+1
1981 fb885120 2023-07-19 thomas .Pc .
1982 bfc91212 2022-03-13 thomas .It Fl n
1983 bfc91212 2022-03-13 thomas Do not make any modifications to the work tree.
1984 bfc91212 2022-03-13 thomas This can be used to check whether a patch would apply without issues.
1985 bfc91212 2022-03-13 thomas If the
1986 bfc91212 2022-03-13 thomas .Ar patchfile
1987 4b06140e 2022-03-22 thomas contains diffs that affect the same file multiple times, the results
1988 bfc91212 2022-03-13 thomas displayed may be incorrect.
1989 d9db2ff9 2022-04-16 thomas .It Fl p Ar strip-count
1990 d9db2ff9 2022-04-16 thomas Specify the number of leading path components to strip from paths
1991 d9db2ff9 2022-04-16 thomas parsed from
1992 d9db2ff9 2022-04-16 thomas .Ar patchfile .
1993 d9db2ff9 2022-04-16 thomas If the
1994 d9db2ff9 2022-04-16 thomas .Fl p
1995 d9db2ff9 2022-04-16 thomas option is not used,
1996 d9db2ff9 2022-04-16 thomas .Sq a/
1997 d9db2ff9 2022-04-16 thomas and
1998 d9db2ff9 2022-04-16 thomas .Sq b/
1999 d9db2ff9 2022-04-16 thomas path prefixes generated by
2000 d9db2ff9 2022-04-16 thomas .Xr git-diff 1
2001 d9db2ff9 2022-04-16 thomas will be recognized and stripped automatically.
2002 eaef698f 2022-04-23 thomas .It Fl R
2003 eaef698f 2022-04-23 thomas Reverse the patch before applying it.
2004 bfc91212 2022-03-13 thomas .El
2005 e8aa341a 2021-10-08 thomas .Tg rv
2006 56c96eff 2022-08-30 thomas .It Xo
2007 56c96eff 2022-08-30 thomas .Cm revert
2008 56c96eff 2022-08-30 thomas .Op Fl pR
2009 56c96eff 2022-08-30 thomas .Op Fl F Ar response-script
2010 56c96eff 2022-08-30 thomas .Ar path ...
2011 56c96eff 2022-08-30 thomas .Xc
2012 d912d125 2021-11-04 thomas .Dl Pq alias: Cm rv
2013 bd81cfb7 2020-04-19 stsp Revert any local changes in files at the specified paths in a work tree.
2014 a129376b 2019-03-28 stsp File contents will be overwritten with those contained in the
2015 1dd86744 2019-08-12 anthony work tree's base commit.
2016 1dd86744 2019-08-12 anthony There is no way to bring discarded changes back after
2017 a129376b 2019-03-28 stsp .Cm got revert !
2018 a129376b 2019-03-28 stsp .Pp
2019 e20a8b6f 2019-06-04 stsp If a file was added with
2020 4b06140e 2022-03-22 thomas .Cm got add ,
2021 a129376b 2019-03-28 stsp it will become an unversioned file again.
2022 e20a8b6f 2019-06-04 stsp If a file was deleted with
2023 4b06140e 2022-03-22 thomas .Cm got remove ,
2024 a129376b 2019-03-28 stsp it will be restored.
2025 0f6d7415 2019-08-08 stsp .Pp
2026 0f6d7415 2019-08-08 stsp The options for
2027 0f6d7415 2019-08-08 stsp .Cm got revert
2028 0f6d7415 2019-08-08 stsp are as follows:
2029 0f6d7415 2019-08-08 stsp .Bl -tag -width Ds
2030 d6506a3d 2022-08-16 thomas .It Fl F Ar response-script
2031 d6506a3d 2022-08-16 thomas With the
2032 d6506a3d 2022-08-16 thomas .Fl p
2033 d6506a3d 2022-08-16 thomas option, read
2034 d6506a3d 2022-08-16 thomas .Dq y ,
2035 d6506a3d 2022-08-16 thomas .Dq n ,
2036 d6506a3d 2022-08-16 thomas and
2037 d6506a3d 2022-08-16 thomas .Dq q
2038 d6506a3d 2022-08-16 thomas responses line-by-line from the specified
2039 d6506a3d 2022-08-16 thomas .Ar response-script
2040 d6506a3d 2022-08-16 thomas file instead of prompting interactively.
2041 33aa809d 2019-08-08 stsp .It Fl p
2042 33aa809d 2019-08-08 stsp Instead of reverting all changes in files, interactively select or reject
2043 33aa809d 2019-08-08 stsp changes to revert based on
2044 33aa809d 2019-08-08 stsp .Dq y
2045 33aa809d 2019-08-08 stsp (revert change),
2046 33aa809d 2019-08-08 stsp .Dq n
2047 33aa809d 2019-08-08 stsp (keep change), and
2048 33aa809d 2019-08-08 stsp .Dq q
2049 33aa809d 2019-08-08 stsp (quit reverting this file) responses.
2050 33aa809d 2019-08-08 stsp If a file is in modified status, individual patches derived from the
2051 33aa809d 2019-08-08 stsp modified file content can be reverted.
2052 33aa809d 2019-08-08 stsp Files in added or deleted status may only be reverted in their entirety.
2053 0f6d7415 2019-08-08 stsp .It Fl R
2054 0f6d7415 2019-08-08 stsp Permit recursion into directories.
2055 0f6d7415 2019-08-08 stsp If this option is not specified,
2056 0f6d7415 2019-08-08 stsp .Cm got revert
2057 0f6d7415 2019-08-08 stsp will refuse to run if a specified
2058 0f6d7415 2019-08-08 stsp .Ar path
2059 0f6d7415 2019-08-08 stsp is a directory.
2060 0f6d7415 2019-08-08 stsp .El
2061 e8aa341a 2021-10-08 thomas .Tg ci
2062 56c96eff 2022-08-30 thomas .It Xo
2063 56c96eff 2022-08-30 thomas .Cm commit
2064 be94c032 2023-02-20 thomas .Op Fl CNnS
2065 56c96eff 2022-08-30 thomas .Op Fl A Ar author
2066 56c96eff 2022-08-30 thomas .Op Fl F Ar path
2067 56c96eff 2022-08-30 thomas .Op Fl m Ar message
2068 56c96eff 2022-08-30 thomas .Op Ar path ...
2069 56c96eff 2022-08-30 thomas .Xc
2070 d912d125 2021-11-04 thomas .Dl Pq alias: Cm ci
2071 4ed9f614 2019-08-04 stsp Create a new commit in the repository from changes in a work tree
2072 15cd91f7 2019-05-12 stsp and use this commit as the new base commit for the work tree.
2073 5c1e53bc 2019-07-28 stsp If no
2074 90e8619e 2019-07-25 stsp .Ar path
2075 4ed9f614 2019-08-04 stsp is specified, commit all changes in the work tree.
2076 4ed9f614 2019-08-04 stsp Otherwise, commit changes at or within the specified paths.
2077 15cd91f7 2019-05-12 stsp .Pp
2078 4ed9f614 2019-08-04 stsp If changes have been explicitly staged for commit with
2079 1dd86744 2019-08-12 anthony .Cm got stage ,
2080 4ed9f614 2019-08-04 stsp only commit staged changes and reject any specified paths which
2081 4ed9f614 2019-08-04 stsp have not been staged.
2082 4ed9f614 2019-08-04 stsp .Pp
2083 28cf319f 2021-01-28 stsp .Cm got commit
2084 28cf319f 2021-01-28 stsp opens a temporary file in an editor where a log message can be written
2085 28cf319f 2021-01-28 stsp unless the
2086 28cf319f 2021-01-28 stsp .Fl m
2087 28cf319f 2021-01-28 stsp option is used
2088 28cf319f 2021-01-28 stsp or the
2089 28cf319f 2021-01-28 stsp .Fl F
2090 28cf319f 2021-01-28 stsp and
2091 28cf319f 2021-01-28 stsp .Fl N
2092 28cf319f 2021-01-28 stsp options are used together.
2093 bccae03f 2023-07-17 thomas Quitting the editor without saving the file will abort the commit operation.
2094 28cf319f 2021-01-28 stsp .Pp
2095 15cd91f7 2019-05-12 stsp Show the status of each affected file, using the following status codes:
2096 15cd91f7 2019-05-12 stsp .Bl -column YXZ description
2097 15cd91f7 2019-05-12 stsp .It M Ta modified file
2098 15cd91f7 2019-05-12 stsp .It D Ta file was deleted
2099 15cd91f7 2019-05-12 stsp .It A Ta new file was added
2100 1ebedb77 2019-10-19 stsp .It m Ta modified file modes (executable bit only)
2101 15cd91f7 2019-05-12 stsp .El
2102 15cd91f7 2019-05-12 stsp .Pp
2103 996d5ccd 2019-08-05 stsp Files which are not part of the new commit will retain their previously
2104 996d5ccd 2019-08-05 stsp recorded base commit.
2105 15cd91f7 2019-05-12 stsp Some
2106 15cd91f7 2019-05-12 stsp .Nm
2107 15cd91f7 2019-05-12 stsp commands may refuse to run while the work tree contains files from
2108 15cd91f7 2019-05-12 stsp multiple base commits.
2109 15cd91f7 2019-05-12 stsp The base commit of such a work tree can be made consistent by running
2110 47ec7be7 2019-05-12 stsp .Cm got update
2111 47ec7be7 2019-05-12 stsp across the entire work tree.
2112 15cd91f7 2019-05-12 stsp .Pp
2113 15cd91f7 2019-05-12 stsp The
2114 15cd91f7 2019-05-12 stsp .Cm got commit
2115 15cd91f7 2019-05-12 stsp command requires the
2116 74416c47 2019-05-09 stsp .Ev GOT_AUTHOR
2117 aba9c984 2019-09-08 stsp environment variable to be set,
2118 257add31 2020-09-09 stsp unless an author has been configured in
2119 257add31 2020-09-09 stsp .Xr got.conf 5
2120 257add31 2020-09-09 stsp or Git's
2121 aba9c984 2019-09-08 stsp .Dv user.name
2122 aba9c984 2019-09-08 stsp and
2123 709ae9eb 2019-09-08 stsp .Dv user.email
2124 709ae9eb 2019-09-08 stsp configuration settings can be
2125 aba9c984 2019-09-08 stsp obtained from the repository's
2126 aba9c984 2019-09-08 stsp .Pa .git/config
2127 c9956ddf 2019-09-08 stsp file or from Git's global
2128 c9956ddf 2019-09-08 stsp .Pa ~/.gitconfig
2129 c9956ddf 2019-09-08 stsp configuration file.
2130 74416c47 2019-05-09 stsp .Pp
2131 74416c47 2019-05-09 stsp The options for
2132 74416c47 2019-05-09 stsp .Cm got commit
2133 74416c47 2019-05-09 stsp are as follows:
2134 74416c47 2019-05-09 stsp .Bl -tag -width Ds
2135 18d1acad 2022-07-20 thomas .It Fl A Ar author
2136 18d1acad 2022-07-20 thomas Set author information in the newly created commit to
2137 18d1acad 2022-07-20 thomas .Ar author .
2138 fbbd3dd5 2023-02-17 thomas This is useful when committing changes on behalf of someone else.
2139 18d1acad 2022-07-20 thomas The
2140 18d1acad 2022-07-20 thomas .Ar author
2141 18d1acad 2022-07-20 thomas argument must use the same format as the
2142 18d1acad 2022-07-20 thomas .Ev GOT_AUTHOR
2143 18d1acad 2022-07-20 thomas environment variable.
2144 18d1acad 2022-07-20 thomas .Pp
2145 18d1acad 2022-07-20 thomas In addition to storing author information, the newly created commit
2146 18d1acad 2022-07-20 thomas object will retain
2147 18d1acad 2022-07-20 thomas .Dq committer
2148 18d1acad 2022-07-20 thomas information which is obtained, as usual, from the
2149 18d1acad 2022-07-20 thomas .Ev GOT_AUTHOR
2150 18d1acad 2022-07-20 thomas environment variable, or
2151 18d1acad 2022-07-20 thomas .Xr got.conf 5 ,
2152 18d1acad 2022-07-20 thomas or Git configuration settings.
2153 be94c032 2023-02-20 thomas .It Fl C
2154 be94c032 2023-02-20 thomas Allow committing files in conflicted status.
2155 be94c032 2023-02-20 thomas .Pp
2156 be94c032 2023-02-20 thomas Committing files with conflict markers should generally be avoided.
2157 be94c032 2023-02-20 thomas Cases where conflict markers must be stored in the repository for
2158 be94c032 2023-02-20 thomas some legitimate reason should be very rare.
2159 be94c032 2023-02-20 thomas There are usually ways to avoid storing conflict markers verbatim by
2160 be94c032 2023-02-20 thomas applying appropriate programming tricks.
2161 28cf319f 2021-01-28 stsp .It Fl F Ar path
2162 28cf319f 2021-01-28 stsp Use the prepared log message stored in the file found at
2163 28cf319f 2021-01-28 stsp .Ar path
2164 28cf319f 2021-01-28 stsp when creating the new commit.
2165 28cf319f 2021-01-28 stsp .Cm got commit
2166 28cf319f 2021-01-28 stsp opens a temporary file in an editor where the prepared log message can be
2167 28cf319f 2021-01-28 stsp reviewed and edited further if needed.
2168 28cf319f 2021-01-28 stsp Cannot be used together with the
2169 23594da9 2019-05-13 stsp .Fl m
2170 28cf319f 2021-01-28 stsp option.
2171 28cf319f 2021-01-28 stsp .It Fl m Ar message
2172 28cf319f 2021-01-28 stsp Use the specified log message when creating the new commit.
2173 28cf319f 2021-01-28 stsp Cannot be used together with the
2174 28cf319f 2021-01-28 stsp .Fl F
2175 28cf319f 2021-01-28 stsp option.
2176 28cf319f 2021-01-28 stsp .It Fl N
2177 28cf319f 2021-01-28 stsp This option prevents
2178 23594da9 2019-05-13 stsp .Cm got commit
2179 28cf319f 2021-01-28 stsp from opening the commit message in an editor.
2180 28cf319f 2021-01-28 stsp It has no effect unless it is used together with the
2181 28cf319f 2021-01-28 stsp .Fl F
2182 28cf319f 2021-01-28 stsp option and is intended for non-interactive use such as scripting.
2183 ef899790 2022-11-01 thomas .It Fl n
2184 ef899790 2022-11-01 thomas This option prevents
2185 ef899790 2022-11-01 thomas .Cm got commit
2186 ef899790 2022-11-01 thomas from generating a diff of the to-be-committed changes in a temporary file
2187 ef899790 2022-11-01 thomas which can be viewed while editing a commit message.
2188 35213c7c 2020-07-23 stsp .It Fl S
2189 af358f55 2020-07-23 stsp Allow the addition of symbolic links which point outside of the path space
2190 af358f55 2020-07-23 stsp that is under version control.
2191 af358f55 2020-07-23 stsp By default,
2192 af358f55 2020-07-23 stsp .Cm got commit
2193 af358f55 2020-07-23 stsp will reject such symbolic links due to safety concerns.
2194 35213c7c 2020-07-23 stsp As a precaution,
2195 35213c7c 2020-07-23 stsp .Nm
2196 af358f55 2020-07-23 stsp may decide to represent such a symbolic link as a regular file which contains
2197 af358f55 2020-07-23 stsp the link's target path, rather than creating an actual symbolic link which
2198 af358f55 2020-07-23 stsp points outside of the work tree.
2199 af358f55 2020-07-23 stsp Use of this option is discouraged because external mechanisms such as
2200 af358f55 2020-07-23 stsp .Dq make obj
2201 af358f55 2020-07-23 stsp are better suited for managing symbolic links to paths not under
2202 af358f55 2020-07-23 stsp version control.
2203 2ec1f75b 2019-03-26 stsp .El
2204 cfce0458 2019-07-28 stsp .Pp
2205 cfce0458 2019-07-28 stsp .Cm got commit
2206 cfce0458 2019-07-28 stsp will refuse to run if certain preconditions are not met.
2207 916f288c 2019-07-30 stsp If the work tree's current branch is not in the
2208 916f288c 2019-07-30 stsp .Dq refs/heads/
2209 916f288c 2019-07-30 stsp reference namespace, new commits may not be created on this branch.
2210 cfce0458 2019-07-28 stsp Local changes may only be committed if they are based on file content
2211 cfce0458 2019-07-28 stsp found in the most recent commit on the work tree's branch.
2212 cfce0458 2019-07-28 stsp If a path is found to be out of date,
2213 cfce0458 2019-07-28 stsp .Cm got update
2214 cfce0458 2019-07-28 stsp must be used first in order to merge local changes with changes made
2215 cfce0458 2019-07-28 stsp in the repository.
2216 e8aa341a 2021-10-08 thomas .Tg se
2217 56c96eff 2022-08-30 thomas .It Xo
2218 56c96eff 2022-08-30 thomas .Cm send
2219 56c96eff 2022-08-30 thomas .Op Fl afqTv
2220 56c96eff 2022-08-30 thomas .Op Fl b Ar branch
2221 56c96eff 2022-08-30 thomas .Op Fl d Ar branch
2222 56c96eff 2022-08-30 thomas .Op Fl r Ar repository-path
2223 56c96eff 2022-08-30 thomas .Op Fl t Ar tag
2224 56c96eff 2022-08-30 thomas .Op Ar remote-repository
2225 56c96eff 2022-08-30 thomas .Xc
2226 d912d125 2021-11-04 thomas .Dl Pq alias: Cm se
2227 f8a36e22 2021-08-26 stsp Send new changes to a remote repository.
2228 f8a36e22 2021-08-26 stsp If no
2229 f8a36e22 2021-08-26 stsp .Ar remote-repository
2230 f8a36e22 2021-08-26 stsp is specified,
2231 f8a36e22 2021-08-26 stsp .Dq origin
2232 f8a36e22 2021-08-26 stsp will be used.
2233 f8a36e22 2021-08-26 stsp The remote repository's URL is obtained from the corresponding entry in
2234 f8a36e22 2021-08-26 stsp .Xr got.conf 5
2235 f8a36e22 2021-08-26 stsp or Git's
2236 f8a36e22 2021-08-26 stsp .Pa config
2237 f8a36e22 2021-08-26 stsp file of the local repository, as created by
2238 f8a36e22 2021-08-26 stsp .Cm got clone .
2239 f8a36e22 2021-08-26 stsp .Pp
2240 f8a36e22 2021-08-26 stsp All objects corresponding to new changes will be written to a temporary
2241 f8a36e22 2021-08-26 stsp pack file which is then uploaded to the server.
2242 f8a36e22 2021-08-26 stsp Upon success, references in the
2243 f8a36e22 2021-08-26 stsp .Dq refs/remotes/
2244 f8a36e22 2021-08-26 stsp reference namespace of the local repository will be updated to point at
2245 f8a36e22 2021-08-26 stsp the commits which have been sent.
2246 f8a36e22 2021-08-26 stsp .Pp
2247 f8a36e22 2021-08-26 stsp By default, changes will only be sent if they are based on up-to-date
2248 f8a36e22 2021-08-26 stsp copies of relevant branches in the remote repository.
2249 fd44090b 2021-08-26 stsp If any changes to be sent are based on out-of-date copies or would
2250 fd44090b 2021-08-26 stsp otherwise break linear history of existing branches, new changes must
2251 fd44090b 2021-08-26 stsp be fetched from the server with
2252 f8a36e22 2021-08-26 stsp .Cm got fetch
2253 f8a36e22 2021-08-26 stsp and local branches must be rebased with
2254 f8a36e22 2021-08-26 stsp .Cm got rebase
2255 f8a36e22 2021-08-26 stsp before
2256 f8a36e22 2021-08-26 stsp .Cm got send
2257 f8a36e22 2021-08-26 stsp can succeed.
2258 fd44090b 2021-08-26 stsp The
2259 fd44090b 2021-08-26 stsp .Fl f
2260 fd44090b 2021-08-26 stsp option can be used to make exceptions to these requirements.
2261 f8a36e22 2021-08-26 stsp .Pp
2262 f8a36e22 2021-08-26 stsp The options for
2263 f8a36e22 2021-08-26 stsp .Cm got send
2264 f8a36e22 2021-08-26 stsp are as follows:
2265 f8a36e22 2021-08-26 stsp .Bl -tag -width Ds
2266 f8a36e22 2021-08-26 stsp .It Fl a
2267 f8a36e22 2021-08-26 stsp Send all branches from the local repository's
2268 f8a36e22 2021-08-26 stsp .Dq refs/heads/
2269 f8a36e22 2021-08-26 stsp reference namespace.
2270 f8a36e22 2021-08-26 stsp The
2271 f8a36e22 2021-08-26 stsp .Fl a
2272 f8a36e22 2021-08-26 stsp option is equivalent to listing all branches with multiple
2273 f8a36e22 2021-08-26 stsp .Fl b
2274 f8a36e22 2021-08-26 stsp options.
2275 f8a36e22 2021-08-26 stsp Cannot be used together with the
2276 f8a36e22 2021-08-26 stsp .Fl b
2277 f8a36e22 2021-08-26 stsp option.
2278 f8a36e22 2021-08-26 stsp .It Fl b Ar branch
2279 f8a36e22 2021-08-26 stsp Send the specified
2280 f8a36e22 2021-08-26 stsp .Ar branch
2281 f8a36e22 2021-08-26 stsp from the local repository's
2282 f8a36e22 2021-08-26 stsp .Dq refs/heads/
2283 f8a36e22 2021-08-26 stsp reference namespace.
2284 f8a36e22 2021-08-26 stsp This option may be specified multiple times to build a list of branches
2285 f8a36e22 2021-08-26 stsp to send.
2286 f8a36e22 2021-08-26 stsp If this option is not specified, default to the work tree's current branch
2287 f8a36e22 2021-08-26 stsp if invoked in a work tree, or to the repository's HEAD reference.
2288 f8a36e22 2021-08-26 stsp Cannot be used together with the
2289 f8a36e22 2021-08-26 stsp .Fl a
2290 f8a36e22 2021-08-26 stsp option.
2291 f8a36e22 2021-08-26 stsp .It Fl d Ar branch
2292 f8a36e22 2021-08-26 stsp Delete the specified
2293 f8a36e22 2021-08-26 stsp .Ar branch
2294 f8a36e22 2021-08-26 stsp from the remote repository's
2295 f8a36e22 2021-08-26 stsp .Dq refs/heads/
2296 f8a36e22 2021-08-26 stsp reference namespace.
2297 f8a36e22 2021-08-26 stsp This option may be specified multiple times to build a list of branches
2298 f8a36e22 2021-08-26 stsp to delete.
2299 f8a36e22 2021-08-26 stsp .Pp
2300 f8a36e22 2021-08-26 stsp Only references are deleted.
2301 f8a36e22 2021-08-26 stsp Any commit, tree, tag, and blob objects belonging to deleted branches
2302 f8a36e22 2021-08-26 stsp may become subject to deletion by Git's garbage collector running on
2303 f8a36e22 2021-08-26 stsp the server.
2304 f8a36e22 2021-08-26 stsp .Pp
2305 f8a36e22 2021-08-26 stsp Requesting deletion of branches results in an error if the server
2306 fd44090b 2021-08-26 stsp does not support this feature or disallows the deletion of branches
2307 fd44090b 2021-08-26 stsp based on its configuration.
2308 f8a36e22 2021-08-26 stsp .It Fl f
2309 fd44090b 2021-08-26 stsp Attempt to force the server to overwrite existing branches or tags
2310 fd44090b 2021-08-26 stsp in the remote repository, even when
2311 fd44090b 2021-08-26 stsp .Cm got fetch
2312 1a70a207 2023-07-05 thomas followed by
2313 fd44090b 2021-08-26 stsp .Cm got rebase
2314 1a70a207 2023-07-05 thomas or
2315 1a70a207 2023-07-05 thomas .Cm got merge
2316 fd44090b 2021-08-26 stsp would usually be required before changes can be sent.
2317 f8a36e22 2021-08-26 stsp The server may reject forced requests regardless, depending on its
2318 f8a36e22 2021-08-26 stsp configuration.
2319 f8a36e22 2021-08-26 stsp .Pp
2320 f8a36e22 2021-08-26 stsp Any commit, tree, tag, and blob objects belonging to overwritten branches
2321 f8a36e22 2021-08-26 stsp or tags may become subject to deletion by Git's garbage collector running
2322 f8a36e22 2021-08-26 stsp on the server.
2323 f8a36e22 2021-08-26 stsp .Pp
2324 f8a36e22 2021-08-26 stsp The
2325 f8a36e22 2021-08-26 stsp .Dq refs/tags
2326 f8a36e22 2021-08-26 stsp reference namespace is globally shared between all repositories.
2327 f8a36e22 2021-08-26 stsp Use of the
2328 f8a36e22 2021-08-26 stsp .Fl f
2329 f8a36e22 2021-08-26 stsp option to overwrite tags is discouraged because it can lead to
2330 f8a36e22 2021-08-26 stsp inconsistencies between the tags present in different repositories.
2331 f8a36e22 2021-08-26 stsp In general, creating a new tag with a different name is recommended
2332 f8a36e22 2021-08-26 stsp instead of overwriting an existing tag.
2333 f8a36e22 2021-08-26 stsp .Pp
2334 f8a36e22 2021-08-26 stsp Use of the
2335 f8a36e22 2021-08-26 stsp .Fl f
2336 f8a36e22 2021-08-26 stsp option is particularly discouraged if changes being sent are based
2337 f8a36e22 2021-08-26 stsp on an out-of-date copy of a branch in the remote repository.
2338 f8a36e22 2021-08-26 stsp Instead of using the
2339 f8a36e22 2021-08-26 stsp .Fl f
2340 f8a36e22 2021-08-26 stsp option, new changes should
2341 f8a36e22 2021-08-26 stsp be fetched with
2342 f8a36e22 2021-08-26 stsp .Cm got fetch
2343 f8a36e22 2021-08-26 stsp and local branches should be rebased with
2344 1a70a207 2023-07-05 thomas .Cm got rebase
2345 1a70a207 2023-07-05 thomas or merged with
2346 1a70a207 2023-07-05 thomas .Cm got merge ,
2347 f8a36e22 2021-08-26 stsp followed by another attempt to send the changes.
2348 f8a36e22 2021-08-26 stsp .Pp
2349 f8a36e22 2021-08-26 stsp The
2350 f8a36e22 2021-08-26 stsp .Fl f
2351 f8a36e22 2021-08-26 stsp option should only be needed in situations where the remote repository's
2352 f8a36e22 2021-08-26 stsp copy of a branch or tag is known to be out-of-date and is considered
2353 f8a36e22 2021-08-26 stsp disposable.
2354 f8a36e22 2021-08-26 stsp The risks of creating inconsistencies between different repositories
2355 f8a36e22 2021-08-26 stsp should also be taken into account.
2356 d6506a3d 2022-08-16 thomas .It Fl q
2357 d6506a3d 2022-08-16 thomas Suppress progress reporting output.
2358 d6506a3d 2022-08-16 thomas The same option will be passed to
2359 d6506a3d 2022-08-16 thomas .Xr ssh 1
2360 d6506a3d 2022-08-16 thomas if applicable.
2361 f8a36e22 2021-08-26 stsp .It Fl r Ar repository-path
2362 f8a36e22 2021-08-26 stsp Use the repository at the specified path.
2363 f8a36e22 2021-08-26 stsp If not specified, assume the repository is located at or above the current
2364 f8a36e22 2021-08-26 stsp working directory.
2365 f8a36e22 2021-08-26 stsp If this directory is a
2366 f8a36e22 2021-08-26 stsp .Nm
2367 f8a36e22 2021-08-26 stsp work tree, use the repository path associated with this work tree.
2368 d6506a3d 2022-08-16 thomas .It Fl T
2369 d6506a3d 2022-08-16 thomas Attempt to send all tags from the local repository's
2370 d6506a3d 2022-08-16 thomas .Dq refs/tags/
2371 d6506a3d 2022-08-16 thomas reference namespace.
2372 d6506a3d 2022-08-16 thomas The
2373 d6506a3d 2022-08-16 thomas .Fl T
2374 d6506a3d 2022-08-16 thomas option is equivalent to listing all tags with multiple
2375 d6506a3d 2022-08-16 thomas .Fl t
2376 d6506a3d 2022-08-16 thomas options.
2377 d6506a3d 2022-08-16 thomas Cannot be used together with the
2378 d6506a3d 2022-08-16 thomas .Fl t
2379 d6506a3d 2022-08-16 thomas option.
2380 f8a36e22 2021-08-26 stsp .It Fl t Ar tag
2381 f8a36e22 2021-08-26 stsp Send the specified
2382 f8a36e22 2021-08-26 stsp .Ar tag
2383 f8a36e22 2021-08-26 stsp from the local repository's
2384 f8a36e22 2021-08-26 stsp .Dq refs/tags/
2385 f8a36e22 2021-08-26 stsp reference namespace, in addition to any branches that are being sent.
2386 f8a36e22 2021-08-26 stsp The
2387 f8a36e22 2021-08-26 stsp .Fl t
2388 f8a36e22 2021-08-26 stsp option may be specified multiple times to build a list of tags to send.
2389 f8a36e22 2021-08-26 stsp No tags will be sent if the
2390 f8a36e22 2021-08-26 stsp .Fl t
2391 f8a36e22 2021-08-26 stsp option is not used.
2392 f8a36e22 2021-08-26 stsp .Pp
2393 f8a36e22 2021-08-26 stsp Raise an error if the specified
2394 f8a36e22 2021-08-26 stsp .Ar tag
2395 f8a36e22 2021-08-26 stsp already exists in the remote repository, unless the
2396 f8a36e22 2021-08-26 stsp .Fl f
2397 93a300b2 2021-08-26 stsp option is used to overwrite the server's copy of the tag.
2398 f8a36e22 2021-08-26 stsp In general, creating a new tag with a different name is recommended
2399 f8a36e22 2021-08-26 stsp instead of overwriting an existing tag.
2400 f8a36e22 2021-08-26 stsp .Pp
2401 f8a36e22 2021-08-26 stsp Cannot be used together with the
2402 f8a36e22 2021-08-26 stsp .Fl T
2403 f8a36e22 2021-08-26 stsp option.
2404 f8a36e22 2021-08-26 stsp .It Fl v
2405 f8a36e22 2021-08-26 stsp Verbose mode.
2406 f8a36e22 2021-08-26 stsp Causes
2407 f8a36e22 2021-08-26 stsp .Cm got send
2408 f8a36e22 2021-08-26 stsp to print debugging messages to standard error output.
2409 f8a36e22 2021-08-26 stsp The same option will be passed to
2410 f8a36e22 2021-08-26 stsp .Xr ssh 1
2411 f8a36e22 2021-08-26 stsp if applicable.
2412 f8a36e22 2021-08-26 stsp Multiple -v options increase the verbosity.
2413 f8a36e22 2021-08-26 stsp The maximum is 3.
2414 f8a36e22 2021-08-26 stsp .El
2415 e8aa341a 2021-10-08 thomas .Tg cy
2416 f6cd0243 2023-01-28 thomas .It Xo
2417 f6cd0243 2023-01-28 thomas .Cm cherrypick
2418 f6cd0243 2023-01-28 thomas .Op Fl lX
2419 7e710171 2023-01-28 thomas .Op Ar commit
2420 f6cd0243 2023-01-28 thomas .Xc
2421 d912d125 2021-11-04 thomas .Dl Pq alias: Cm cy
2422 234035bc 2019-06-01 stsp Merge changes from a single
2423 234035bc 2019-06-01 stsp .Ar commit
2424 234035bc 2019-06-01 stsp into the work tree.
2425 234035bc 2019-06-01 stsp The specified
2426 234035bc 2019-06-01 stsp .Ar commit
2427 a16d97bd 2021-09-02 stsp should be on a different branch than the work tree's base commit.
2428 a290e4b4 2023-07-19 thomas .Pp
2429 a290e4b4 2023-07-19 thomas The expected argument is a commit ID SHA1 hash, or a reference name or
2430 a290e4b4 2023-07-19 thomas keyword which will be resolved to a commit ID.
2431 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
2432 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
2433 a290e4b4 2023-07-19 thomas The keywords
2434 fb885120 2023-07-19 thomas .Qq :base
2435 fb885120 2023-07-19 thomas and
2436 fb885120 2023-07-19 thomas .Qq :head
2437 a290e4b4 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
2438 fb885120 2023-07-19 thomas Keywords and references may be appended with
2439 fb885120 2023-07-19 thomas .Qq :+
2440 fb885120 2023-07-19 thomas or
2441 fb885120 2023-07-19 thomas .Qq :-
2442 fb885120 2023-07-19 thomas modifiers and an optional integer N to denote the
2443 fb885120 2023-07-19 thomas Nth descendant or antecedent by first parent traversal, respectively;
2444 fb885120 2023-07-19 thomas for example,
2445 fb885120 2023-07-19 thomas .Sy :head:-2
2446 fb885120 2023-07-19 thomas denotes the work tree branch head's 2nd generation ancestor, and
2447 fb885120 2023-07-19 thomas .Sy :base:+4
2448 fb885120 2023-07-19 thomas denotes the 4th generation descendant of the work tree's base commit.
2449 fb885120 2023-07-19 thomas Similarly,
2450 fb885120 2023-07-19 thomas .Sy barbaz:+3
2451 fb885120 2023-07-19 thomas will denote the 3rd generation descendant of the commit resolved by the
2452 fb885120 2023-07-19 thomas .Qq barbaz
2453 fb885120 2023-07-19 thomas reference.
2454 fb885120 2023-07-19 thomas A
2455 fb885120 2023-07-19 thomas .Qq :+
2456 fb885120 2023-07-19 thomas or
2457 fb885120 2023-07-19 thomas .Qq :-
2458 fb885120 2023-07-19 thomas modifier without a trailing integer has an implicit
2459 fb885120 2023-07-19 thomas .Qq 1
2460 fb885120 2023-07-19 thomas appended
2461 fb885120 2023-07-19 thomas .Po e.g.,
2462 fb885120 2023-07-19 thomas .Sy :base:+
2463 fb885120 2023-07-19 thomas is equivalent to
2464 fb885120 2023-07-19 thomas .Sy :base:+1
2465 fb885120 2023-07-19 thomas .Pc .
2466 234035bc 2019-06-01 stsp .Pp
2467 234035bc 2019-06-01 stsp Show the status of each affected file, using the following status codes:
2468 234035bc 2019-06-01 stsp .Bl -column YXZ description
2469 234035bc 2019-06-01 stsp .It G Ta file was merged
2470 234035bc 2019-06-01 stsp .It C Ta file was merged and conflicts occurred during merge
2471 234035bc 2019-06-01 stsp .It ! Ta changes destined for a missing file were not merged
2472 234035bc 2019-06-01 stsp .It D Ta file was deleted
2473 df3d7c3e 2021-09-24 thomas .It d Ta file's deletion was prevented by local modifications
2474 234035bc 2019-06-01 stsp .It A Ta new file was added
2475 1dd86744 2019-08-12 anthony .It \(a~ Ta changes destined for a non-regular file were not merged
2476 c90c8ce3 2020-07-23 stsp .It ? Ta changes destined for an unversioned file were not merged
2477 74416c47 2019-05-09 stsp .El
2478 234035bc 2019-06-01 stsp .Pp
2479 234035bc 2019-06-01 stsp The merged changes will appear as local changes in the work tree, which
2480 234035bc 2019-06-01 stsp may be viewed with
2481 234035bc 2019-06-01 stsp .Cm got diff ,
2482 234035bc 2019-06-01 stsp amended manually or with further
2483 234035bc 2019-06-01 stsp .Cm got cherrypick
2484 bc3056e3 2019-08-18 stsp commands,
2485 234035bc 2019-06-01 stsp committed with
2486 52d3950d 2023-01-28 thomas .Cm got commit .
2487 52d3950d 2023-01-28 thomas .Pp
2488 52d3950d 2023-01-28 thomas If invoked in a work tree where no
2489 52d3950d 2023-01-28 thomas .Cm rebase ,
2490 52d3950d 2023-01-28 thomas .Cm histedit ,
2491 52d3950d 2023-01-28 thomas or
2492 52d3950d 2023-01-28 thomas .Cm merge
2493 52d3950d 2023-01-28 thomas operation is taking place,
2494 52d3950d 2023-01-28 thomas .Cm got cherrypick
2495 52d3950d 2023-01-28 thomas creates a record of commits which have been merged into the work tree.
2496 52d3950d 2023-01-28 thomas When a file changed by
2497 52d3950d 2023-01-28 thomas .Cm got cherrypick
2498 52d3950d 2023-01-28 thomas is committed with
2499 52d3950d 2023-01-28 thomas .Cm got commit ,
2500 52d3950d 2023-01-28 thomas the log messages of relevant merged commits will then appear in the editor,
2501 75a8c854 2023-02-17 thomas where the messages should be further adjusted to convey the reasons for
2502 95e6f77e 2023-01-28 thomas cherrypicking the changes.
2503 83389425 2023-02-17 thomas Upon exiting the editor, if the time stamp of the log message file
2504 83389425 2023-02-17 thomas is unchanged or the log message is empty,
2505 75a8c854 2023-02-17 thomas .Cm got commit
2506 83389425 2023-02-17 thomas will fail with an unmodified or empty log message error.
2507 75a8c854 2023-02-17 thomas .Pp
2508 52d3950d 2023-01-28 thomas If all the changes in all files touched by a given commit are discarded,
2509 52d3950d 2023-01-28 thomas e.g. with
2510 52d3950d 2023-01-28 thomas .Cm got revert ,
2511 52d3950d 2023-01-28 thomas this commit's log message record will also disappear.
2512 234035bc 2019-06-01 stsp .Pp
2513 234035bc 2019-06-01 stsp .Cm got cherrypick
2514 234035bc 2019-06-01 stsp will refuse to run if certain preconditions are not met.
2515 4b06140e 2022-03-22 thomas If the work tree contains multiple base commits, it must first be updated
2516 234035bc 2019-06-01 stsp to a single base commit with
2517 234035bc 2019-06-01 stsp .Cm got update .
2518 69de9dd4 2021-09-03 stsp If any relevant files already contain merge conflicts, these
2519 234035bc 2019-06-01 stsp conflicts must be resolved first.
2520 f6cd0243 2023-01-28 thomas .Pp
2521 f6cd0243 2023-01-28 thomas The options for
2522 f6cd0243 2023-01-28 thomas .Nm
2523 f6cd0243 2023-01-28 thomas .Cm cherrypick
2524 f6cd0243 2023-01-28 thomas are as follows:
2525 f6cd0243 2023-01-28 thomas .Bl -tag -width Ds
2526 f6cd0243 2023-01-28 thomas .It Fl l
2527 f6cd0243 2023-01-28 thomas Display a list of commit log messages recorded by cherrypick operations,
2528 f6cd0243 2023-01-28 thomas represented by references in the
2529 f6cd0243 2023-01-28 thomas .Dq refs/got/worktree
2530 f6cd0243 2023-01-28 thomas reference namespace.
2531 f6cd0243 2023-01-28 thomas If a
2532 f6cd0243 2023-01-28 thomas .Ar commit
2533 f6cd0243 2023-01-28 thomas is specified, only show the log message of the specified commit.
2534 f6cd0243 2023-01-28 thomas .Pp
2535 f6cd0243 2023-01-28 thomas If invoked in a work tree, only log messages recorded by cherrypick operations
2536 f6cd0243 2023-01-28 thomas in the current work tree will be displayed.
2537 f6cd0243 2023-01-28 thomas Otherwise, all commit log messages will be displayed irrespective of the
2538 f6cd0243 2023-01-28 thomas work tree in which they were created.
2539 f6cd0243 2023-01-28 thomas This option cannot be used with
2540 52d3950d 2023-01-28 thomas .Fl X .
2541 f6cd0243 2023-01-28 thomas .It Fl X
2542 f6cd0243 2023-01-28 thomas Delete log messages created by previous cherrypick operations, represented by
2543 f6cd0243 2023-01-28 thomas references in the
2544 f6cd0243 2023-01-28 thomas .Dq refs/got/worktree
2545 f6cd0243 2023-01-28 thomas reference namespace.
2546 f6cd0243 2023-01-28 thomas If a
2547 f6cd0243 2023-01-28 thomas .Ar commit
2548 f6cd0243 2023-01-28 thomas is specified, only delete the log message of the specified commit.
2549 f6cd0243 2023-01-28 thomas .Pp
2550 f6cd0243 2023-01-28 thomas If invoked in a work tree, only log messages recorded by cherrypick operations
2551 f6cd0243 2023-01-28 thomas in the current work tree will be deleted.
2552 f6cd0243 2023-01-28 thomas Otherwise, all commit log messages will be deleted irrespective of the
2553 f6cd0243 2023-01-28 thomas work tree in which they were created.
2554 f6cd0243 2023-01-28 thomas This option cannot be used with
2555 52d3950d 2023-01-28 thomas .Fl l .
2556 f6cd0243 2023-01-28 thomas .El
2557 f6cd0243 2023-01-28 thomas .Pp
2558 e8aa341a 2021-10-08 thomas .Tg bo
2559 f6cd0243 2023-01-28 thomas .It Xo
2560 f6cd0243 2023-01-28 thomas .Cm backout
2561 f6cd0243 2023-01-28 thomas .Op Fl lX
2562 7e710171 2023-01-28 thomas .Op Ar commit
2563 f6cd0243 2023-01-28 thomas .Xc
2564 d912d125 2021-11-04 thomas .Dl Pq alias: Cm bo
2565 5ef14e63 2019-06-02 stsp Reverse-merge changes from a single
2566 5ef14e63 2019-06-02 stsp .Ar commit
2567 5ef14e63 2019-06-02 stsp into the work tree.
2568 5ef14e63 2019-06-02 stsp The specified
2569 5ef14e63 2019-06-02 stsp .Ar commit
2570 a16d97bd 2021-09-02 stsp should be on the same branch as the work tree's base commit.
2571 a290e4b4 2023-07-19 thomas .Pp
2572 a290e4b4 2023-07-19 thomas The expected argument is a commit ID SHA1 hash, or a reference name
2573 a290e4b4 2023-07-19 thomas or keyword which will be resolved to a commit ID.
2574 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
2575 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
2576 a290e4b4 2023-07-19 thomas The keywords
2577 fb885120 2023-07-19 thomas .Qq :base
2578 fb885120 2023-07-19 thomas and
2579 fb885120 2023-07-19 thomas .Qq :head
2580 a290e4b4 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
2581 fb885120 2023-07-19 thomas Keywords and references may be appended with
2582 fb885120 2023-07-19 thomas .Qq :+
2583 fb885120 2023-07-19 thomas or
2584 fb885120 2023-07-19 thomas .Qq :-
2585 fb885120 2023-07-19 thomas modifiers and an optional integer N to denote the
2586 fb885120 2023-07-19 thomas Nth descendant or antecedent by first parent traversal, respectively;
2587 fb885120 2023-07-19 thomas for example,
2588 fb885120 2023-07-19 thomas .Sy :head:-2
2589 fb885120 2023-07-19 thomas denotes the work tree branch head's 2nd generation ancestor, and
2590 fb885120 2023-07-19 thomas .Sy :base:+4
2591 fb885120 2023-07-19 thomas denotes the 4th generation descendant of the work tree's base commit.
2592 fb885120 2023-07-19 thomas Similarly,
2593 fb885120 2023-07-19 thomas .Sy wip:+5
2594 fb885120 2023-07-19 thomas will denote the 5th generation descendant of the commit resolved by the
2595 fb885120 2023-07-19 thomas .Qq wip
2596 fb885120 2023-07-19 thomas reference.
2597 fb885120 2023-07-19 thomas A
2598 fb885120 2023-07-19 thomas .Qq :+
2599 fb885120 2023-07-19 thomas or
2600 fb885120 2023-07-19 thomas .Qq :-
2601 fb885120 2023-07-19 thomas modifier without a trailing integer has an implicit
2602 fb885120 2023-07-19 thomas .Qq 1
2603 fb885120 2023-07-19 thomas appended
2604 fb885120 2023-07-19 thomas .Po e.g.,
2605 fb885120 2023-07-19 thomas .Sy :base:+
2606 fb885120 2023-07-19 thomas is equivalent to
2607 fb885120 2023-07-19 thomas .Sy :base:+1
2608 fb885120 2023-07-19 thomas .Pc .
2609 fb885120 2023-07-19 thomas .Pp
2610 5ef14e63 2019-06-02 stsp Show the status of each affected file, using the following status codes:
2611 5ef14e63 2019-06-02 stsp .Bl -column YXZ description
2612 5ef14e63 2019-06-02 stsp .It G Ta file was merged
2613 5ef14e63 2019-06-02 stsp .It C Ta file was merged and conflicts occurred during merge
2614 5ef14e63 2019-06-02 stsp .It ! Ta changes destined for a missing file were not merged
2615 5ef14e63 2019-06-02 stsp .It D Ta file was deleted
2616 df3d7c3e 2021-09-24 thomas .It d Ta file's deletion was prevented by local modifications
2617 5ef14e63 2019-06-02 stsp .It A Ta new file was added
2618 1dd86744 2019-08-12 anthony .It \(a~ Ta changes destined for a non-regular file were not merged
2619 c90c8ce3 2020-07-23 stsp .It ? Ta changes destined for an unversioned file were not merged
2620 234035bc 2019-06-01 stsp .El
2621 5ef14e63 2019-06-02 stsp .Pp
2622 5ef14e63 2019-06-02 stsp The reverse-merged changes will appear as local changes in the work tree,
2623 5ef14e63 2019-06-02 stsp which may be viewed with
2624 5ef14e63 2019-06-02 stsp .Cm got diff ,
2625 5ef14e63 2019-06-02 stsp amended manually or with further
2626 778a73c2 2019-07-12 stsp .Cm got backout
2627 bc3056e3 2019-08-18 stsp commands,
2628 5ef14e63 2019-06-02 stsp committed with
2629 52d3950d 2023-01-28 thomas .Cm got commit .
2630 52d3950d 2023-01-28 thomas .Pp
2631 52d3950d 2023-01-28 thomas If invoked in a work tree where no
2632 52d3950d 2023-01-28 thomas .Cm rebase ,
2633 52d3950d 2023-01-28 thomas .Cm histedit ,
2634 52d3950d 2023-01-28 thomas or
2635 52d3950d 2023-01-28 thomas .Cm merge
2636 52d3950d 2023-01-28 thomas operation is taking place,
2637 52d3950d 2023-01-28 thomas .Cm got backout
2638 52d3950d 2023-01-28 thomas creates a record of commits which have been reverse-merged into the work tree.
2639 52d3950d 2023-01-28 thomas When a file changed by
2640 52d3950d 2023-01-28 thomas .Cm got backout
2641 52d3950d 2023-01-28 thomas is committed with
2642 52d3950d 2023-01-28 thomas .Cm got commit ,
2643 52d3950d 2023-01-28 thomas the log messages of relevant reverse-merged commits will then appear in
2644 75a8c854 2023-02-17 thomas the editor, where the messages should be further adjusted to convey the
2645 95e6f77e 2023-01-28 thomas reasons for backing out the changes.
2646 83389425 2023-02-17 thomas Upon exiting the editor, if the time stamp of the log message file
2647 83389425 2023-02-17 thomas is unchanged or the log message is empty,
2648 75a8c854 2023-02-17 thomas .Cm got commit
2649 83389425 2023-02-17 thomas will fail with an unmodified or empty log message error.
2650 75a8c854 2023-02-17 thomas .Pp
2651 52d3950d 2023-01-28 thomas If all the changes in all files touched by a given commit are discarded,
2652 52d3950d 2023-01-28 thomas e.g. with
2653 52d3950d 2023-01-28 thomas .Cm got revert ,
2654 52d3950d 2023-01-28 thomas this commit's log message record will also disappear.
2655 5ef14e63 2019-06-02 stsp .Pp
2656 92228c38 2019-06-02 stsp .Cm got backout
2657 92228c38 2019-06-02 stsp will refuse to run if certain preconditions are not met.
2658 4b06140e 2022-03-22 thomas If the work tree contains multiple base commits, it must first be updated
2659 92228c38 2019-06-02 stsp to a single base commit with
2660 92228c38 2019-06-02 stsp .Cm got update .
2661 69de9dd4 2021-09-03 stsp If any relevant files already contain merge conflicts, these
2662 92228c38 2019-06-02 stsp conflicts must be resolved first.
2663 f6cd0243 2023-01-28 thomas .Pp
2664 f6cd0243 2023-01-28 thomas The options for
2665 f6cd0243 2023-01-28 thomas .Nm
2666 f6cd0243 2023-01-28 thomas .Cm backout
2667 f6cd0243 2023-01-28 thomas are as follows:
2668 f6cd0243 2023-01-28 thomas .Bl -tag -width Ds
2669 f6cd0243 2023-01-28 thomas .It Fl l
2670 f6cd0243 2023-01-28 thomas Display a list of commit log messages recorded by backout operations,
2671 f6cd0243 2023-01-28 thomas represented by references in the
2672 f6cd0243 2023-01-28 thomas .Dq refs/got/worktree
2673 f6cd0243 2023-01-28 thomas reference namespace.
2674 f6cd0243 2023-01-28 thomas If a
2675 f6cd0243 2023-01-28 thomas .Ar commit
2676 f6cd0243 2023-01-28 thomas is specified, only show the log message of the specified commit.
2677 f6cd0243 2023-01-28 thomas .Pp
2678 f6cd0243 2023-01-28 thomas If invoked in a work tree, only log messages recorded by backout operations
2679 f6cd0243 2023-01-28 thomas in the current work tree will be displayed.
2680 f6cd0243 2023-01-28 thomas Otherwise, all commit log messages will be displayed irrespective of the
2681 f6cd0243 2023-01-28 thomas work tree in which they were created.
2682 f6cd0243 2023-01-28 thomas This option cannot be used with
2683 52d3950d 2023-01-28 thomas .Fl X .
2684 f6cd0243 2023-01-28 thomas .It Fl X
2685 f6cd0243 2023-01-28 thomas Delete log messages created by previous backout operations, represented by
2686 f6cd0243 2023-01-28 thomas references in the
2687 f6cd0243 2023-01-28 thomas .Dq refs/got/worktree
2688 f6cd0243 2023-01-28 thomas reference namespace.
2689 f6cd0243 2023-01-28 thomas If a
2690 f6cd0243 2023-01-28 thomas .Ar commit
2691 f6cd0243 2023-01-28 thomas is specified, only delete the log message of the specified commit.
2692 f6cd0243 2023-01-28 thomas .Pp
2693 f6cd0243 2023-01-28 thomas If invoked in a work tree, only log messages recorded by backout operations
2694 f6cd0243 2023-01-28 thomas in the current work tree will be deleted.
2695 f6cd0243 2023-01-28 thomas Otherwise, all commit log messages will be deleted irrespective of the
2696 f6cd0243 2023-01-28 thomas work tree in which they were created.
2697 f6cd0243 2023-01-28 thomas This option cannot be used with
2698 52d3950d 2023-01-28 thomas .Fl l .
2699 f6cd0243 2023-01-28 thomas .El
2700 f6cd0243 2023-01-28 thomas .Pp
2701 e8aa341a 2021-10-08 thomas .Tg rb
2702 56c96eff 2022-08-30 thomas .It Xo
2703 56c96eff 2022-08-30 thomas .Cm rebase
2704 be94c032 2023-02-20 thomas .Op Fl aCclX
2705 56c96eff 2022-08-30 thomas .Op Ar branch
2706 56c96eff 2022-08-30 thomas .Xc
2707 d912d125 2021-11-04 thomas .Dl Pq alias: Cm rb
2708 818c7501 2019-07-11 stsp Rebase commits on the specified
2709 818c7501 2019-07-11 stsp .Ar branch
2710 818c7501 2019-07-11 stsp onto the tip of the current branch of the work tree.
2711 818c7501 2019-07-11 stsp The
2712 818c7501 2019-07-11 stsp .Ar branch
2713 818c7501 2019-07-11 stsp must share common ancestry with the work tree's current branch.
2714 bc3056e3 2019-08-18 stsp Rebasing begins with the first descendant commit of the youngest
2715 f09e2405 2019-07-11 stsp common ancestor commit shared by the specified
2716 818c7501 2019-07-11 stsp .Ar branch
2717 818c7501 2019-07-11 stsp and the work tree's current branch, and stops once the tip commit
2718 f09e2405 2019-07-11 stsp of the specified
2719 818c7501 2019-07-11 stsp .Ar branch
2720 f09e2405 2019-07-11 stsp has been rebased.
2721 818c7501 2019-07-11 stsp .Pp
2722 2b6826ba 2020-02-24 stsp When
2723 2b6826ba 2020-02-24 stsp .Cm got rebase
2724 2b6826ba 2020-02-24 stsp is used as intended, the specified
2725 2b6826ba 2020-02-24 stsp .Ar branch
2726 c10890ce 2020-02-25 stsp represents a local commit history and may already contain changes
2727 c10890ce 2020-02-25 stsp that are not yet visible in any other repositories.
2728 2b6826ba 2020-02-24 stsp The work tree's current branch, which must be set with
2729 2b6826ba 2020-02-24 stsp .Cm got update -b
2730 2b6826ba 2020-02-24 stsp before starting the
2731 2b6826ba 2020-02-24 stsp .Cm rebase
2732 2b6826ba 2020-02-24 stsp operation, represents a branch from a remote repository which shares
2733 2b6826ba 2020-02-24 stsp a common history with the specified
2734 2b6826ba 2020-02-24 stsp .Ar branch
2735 c10890ce 2020-02-25 stsp but has progressed, and perhaps diverged, due to commits added to the
2736 c10890ce 2020-02-25 stsp remote repository.
2737 2b6826ba 2020-02-24 stsp .Pp
2738 c6b4581b 2019-07-28 stsp Rebased commits are accumulated on a temporary branch which the work tree
2739 c6b4581b 2019-07-28 stsp will remain switched to throughout the entire rebase operation.
2740 c6b4581b 2019-07-28 stsp Commits on this branch represent the same changes with the same log
2741 c6b4581b 2019-07-28 stsp messages as their counterparts on the original
2742 818c7501 2019-07-11 stsp .Ar branch ,
2743 818c7501 2019-07-11 stsp but with different commit IDs.
2744 818c7501 2019-07-11 stsp Once rebasing has completed successfully, the temporary branch becomes
2745 f09e2405 2019-07-11 stsp the new version of the specified
2746 818c7501 2019-07-11 stsp .Ar branch
2747 818c7501 2019-07-11 stsp and the work tree is automatically switched to it.
2748 d4dddcbf 2022-07-22 thomas If author information is available via the
2749 d4dddcbf 2022-07-22 thomas .Ev GOT_AUTHOR
2750 d4dddcbf 2022-07-22 thomas environment variable,
2751 d4dddcbf 2022-07-22 thomas .Xr got.conf 5
2752 d4dddcbf 2022-07-22 thomas or Git's
2753 d4dddcbf 2022-07-22 thomas .Dv user.name
2754 d4dddcbf 2022-07-22 thomas and
2755 d4dddcbf 2022-07-22 thomas .Dv user.email
2756 d4dddcbf 2022-07-22 thomas configuration settings, this author information will be used to identify
2757 d4dddcbf 2022-07-22 thomas the
2758 d4dddcbf 2022-07-22 thomas .Dq committer
2759 d4dddcbf 2022-07-22 thomas of rebased commits.
2760 e600f124 2021-03-21 stsp .Pp
2761 1795b260 2021-04-02 kn Old commits in their pre-rebase state are automatically backed up in the
2762 e600f124 2021-03-21 stsp .Dq refs/got/backup/rebase
2763 e600f124 2021-03-21 stsp reference namespace.
2764 e600f124 2021-03-21 stsp As long as these references are not removed older versions of rebased
2765 e600f124 2021-03-21 stsp commits will remain in the repository and can be viewed with the
2766 e600f124 2021-03-21 stsp .Cm got rebase -l
2767 e600f124 2021-03-21 stsp command.
2768 e600f124 2021-03-21 stsp Removal of these references makes objects which become unreachable via
2769 e6786710 2021-07-03 stsp any reference subject to removal by Git's garbage collector or
2770 e6786710 2021-07-03 stsp .Cm gotadmin cleanup .
2771 818c7501 2019-07-11 stsp .Pp
2772 818c7501 2019-07-11 stsp While rebasing commits, show the status of each affected file,
2773 818c7501 2019-07-11 stsp using the following status codes:
2774 818c7501 2019-07-11 stsp .Bl -column YXZ description
2775 818c7501 2019-07-11 stsp .It G Ta file was merged
2776 818c7501 2019-07-11 stsp .It C Ta file was merged and conflicts occurred during merge
2777 818c7501 2019-07-11 stsp .It ! Ta changes destined for a missing file were not merged
2778 818c7501 2019-07-11 stsp .It D Ta file was deleted
2779 df3d7c3e 2021-09-24 thomas .It d Ta file's deletion was prevented by local modifications
2780 818c7501 2019-07-11 stsp .It A Ta new file was added
2781 1dd86744 2019-08-12 anthony .It \(a~ Ta changes destined for a non-regular file were not merged
2782 c90c8ce3 2020-07-23 stsp .It ? Ta changes destined for an unversioned file were not merged
2783 5ef14e63 2019-06-02 stsp .El
2784 818c7501 2019-07-11 stsp .Pp
2785 4b06140e 2022-03-22 thomas If merge conflicts occur, the rebase operation is interrupted and may
2786 f09e2405 2019-07-11 stsp be continued once conflicts have been resolved.
2787 bb494413 2021-09-28 thomas If any files with destined changes are found to be missing or unversioned,
2788 bb494413 2021-09-28 thomas or if files could not be deleted due to differences in deleted content,
2789 bb494413 2021-09-28 thomas the rebase operation will be interrupted to prevent potentially incomplete
2790 bb494413 2021-09-28 thomas changes from being committed to the repository without user intervention.
2791 bb494413 2021-09-28 thomas The work tree may be modified as desired and the rebase operation can be
2792 bb494413 2021-09-28 thomas continued once the changes present in the work tree are considered complete.
2793 818c7501 2019-07-11 stsp Alternatively, the rebase operation may be aborted which will leave
2794 818c7501 2019-07-11 stsp .Ar branch
2795 818c7501 2019-07-11 stsp unmodified and the work tree switched back to its original branch.
2796 818c7501 2019-07-11 stsp .Pp
2797 ff0d2220 2019-07-11 stsp If a merge conflict is resolved in a way which renders the merged
2798 f09e2405 2019-07-11 stsp change into a no-op change, the corresponding commit will be elided
2799 f09e2405 2019-07-11 stsp when the rebase operation continues.
2800 ff0d2220 2019-07-11 stsp .Pp
2801 818c7501 2019-07-11 stsp .Cm got rebase
2802 818c7501 2019-07-11 stsp will refuse to run if certain preconditions are not met.
2803 8dbcf388 2022-09-04 thomas If the
2804 8dbcf388 2022-09-04 thomas .Ar branch
2805 8dbcf388 2022-09-04 thomas is not in the
2806 8dbcf388 2022-09-04 thomas .Dq refs/heads/
2807 8dbcf388 2022-09-04 thomas reference namespace, the branch may not be rebased.
2808 a85446b2 2020-01-04 stsp If the work tree is not yet fully updated to the tip commit of its
2809 4b06140e 2022-03-22 thomas branch, then the work tree must first be updated with
2810 818c7501 2019-07-11 stsp .Cm got update .
2811 4ed9f614 2019-08-04 stsp If changes have been staged with
2812 4ed9f614 2019-08-04 stsp .Cm got stage ,
2813 bc3056e3 2019-08-18 stsp these changes must first be committed with
2814 4ed9f614 2019-08-04 stsp .Cm got commit
2815 4ed9f614 2019-08-04 stsp or unstaged with
2816 4ed9f614 2019-08-04 stsp .Cm got unstage .
2817 f09e2405 2019-07-11 stsp If the work tree contains local changes, these changes must first be
2818 f09e2405 2019-07-11 stsp committed with
2819 f09e2405 2019-07-11 stsp .Cm got commit
2820 f09e2405 2019-07-11 stsp or reverted with
2821 f09e2405 2019-07-11 stsp .Cm got revert .
2822 64c6d990 2019-07-11 stsp If the
2823 64c6d990 2019-07-11 stsp .Ar branch
2824 64c6d990 2019-07-11 stsp contains changes to files outside of the work tree's path prefix,
2825 64c6d990 2019-07-11 stsp the work tree cannot be used to rebase this branch.
2826 818c7501 2019-07-11 stsp .Pp
2827 7d5807f4 2019-07-11 stsp The
2828 8bcebf69 2023-01-08 thomas .Cm got update ,
2829 8bcebf69 2023-01-08 thomas .Cm got integrate ,
2830 8bcebf69 2023-01-08 thomas .Cm got merge ,
2831 8bcebf69 2023-01-08 thomas .Cm got commit ,
2832 7d5807f4 2019-07-11 stsp and
2833 8bcebf69 2023-01-08 thomas .Cm got histedit
2834 7d5807f4 2019-07-11 stsp commands will refuse to run while a rebase operation is in progress.
2835 7d5807f4 2019-07-11 stsp Other commands which manipulate the work tree may be used for
2836 7d5807f4 2019-07-11 stsp conflict resolution purposes.
2837 818c7501 2019-07-11 stsp .Pp
2838 d10218e7 2021-11-04 thomas If the specified
2839 d10218e7 2021-11-04 thomas .Ar branch
2840 4b06140e 2022-03-22 thomas is already based on the work tree's current branch, then no commits
2841 d10218e7 2021-11-04 thomas need to be rebased and
2842 d10218e7 2021-11-04 thomas .Cm got rebase
2843 d10218e7 2021-11-04 thomas will simply switch the work tree to the specified
2844 d10218e7 2021-11-04 thomas .Ar branch
2845 d10218e7 2021-11-04 thomas and update files in the work tree accordingly.
2846 d10218e7 2021-11-04 thomas .Pp
2847 818c7501 2019-07-11 stsp The options for
2848 818c7501 2019-07-11 stsp .Cm got rebase
2849 818c7501 2019-07-11 stsp are as follows:
2850 818c7501 2019-07-11 stsp .Bl -tag -width Ds
2851 818c7501 2019-07-11 stsp .It Fl a
2852 818c7501 2019-07-11 stsp Abort an interrupted rebase operation.
2853 c478f6d8 2019-08-08 stsp If this option is used, no other command-line arguments are allowed.
2854 be94c032 2023-02-20 thomas .It Fl C
2855 be94c032 2023-02-20 thomas Allow a rebase operation to continue with files in conflicted status.
2856 be94c032 2023-02-20 thomas This option should generally be avoided, and can only be used with the
2857 be94c032 2023-02-20 thomas .Fl c
2858 be94c032 2023-02-20 thomas option.
2859 818c7501 2019-07-11 stsp .It Fl c
2860 06067b48 2019-07-11 stsp Continue an interrupted rebase operation.
2861 79878eb8 2023-07-05 thomas If this option is used, no other command-line arguments are allowed except
2862 79878eb8 2023-07-05 thomas .Fl C .
2863 e600f124 2021-03-21 stsp .It Fl l
2864 e600f124 2021-03-21 stsp Show a list of past rebase operations, represented by references in the
2865 e600f124 2021-03-21 stsp .Dq refs/got/backup/rebase
2866 e600f124 2021-03-21 stsp reference namespace.
2867 e600f124 2021-03-21 stsp .Pp
2868 e600f124 2021-03-21 stsp Display the author, date, and log message of each backed up commit,
2869 e600f124 2021-03-21 stsp the object ID of the corresponding post-rebase commit, and
2870 e600f124 2021-03-21 stsp the object ID of their common ancestor commit.
2871 e600f124 2021-03-21 stsp Given these object IDs,
2872 e600f124 2021-03-21 stsp the
2873 e600f124 2021-03-21 stsp .Cm got log
2874 e600f124 2021-03-21 stsp command with the
2875 e600f124 2021-03-21 stsp .Fl c
2876 e600f124 2021-03-21 stsp and
2877 e600f124 2021-03-21 stsp .Fl x
2878 e600f124 2021-03-21 stsp options can be used to examine the history of either version of the branch,
2879 e600f124 2021-03-21 stsp and the
2880 e600f124 2021-03-21 stsp .Cm got branch
2881 e600f124 2021-03-21 stsp command with the
2882 e600f124 2021-03-21 stsp .Fl c
2883 e600f124 2021-03-21 stsp option can be used to create a new branch from a pre-rebase state if desired.
2884 e600f124 2021-03-21 stsp .Pp
2885 e600f124 2021-03-21 stsp If a
2886 e600f124 2021-03-21 stsp .Ar branch
2887 e600f124 2021-03-21 stsp is specified, only show commits which at some point in time represented this
2888 e600f124 2021-03-21 stsp branch.
2889 e600f124 2021-03-21 stsp Otherwise, list all backed up commits for any branches.
2890 e600f124 2021-03-21 stsp .Pp
2891 e600f124 2021-03-21 stsp If this option is used,
2892 e600f124 2021-03-21 stsp .Cm got rebase
2893 e600f124 2021-03-21 stsp does not require a work tree.
2894 e600f124 2021-03-21 stsp None of the other options can be used together with
2895 e600f124 2021-03-21 stsp .Fl l .
2896 643b85bc 2021-07-16 stsp .It Fl X
2897 643b85bc 2021-07-16 stsp Delete backups created by past rebase operations, represented by references
2898 643b85bc 2021-07-16 stsp in the
2899 643b85bc 2021-07-16 stsp .Dq refs/got/backup/rebase
2900 643b85bc 2021-07-16 stsp reference namespace.
2901 643b85bc 2021-07-16 stsp .Pp
2902 643b85bc 2021-07-16 stsp If a
2903 643b85bc 2021-07-16 stsp .Ar branch
2904 643b85bc 2021-07-16 stsp is specified, only delete backups which at some point in time represented
2905 643b85bc 2021-07-16 stsp this branch.
2906 643b85bc 2021-07-16 stsp Otherwise, delete all references found within
2907 643b85bc 2021-07-16 stsp .Dq refs/got/backup/rebase .
2908 643b85bc 2021-07-16 stsp .Pp
2909 643b85bc 2021-07-16 stsp Any commit, tree, tag, and blob objects belonging to deleted backups
2910 643b85bc 2021-07-16 stsp remain in the repository and may be removed separately with
2911 643b85bc 2021-07-16 stsp Git's garbage collector or
2912 643b85bc 2021-07-16 stsp .Cm gotadmin cleanup .
2913 643b85bc 2021-07-16 stsp .Pp
2914 643b85bc 2021-07-16 stsp If this option is used,
2915 643b85bc 2021-07-16 stsp .Cm got rebase
2916 643b85bc 2021-07-16 stsp does not require a work tree.
2917 643b85bc 2021-07-16 stsp None of the other options can be used together with
2918 643b85bc 2021-07-16 stsp .Fl X .
2919 818c7501 2019-07-11 stsp .El
2920 e8aa341a 2021-10-08 thomas .Tg he
2921 56c96eff 2022-08-30 thomas .It Xo
2922 56c96eff 2022-08-30 thomas .Cm histedit
2923 be94c032 2023-02-20 thomas .Op Fl aCcdeflmX
2924 56c96eff 2022-08-30 thomas .Op Fl F Ar histedit-script
2925 56c96eff 2022-08-30 thomas .Op Ar branch
2926 56c96eff 2022-08-30 thomas .Xc
2927 d912d125 2021-11-04 thomas .Dl Pq alias: Cm he
2928 0ebf8283 2019-07-24 stsp Edit commit history between the work tree's current base commit and
2929 0ebf8283 2019-07-24 stsp the tip commit of the work tree's current branch.
2930 d4dddcbf 2022-07-22 thomas .Pp
2931 d4dddcbf 2022-07-22 thomas The
2932 d4dddcbf 2022-07-22 thomas .Cm got histedit
2933 d4dddcbf 2022-07-22 thomas command requires the
2934 d4dddcbf 2022-07-22 thomas .Ev GOT_AUTHOR
2935 d4dddcbf 2022-07-22 thomas environment variable to be set,
2936 d4dddcbf 2022-07-22 thomas unless an author has been configured in
2937 d4dddcbf 2022-07-22 thomas .Xr got.conf 5
2938 d4dddcbf 2022-07-22 thomas or Git's
2939 d4dddcbf 2022-07-22 thomas .Dv user.name
2940 d4dddcbf 2022-07-22 thomas and
2941 d4dddcbf 2022-07-22 thomas .Dv user.email
2942 d4dddcbf 2022-07-22 thomas configuration settings can be obtained from the repository's
2943 d4dddcbf 2022-07-22 thomas .Pa .git/config
2944 d4dddcbf 2022-07-22 thomas file or from Git's global
2945 d4dddcbf 2022-07-22 thomas .Pa ~/.gitconfig
2946 d4dddcbf 2022-07-22 thomas configuration file.
2947 6e54d307 2020-02-24 stsp .Pp
2948 6e54d307 2020-02-24 stsp Before starting a
2949 6e54d307 2020-02-24 stsp .Cm histedit
2950 4b06140e 2022-03-22 thomas operation, the work tree's current branch must be set with
2951 6e54d307 2020-02-24 stsp .Cm got update -b
2952 6e54d307 2020-02-24 stsp to the branch which should be edited, unless this branch is already the
2953 6e54d307 2020-02-24 stsp current branch of the work tree.
2954 6e54d307 2020-02-24 stsp The tip of this branch represents the upper bound (inclusive) of commits
2955 6e54d307 2020-02-24 stsp touched by the
2956 6e54d307 2020-02-24 stsp .Cm histedit
2957 6e54d307 2020-02-24 stsp operation.
2958 0ebf8283 2019-07-24 stsp .Pp
2959 6e54d307 2020-02-24 stsp Furthermore, the work tree's base commit
2960 6e54d307 2020-02-24 stsp must be set with
2961 6e54d307 2020-02-24 stsp .Cm got update -c
2962 6e54d307 2020-02-24 stsp to a point in this branch's commit history where editing should begin.
2963 6e54d307 2020-02-24 stsp This commit represents the lower bound (non-inclusive) of commits touched
2964 6e54d307 2020-02-24 stsp by the
2965 6e54d307 2020-02-24 stsp .Cm histedit
2966 6e54d307 2020-02-24 stsp operation.
2967 6e54d307 2020-02-24 stsp .Pp
2968 0ebf8283 2019-07-24 stsp Editing of commit history is controlled via a
2969 0ebf8283 2019-07-24 stsp .Ar histedit script
2970 46fa4c83 2020-02-24 stsp which can be written in an editor based on a template, passed on the
2971 46fa4c83 2020-02-24 stsp command line, or generated with the
2972 bbf6b418 2023-03-01 thomas .Fl d ,
2973 bbf6b418 2023-03-01 thomas .Fl e ,
2974 bbf6b418 2023-03-01 thomas .Fl f ,
2975 466785b9 2020-12-10 jrick or
2976 083957f4 2020-02-24 stsp .Fl m
2977 466785b9 2020-12-10 jrick options.
2978 bccae03f 2023-07-17 thomas Quitting the editor without saving the file will abort the histedit operation.
2979 083957f4 2020-02-24 stsp .Pp
2980 0ebf8283 2019-07-24 stsp The format of the histedit script is line-based.
2981 0ebf8283 2019-07-24 stsp Each line in the script begins with a command name, followed by
2982 0ebf8283 2019-07-24 stsp whitespace and an argument.
2983 0ebf8283 2019-07-24 stsp For most commands, the expected argument is a commit ID SHA1 hash.
2984 0ebf8283 2019-07-24 stsp Any remaining text on the line is ignored.
2985 0ebf8283 2019-07-24 stsp Lines which begin with the
2986 0ebf8283 2019-07-24 stsp .Sq #
2987 0ebf8283 2019-07-24 stsp character are ignored entirely.
2988 0ebf8283 2019-07-24 stsp .Pp
2989 f3a5718a 2022-07-12 thomas The available histedit script commands are as follows:
2990 0ebf8283 2019-07-24 stsp .Bl -column YXZ pick-commit
2991 f3a5718a 2022-07-12 thomas .It Cm pick Ar commit Ta Use the specified commit as it is.
2992 71654e8d 2023-03-01 thomas .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
2993 71654e8d 2023-03-01 thomas then interrupt the histedit operation for amending, without creating a commit.
2994 49f76ad0 2023-03-01 thomas While the histedit operation is interrupted arbitrary files may be edited,
2995 49f76ad0 2023-03-01 thomas and commands which manipulate the work tree can be used freely.
2996 49f76ad0 2023-03-01 thomas The
2997 49f76ad0 2023-03-01 thomas .Cm got add
2998 49f76ad0 2023-03-01 thomas and
2999 49f76ad0 2023-03-01 thomas .Cm got remove
3000 49f76ad0 2023-03-01 thomas commands can be used to add new files or remove existing ones.
3001 49f76ad0 2023-03-01 thomas The
3002 49f76ad0 2023-03-01 thomas .Cm got revert -p
3003 49f76ad0 2023-03-01 thomas command can be used to eliminate arbitrary changes from files in the work tree.
3004 49f76ad0 2023-03-01 thomas The
3005 49f76ad0 2023-03-01 thomas .Cm got stage -p
3006 49f76ad0 2023-03-01 thomas command may be used to prepare a subset of changes for inclusion in the
3007 49f76ad0 2023-03-01 thomas next commit.
3008 49f76ad0 2023-03-01 thomas Finally, the
3009 49f76ad0 2023-03-01 thomas .Cm got commit
3010 49f76ad0 2023-03-01 thomas command can be used to insert arbitrary commits into the edited history.
3011 49f76ad0 2023-03-01 thomas Regular editing of history must eventually be resumed by running
3012 49f76ad0 2023-03-01 thomas .Cm got histedit -c .
3013 f3a5718a 2022-07-12 thomas .It Cm fold Ar commit Ta Combine the specified commit with the next commit
3014 0ebf8283 2019-07-24 stsp listed further below that will be used.
3015 f3a5718a 2022-07-12 thomas .It Cm drop Ar commit Ta Remove this commit from the edited history.
3016 f3a5718a 2022-07-12 thomas .It Cm mesg Oo Ar log-message Oc Ta Create a new log message for the commit of
3017 f3a5718a 2022-07-12 thomas a preceding
3018 f3a5718a 2022-07-12 thomas .Cm pick
3019 f3a5718a 2022-07-12 thomas or
3020 f3a5718a 2022-07-12 thomas .Cm edit
3021 f3a5718a 2022-07-12 thomas command on the previous line of the histedit script.
3022 eefbc049 2022-07-12 thomas The optional
3023 eefbc049 2022-07-12 thomas .Ar log-message
3024 eefbc049 2022-07-12 thomas argument provides a new single-line log message to use.
3025 eefbc049 2022-07-12 thomas If the
3026 eefbc049 2022-07-12 thomas .Ar log-message
3027 eefbc049 2022-07-12 thomas argument is omitted, open an editor where a new log message can be written.
3028 0ebf8283 2019-07-24 stsp .El
3029 0ebf8283 2019-07-24 stsp .Pp
3030 ba67992e 2019-07-25 stsp Every commit in the history being edited must be mentioned in the script.
3031 0ebf8283 2019-07-24 stsp Lines may be re-ordered to change the order of commits in the edited history.
3032 5b87815e 2020-03-05 stsp No commit may be listed more than once.
3033 0ebf8283 2019-07-24 stsp .Pp
3034 c6b4581b 2019-07-28 stsp Edited commits are accumulated on a temporary branch which the work tree
3035 c6b4581b 2019-07-28 stsp will remain switched to throughout the entire histedit operation.
3036 0ebf8283 2019-07-24 stsp Once history editing has completed successfully, the temporary branch becomes
3037 498a90b7 2019-07-25 stsp the new version of the work tree's branch and the work tree is automatically
3038 498a90b7 2019-07-25 stsp switched to it.
3039 0ebf8283 2019-07-24 stsp .Pp
3040 1795b260 2021-04-02 kn Old commits in their pre-histedit state are automatically backed up in the
3041 e600f124 2021-03-21 stsp .Dq refs/got/backup/histedit
3042 e600f124 2021-03-21 stsp reference namespace.
3043 e600f124 2021-03-21 stsp As long as these references are not removed older versions of edited
3044 e600f124 2021-03-21 stsp commits will remain in the repository and can be viewed with the
3045 e600f124 2021-03-21 stsp .Cm got histedit -l
3046 e600f124 2021-03-21 stsp command.
3047 e600f124 2021-03-21 stsp Removal of these references makes objects which become unreachable via
3048 e6786710 2021-07-03 stsp any reference subject to removal by Git's garbage collector or
3049 e6786710 2021-07-03 stsp .Cm gotadmin cleanup .
3050 e600f124 2021-03-21 stsp .Pp
3051 0ebf8283 2019-07-24 stsp While merging commits, show the status of each affected file,
3052 0ebf8283 2019-07-24 stsp using the following status codes:
3053 0ebf8283 2019-07-24 stsp .Bl -column YXZ description
3054 0ebf8283 2019-07-24 stsp .It G Ta file was merged
3055 0ebf8283 2019-07-24 stsp .It C Ta file was merged and conflicts occurred during merge
3056 0ebf8283 2019-07-24 stsp .It ! Ta changes destined for a missing file were not merged
3057 0ebf8283 2019-07-24 stsp .It D Ta file was deleted
3058 df3d7c3e 2021-09-24 thomas .It d Ta file's deletion was prevented by local modifications
3059 0ebf8283 2019-07-24 stsp .It A Ta new file was added
3060 1dd86744 2019-08-12 anthony .It \(a~ Ta changes destined for a non-regular file were not merged
3061 c90c8ce3 2020-07-23 stsp .It ? Ta changes destined for an unversioned file were not merged
3062 0ebf8283 2019-07-24 stsp .El
3063 0ebf8283 2019-07-24 stsp .Pp
3064 4b06140e 2022-03-22 thomas If merge conflicts occur, the histedit operation is interrupted and may
3065 0ebf8283 2019-07-24 stsp be continued once conflicts have been resolved.
3066 dddbe150 2021-09-28 thomas If any files with destined changes are found to be missing or unversioned,
3067 dddbe150 2021-09-28 thomas or if files could not be deleted due to differences in deleted content,
3068 dddbe150 2021-09-28 thomas the histedit operation will be interrupted to prevent potentially incomplete
3069 dddbe150 2021-09-28 thomas changes from being committed to the repository without user intervention.
3070 dddbe150 2021-09-28 thomas The work tree may be modified as desired and the histedit operation can be
3071 dddbe150 2021-09-28 thomas continued once the changes present in the work tree are considered complete.
3072 0ebf8283 2019-07-24 stsp Alternatively, the histedit operation may be aborted which will leave
3073 0ebf8283 2019-07-24 stsp the work tree switched back to its original branch.
3074 0ebf8283 2019-07-24 stsp .Pp
3075 0ebf8283 2019-07-24 stsp If a merge conflict is resolved in a way which renders the merged
3076 0ebf8283 2019-07-24 stsp change into a no-op change, the corresponding commit will be elided
3077 0ebf8283 2019-07-24 stsp when the histedit operation continues.
3078 0ebf8283 2019-07-24 stsp .Pp
3079 0ebf8283 2019-07-24 stsp .Cm got histedit
3080 0ebf8283 2019-07-24 stsp will refuse to run if certain preconditions are not met.
3081 c7d20a3f 2019-07-30 stsp If the work tree's current branch is not in the
3082 c7d20a3f 2019-07-30 stsp .Dq refs/heads/
3083 c7d20a3f 2019-07-30 stsp reference namespace, the history of the branch may not be edited.
3084 4b06140e 2022-03-22 thomas If the work tree contains multiple base commits, it must first be updated
3085 0ebf8283 2019-07-24 stsp to a single base commit with
3086 0ebf8283 2019-07-24 stsp .Cm got update .
3087 4ed9f614 2019-08-04 stsp If changes have been staged with
3088 4ed9f614 2019-08-04 stsp .Cm got stage ,
3089 bc3056e3 2019-08-18 stsp these changes must first be committed with
3090 4ed9f614 2019-08-04 stsp .Cm got commit
3091 4ed9f614 2019-08-04 stsp or unstaged with
3092 4ed9f614 2019-08-04 stsp .Cm got unstage .
3093 0ebf8283 2019-07-24 stsp If the work tree contains local changes, these changes must first be
3094 0ebf8283 2019-07-24 stsp committed with
3095 0ebf8283 2019-07-24 stsp .Cm got commit
3096 0ebf8283 2019-07-24 stsp or reverted with
3097 0ebf8283 2019-07-24 stsp .Cm got revert .
3098 0ebf8283 2019-07-24 stsp If the edited history contains changes to files outside of the work tree's
3099 0ebf8283 2019-07-24 stsp path prefix, the work tree cannot be used to edit the history of this branch.
3100 0ebf8283 2019-07-24 stsp .Pp
3101 0ebf8283 2019-07-24 stsp The
3102 7ef62c4e 2020-02-24 stsp .Cm got update ,
3103 7ef62c4e 2020-02-24 stsp .Cm got rebase ,
3104 8bcebf69 2023-01-08 thomas .Cm got merge ,
3105 65db4ffb 2020-02-24 stsp and
3106 65db4ffb 2020-02-24 stsp .Cm got integrate
3107 65db4ffb 2020-02-24 stsp commands will refuse to run while a histedit operation is in progress.
3108 a698f62e 2019-07-25 stsp Other commands which manipulate the work tree may be used, and the
3109 0ebf8283 2019-07-24 stsp .Cm got commit
3110 a698f62e 2019-07-25 stsp command may be used to commit arbitrary changes to the temporary branch
3111 a698f62e 2019-07-25 stsp while the histedit operation is interrupted.
3112 0ebf8283 2019-07-24 stsp .Pp
3113 0ebf8283 2019-07-24 stsp The options for
3114 0ebf8283 2019-07-24 stsp .Cm got histedit
3115 0ebf8283 2019-07-24 stsp are as follows:
3116 0ebf8283 2019-07-24 stsp .Bl -tag -width Ds
3117 0ebf8283 2019-07-24 stsp .It Fl a
3118 0ebf8283 2019-07-24 stsp Abort an interrupted histedit operation.
3119 c478f6d8 2019-08-08 stsp If this option is used, no other command-line arguments are allowed.
3120 be94c032 2023-02-20 thomas .It Fl C
3121 be94c032 2023-02-20 thomas Allow a histedit operation to continue with files in conflicted status.
3122 be94c032 2023-02-20 thomas This option should generally be avoided, and can only be used with the
3123 be94c032 2023-02-20 thomas .Fl c
3124 be94c032 2023-02-20 thomas option.
3125 0ebf8283 2019-07-24 stsp .It Fl c
3126 0ebf8283 2019-07-24 stsp Continue an interrupted histedit operation.
3127 79878eb8 2023-07-05 thomas If this option is used, no other command-line arguments are allowed except
3128 79878eb8 2023-07-05 thomas .Fl C .
3129 070c80a5 2023-01-31 thomas .It Fl d
3130 070c80a5 2023-01-31 thomas Drop all commits.
3131 070c80a5 2023-01-31 thomas This option is a quick equivalent to a histedit script which drops all
3132 070c80a5 2023-01-31 thomas commits.
3133 070c80a5 2023-01-31 thomas The
3134 070c80a5 2023-01-31 thomas .Fl d
3135 070c80a5 2023-01-31 thomas option can only be used when starting a new histedit operation.
3136 c478f6d8 2019-08-08 stsp If this option is used, no other command-line arguments are allowed.
3137 c50a7455 2021-10-04 thomas .It Fl e
3138 c50a7455 2021-10-04 thomas Interrupt the histedit operation for editing after merging each commit.
3139 c50a7455 2021-10-04 thomas This option is a quick equivalent to a histedit script which uses the
3140 c50a7455 2021-10-04 thomas .Cm edit
3141 c50a7455 2021-10-04 thomas command for all commits.
3142 c50a7455 2021-10-04 thomas The
3143 c50a7455 2021-10-04 thomas .Fl e
3144 c50a7455 2021-10-04 thomas option can only be used when starting a new histedit operation.
3145 c50a7455 2021-10-04 thomas If this option is used, no other command-line arguments are allowed.
3146 d6506a3d 2022-08-16 thomas .It Fl F Ar histedit-script
3147 d6506a3d 2022-08-16 thomas Use the specified
3148 d6506a3d 2022-08-16 thomas .Ar histedit-script
3149 d6506a3d 2022-08-16 thomas instead of opening a temporary file in an editor where a histedit script
3150 d6506a3d 2022-08-16 thomas can be written.
3151 466785b9 2020-12-10 jrick .It Fl f
3152 466785b9 2020-12-10 jrick Fold all commits into a single commit.
3153 466785b9 2020-12-10 jrick This option is a quick equivalent to a histedit script which folds all
3154 466785b9 2020-12-10 jrick commits, combining them all into one commit.
3155 2a78779e 2020-12-11 stsp The
3156 2a78779e 2020-12-11 stsp .Fl f
3157 2a78779e 2020-12-11 stsp option can only be used when starting a new histedit operation.
3158 466785b9 2020-12-10 jrick If this option is used, no other command-line arguments are allowed.
3159 e600f124 2021-03-21 stsp .It Fl l
3160 e600f124 2021-03-21 stsp Show a list of past histedit operations, represented by references in the
3161 e600f124 2021-03-21 stsp .Dq refs/got/backup/histedit
3162 e600f124 2021-03-21 stsp reference namespace.
3163 e600f124 2021-03-21 stsp .Pp
3164 e600f124 2021-03-21 stsp Display the author, date, and log message of each backed up commit,
3165 e600f124 2021-03-21 stsp the object ID of the corresponding post-histedit commit, and
3166 e600f124 2021-03-21 stsp the object ID of their common ancestor commit.
3167 e600f124 2021-03-21 stsp Given these object IDs,
3168 e600f124 2021-03-21 stsp the
3169 e600f124 2021-03-21 stsp .Cm got log
3170 e600f124 2021-03-21 stsp command with the
3171 e600f124 2021-03-21 stsp .Fl c
3172 e600f124 2021-03-21 stsp and
3173 e600f124 2021-03-21 stsp .Fl x
3174 e600f124 2021-03-21 stsp options can be used to examine the history of either version of the branch,
3175 e600f124 2021-03-21 stsp and the
3176 e600f124 2021-03-21 stsp .Cm got branch
3177 e600f124 2021-03-21 stsp command with the
3178 e600f124 2021-03-21 stsp .Fl c
3179 e600f124 2021-03-21 stsp option can be used to create a new branch from a pre-histedit state if desired.
3180 e600f124 2021-03-21 stsp .Pp
3181 e600f124 2021-03-21 stsp If a
3182 e600f124 2021-03-21 stsp .Ar branch
3183 e600f124 2021-03-21 stsp is specified, only show commits which at some point in time represented this
3184 e600f124 2021-03-21 stsp branch.
3185 e600f124 2021-03-21 stsp Otherwise, list all backed up commits for any branches.
3186 e600f124 2021-03-21 stsp .Pp
3187 e600f124 2021-03-21 stsp If this option is used,
3188 e600f124 2021-03-21 stsp .Cm got histedit
3189 e600f124 2021-03-21 stsp does not require a work tree.
3190 e600f124 2021-03-21 stsp None of the other options can be used together with
3191 e600f124 2021-03-21 stsp .Fl l .
3192 d6506a3d 2022-08-16 thomas .It Fl m
3193 d6506a3d 2022-08-16 thomas Edit log messages only.
3194 d6506a3d 2022-08-16 thomas This option is a quick equivalent to a histedit script which edits
3195 d6506a3d 2022-08-16 thomas only log messages but otherwise leaves every picked commit as-is.
3196 d6506a3d 2022-08-16 thomas The
3197 d6506a3d 2022-08-16 thomas .Fl m
3198 d6506a3d 2022-08-16 thomas option can only be used when starting a new histedit operation.
3199 d6506a3d 2022-08-16 thomas If this option is used, no other command-line arguments are allowed.
3200 643b85bc 2021-07-16 stsp .It Fl X
3201 643b85bc 2021-07-16 stsp Delete backups created by past histedit operations, represented by references
3202 643b85bc 2021-07-16 stsp in the
3203 643b85bc 2021-07-16 stsp .Dq refs/got/backup/histedit
3204 643b85bc 2021-07-16 stsp reference namespace.
3205 643b85bc 2021-07-16 stsp .Pp
3206 643b85bc 2021-07-16 stsp If a
3207 643b85bc 2021-07-16 stsp .Ar branch
3208 643b85bc 2021-07-16 stsp is specified, only delete backups which at some point in time represented
3209 643b85bc 2021-07-16 stsp this branch.
3210 643b85bc 2021-07-16 stsp Otherwise, delete all references found within
3211 643b85bc 2021-07-16 stsp .Dq refs/got/backup/histedit .
3212 643b85bc 2021-07-16 stsp .Pp
3213 643b85bc 2021-07-16 stsp Any commit, tree, tag, and blob objects belonging to deleted backups
3214 643b85bc 2021-07-16 stsp remain in the repository and may be removed separately with
3215 643b85bc 2021-07-16 stsp Git's garbage collector or
3216 643b85bc 2021-07-16 stsp .Cm gotadmin cleanup .
3217 643b85bc 2021-07-16 stsp .Pp
3218 643b85bc 2021-07-16 stsp If this option is used,
3219 643b85bc 2021-07-16 stsp .Cm got histedit
3220 643b85bc 2021-07-16 stsp does not require a work tree.
3221 643b85bc 2021-07-16 stsp None of the other options can be used together with
3222 643b85bc 2021-07-16 stsp .Fl X .
3223 818c7501 2019-07-11 stsp .El
3224 e8aa341a 2021-10-08 thomas .Tg ig
3225 2822a352 2019-10-15 stsp .It Cm integrate Ar branch
3226 d912d125 2021-11-04 thomas .Dl Pq alias: Cm ig
3227 2822a352 2019-10-15 stsp Integrate the specified
3228 2822a352 2019-10-15 stsp .Ar branch
3229 2822a352 2019-10-15 stsp into the work tree's current branch.
3230 2822a352 2019-10-15 stsp Files in the work tree are updated to match the contents on the integrated
3231 2822a352 2019-10-15 stsp .Ar branch ,
3232 2822a352 2019-10-15 stsp and the reference of the work tree's branch is changed to point at the
3233 2822a352 2019-10-15 stsp head commit of the integrated
3234 2822a352 2019-10-15 stsp .Ar branch .
3235 2822a352 2019-10-15 stsp .Pp
3236 2822a352 2019-10-15 stsp Both branches can be considered equivalent after integration since they
3237 2822a352 2019-10-15 stsp will be pointing at the same commit.
3238 2822a352 2019-10-15 stsp Both branches remain available for future work, if desired.
3239 2822a352 2019-10-15 stsp In case the integrated
3240 2822a352 2019-10-15 stsp .Ar branch
3241 2822a352 2019-10-15 stsp is no longer needed it may be deleted with
3242 2822a352 2019-10-15 stsp .Cm got branch -d .
3243 2822a352 2019-10-15 stsp .Pp
3244 2822a352 2019-10-15 stsp Show the status of each affected file, using the following status codes:
3245 2822a352 2019-10-15 stsp .Bl -column YXZ description
3246 2822a352 2019-10-15 stsp .It U Ta file was updated
3247 2822a352 2019-10-15 stsp .It D Ta file was deleted
3248 2822a352 2019-10-15 stsp .It A Ta new file was added
3249 2822a352 2019-10-15 stsp .It \(a~ Ta versioned file is obstructed by a non-regular file
3250 2822a352 2019-10-15 stsp .It ! Ta a missing versioned file was restored
3251 2822a352 2019-10-15 stsp .El
3252 2822a352 2019-10-15 stsp .Pp
3253 2822a352 2019-10-15 stsp .Cm got integrate
3254 2822a352 2019-10-15 stsp will refuse to run if certain preconditions are not met.
3255 2822a352 2019-10-15 stsp Most importantly, the
3256 2822a352 2019-10-15 stsp .Ar branch
3257 2822a352 2019-10-15 stsp must have been rebased onto the work tree's current branch with
3258 2822a352 2019-10-15 stsp .Cm got rebase
3259 2822a352 2019-10-15 stsp before it can be integrated, in order to linearize commit history and
3260 2822a352 2019-10-15 stsp resolve merge conflicts.
3261 4b06140e 2022-03-22 thomas If the work tree contains multiple base commits, it must first be updated
3262 2822a352 2019-10-15 stsp to a single base commit with
3263 2822a352 2019-10-15 stsp .Cm got update .
3264 2822a352 2019-10-15 stsp If changes have been staged with
3265 2822a352 2019-10-15 stsp .Cm got stage ,
3266 2822a352 2019-10-15 stsp these changes must first be committed with
3267 2822a352 2019-10-15 stsp .Cm got commit
3268 2822a352 2019-10-15 stsp or unstaged with
3269 2822a352 2019-10-15 stsp .Cm got unstage .
3270 2822a352 2019-10-15 stsp If the work tree contains local changes, these changes must first be
3271 2822a352 2019-10-15 stsp committed with
3272 2822a352 2019-10-15 stsp .Cm got commit
3273 2822a352 2019-10-15 stsp or reverted with
3274 2822a352 2019-10-15 stsp .Cm got revert .
3275 bea5ae74 2021-10-10 thomas .Tg mg
3276 56c96eff 2022-08-30 thomas .It Xo
3277 56c96eff 2022-08-30 thomas .Cm merge
3278 31009ade 2023-07-05 thomas .Op Fl aCcMn
3279 56c96eff 2022-08-30 thomas .Op Ar branch
3280 56c96eff 2022-08-30 thomas .Xc
3281 d912d125 2021-11-04 thomas .Dl Pq alias: Cm mg
3282 2b72f32d 2023-06-22 thomas Merge the specified
3283 2b72f32d 2023-06-22 thomas .Ar branch
3284 2b72f32d 2023-06-22 thomas into the current branch of the work tree.
3285 2b72f32d 2023-06-22 thomas If the branches have diverged, creates a merge commit.
3286 2b72f32d 2023-06-22 thomas Otherwise, if
3287 2b72f32d 2023-06-22 thomas .Ar branch
3288 2b72f32d 2023-06-22 thomas already includes all commits from the work tree's branch, updates the work
3289 2b72f32d 2023-06-22 thomas tree's branch to be the same as
3290 2b72f32d 2023-06-22 thomas .Ar branch
3291 2b72f32d 2023-06-22 thomas without creating a commit, and updates the work tree to the most recent commit
3292 2b72f32d 2023-06-22 thomas on the branch.
3293 2b72f32d 2023-06-22 thomas .Pp
3294 10604dce 2021-09-24 thomas If a linear project history is desired, then use of
3295 10604dce 2021-09-24 thomas .Cm got rebase
3296 10604dce 2021-09-24 thomas should be preferred over
3297 10604dce 2021-09-24 thomas .Cm got merge .
3298 10604dce 2021-09-24 thomas However, even strictly linear projects may require merge commits in order
3299 768705e3 2021-09-27 thomas to merge in new versions of third-party code stored on vendor branches
3300 768705e3 2021-09-27 thomas created with
3301 768705e3 2021-09-27 thomas .Cm got import .
3302 10604dce 2021-09-24 thomas .Pp
3303 10604dce 2021-09-24 thomas Merge commits are commits based on multiple parent commits.
3304 86295155 2023-06-22 thomas The tip commit of the work tree's current branch, which must be in the
3305 4434a15a 2023-06-22 thomas .Dq refs/heads/
3306 4434a15a 2023-06-22 thomas reference namespace and must be set with
3307 10604dce 2021-09-24 thomas .Cm got update -b
3308 10604dce 2021-09-24 thomas before starting the
3309 10604dce 2021-09-24 thomas .Cm merge
3310 10604dce 2021-09-24 thomas operation, will be used as the first parent.
3311 10604dce 2021-09-24 thomas The tip commit of the specified
3312 10604dce 2021-09-24 thomas .Ar branch
3313 10604dce 2021-09-24 thomas will be used as the second parent.
3314 10604dce 2021-09-24 thomas .Pp
3315 768705e3 2021-09-27 thomas No ancestral relationship between the two branches is required.
3316 768705e3 2021-09-27 thomas If the two branches have already been merged previously, only new changes
3317 768705e3 2021-09-27 thomas will be merged.
3318 768705e3 2021-09-27 thomas .Pp
3319 10604dce 2021-09-24 thomas It is not possible to create merge commits with more than two parents.
3320 10604dce 2021-09-24 thomas If more than one branch needs to be merged, then multiple merge commits
3321 10604dce 2021-09-24 thomas with two parents each can be created in sequence.
3322 10604dce 2021-09-24 thomas .Pp
3323 10604dce 2021-09-24 thomas While merging changes found on the
3324 10604dce 2021-09-24 thomas .Ar branch
3325 10604dce 2021-09-24 thomas into the work tree, show the status of each affected file,
3326 10604dce 2021-09-24 thomas using the following status codes:
3327 10604dce 2021-09-24 thomas .Bl -column YXZ description
3328 10604dce 2021-09-24 thomas .It G Ta file was merged
3329 10604dce 2021-09-24 thomas .It C Ta file was merged and conflicts occurred during merge
3330 10604dce 2021-09-24 thomas .It ! Ta changes destined for a missing file were not merged
3331 10604dce 2021-09-24 thomas .It D Ta file was deleted
3332 df3d7c3e 2021-09-24 thomas .It d Ta file's deletion was prevented by local modifications
3333 10604dce 2021-09-24 thomas .It A Ta new file was added
3334 10604dce 2021-09-24 thomas .It \(a~ Ta changes destined for a non-regular file were not merged
3335 10604dce 2021-09-24 thomas .It ? Ta changes destined for an unversioned file were not merged
3336 10604dce 2021-09-24 thomas .El
3337 10604dce 2021-09-24 thomas .Pp
3338 10604dce 2021-09-24 thomas If merge conflicts occur, the merge operation is interrupted and conflicts
3339 10604dce 2021-09-24 thomas must be resolved before the merge operation can continue.
3340 8cf2970b 2021-09-28 thomas If any files with destined changes are found to be missing or unversioned,
3341 8cf2970b 2021-09-28 thomas or if files could not be deleted due to differences in deleted content,
3342 10604dce 2021-09-24 thomas the merge operation will be interrupted to prevent potentially incomplete
3343 10604dce 2021-09-24 thomas changes from being committed to the repository without user intervention.
3344 10604dce 2021-09-24 thomas The work tree may be modified as desired and the merge can be continued
3345 10604dce 2021-09-24 thomas once the changes present in the work tree are considered complete.
3346 10604dce 2021-09-24 thomas Alternatively, the merge operation may be aborted which will leave
3347 10604dce 2021-09-24 thomas the work tree's current branch unmodified.
3348 10604dce 2021-09-24 thomas .Pp
3349 10604dce 2021-09-24 thomas .Cm got merge
3350 10604dce 2021-09-24 thomas will refuse to run if certain preconditions are not met.
3351 4434a15a 2023-06-22 thomas If the work tree's current branch is not in the
3352 4434a15a 2023-06-22 thomas .Dq refs/heads/
3353 4434a15a 2023-06-22 thomas reference namespace then the work tree must first be switched to a
3354 4434a15a 2023-06-22 thomas branch in the
3355 4434a15a 2023-06-22 thomas .Dq refs/heads/
3356 4434a15a 2023-06-22 thomas namespace with
3357 4434a15a 2023-06-22 thomas .Cm got update -b .
3358 10604dce 2021-09-24 thomas If the work tree is not yet fully updated to the tip commit of its
3359 10604dce 2021-09-24 thomas branch, then the work tree must first be updated with
3360 10604dce 2021-09-24 thomas .Cm got update .
3361 4b06140e 2022-03-22 thomas If the work tree contains multiple base commits, it must first be updated
3362 10604dce 2021-09-24 thomas to a single base commit with
3363 10604dce 2021-09-24 thomas .Cm got update .
3364 10604dce 2021-09-24 thomas If changes have been staged with
3365 10604dce 2021-09-24 thomas .Cm got stage ,
3366 10604dce 2021-09-24 thomas these changes must first be committed with
3367 10604dce 2021-09-24 thomas .Cm got commit
3368 10604dce 2021-09-24 thomas or unstaged with
3369 10604dce 2021-09-24 thomas .Cm got unstage .
3370 10604dce 2021-09-24 thomas If the work tree contains local changes, these changes must first be
3371 10604dce 2021-09-24 thomas committed with
3372 10604dce 2021-09-24 thomas .Cm got commit
3373 10604dce 2021-09-24 thomas or reverted with
3374 10604dce 2021-09-24 thomas .Cm got revert .
3375 10604dce 2021-09-24 thomas If the
3376 10604dce 2021-09-24 thomas .Ar branch
3377 10604dce 2021-09-24 thomas contains changes to files outside of the work tree's path prefix,
3378 10604dce 2021-09-24 thomas the work tree cannot be used to merge this branch.
3379 10604dce 2021-09-24 thomas .Pp
3380 10604dce 2021-09-24 thomas The
3381 10604dce 2021-09-24 thomas .Cm got update ,
3382 10604dce 2021-09-24 thomas .Cm got commit ,
3383 10604dce 2021-09-24 thomas .Cm got rebase ,
3384 ac93b2c5 2021-10-08 thomas .Cm got histedit ,
3385 10604dce 2021-09-24 thomas .Cm got integrate ,
3386 10604dce 2021-09-24 thomas and
3387 10604dce 2021-09-24 thomas .Cm got stage
3388 10604dce 2021-09-24 thomas commands will refuse to run while a merge operation is in progress.
3389 10604dce 2021-09-24 thomas Other commands which manipulate the work tree may be used for
3390 10604dce 2021-09-24 thomas conflict resolution purposes.
3391 10604dce 2021-09-24 thomas .Pp
3392 10604dce 2021-09-24 thomas The options for
3393 10604dce 2021-09-24 thomas .Cm got merge
3394 10604dce 2021-09-24 thomas are as follows:
3395 10604dce 2021-09-24 thomas .Bl -tag -width Ds
3396 10604dce 2021-09-24 thomas .It Fl a
3397 10604dce 2021-09-24 thomas Abort an interrupted merge operation.
3398 10604dce 2021-09-24 thomas If this option is used, no other command-line arguments are allowed.
3399 be94c032 2023-02-20 thomas .It Fl C
3400 be94c032 2023-02-20 thomas Allow a merge operation to continue with files in conflicted status.
3401 be94c032 2023-02-20 thomas This option should generally be avoided, and can only be used with the
3402 be94c032 2023-02-20 thomas .Fl c
3403 be94c032 2023-02-20 thomas option.
3404 10604dce 2021-09-24 thomas .It Fl c
3405 10604dce 2021-09-24 thomas Continue an interrupted merge operation.
3406 dcd455ee 2023-07-05 thomas If this option is used, no other command-line arguments are allowed except
3407 dcd455ee 2023-07-05 thomas .Fl C .
3408 31009ade 2023-07-05 thomas .It Fl M
3409 31009ade 2023-07-05 thomas Create a merge commit even if the branches have not diverged.
3410 ba34626b 2021-09-27 thomas .It Fl n
3411 ba34626b 2021-09-27 thomas Merge changes into the work tree as usual but do not create a merge
3412 ba34626b 2021-09-27 thomas commit immediately.
3413 ba34626b 2021-09-27 thomas The merge result can be adjusted as desired before a merge commit is
3414 ba34626b 2021-09-27 thomas created with
3415 ba34626b 2021-09-27 thomas .Cm got merge -c .
3416 ba34626b 2021-09-27 thomas Alternatively, the merge may be aborted with
3417 ba34626b 2021-09-27 thomas .Cm got merge -a .
3418 10604dce 2021-09-24 thomas .El
3419 e8aa341a 2021-10-08 thomas .Tg sg
3420 56c96eff 2022-08-30 thomas .It Xo
3421 56c96eff 2022-08-30 thomas .Cm stage
3422 56c96eff 2022-08-30 thomas .Op Fl lpS
3423 56c96eff 2022-08-30 thomas .Op Fl F Ar response-script
3424 56c96eff 2022-08-30 thomas .Op Ar path ...
3425 56c96eff 2022-08-30 thomas .Xc
3426 d912d125 2021-11-04 thomas .Dl Pq alias: Cm sg
3427 2db2652d 2019-08-07 stsp Stage local changes for inclusion in the next commit.
3428 2db2652d 2019-08-07 stsp If no
3429 2db2652d 2019-08-07 stsp .Ar path
3430 2db2652d 2019-08-07 stsp is specified, stage all changes in the work tree.
3431 2db2652d 2019-08-07 stsp Otherwise, stage changes at or within the specified paths.
3432 4ed9f614 2019-08-04 stsp Paths may be staged if they are added, modified, or deleted according to
3433 4ed9f614 2019-08-04 stsp .Cm got status .
3434 4ed9f614 2019-08-04 stsp .Pp
3435 9d8b19a4 2019-08-04 stsp Show the status of each affected file, using the following status codes:
3436 9d8b19a4 2019-08-04 stsp .Bl -column YXZ description
3437 9d8b19a4 2019-08-04 stsp .It A Ta file addition has been staged
3438 9d8b19a4 2019-08-04 stsp .It M Ta file modification has been staged
3439 9d8b19a4 2019-08-04 stsp .It D Ta file deletion has been staged
3440 9d8b19a4 2019-08-04 stsp .El
3441 9d8b19a4 2019-08-04 stsp .Pp
3442 9d8b19a4 2019-08-04 stsp Staged file contents are saved in newly created blob objects in the repository.
3443 52c8d4ac 2019-08-04 stsp These blobs will be referred to by tree objects once staged changes have been
3444 9d8b19a4 2019-08-04 stsp committed.
3445 9d8b19a4 2019-08-04 stsp .Pp
3446 890ea719 2019-08-04 stsp Staged changes affect the behaviour of
3447 4ed9f614 2019-08-04 stsp .Cm got commit ,
3448 4ed9f614 2019-08-04 stsp .Cm got status ,
3449 4ed9f614 2019-08-04 stsp and
3450 4ed9f614 2019-08-04 stsp .Cm got diff .
3451 4ed9f614 2019-08-04 stsp While paths with staged changes exist, the
3452 4ed9f614 2019-08-04 stsp .Cm got commit
3453 4ed9f614 2019-08-04 stsp command will refuse to commit any paths which do not have staged changes.
3454 4ed9f614 2019-08-04 stsp Local changes created on top of staged changes can only be committed if
3455 4ed9f614 2019-08-04 stsp the path is staged again, or if the staged changes are committed first.
3456 4ed9f614 2019-08-04 stsp The
3457 4ed9f614 2019-08-04 stsp .Cm got status
3458 4ed9f614 2019-08-04 stsp command will show both local changes and staged changes.
3459 4ed9f614 2019-08-04 stsp The
3460 4ed9f614 2019-08-04 stsp .Cm got diff
3461 ecf14362 2019-08-04 stsp command is able to display local changes relative to staged changes,
3462 ecf14362 2019-08-04 stsp and to display staged changes relative to the repository.
3463 4ed9f614 2019-08-04 stsp The
3464 4ed9f614 2019-08-04 stsp .Cm got revert
3465 4ed9f614 2019-08-04 stsp command cannot revert staged changes but may be used to revert
3466 4f2494e6 2019-08-08 stsp local changes created on top of staged changes.
3467 4ed9f614 2019-08-04 stsp .Pp
3468 4ed9f614 2019-08-04 stsp The options for
3469 4ed9f614 2019-08-04 stsp .Cm got stage
3470 4ed9f614 2019-08-04 stsp are as follows:
3471 4ed9f614 2019-08-04 stsp .Bl -tag -width Ds
3472 d6506a3d 2022-08-16 thomas .It Fl F Ar response-script
3473 d6506a3d 2022-08-16 thomas With the
3474 d6506a3d 2022-08-16 thomas .Fl p
3475 d6506a3d 2022-08-16 thomas option, read
3476 d6506a3d 2022-08-16 thomas .Dq y ,
3477 d6506a3d 2022-08-16 thomas .Dq n ,
3478 d6506a3d 2022-08-16 thomas and
3479 d6506a3d 2022-08-16 thomas .Dq q
3480 d6506a3d 2022-08-16 thomas responses line-by-line from the specified
3481 d6506a3d 2022-08-16 thomas .Ar response-script
3482 d6506a3d 2022-08-16 thomas file instead of prompting interactively.
3483 4ed9f614 2019-08-04 stsp .It Fl l
3484 4ed9f614 2019-08-04 stsp Instead of staging new changes, list paths which are already staged,
3485 9d8b19a4 2019-08-04 stsp along with the IDs of staged blob objects and stage status codes.
3486 4b06140e 2022-03-22 thomas If paths were provided on the command line, show the staged paths
3487 1dd86744 2019-08-12 anthony among the specified paths.
3488 1dd86744 2019-08-12 anthony Otherwise, show all staged paths.
3489 dc424a06 2019-08-07 stsp .It Fl p
3490 dc424a06 2019-08-07 stsp Instead of staging the entire content of a changed file, interactively
3491 dc424a06 2019-08-07 stsp select or reject changes for staging based on
3492 dc424a06 2019-08-07 stsp .Dq y
3493 6d23ec10 2019-08-08 stsp (stage change),
3494 dc424a06 2019-08-07 stsp .Dq n
3495 6d23ec10 2019-08-08 stsp (reject change), and
3496 b353a198 2019-08-07 stsp .Dq q
3497 6d23ec10 2019-08-08 stsp (quit staging this file) responses.
3498 dc424a06 2019-08-07 stsp If a file is in modified status, individual patches derived from the
3499 dc424a06 2019-08-07 stsp modified file content can be staged.
3500 6d23ec10 2019-08-08 stsp Files in added or deleted status may only be staged or rejected in
3501 6d23ec10 2019-08-08 stsp their entirety.
3502 35213c7c 2020-07-23 stsp .It Fl S
3503 af358f55 2020-07-23 stsp Allow staging of symbolic links which point outside of the path space
3504 af358f55 2020-07-23 stsp that is under version control.
3505 af358f55 2020-07-23 stsp By default,
3506 af358f55 2020-07-23 stsp .Cm got stage
3507 af358f55 2020-07-23 stsp will reject such symbolic links due to safety concerns.
3508 35213c7c 2020-07-23 stsp As a precaution,
3509 35213c7c 2020-07-23 stsp .Nm
3510 af358f55 2020-07-23 stsp may decide to represent such a symbolic link as a regular file which contains
3511 af358f55 2020-07-23 stsp the link's target path, rather than creating an actual symbolic link which
3512 af358f55 2020-07-23 stsp points outside of the work tree.
3513 af358f55 2020-07-23 stsp Use of this option is discouraged because external mechanisms such as
3514 af358f55 2020-07-23 stsp .Dq make obj
3515 af358f55 2020-07-23 stsp are better suited for managing symbolic links to paths not under
3516 af358f55 2020-07-23 stsp version control.
3517 4ed9f614 2019-08-04 stsp .El
3518 4ed9f614 2019-08-04 stsp .Pp
3519 4ed9f614 2019-08-04 stsp .Cm got stage
3520 4ed9f614 2019-08-04 stsp will refuse to run if certain preconditions are not met.
3521 4ed9f614 2019-08-04 stsp If a file contains merge conflicts, these conflicts must be resolved first.
3522 4ed9f614 2019-08-04 stsp If a file is found to be out of date relative to the head commit on the
3523 4ed9f614 2019-08-04 stsp work tree's current branch, the file must be updated with
3524 4ed9f614 2019-08-04 stsp .Cm got update
3525 4ed9f614 2019-08-04 stsp before it can be staged (however, this does not prevent the file from
3526 4ed9f614 2019-08-04 stsp becoming out-of-date at some point after having been staged).
3527 4ed9f614 2019-08-04 stsp .Pp
3528 4ed9f614 2019-08-04 stsp The
3529 4ed9f614 2019-08-04 stsp .Cm got update ,
3530 4ed9f614 2019-08-04 stsp .Cm got rebase ,
3531 1a70a207 2023-07-05 thomas .Cm got merge ,
3532 4ed9f614 2019-08-04 stsp and
3533 4ed9f614 2019-08-04 stsp .Cm got histedit
3534 4ed9f614 2019-08-04 stsp commands will refuse to run while staged changes exist.
3535 4ed9f614 2019-08-04 stsp If staged changes cannot be committed because a staged path
3536 4ed9f614 2019-08-04 stsp is out of date, the path must be unstaged with
3537 4ed9f614 2019-08-04 stsp .Cm got unstage
3538 4ed9f614 2019-08-04 stsp before it can be updated with
3539 4ed9f614 2019-08-04 stsp .Cm got update ,
3540 4ed9f614 2019-08-04 stsp and may then be staged again if necessary.
3541 e8aa341a 2021-10-08 thomas .Tg ug
3542 56c96eff 2022-08-30 thomas .It Xo
3543 56c96eff 2022-08-30 thomas .Cm unstage
3544 56c96eff 2022-08-30 thomas .Op Fl p
3545 56c96eff 2022-08-30 thomas .Op Fl F Ar response-script
3546 56c96eff 2022-08-30 thomas .Op Ar path ...
3547 56c96eff 2022-08-30 thomas .Xc
3548 d912d125 2021-11-04 thomas .Dl Pq alias: Cm ug
3549 4ed9f614 2019-08-04 stsp Merge staged changes back into the work tree and put affected paths
3550 4ed9f614 2019-08-04 stsp back into non-staged status.
3551 4ed9f614 2019-08-04 stsp If no
3552 4ed9f614 2019-08-04 stsp .Ar path
3553 4ed9f614 2019-08-04 stsp is specified, unstage all staged changes across the entire work tree.
3554 2db2652d 2019-08-07 stsp Otherwise, unstage changes at or within the specified paths.
3555 4ed9f614 2019-08-04 stsp .Pp
3556 4ed9f614 2019-08-04 stsp Show the status of each affected file, using the following status codes:
3557 4ed9f614 2019-08-04 stsp .Bl -column YXZ description
3558 4ed9f614 2019-08-04 stsp .It G Ta file was unstaged
3559 4ed9f614 2019-08-04 stsp .It C Ta file was unstaged and conflicts occurred during merge
3560 4ed9f614 2019-08-04 stsp .It ! Ta changes destined for a missing file were not merged
3561 4ed9f614 2019-08-04 stsp .It D Ta file was staged as deleted and still is deleted
3562 df3d7c3e 2021-09-24 thomas .It d Ta file's deletion was prevented by local modifications
3563 1dd86744 2019-08-12 anthony .It \(a~ Ta changes destined for a non-regular file were not merged
3564 4ed9f614 2019-08-04 stsp .El
3565 2e1f37b0 2019-08-08 stsp .Pp
3566 2e1f37b0 2019-08-08 stsp The options for
3567 2e1f37b0 2019-08-08 stsp .Cm got unstage
3568 2e1f37b0 2019-08-08 stsp are as follows:
3569 2e1f37b0 2019-08-08 stsp .Bl -tag -width Ds
3570 2e1f37b0 2019-08-08 stsp .It Fl F Ar response-script
3571 2e1f37b0 2019-08-08 stsp With the
3572 2e1f37b0 2019-08-08 stsp .Fl p
3573 2e1f37b0 2019-08-08 stsp option, read
3574 2e1f37b0 2019-08-08 stsp .Dq y ,
3575 2e1f37b0 2019-08-08 stsp .Dq n ,
3576 2e1f37b0 2019-08-08 stsp and
3577 2e1f37b0 2019-08-08 stsp .Dq q
3578 2e1f37b0 2019-08-08 stsp responses line-by-line from the specified
3579 2e1f37b0 2019-08-08 stsp .Ar response-script
3580 2e1f37b0 2019-08-08 stsp file instead of prompting interactively.
3581 d6506a3d 2022-08-16 thomas .It Fl p
3582 d6506a3d 2022-08-16 thomas Instead of unstaging the entire content of a changed file, interactively
3583 d6506a3d 2022-08-16 thomas select or reject changes for unstaging based on
3584 d6506a3d 2022-08-16 thomas .Dq y
3585 d6506a3d 2022-08-16 thomas (unstage change),
3586 d6506a3d 2022-08-16 thomas .Dq n
3587 d6506a3d 2022-08-16 thomas (keep change staged), and
3588 d6506a3d 2022-08-16 thomas .Dq q
3589 d6506a3d 2022-08-16 thomas (quit unstaging this file) responses.
3590 d6506a3d 2022-08-16 thomas If a file is staged in modified status, individual patches derived from the
3591 d6506a3d 2022-08-16 thomas staged file content can be unstaged.
3592 d6506a3d 2022-08-16 thomas Files staged in added or deleted status may only be unstaged in their entirety.
3593 2e1f37b0 2019-08-08 stsp .El
3594 56c96eff 2022-08-30 thomas .It Xo
3595 56c96eff 2022-08-30 thomas .Cm cat
3596 56c96eff 2022-08-30 thomas .Op Fl P
3597 56c96eff 2022-08-30 thomas .Op Fl c Ar commit
3598 56c96eff 2022-08-30 thomas .Op Fl r Ar repository-path
3599 56c96eff 2022-08-30 thomas .Ar arg ...
3600 56c96eff 2022-08-30 thomas .Xc
3601 896e9b6f 2019-08-26 stsp Parse and print contents of objects to standard output in a line-based
3602 896e9b6f 2019-08-26 stsp text format.
3603 896e9b6f 2019-08-26 stsp Content of commit, tree, and tag objects is printed in a way similar
3604 896e9b6f 2019-08-26 stsp to the actual content stored in such objects.
3605 896e9b6f 2019-08-26 stsp Blob object contents are printed as they would appear in files on disk.
3606 896e9b6f 2019-08-26 stsp .Pp
3607 896e9b6f 2019-08-26 stsp Attempt to interpret each argument as a reference, a tag name, or
3608 896e9b6f 2019-08-26 stsp an object ID SHA1 hash.
3609 01073a5d 2019-08-22 stsp References will be resolved to an object ID.
3610 01073a5d 2019-08-22 stsp Tag names will resolved to a tag object.
3611 01073a5d 2019-08-22 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
3612 01073a5d 2019-08-22 stsp automatically, provided the abbreviation is unique.
3613 01073a5d 2019-08-22 stsp .Pp
3614 896e9b6f 2019-08-26 stsp If none of the above interpretations produce a valid result, or if the
3615 896e9b6f 2019-08-26 stsp .Fl P
3616 896e9b6f 2019-08-26 stsp option is used, attempt to interpret the argument as a path which will
3617 896e9b6f 2019-08-26 stsp be resolved to the ID of an object found at this path in the repository.
3618 896e9b6f 2019-08-26 stsp .Pp
3619 01073a5d 2019-08-22 stsp The options for
3620 01073a5d 2019-08-22 stsp .Cm got cat
3621 01073a5d 2019-08-22 stsp are as follows:
3622 01073a5d 2019-08-22 stsp .Bl -tag -width Ds
3623 896e9b6f 2019-08-26 stsp .It Fl c Ar commit
3624 896e9b6f 2019-08-26 stsp Look up paths in the specified
3625 896e9b6f 2019-08-26 stsp .Ar commit .
3626 896e9b6f 2019-08-26 stsp If this option is not used, paths are looked up in the commit resolved
3627 896e9b6f 2019-08-26 stsp via the repository's HEAD reference.
3628 9f625d2d 2023-07-19 thomas .Pp
3629 9f625d2d 2023-07-19 thomas The expected argument is a commit ID SHA1 hash, or a reference name
3630 9f625d2d 2023-07-19 thomas or keyword which will be resolved to a commit ID.
3631 896e9b6f 2019-08-26 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
3632 896e9b6f 2019-08-26 stsp automatically, provided the abbreviation is unique.
3633 9f625d2d 2023-07-19 thomas The keywords
3634 3795e2b6 2023-07-19 thomas .Qq :base
3635 3795e2b6 2023-07-19 thomas and
3636 3795e2b6 2023-07-19 thomas .Qq :head
3637 9f625d2d 2023-07-19 thomas resolve to the work tree's base commit and branch head, respectively.
3638 3795e2b6 2023-07-19 thomas The former is only valid if invoked in a work tree, while the latter will
3639 3795e2b6 2023-07-19 thomas resolve to the tip of the work tree's current branch if invoked in a
3640 3795e2b6 2023-07-19 thomas work tree, otherwise it will resolve to the repository's HEAD reference.
3641 3795e2b6 2023-07-19 thomas Keywords and references may be appended with
3642 3795e2b6 2023-07-19 thomas .Qq :+
3643 3795e2b6 2023-07-19 thomas or
3644 3795e2b6 2023-07-19 thomas .Qq :-
3645 3795e2b6 2023-07-19 thomas modifiers and an optional integer N to denote the
3646 3795e2b6 2023-07-19 thomas Nth descendant or antecedent by first parent traversal, respectively;
3647 3795e2b6 2023-07-19 thomas for example,
3648 3795e2b6 2023-07-19 thomas .Sy :head:-2
3649 3795e2b6 2023-07-19 thomas denotes the work tree branch head's 2nd generation ancestor, and
3650 3795e2b6 2023-07-19 thomas .Sy :base:+4
3651 3795e2b6 2023-07-19 thomas denotes the 4th generation descendant of the work tree's base commit.
3652 3795e2b6 2023-07-19 thomas Similarly,
3653 3795e2b6 2023-07-19 thomas .Sy quux:-8
3654 3795e2b6 2023-07-19 thomas will denote the 8th generation ancestor of the commit resolved by the
3655 3795e2b6 2023-07-19 thomas .Qq quux
3656 3795e2b6 2023-07-19 thomas reference.
3657 3795e2b6 2023-07-19 thomas A
3658 3795e2b6 2023-07-19 thomas .Qq :+
3659 3795e2b6 2023-07-19 thomas or
3660 3795e2b6 2023-07-19 thomas .Qq :-
3661 3795e2b6 2023-07-19 thomas modifier without a trailing integer has an implicit
3662 3795e2b6 2023-07-19 thomas .Qq 1
3663 3795e2b6 2023-07-19 thomas appended
3664 3795e2b6 2023-07-19 thomas .Po e.g.,
3665 3795e2b6 2023-07-19 thomas .Sy :base:+
3666 3795e2b6 2023-07-19 thomas is equivalent to
3667 3795e2b6 2023-07-19 thomas .Sy :base:+1
3668 3795e2b6 2023-07-19 thomas .Pc .
3669 d6506a3d 2022-08-16 thomas .It Fl P
3670 d6506a3d 2022-08-16 thomas Interpret all arguments as paths only.
3671 d6506a3d 2022-08-16 thomas This option can be used to resolve ambiguity in cases where paths
3672 d6506a3d 2022-08-16 thomas look like tag names, reference names, or object IDs.
3673 01073a5d 2019-08-22 stsp .It Fl r Ar repository-path
3674 01073a5d 2019-08-22 stsp Use the repository at the specified path.
3675 01073a5d 2019-08-22 stsp If not specified, assume the repository is located at or above the current
3676 01073a5d 2019-08-22 stsp working directory.
3677 01073a5d 2019-08-22 stsp If this directory is a
3678 01073a5d 2019-08-22 stsp .Nm
3679 01073a5d 2019-08-22 stsp work tree, use the repository path associated with this work tree.
3680 4ed9f614 2019-08-04 stsp .El
3681 b2118c49 2020-07-28 stsp .It Cm info Op Ar path ...
3682 b2118c49 2020-07-28 stsp Display meta-data stored in a work tree.
3683 b2118c49 2020-07-28 stsp See
3684 b2118c49 2020-07-28 stsp .Xr got-worktree 5
3685 b2118c49 2020-07-28 stsp for details.
3686 b2118c49 2020-07-28 stsp .Pp
3687 b2118c49 2020-07-28 stsp The work tree to use is resolved implicitly by walking upwards from the
3688 b2118c49 2020-07-28 stsp current working directory.
3689 b2118c49 2020-07-28 stsp .Pp
3690 b2118c49 2020-07-28 stsp If one or more
3691 b2118c49 2020-07-28 stsp .Ar path
3692 b2118c49 2020-07-28 stsp arguments are specified, show additional per-file information for tracked
3693 b2118c49 2020-07-28 stsp files located at or within these paths.
3694 b2118c49 2020-07-28 stsp If a
3695 b2118c49 2020-07-28 stsp .Ar path
3696 b2118c49 2020-07-28 stsp argument corresponds to the work tree's root directory, display information
3697 b2118c49 2020-07-28 stsp for all tracked files.
3698 01073a5d 2019-08-22 stsp .El
3699 74416c47 2019-05-09 stsp .Sh ENVIRONMENT
3700 5daf5c53 2022-07-23 thomas .Bl -tag -width GOT_IGNORE_GITCONFIG
3701 74416c47 2019-05-09 stsp .It Ev GOT_AUTHOR
3702 d4dddcbf 2022-07-22 thomas The author's name and email address, such as
3703 aba9c984 2019-09-08 stsp .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3704 d4dddcbf 2022-07-22 thomas Used by the
3705 d4dddcbf 2022-07-22 thomas .Cm got commit ,
3706 d4dddcbf 2022-07-22 thomas .Cm got import ,
3707 d4dddcbf 2022-07-22 thomas .Cm got rebase ,
3708 1a70a207 2023-07-05 thomas .Cm got merge ,
3709 d4dddcbf 2022-07-22 thomas and
3710 d4dddcbf 2022-07-22 thomas .Cm got histedit
3711 d4dddcbf 2022-07-22 thomas commands.
3712 84792843 2019-08-09 stsp Because
3713 0e444aba 2019-08-08 stsp .Xr git 1
3714 84792843 2019-08-09 stsp may fail to parse commits without an email address in author data,
3715 0e444aba 2019-08-08 stsp .Nm
3716 84792843 2019-08-09 stsp attempts to reject
3717 0e444aba 2019-08-08 stsp .Ev GOT_AUTHOR
3718 84792843 2019-08-09 stsp environment variables with a missing email address.
3719 c9956ddf 2019-09-08 stsp .Pp
3720 93a300b2 2021-08-26 stsp .Ev GOT_AUTHOR will be overridden by configuration settings in
3721 50b0790e 2020-09-11 stsp .Xr got.conf 5
3722 50b0790e 2020-09-11 stsp or by Git's
3723 aba9c984 2019-09-08 stsp .Dv user.name
3724 aba9c984 2019-09-08 stsp and
3725 709ae9eb 2019-09-08 stsp .Dv user.email
3726 709ae9eb 2019-09-08 stsp configuration settings in the repository's
3727 aba9c984 2019-09-08 stsp .Pa .git/config
3728 50b0790e 2020-09-11 stsp file.
3729 257add31 2020-09-09 stsp The
3730 c9956ddf 2019-09-08 stsp .Dv user.name
3731 c9956ddf 2019-09-08 stsp and
3732 c9956ddf 2019-09-08 stsp .Dv user.email
3733 c9956ddf 2019-09-08 stsp configuration settings contained in Git's global
3734 c9956ddf 2019-09-08 stsp .Pa ~/.gitconfig
3735 257add31 2020-09-09 stsp configuration file will only be used if neither
3736 257add31 2020-09-09 stsp .Xr got.conf 5
3737 257add31 2020-09-09 stsp nor the
3738 c9956ddf 2019-09-08 stsp .Ev GOT_AUTHOR
3739 257add31 2020-09-09 stsp environment variable provide author information.
3740 bd15e874 2023-01-20 thomas .It Ev GOT_IGNORE_GITCONFIG
3741 bd15e874 2023-01-20 thomas If this variable is set then any remote repository definitions or author
3742 bd15e874 2023-01-20 thomas information found in Git configuration files will be ignored.
3743 bd15e874 2023-01-20 thomas .It Ev GOT_LOG_DEFAULT_LIMIT
3744 bd15e874 2023-01-20 thomas The default limit on the number of commits traversed by
3745 bd15e874 2023-01-20 thomas .Cm got log .
3746 bd15e874 2023-01-20 thomas If set to zero, the limit is unbounded.
3747 bd15e874 2023-01-20 thomas This variable will be silently ignored if it is set to a non-numeric value.
3748 1dd86744 2019-08-12 anthony .It Ev VISUAL , EDITOR
3749 23594da9 2019-05-13 stsp The editor spawned by
3750 8e7bd50a 2019-08-22 stsp .Cm got commit ,
3751 46215d2a 2020-09-11 stsp .Cm got histedit ,
3752 8e7bd50a 2019-08-22 stsp .Cm got import ,
3753 8e7bd50a 2019-08-22 stsp or
3754 8e7bd50a 2019-08-22 stsp .Cm got tag .
3755 5b735925 2020-09-15 stsp If not set, the
3756 f8da67e8 2023-03-01 thomas .Xr vi 1
3757 f8da67e8 2023-03-01 thomas text editor will be spawned.
3758 74416c47 2019-05-09 stsp .El
3759 257add31 2020-09-09 stsp .Sh FILES
3760 257add31 2020-09-09 stsp .Bl -tag -width packed-refs -compact
3761 257add31 2020-09-09 stsp .It Pa got.conf
3762 257add31 2020-09-09 stsp Repository-wide configuration settings for
3763 257add31 2020-09-09 stsp .Nm .
3764 50b0790e 2020-09-11 stsp If present, a
3765 50b0790e 2020-09-11 stsp .Xr got.conf 5
3766 50b0790e 2020-09-11 stsp configuration file located in the root directory of a Git repository
3767 50b0790e 2020-09-11 stsp supersedes any relevant settings in Git's
3768 257add31 2020-09-09 stsp .Pa config
3769 257add31 2020-09-09 stsp file.
3770 50b0790e 2020-09-11 stsp .Pp
3771 50b0790e 2020-09-11 stsp .It Pa .got/got.conf
3772 50b0790e 2020-09-11 stsp Worktree-specific configuration settings for
3773 50b0790e 2020-09-11 stsp .Nm .
3774 50b0790e 2020-09-11 stsp If present, a
3775 1795b260 2021-04-02 kn .Xr got.conf 5
3776 50b0790e 2020-09-11 stsp configuration file in the
3777 50b0790e 2020-09-11 stsp .Pa .got
3778 50b0790e 2020-09-11 stsp meta-data directory of a work tree supersedes any relevant settings in
3779 50b0790e 2020-09-11 stsp the repository's
3780 50b0790e 2020-09-11 stsp .Xr got.conf 5
3781 50b0790e 2020-09-11 stsp configuration file and Git's
3782 50b0790e 2020-09-11 stsp .Pa config
3783 50b0790e 2020-09-11 stsp file.
3784 257add31 2020-09-09 stsp .El
3785 5c860e29 2018-03-12 stsp .Sh EXIT STATUS
3786 5c860e29 2018-03-12 stsp .Ex -std got
3787 97925469 2018-03-17 stsp .Sh EXAMPLES
3788 43e4eb1b 2021-08-29 stsp Enable tab-completion of
3789 43e4eb1b 2021-08-29 stsp .Nm
3790 43e4eb1b 2021-08-29 stsp command names in
3791 43e4eb1b 2021-08-29 stsp .Xr ksh 1 :
3792 43e4eb1b 2021-08-29 stsp .Pp
3793 e1d27370 2021-09-01 stsp .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3794 43e4eb1b 2021-08-29 stsp .Pp
3795 fa6e0e48 2019-05-23 stsp Clone an existing Git repository for use with
3796 f357763f 2023-06-22 thomas .Nm :
3797 fd039d72 2020-03-18 stsp .Pp
3798 fd039d72 2020-03-18 stsp .Dl $ cd /var/git/
3799 fd039d72 2020-03-18 stsp .Dl $ got clone ssh://git@github.com/openbsd/src.git
3800 fd039d72 2020-03-18 stsp .Pp
3801 f357763f 2023-06-22 thomas Unfortunately, many of the popular Git hosting sites do not offer anonymous
3802 f357763f 2023-06-22 thomas access via SSH.
3803 f357763f 2023-06-22 thomas Such sites will require an account to be created, and a public SSH key to be
3804 f357763f 2023-06-22 thomas uploaded to this account, before repository access via ssh:// URLs will work.
3805 f357763f 2023-06-22 thomas .Pp
3806 fd039d72 2020-03-18 stsp Use of HTTP URLs currently requires
3807 fa6e0e48 2019-05-23 stsp .Xr git 1 :
3808 d83d9d5c 2019-05-13 stsp .Pp
3809 fa6e0e48 2019-05-23 stsp .Dl $ cd /var/git/
3810 fa6e0e48 2019-05-23 stsp .Dl $ git clone --bare https://github.com/openbsd/src.git
3811 fa6e0e48 2019-05-23 stsp .Pp
3812 3ce1b845 2019-07-15 stsp Alternatively, for quick and dirty local testing of
3813 3ce1b845 2019-07-15 stsp .Nm
3814 3ce1b845 2019-07-15 stsp a new Git repository could be created and populated with files,
3815 3ce1b845 2019-07-15 stsp e.g. from a temporary CVS checkout located at
3816 3ce1b845 2019-07-15 stsp .Pa /tmp/src :
3817 fa6e0e48 2019-05-23 stsp .Pp
3818 27b10c3c 2022-07-04 thomas .Dl $ gotadmin init /var/git/src.git
3819 2930ef13 2019-07-15 stsp .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3820 3ce1b845 2019-07-15 stsp .Pp
3821 3ce1b845 2019-07-15 stsp Check out a work tree from the Git repository to /usr/src:
3822 3ce1b845 2019-07-15 stsp .Pp
3823 fa6e0e48 2019-05-23 stsp .Dl $ got checkout /var/git/src.git /usr/src
3824 fa6e0e48 2019-05-23 stsp .Pp
3825 e70c17ce 2019-05-22 stsp View local changes in a work tree directory:
3826 e70c17ce 2019-05-22 stsp .Pp
3827 e70c17ce 2019-05-22 stsp .Dl $ got diff | less
3828 33aa809d 2019-08-08 stsp .Pp
3829 081470ac 2020-08-13 stsp In a work tree, display files in a potentially problematic state:
3830 081470ac 2020-08-13 stsp .Pp
3831 081470ac 2020-08-13 stsp .Dl $ got status -s 'C!~?'
3832 081470ac 2020-08-13 stsp .Pp
3833 33aa809d 2019-08-08 stsp Interactively revert selected local changes in a work tree directory:
3834 e70c17ce 2019-05-22 stsp .Pp
3835 33aa809d 2019-08-08 stsp .Dl $ got revert -p -R\ .
3836 33aa809d 2019-08-08 stsp .Pp
3837 e70c17ce 2019-05-22 stsp In a work tree or a git repository directory, list all branch references:
3838 e70c17ce 2019-05-22 stsp .Pp
3839 4e759de4 2019-06-26 stsp .Dl $ got branch -l
3840 7fc94106 2023-01-14 thomas .Pp
3841 7fc94106 2023-01-14 thomas As above, but list the most recently modified branches only:
3842 7fc94106 2023-01-14 thomas .Pp
3843 7fc94106 2023-01-14 thomas .Dl $ got branch -lt | head
3844 e70c17ce 2019-05-22 stsp .Pp
3845 fa6e0e48 2019-05-23 stsp In a work tree or a git repository directory, create a new branch called
3846 e70c17ce 2019-05-22 stsp .Dq unified-buffer-cache
3847 d83d9d5c 2019-05-13 stsp which is forked off the
3848 d83d9d5c 2019-05-13 stsp .Dq master
3849 d83d9d5c 2019-05-13 stsp branch:
3850 d83d9d5c 2019-05-13 stsp .Pp
3851 7b4f1fcb 2021-01-27 stsp .Dl $ got branch -c master unified-buffer-cache
3852 e70c17ce 2019-05-22 stsp .Pp
3853 e70c17ce 2019-05-22 stsp Switch an existing work tree to the branch
3854 e70c17ce 2019-05-22 stsp .Dq unified-buffer-cache .
3855 e70c17ce 2019-05-22 stsp Local changes in the work tree will be preserved and merged if necessary:
3856 e70c17ce 2019-05-22 stsp .Pp
3857 e70c17ce 2019-05-22 stsp .Dl $ got update -b unified-buffer-cache
3858 e70c17ce 2019-05-22 stsp .Pp
3859 fa6e0e48 2019-05-23 stsp Create a new commit from local changes in a work tree directory.
3860 fa6e0e48 2019-05-23 stsp This new commit will become the head commit of the work tree's current branch:
3861 fa6e0e48 2019-05-23 stsp .Pp
3862 fa6e0e48 2019-05-23 stsp .Dl $ got commit
3863 fa6e0e48 2019-05-23 stsp .Pp
3864 fa6e0e48 2019-05-23 stsp In a work tree or a git repository directory, view changes committed in
3865 fa6e0e48 2019-05-23 stsp the 3 most recent commits to the work tree's branch, or the branch resolved
3866 fa6e0e48 2019-05-23 stsp via the repository's HEAD reference, respectively:
3867 fa6e0e48 2019-05-23 stsp .Pp
3868 48c8c60d 2020-01-27 stsp .Dl $ got log -p -l 3
3869 04e9dcf3 2020-04-18 stsp .Pp
3870 3d0ac559 2020-04-18 stsp As above, but display changes in the order in which
3871 04e9dcf3 2020-04-18 stsp .Xr patch 1
3872 04e9dcf3 2020-04-18 stsp could apply them in sequence:
3873 5b666081 2020-02-24 stsp .Pp
3874 04e9dcf3 2020-04-18 stsp .Dl $ got log -p -l 3 -R
3875 04e9dcf3 2020-04-18 stsp .Pp
3876 5b666081 2020-02-24 stsp In a work tree or a git repository directory, log the history of a subdirectory:
3877 5b666081 2020-02-24 stsp .Pp
3878 5b666081 2020-02-24 stsp .Dl $ got log sys/uvm
3879 5b666081 2020-02-24 stsp .Pp
3880 5b666081 2020-02-24 stsp While operating inside a work tree, paths are specified relative to the current
3881 5b666081 2020-02-24 stsp working directory, so this command will log the subdirectory
3882 5b666081 2020-02-24 stsp .Pa sys/uvm :
3883 fa6e0e48 2019-05-23 stsp .Pp
3884 cf07f22b 2020-07-25 stsp .Dl $ cd sys/uvm && got log\ .
3885 5b666081 2020-02-24 stsp .Pp
3886 5b666081 2020-02-24 stsp And this command has the same effect:
3887 5b666081 2020-02-24 stsp .Pp
3888 5b666081 2020-02-24 stsp .Dl $ cd sys/dev/usb && got log ../../uvm
3889 5b666081 2020-02-24 stsp .Pp
3890 b2118c49 2020-07-28 stsp And this command displays work tree meta-data about all tracked files:
3891 b2118c49 2020-07-28 stsp .Pp
3892 b2118c49 2020-07-28 stsp .Dl $ cd /usr/src
3893 b2118c49 2020-07-28 stsp .Dl $ got info\ . | less
3894 b2118c49 2020-07-28 stsp .Pp
3895 e70c17ce 2019-05-22 stsp Add new files and remove obsolete files in a work tree directory:
3896 e70c17ce 2019-05-22 stsp .Pp
3897 fa6e0e48 2019-05-23 stsp .Dl $ got add sys/uvm/uvm_ubc.c
3898 86d25a1b 2019-07-11 stsp .Dl $ got remove sys/uvm/uvm_vnode.c
3899 e70c17ce 2019-05-22 stsp .Pp
3900 e70c17ce 2019-05-22 stsp Create a new commit from local changes in a work tree directory
3901 e70c17ce 2019-05-22 stsp with a pre-defined log message.
3902 e70c17ce 2019-05-22 stsp .Pp
3903 e70c17ce 2019-05-22 stsp .Dl $ got commit -m 'unify the buffer cache'
3904 95fc3404 2019-07-15 stsp .Pp
3905 bcbc2272 2020-05-20 stsp Alternatively, create a new commit from local changes in a work tree
3906 bcbc2272 2020-05-20 stsp directory with a log message that has been prepared in the file
3907 1795b260 2021-04-02 kn .Pa /tmp/msg :
3908 bcbc2272 2020-05-20 stsp .Pp
3909 28cf319f 2021-01-28 stsp .Dl $ got commit -F /tmp/msg
3910 bcbc2272 2020-05-20 stsp .Pp
3911 95fc3404 2019-07-15 stsp Update any work tree checked out from the
3912 95fc3404 2019-07-15 stsp .Dq unified-buffer-cache
3913 95fc3404 2019-07-15 stsp branch to the latest commit on this branch:
3914 95fc3404 2019-07-15 stsp .Pp
3915 95fc3404 2019-07-15 stsp .Dl $ got update
3916 ac90e726 2019-07-15 stsp .Pp
3917 c991308a 2019-07-15 stsp Roll file content on the unified-buffer-cache branch back by one commit,
3918 c991308a 2019-07-15 stsp and then fetch the rolled-back change into the work tree as a local change
3919 ac90e726 2019-07-15 stsp to be amended and perhaps committed again:
3920 e70c17ce 2019-05-22 stsp .Pp
3921 ac90e726 2019-07-15 stsp .Dl $ got backout unified-buffer-cache
3922 ac90e726 2019-07-15 stsp .Dl $ got commit -m 'roll back previous'
3923 59d52b88 2019-07-15 stsp .Dl $ # now back out the previous backout :-)
3924 ac90e726 2019-07-15 stsp .Dl $ got backout unified-buffer-cache
3925 ac90e726 2019-07-15 stsp .Pp
3926 a099809f 2021-08-27 stsp Fetch new changes on the remote repository's
3927 a099809f 2021-08-27 stsp .Dq master
3928 a099809f 2021-08-27 stsp branch, making them visible on the local repository's
3929 469dd726 2020-03-20 stsp .Dq origin/master
3930 469dd726 2020-03-20 stsp branch:
3931 fa6e0e48 2019-05-23 stsp .Pp
3932 469dd726 2020-03-20 stsp .Dl $ cd /usr/src
3933 469dd726 2020-03-20 stsp .Dl $ got fetch
3934 469dd726 2020-03-20 stsp .Pp
3935 469dd726 2020-03-20 stsp In a repository created with a HTTP URL and
3936 469dd726 2020-03-20 stsp .Cm git clone --bare
3937 469dd726 2020-03-20 stsp the
3938 469dd726 2020-03-20 stsp .Xr git-fetch 1
3939 469dd726 2020-03-20 stsp command must be used instead:
3940 469dd726 2020-03-20 stsp .Pp
3941 fa6e0e48 2019-05-23 stsp .Dl $ cd /var/git/src.git
3942 469dd726 2020-03-20 stsp .Dl $ git fetch origin master:refs/remotes/origin/master
3943 fa6e0e48 2019-05-23 stsp .Pp
3944 469dd726 2020-03-20 stsp Rebase the local
3945 469dd726 2020-03-20 stsp .Dq master
3946 469dd726 2020-03-20 stsp branch to merge the new changes that are now visible on the
3947 469dd726 2020-03-20 stsp .Dq origin/master
3948 469dd726 2020-03-20 stsp branch:
3949 469dd726 2020-03-20 stsp .Pp
3950 469dd726 2020-03-20 stsp .Dl $ cd /usr/src
3951 469dd726 2020-03-20 stsp .Dl $ got update -b origin/master
3952 469dd726 2020-03-20 stsp .Dl $ got rebase master
3953 469dd726 2020-03-20 stsp .Pp
3954 fa6e0e48 2019-05-23 stsp Rebase the
3955 fa6e0e48 2019-05-23 stsp .Dq unified-buffer-cache
3956 fa6e0e48 2019-05-23 stsp branch on top of the new head commit of the
3957 fa6e0e48 2019-05-23 stsp .Dq master
3958 fa6e0e48 2019-05-23 stsp branch.
3959 fa6e0e48 2019-05-23 stsp .Pp
3960 818c7501 2019-07-11 stsp .Dl $ got update -b master
3961 818c7501 2019-07-11 stsp .Dl $ got rebase unified-buffer-cache
3962 7d7ffedb 2019-07-14 stsp .Pp
3963 7d7ffedb 2019-07-14 stsp Create a patch from all changes on the unified-buffer-cache branch.
3964 1dd86744 2019-08-12 anthony The patch can be mailed out for review and applied to
3965 1dd86744 2019-08-12 anthony .Ox Ns 's
3966 1dd86744 2019-08-12 anthony CVS tree:
3967 7d7ffedb 2019-07-14 stsp .Pp
3968 7d7ffedb 2019-07-14 stsp .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
3969 7d7ffedb 2019-07-14 stsp .Pp
3970 0ebf8283 2019-07-24 stsp Edit the entire commit history of the
3971 0ebf8283 2019-07-24 stsp .Dq unified-buffer-cache
3972 0ebf8283 2019-07-24 stsp branch:
3973 0ebf8283 2019-07-24 stsp .Pp
3974 0ebf8283 2019-07-24 stsp .Dl $ got update -b unified-buffer-cache
3975 0ebf8283 2019-07-24 stsp .Dl $ got update -c master
3976 0ebf8283 2019-07-24 stsp .Dl $ got histedit
3977 469dd726 2020-03-20 stsp .Pp
3978 ff2cf171 2019-07-28 stsp Before working against existing branches in a repository cloned with
3979 469dd726 2020-03-20 stsp .Cm git clone --bare
3980 7848a0e1 2020-03-19 stsp instead of
3981 7848a0e1 2020-03-19 stsp .Cm got clone ,
3982 ff2cf171 2019-07-28 stsp a Git
3983 ff2cf171 2019-07-28 stsp .Dq refspec
3984 ff2cf171 2019-07-28 stsp must be configured to map all references in the remote repository
3985 ff2cf171 2019-07-28 stsp into the
3986 ff2cf171 2019-07-28 stsp .Dq refs/remotes
3987 ff2cf171 2019-07-28 stsp namespace of the local repository.
3988 1795b260 2021-04-02 kn This can be achieved by setting Git's
3989 ff2cf171 2019-07-28 stsp .Pa remote.origin.fetch
3990 ff2cf171 2019-07-28 stsp configuration variable to the value
3991 ff2cf171 2019-07-28 stsp .Dq +refs/heads/*:refs/remotes/origin/*
3992 ff2cf171 2019-07-28 stsp with the
3993 ff2cf171 2019-07-28 stsp .Cm git config
3994 ff2cf171 2019-07-28 stsp command:
3995 ff2cf171 2019-07-28 stsp .Pp
3996 ff2cf171 2019-07-28 stsp .Dl $ cd /var/git/repo
3997 ff2cf171 2019-07-28 stsp .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
3998 eac81709 2020-03-21 stsp .Pp
3999 469dd726 2020-03-20 stsp Additionally, the
4000 469dd726 2020-03-20 stsp .Dq mirror
4001 469dd726 2020-03-20 stsp option must be disabled:
4002 ff2cf171 2019-07-28 stsp .Pp
4003 469dd726 2020-03-20 stsp .Dl $ cd /var/git/repo
4004 469dd726 2020-03-20 stsp .Dl $ git config remote.origin.mirror false
4005 469dd726 2020-03-20 stsp .Pp
4006 ff2cf171 2019-07-28 stsp Alternatively, the following
4007 469dd726 2020-03-20 stsp .Xr git-fetch 1
4008 ff2cf171 2019-07-28 stsp configuration item can be added manually to the Git repository's
4009 ff2cf171 2019-07-28 stsp .Pa config
4010 ff2cf171 2019-07-28 stsp file:
4011 0ebf8283 2019-07-24 stsp .Pp
4012 91c82228 2021-04-18 stsp .Dl [remote \&"origin\&"]
4013 ff2cf171 2019-07-28 stsp .Dl url = ...
4014 ff2cf171 2019-07-28 stsp .Dl fetch = +refs/heads/*:refs/remotes/origin/*
4015 469dd726 2020-03-20 stsp .Dl mirror = false
4016 ff2cf171 2019-07-28 stsp .Pp
4017 fe307c9b 2019-07-28 stsp This configuration leaves the local repository's
4018 ff2cf171 2019-07-28 stsp .Dq refs/heads
4019 ff2cf171 2019-07-28 stsp namespace free for use by local branches checked out with
4020 ff2cf171 2019-07-28 stsp .Cm got checkout
4021 ff2cf171 2019-07-28 stsp and, if needed, created with
4022 ff2cf171 2019-07-28 stsp .Cm got branch .
4023 ff2cf171 2019-07-28 stsp Branches in the
4024 a099809f 2021-08-27 stsp .Dq refs/remotes/origin
4025 469dd726 2020-03-20 stsp namespace can now be updated with incoming changes from the remote
4026 ff2cf171 2019-07-28 stsp repository with
4027 469dd726 2020-03-20 stsp .Cm got fetch
4028 469dd726 2020-03-20 stsp or
4029 469dd726 2020-03-20 stsp .Xr git-fetch 1
4030 a099809f 2021-08-27 stsp without extra command line arguments.
4031 a099809f 2021-08-27 stsp Newly fetched changes can be examined with
4032 a099809f 2021-08-27 stsp .Cm got log .
4033 ff2cf171 2019-07-28 stsp .Pp
4034 a099809f 2021-08-27 stsp Display changes on the remote repository's version of the
4035 ff2cf171 2019-07-28 stsp .Dq master
4036 a099809f 2021-08-27 stsp branch, as of the last time
4037 a099809f 2021-08-27 stsp .Cm got fetch
4038 a099809f 2021-08-27 stsp was run:
4039 a099809f 2021-08-27 stsp .Pp
4040 a099809f 2021-08-27 stsp .Dl $ got log -c origin/master | less
4041 a099809f 2021-08-27 stsp .Pp
4042 a099809f 2021-08-27 stsp As shown here, most commands accept abbreviated reference names such as
4043 ff2cf171 2019-07-28 stsp .Dq origin/master
4044 a099809f 2021-08-27 stsp instead of
4045 a099809f 2021-08-27 stsp .Dq refs/remotes/origin/master .
4046 a099809f 2021-08-27 stsp The latter is only needed in case of ambiguity.
4047 a099809f 2021-08-27 stsp .Pp
4048 a099809f 2021-08-27 stsp .Cm got rebase
4049 1fa75a87 2023-06-22 thomas can be used to merge changes which are visible on the
4050 a099809f 2021-08-27 stsp .Dq origin/master
4051 a099809f 2021-08-27 stsp branch into the
4052 a099809f 2021-08-27 stsp .Dq master
4053 7b0db533 2020-02-04 stsp branch.
4054 7b0db533 2020-02-04 stsp This will also merge local changes, if any, with the incoming changes:
4055 ff2cf171 2019-07-28 stsp .Pp
4056 ff2cf171 2019-07-28 stsp .Dl $ got update -b origin/master
4057 ff2cf171 2019-07-28 stsp .Dl $ got rebase master
4058 083957f4 2020-02-24 stsp .Pp
4059 a099809f 2021-08-27 stsp In order to make changes committed to the
4060 a099809f 2021-08-27 stsp .Dq unified-buffer-cache
4061 a099809f 2021-08-27 stsp visible on the
4062 a099809f 2021-08-27 stsp .Dq master
4063 a099809f 2021-08-27 stsp branch, the
4064 a099809f 2021-08-27 stsp .Dq unified-buffer-cache
4065 1fa75a87 2023-06-22 thomas branch can be rebased onto the
4066 a099809f 2021-08-27 stsp .Dq master
4067 a099809f 2021-08-27 stsp branch:
4068 a099809f 2021-08-27 stsp .Pp
4069 a099809f 2021-08-27 stsp .Dl $ got update -b master
4070 a099809f 2021-08-27 stsp .Dl $ got rebase unified-buffer-cache
4071 a099809f 2021-08-27 stsp .Pp
4072 a099809f 2021-08-27 stsp Changes on the
4073 a099809f 2021-08-27 stsp .Dq unified-buffer-cache
4074 a099809f 2021-08-27 stsp branch can now be made visible on the
4075 a099809f 2021-08-27 stsp .Dq master
4076 a099809f 2021-08-27 stsp branch with
4077 a099809f 2021-08-27 stsp .Cm got integrate .
4078 a099809f 2021-08-27 stsp Because the rebase operation switched the work tree to the
4079 a099809f 2021-08-27 stsp .Dq unified-buffer-cache
4080 4b06140e 2022-03-22 thomas branch, the work tree must be switched back to the
4081 a099809f 2021-08-27 stsp .Dq master
4082 a099809f 2021-08-27 stsp branch first:
4083 a099809f 2021-08-27 stsp .Pp
4084 a099809f 2021-08-27 stsp .Dl $ got update -b master
4085 a099809f 2021-08-27 stsp .Dl $ got integrate unified-buffer-cache
4086 a099809f 2021-08-27 stsp .Pp
4087 083957f4 2020-02-24 stsp On the
4088 083957f4 2020-02-24 stsp .Dq master
4089 083957f4 2020-02-24 stsp branch, log messages for local changes can now be amended with
4090 083957f4 2020-02-24 stsp .Dq OK
4091 083957f4 2020-02-24 stsp by other developers and any other important new information:
4092 ff2cf171 2019-07-28 stsp .Pp
4093 083957f4 2020-02-24 stsp .Dl $ got update -c origin/master
4094 083957f4 2020-02-24 stsp .Dl $ got histedit -m
4095 083957f4 2020-02-24 stsp .Pp
4096 4b06140e 2022-03-22 thomas If the remote repository offers write access, local changes on the
4097 ff2cf171 2019-07-28 stsp .Dq master
4098 a099809f 2021-08-27 stsp branch can be sent to the remote repository with
4099 ac93b2c5 2021-10-08 thomas .Cm got send .
4100 ac93b2c5 2021-10-08 thomas Usually,
4101 a099809f 2021-08-27 stsp .Cm got send
4102 a099809f 2021-08-27 stsp can be run without further arguments.
4103 a099809f 2021-08-27 stsp The arguments shown here match defaults, provided the work tree's
4104 a099809f 2021-08-27 stsp current branch is the
4105 a099809f 2021-08-27 stsp .Dq master
4106 a099809f 2021-08-27 stsp branch:
4107 ff2cf171 2019-07-28 stsp .Pp
4108 a099809f 2021-08-27 stsp .Dl $ got send -b master origin
4109 a099809f 2021-08-27 stsp .Pp
4110 4b06140e 2022-03-22 thomas If the remote repository requires the HTTPS protocol, the
4111 a099809f 2021-08-27 stsp .Xr git-push 1
4112 a099809f 2021-08-27 stsp command must be used instead:
4113 a099809f 2021-08-27 stsp .Pp
4114 a099809f 2021-08-27 stsp .Dl $ cd /var/git/src.git
4115 ff2cf171 2019-07-28 stsp .Dl $ git push origin master
4116 4ff74dcf 2022-07-20 thomas .Pp
4117 4ff74dcf 2022-07-20 thomas When making contributions to projects which use the
4118 4ff74dcf 2022-07-20 thomas .Dq pull request
4119 4ff74dcf 2022-07-20 thomas workflow, SSH protocol repository access needs to be set up first.
4120 4ff74dcf 2022-07-20 thomas Once an account has been created on a Git hosting site it should
4121 4ff74dcf 2022-07-20 thomas be possible to upload a public SSH key for repository access
4122 4ff74dcf 2022-07-20 thomas authentication.
4123 4ff74dcf 2022-07-20 thomas .Pp
4124 4ff74dcf 2022-07-20 thomas The
4125 4ff74dcf 2022-07-20 thomas .Dq pull request
4126 4ff74dcf 2022-07-20 thomas workflow will usually involve two remote repositories.
4127 4ff74dcf 2022-07-20 thomas In the real-life example below, the
4128 4ff74dcf 2022-07-20 thomas .Dq origin
4129 4ff74dcf 2022-07-20 thomas repository was forked from the
4130 4ff74dcf 2022-07-20 thomas .Dq upstream
4131 4ff74dcf 2022-07-20 thomas repository by using the Git hosting site's web interface.
4132 4ff74dcf 2022-07-20 thomas The
4133 4ff74dcf 2022-07-20 thomas .Xr got.conf 5
4134 4ff74dcf 2022-07-20 thomas file in the local repository describes both remote repositories:
4135 4ff74dcf 2022-07-20 thomas .Bd -literal -offset indent
4136 4ff74dcf 2022-07-20 thomas # Jelmers's repository, which accepts pull requests
4137 4ff74dcf 2022-07-20 thomas remote "upstream" {
4138 4ff74dcf 2022-07-20 thomas server git@github.com
4139 4ff74dcf 2022-07-20 thomas protocol ssh
4140 4ff74dcf 2022-07-20 thomas repository "/jelmer/dulwich"
4141 4ff74dcf 2022-07-20 thomas branch { "master" }
4142 4ff74dcf 2022-07-20 thomas }
4143 4ff74dcf 2022-07-20 thomas
4144 4ff74dcf 2022-07-20 thomas # Stefan's fork, used as the default remote repository
4145 4ff74dcf 2022-07-20 thomas remote "origin" {
4146 4ff74dcf 2022-07-20 thomas server git@github.com
4147 4ff74dcf 2022-07-20 thomas protocol ssh
4148 4ff74dcf 2022-07-20 thomas repository "/stspdotname/dulwich"
4149 4ff74dcf 2022-07-20 thomas branch { "master" }
4150 4ff74dcf 2022-07-20 thomas }
4151 4ff74dcf 2022-07-20 thomas .Ed
4152 4ff74dcf 2022-07-20 thomas .Pp
4153 4ff74dcf 2022-07-20 thomas With this configuration, Stefan can create commits on
4154 4ff74dcf 2022-07-20 thomas .Dq refs/heads/master
4155 4ff74dcf 2022-07-20 thomas and send them to the
4156 4ff74dcf 2022-07-20 thomas .Dq origin
4157 4ff74dcf 2022-07-20 thomas repository by running:
4158 4ff74dcf 2022-07-20 thomas .Pp
4159 4ff74dcf 2022-07-20 thomas .Dl $ got send -b master origin
4160 4ff74dcf 2022-07-20 thomas .Pp
4161 4ff74dcf 2022-07-20 thomas The changes can now be proposed to Jelmer by opening a pull request
4162 4ff74dcf 2022-07-20 thomas via the Git hosting site's web interface.
4163 4ff74dcf 2022-07-20 thomas If Jelmer requests further changes to be made, additional commits
4164 4ff74dcf 2022-07-20 thomas can be created on the
4165 4ff74dcf 2022-07-20 thomas .Dq master
4166 4ff74dcf 2022-07-20 thomas branch and be added to the pull request by running
4167 4ff74dcf 2022-07-20 thomas .Cd got send
4168 4ff74dcf 2022-07-20 thomas again.
4169 4ff74dcf 2022-07-20 thomas .Pp
4170 4ff74dcf 2022-07-20 thomas If Jelmer prefers additional commits to be
4171 4ff74dcf 2022-07-20 thomas .Dq squashed
4172 4ff74dcf 2022-07-20 thomas then the following commands can be used to achieve this:
4173 4ff74dcf 2022-07-20 thomas .Pp
4174 4ff74dcf 2022-07-20 thomas .Dl $ got update -b master
4175 4ff74dcf 2022-07-20 thomas .Dl $ got update -c origin/master
4176 4ff74dcf 2022-07-20 thomas .Dl $ got histedit -f
4177 4ff74dcf 2022-07-20 thomas .Dl $ got send -f -b master origin
4178 4ff74dcf 2022-07-20 thomas .Pp
4179 f2afb89d 2023-04-22 thomas In addition to reviewing the pull request in the web user interface,
4180 f2afb89d 2023-04-22 thomas Jelmer can fetch the pull request's branch into his local repository
4181 f2afb89d 2023-04-22 thomas and create a local branch which contains the proposed changes:
4182 f2afb89d 2023-04-22 thomas .Pp
4183 f2afb89d 2023-04-22 thomas .Dl $ got fetch -R refs/pull/1046/head origin
4184 f2afb89d 2023-04-22 thomas .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
4185 f2afb89d 2023-04-22 thomas .Pp
4186 4ff74dcf 2022-07-20 thomas Once Jelmer has accepted the pull request, Stefan can fetch the
4187 4ff74dcf 2022-07-20 thomas merged changes, and possibly several other new changes, by running:
4188 4ff74dcf 2022-07-20 thomas .Pp
4189 4ff74dcf 2022-07-20 thomas .Dl $ got fetch upstream
4190 4ff74dcf 2022-07-20 thomas .Pp
4191 4ff74dcf 2022-07-20 thomas The merged changes will now be visible under the reference
4192 4ff74dcf 2022-07-20 thomas .Dq refs/remotes/upstream/master .
4193 4ff74dcf 2022-07-20 thomas The local
4194 4ff74dcf 2022-07-20 thomas .Dq master
4195 4ff74dcf 2022-07-20 thomas branch can now be rebased on top of the latest changes
4196 4ff74dcf 2022-07-20 thomas from upstream:
4197 4ff74dcf 2022-07-20 thomas .Pp
4198 4ff74dcf 2022-07-20 thomas .Dl $ got update -b upstream/master
4199 4ff74dcf 2022-07-20 thomas .Dl $ got rebase master
4200 0b83b8f6 2023-06-22 thomas .Pp
4201 0b83b8f6 2023-06-22 thomas As an alternative to
4202 0b83b8f6 2023-06-22 thomas .Cm got rebase ,
4203 0b83b8f6 2023-06-22 thomas branches can be merged with
4204 0b83b8f6 2023-06-22 thomas .Cm got merge :
4205 0b83b8f6 2023-06-22 thomas .Pp
4206 0b83b8f6 2023-06-22 thomas .Dl $ got update -b master
4207 0b83b8f6 2023-06-22 thomas .Dl $ got merge upstream/master
4208 4ff74dcf 2022-07-20 thomas .Pp
4209 0b83b8f6 2023-06-22 thomas The question of whether to rebase or merge branches is philosophical.
4210 0b83b8f6 2023-06-22 thomas When in doubt, refer to the software project's policies set by project
4211 0b83b8f6 2023-06-22 thomas maintainers.
4212 0b83b8f6 2023-06-22 thomas .Pp
4213 4ff74dcf 2022-07-20 thomas As a final step, the forked repository's copy of the master branch needs
4214 4ff74dcf 2022-07-20 thomas to be kept in sync by sending the new changes there:
4215 4ff74dcf 2022-07-20 thomas .Pp
4216 4ff74dcf 2022-07-20 thomas .Dl $ got send -f -b master origin
4217 4ff74dcf 2022-07-20 thomas .Pp
4218 4ff74dcf 2022-07-20 thomas If multiple pull requests need to be managed in parallel, a separate branch
4219 4ff74dcf 2022-07-20 thomas must be created for each pull request with
4220 4ff74dcf 2022-07-20 thomas .Cm got branch .
4221 4ff74dcf 2022-07-20 thomas Each such branch can then be used as above, in place of
4222 4ff74dcf 2022-07-20 thomas .Dq refs/heads/master .
4223 4ff74dcf 2022-07-20 thomas Changes for any accepted pull requests will still appear under
4224 4ff74dcf 2022-07-20 thomas .Dq refs/remotes/upstream/master,
4225 4ff74dcf 2022-07-20 thomas regardless of which branch was used in the forked repository to
4226 4ff74dcf 2022-07-20 thomas create a pull request.
4227 5c860e29 2018-03-12 stsp .Sh SEE ALSO
4228 0a79feb1 2021-04-10 stsp .Xr gotadmin 1 ,
4229 2312fc47 2019-07-15 stsp .Xr tog 1 ,
4230 2312fc47 2019-07-15 stsp .Xr git-repository 5 ,
4231 257add31 2020-09-09 stsp .Xr got-worktree 5 ,
4232 b345cf8f 2022-07-05 thomas .Xr got.conf 5 ,
4233 85c360aa 2023-01-02 thomas .Xr gotwebd 8
4234 1a208aaf 2018-04-01 stsp .Sh AUTHORS
4235 60c73080 2022-07-05 thomas .An Anthony J. Bentley Aq Mt bentley@openbsd.org
4236 60c73080 2022-07-05 thomas .An Christian Weisgerber Aq Mt naddy@openbsd.org
4237 60c73080 2022-07-05 thomas .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
4238 60c73080 2022-07-05 thomas .An Josh Rickmar Aq Mt jrick@zettaport.com
4239 bc3056e3 2019-08-18 stsp .An Joshua Stein Aq Mt jcs@openbsd.org
4240 60c73080 2022-07-05 thomas .An Klemens Nanni Aq Mt kn@openbsd.org
4241 60c73080 2022-07-05 thomas .An Martin Pieuchot Aq Mt mpi@openbsd.org
4242 f6fad9f6 2022-07-05 thomas .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
4243 60c73080 2022-07-05 thomas .An Omar Polo Aq Mt op@openbsd.org
4244 83b416ed 2020-03-18 stsp .An Ori Bernstein Aq Mt ori@openbsd.org
4245 60c73080 2022-07-05 thomas .An Sebastien Marie Aq Mt semarie@openbsd.org
4246 60c73080 2022-07-05 thomas .An Stefan Sperling Aq Mt stsp@openbsd.org
4247 bee5044f 2022-07-05 thomas .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
4248 60c73080 2022-07-05 thomas .An Theo Buehler Aq Mt tb@openbsd.org
4249 60c73080 2022-07-05 thomas .An Thomas Adam Aq Mt thomas@xteddy.org
4250 60c73080 2022-07-05 thomas .An Tracey Emery Aq Mt tracey@traceyemery.net
4251 60c73080 2022-07-05 thomas .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
4252 de71b616 2022-07-05 thomas .Pp
4253 de71b616 2022-07-05 thomas Parts of
4254 de71b616 2022-07-05 thomas .Nm ,
4255 de71b616 2022-07-05 thomas .Xr tog 1 ,
4256 de71b616 2022-07-05 thomas and
4257 85c360aa 2023-01-02 thomas .Xr gotwebd 8
4258 de71b616 2022-07-05 thomas were derived from code under copyright by:
4259 de71b616 2022-07-05 thomas .Pp
4260 408db73d 2022-07-22 thomas .An Caldera International
4261 de71b616 2022-07-05 thomas .An Daniel Hartmeier
4262 de71b616 2022-07-05 thomas .An Esben Norby
4263 de71b616 2022-07-05 thomas .An Henning Brauer
4264 de71b616 2022-07-05 thomas .An HÃ¥kan Olsson
4265 de71b616 2022-07-05 thomas .An Ingo Schwarze
4266 de71b616 2022-07-05 thomas .An Jean-Francois Brousseau
4267 de71b616 2022-07-05 thomas .An Joris Vink
4268 de71b616 2022-07-05 thomas .An Jyri J. Virkki
4269 de71b616 2022-07-05 thomas .An Larry Wall
4270 408db73d 2022-07-22 thomas .An Markus Friedl
4271 de71b616 2022-07-05 thomas .An Niall O'Higgins
4272 de71b616 2022-07-05 thomas .An Niklas Hallqvist
4273 de71b616 2022-07-05 thomas .An Ray Lai
4274 de71b616 2022-07-05 thomas .An Ryan McBride
4275 de71b616 2022-07-05 thomas .An Theo de Raadt
4276 de71b616 2022-07-05 thomas .An Todd C. Miller
4277 de71b616 2022-07-05 thomas .An Xavier Santolaria
4278 e4badaa9 2022-07-05 thomas .Pp
4279 e4badaa9 2022-07-05 thomas .Nm
4280 e4badaa9 2022-07-05 thomas contains code contributed to the public domain by
4281 86f8a176 2022-12-30 thomas .An Austin Appleby .
4282 fa6e0e48 2019-05-23 stsp .Sh CAVEATS
4283 fa6e0e48 2019-05-23 stsp .Nm
4284 cc63216e 2020-12-26 stsp is a work-in-progress and some features remain to be implemented.
4285 1795b260 2021-04-02 kn .Pp
4286 fa6e0e48 2019-05-23 stsp At present, the user has to fall back on
4287 fa6e0e48 2019-05-23 stsp .Xr git 1
4288 cc63216e 2020-12-26 stsp to perform some tasks.
4289 cc63216e 2020-12-26 stsp In particular:
4290 cc63216e 2020-12-26 stsp .Bl -bullet
4291 cc63216e 2020-12-26 stsp .It
4292 cc63216e 2020-12-26 stsp Reading from remote repositories over HTTP or HTTPS protocols requires
4293 cc63216e 2020-12-26 stsp .Xr git-clone 1
4294 cc63216e 2020-12-26 stsp and
4295 cc63216e 2020-12-26 stsp .Xr git-fetch 1 .
4296 cc63216e 2020-12-26 stsp .It
4297 a099809f 2021-08-27 stsp Writing to remote repositories over HTTP or HTTPS protocols requires
4298 cc63216e 2020-12-26 stsp .Xr git-push 1 .
4299 cc63216e 2020-12-26 stsp .It
4300 22a38a43 2021-09-28 thomas The creation of merge commits with more than two parent commits requires
4301 cc63216e 2020-12-26 stsp .Xr git-merge 1 .
4302 cc63216e 2020-12-26 stsp .It
4303 cc63216e 2020-12-26 stsp In situations where files or directories were moved around
4304 cc63216e 2020-12-26 stsp .Cm got
4305 cc63216e 2020-12-26 stsp will not automatically merge changes to new locations and
4306 cc63216e 2020-12-26 stsp .Xr git 1
4307 cc63216e 2020-12-26 stsp will usually produce better results.
4308 cc63216e 2020-12-26 stsp .El