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