Blame


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