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