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 7e2f1819 2023-07-10 thomas .Dt CVG 1
19 97a02382 2023-07-10 thomas .Os
20 97a02382 2023-07-10 thomas .Sh NAME
21 7e2f1819 2023-07-10 thomas .Nm cvg
22 7e2f1819 2023-07-10 thomas .Nd CVS-like Git client
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 7e2f1819 2023-07-10 thomas is a Git-compatible version control system with a user interface
31 7e2f1819 2023-07-10 thomas similar to
32 7e2f1819 2023-07-10 thomas .Xr cvs 1 .
33 97a02382 2023-07-10 thomas .Pp
34 97a02382 2023-07-10 thomas .Nm
35 7e2f1819 2023-07-10 thomas supports local and remote Git repositories.
36 7e2f1819 2023-07-10 thomas The Git repository format is described in
37 7e2f1819 2023-07-10 thomas .Xr git-repository 5 .
38 97a02382 2023-07-10 thomas .Pp
39 97a02382 2023-07-10 thomas Files managed by
40 97a02382 2023-07-10 thomas .Nm
41 97a02382 2023-07-10 thomas must be checked out from the repository for modification.
42 97a02382 2023-07-10 thomas Checked out files are stored in a
43 97a02382 2023-07-10 thomas .Em work tree
44 97a02382 2023-07-10 thomas which can be placed at an arbitrary directory in the filesystem hierarchy.
45 97a02382 2023-07-10 thomas The on-disk format of this work tree is described in
46 7e2f1819 2023-07-10 thomas .Xr cvg-worktree 5 .
47 97a02382 2023-07-10 thomas .Pp
48 97a02382 2023-07-10 thomas .Nm
49 97a02382 2023-07-10 thomas provides global and command-specific options.
50 97a02382 2023-07-10 thomas Global options must precede the command name, and are as follows:
51 97a02382 2023-07-10 thomas .Bl -tag -width tenletters
52 97a02382 2023-07-10 thomas .It Fl h
53 97a02382 2023-07-10 thomas Display usage information and exit immediately.
54 97a02382 2023-07-10 thomas .It Fl V , -version
55 97a02382 2023-07-10 thomas Display program version and exit immediately.
56 97a02382 2023-07-10 thomas .El
57 97a02382 2023-07-10 thomas .Pp
58 97a02382 2023-07-10 thomas The commands for
59 97a02382 2023-07-10 thomas .Nm
60 97a02382 2023-07-10 thomas are as follows:
61 97a02382 2023-07-10 thomas .Bl -tag -width checkout
62 97a02382 2023-07-10 thomas .Tg im
63 97a02382 2023-07-10 thomas .It Xo
64 97a02382 2023-07-10 thomas .Cm import
65 97a02382 2023-07-10 thomas .Op Fl b Ar branch
66 97a02382 2023-07-10 thomas .Op Fl I Ar pattern
67 97a02382 2023-07-10 thomas .Op Fl m Ar message
68 97a02382 2023-07-10 thomas .Op Fl r Ar repository-path
69 97a02382 2023-07-10 thomas .Ar directory
70 97a02382 2023-07-10 thomas .Xc
71 97a02382 2023-07-10 thomas .Dl Pq alias: Cm im
72 97a02382 2023-07-10 thomas Create an initial commit in a repository from the file hierarchy
73 97a02382 2023-07-10 thomas within the specified
74 97a02382 2023-07-10 thomas .Ar directory .
75 97a02382 2023-07-10 thomas The created commit will not have any parent commits, i.e. it will be a
76 97a02382 2023-07-10 thomas root commit.
77 97a02382 2023-07-10 thomas Also create a new reference which provides a branch name for the newly
78 97a02382 2023-07-10 thomas created commit.
79 97a02382 2023-07-10 thomas Show the path of each imported file to indicate progress.
80 97a02382 2023-07-10 thomas .Pp
81 97a02382 2023-07-10 thomas The
82 97a02382 2023-07-10 thomas .Cm got import
83 97a02382 2023-07-10 thomas command requires the
84 97a02382 2023-07-10 thomas .Ev GOT_AUTHOR
85 97a02382 2023-07-10 thomas environment variable to be set,
86 97a02382 2023-07-10 thomas unless an author has been configured in
87 97a02382 2023-07-10 thomas .Xr got.conf 5
88 97a02382 2023-07-10 thomas or Git's
89 97a02382 2023-07-10 thomas .Dv user.name
90 97a02382 2023-07-10 thomas and
91 97a02382 2023-07-10 thomas .Dv user.email
92 97a02382 2023-07-10 thomas configuration settings can be obtained from the repository's
93 97a02382 2023-07-10 thomas .Pa .git/config
94 97a02382 2023-07-10 thomas file or from Git's global
95 97a02382 2023-07-10 thomas .Pa ~/.gitconfig
96 97a02382 2023-07-10 thomas configuration file.
97 97a02382 2023-07-10 thomas .Pp
98 97a02382 2023-07-10 thomas The options for
99 97a02382 2023-07-10 thomas .Cm got import
100 97a02382 2023-07-10 thomas are as follows:
101 97a02382 2023-07-10 thomas .Bl -tag -width Ds
102 97a02382 2023-07-10 thomas .It Fl b Ar branch
103 97a02382 2023-07-10 thomas Create the specified
104 97a02382 2023-07-10 thomas .Ar branch .
105 97a02382 2023-07-10 thomas If this option is not specified, a branch corresponding to the repository's
106 97a02382 2023-07-10 thomas HEAD reference will be used.
107 97a02382 2023-07-10 thomas Use of this option is required if the branch resolved via the repository's
108 97a02382 2023-07-10 thomas HEAD reference already exists.
109 97a02382 2023-07-10 thomas .It Fl I Ar pattern
110 97a02382 2023-07-10 thomas Ignore files or directories with a name which matches the specified
111 97a02382 2023-07-10 thomas .Ar pattern .
112 97a02382 2023-07-10 thomas This option may be specified multiple times to build a list of ignore patterns.
113 97a02382 2023-07-10 thomas The
114 97a02382 2023-07-10 thomas .Ar pattern
115 97a02382 2023-07-10 thomas follows the globbing rules documented in
116 97a02382 2023-07-10 thomas .Xr glob 7 .
117 97a02382 2023-07-10 thomas Ignore patterns which end with a slash,
118 97a02382 2023-07-10 thomas .Dq / ,
119 97a02382 2023-07-10 thomas will only match directories.
120 97a02382 2023-07-10 thomas .It Fl m Ar message
121 97a02382 2023-07-10 thomas Use the specified log message when creating the new commit.
122 97a02382 2023-07-10 thomas Without the
123 97a02382 2023-07-10 thomas .Fl m
124 97a02382 2023-07-10 thomas option,
125 97a02382 2023-07-10 thomas .Cm got import
126 97a02382 2023-07-10 thomas opens a temporary file in an editor where a log message can be written.
127 bccae03f 2023-07-17 thomas Quitting the editor without saving the file will abort the import operation.
128 97a02382 2023-07-10 thomas .It Fl r Ar repository-path
129 97a02382 2023-07-10 thomas Use the repository at the specified path.
130 97a02382 2023-07-10 thomas If not specified, assume the repository is located at or above the current
131 97a02382 2023-07-10 thomas working directory.
132 97a02382 2023-07-10 thomas .El
133 97a02382 2023-07-10 thomas .Tg cl
134 97a02382 2023-07-10 thomas .It Xo
135 97a02382 2023-07-10 thomas .Cm clone
136 97a02382 2023-07-10 thomas .Op Fl almqv
137 97a02382 2023-07-10 thomas .Op Fl b Ar branch
138 97a02382 2023-07-10 thomas .Op Fl R Ar reference
139 97a02382 2023-07-10 thomas .Ar repository-URL
140 97a02382 2023-07-10 thomas .Op Ar directory
141 97a02382 2023-07-10 thomas .Xc
142 97a02382 2023-07-10 thomas .Dl Pq alias: Cm cl
143 97a02382 2023-07-10 thomas Clone a Git repository at the specified
144 97a02382 2023-07-10 thomas .Ar repository-URL
145 97a02382 2023-07-10 thomas into the specified
146 97a02382 2023-07-10 thomas .Ar directory .
147 97a02382 2023-07-10 thomas If no
148 97a02382 2023-07-10 thomas .Ar directory
149 97a02382 2023-07-10 thomas is specified, the directory name will be derived from the name of the
150 97a02382 2023-07-10 thomas cloned repository.
151 97a02382 2023-07-10 thomas .Cm got clone
152 97a02382 2023-07-10 thomas will refuse to run if the
153 97a02382 2023-07-10 thomas .Ar directory
154 97a02382 2023-07-10 thomas already exists.
155 97a02382 2023-07-10 thomas .Pp
156 97a02382 2023-07-10 thomas The
157 97a02382 2023-07-10 thomas .Ar repository-URL
158 97a02382 2023-07-10 thomas specifies a protocol scheme, a server hostname, an optional port number
159 97a02382 2023-07-10 thomas separated from the hostname by a colon, and a path to the repository on
160 97a02382 2023-07-10 thomas the server:
161 97a02382 2023-07-10 thomas .Lk scheme://hostname:port/path/to/repository
162 97a02382 2023-07-10 thomas .Pp
163 97a02382 2023-07-10 thomas The following protocol schemes are supported:
164 97a02382 2023-07-10 thomas .Bl -tag -width git+ssh
165 97a02382 2023-07-10 thomas .It git
166 97a02382 2023-07-10 thomas The Git protocol as implemented by the
167 97a02382 2023-07-10 thomas .Xr git-daemon 1
168 97a02382 2023-07-10 thomas server.
169 97a02382 2023-07-10 thomas Use of this protocol is discouraged since it supports neither authentication
170 97a02382 2023-07-10 thomas nor encryption.
171 97a02382 2023-07-10 thomas .It git+ssh
172 97a02382 2023-07-10 thomas The Git protocol wrapped in an authenticated and encrypted
173 97a02382 2023-07-10 thomas .Xr ssh 1
174 97a02382 2023-07-10 thomas tunnel.
175 97a02382 2023-07-10 thomas With this protocol the hostname may contain an embedded username for
176 97a02382 2023-07-10 thomas .Xr ssh 1
177 97a02382 2023-07-10 thomas to use:
178 97a02382 2023-07-10 thomas .Mt user@hostname
179 97a02382 2023-07-10 thomas .It ssh
180 97a02382 2023-07-10 thomas Short alias for git+ssh.
181 97a02382 2023-07-10 thomas .El
182 97a02382 2023-07-10 thomas .Pp
183 97a02382 2023-07-10 thomas Objects in the cloned repository are stored in a pack file which is downloaded
184 97a02382 2023-07-10 thomas from the server.
185 97a02382 2023-07-10 thomas This pack file will then be indexed to facilitate access to the objects stored
186 97a02382 2023-07-10 thomas within.
187 97a02382 2023-07-10 thomas If any objects in the pack file are stored in deltified form, all deltas will
188 97a02382 2023-07-10 thomas be fully resolved in order to compute the ID of such objects.
189 97a02382 2023-07-10 thomas This can take some time.
190 97a02382 2023-07-10 thomas More details about the pack file format are documented in
191 97a02382 2023-07-10 thomas .Xr git-repository 5 .
192 97a02382 2023-07-10 thomas .Pp
193 97a02382 2023-07-10 thomas .Cm got clone
194 97a02382 2023-07-10 thomas creates a remote repository entry in the
195 97a02382 2023-07-10 thomas .Xr got.conf 5
196 97a02382 2023-07-10 thomas and
197 97a02382 2023-07-10 thomas .Pa config
198 97a02382 2023-07-10 thomas files of the cloned repository to store the
199 97a02382 2023-07-10 thomas .Ar repository-url
200 97a02382 2023-07-10 thomas and any
201 97a02382 2023-07-10 thomas .Ar branch
202 97a02382 2023-07-10 thomas or
203 97a02382 2023-07-10 thomas .Ar reference
204 97a02382 2023-07-10 thomas arguments for future use by
205 97a02382 2023-07-10 thomas .Cm got fetch
206 97a02382 2023-07-10 thomas or
207 97a02382 2023-07-10 thomas .Xr git-fetch 1 .
208 97a02382 2023-07-10 thomas .Pp
209 97a02382 2023-07-10 thomas The options for
210 97a02382 2023-07-10 thomas .Cm got clone
211 97a02382 2023-07-10 thomas are as follows:
212 97a02382 2023-07-10 thomas .Bl -tag -width Ds
213 97a02382 2023-07-10 thomas .It Fl a
214 97a02382 2023-07-10 thomas Fetch all branches from the remote repository's
215 97a02382 2023-07-10 thomas .Dq refs/heads/
216 97a02382 2023-07-10 thomas reference namespace and set
217 97a02382 2023-07-10 thomas .Cm fetch_all_branches
218 97a02382 2023-07-10 thomas in the cloned repository's
219 97a02382 2023-07-10 thomas .Xr got.conf 5
220 97a02382 2023-07-10 thomas file for future use by
221 97a02382 2023-07-10 thomas .Cm got fetch .
222 97a02382 2023-07-10 thomas If this option is not specified, a branch resolved via the remote
223 97a02382 2023-07-10 thomas repository's HEAD reference will be fetched.
224 97a02382 2023-07-10 thomas Cannot be used together with the
225 97a02382 2023-07-10 thomas .Fl b
226 97a02382 2023-07-10 thomas option.
227 97a02382 2023-07-10 thomas .It Fl b Ar branch
228 97a02382 2023-07-10 thomas Fetch the specified
229 97a02382 2023-07-10 thomas .Ar branch
230 97a02382 2023-07-10 thomas from the remote repository's
231 97a02382 2023-07-10 thomas .Dq refs/heads/
232 97a02382 2023-07-10 thomas reference namespace.
233 97a02382 2023-07-10 thomas This option may be specified multiple times to build a list of branches
234 97a02382 2023-07-10 thomas to fetch.
235 97a02382 2023-07-10 thomas If the branch corresponding to the remote repository's HEAD reference is not
236 97a02382 2023-07-10 thomas in this list, the cloned repository's HEAD reference will be set to the first
237 97a02382 2023-07-10 thomas branch which was fetched.
238 97a02382 2023-07-10 thomas If this option is not specified, a branch resolved via the remote
239 97a02382 2023-07-10 thomas repository's HEAD reference will be fetched.
240 97a02382 2023-07-10 thomas Cannot be used together with the
241 97a02382 2023-07-10 thomas .Fl a
242 97a02382 2023-07-10 thomas option.
243 97a02382 2023-07-10 thomas .It Fl l
244 97a02382 2023-07-10 thomas List branches and tags available for fetching from the remote repository
245 97a02382 2023-07-10 thomas and exit immediately.
246 97a02382 2023-07-10 thomas Cannot be used together with any of the other options except
247 97a02382 2023-07-10 thomas .Fl q
248 97a02382 2023-07-10 thomas and
249 97a02382 2023-07-10 thomas .Fl v .
250 97a02382 2023-07-10 thomas .It Fl m
251 97a02382 2023-07-10 thomas Create the cloned repository as a mirror of the original repository.
252 97a02382 2023-07-10 thomas This is useful if the cloned repository will not be used to store
253 97a02382 2023-07-10 thomas locally created commits.
254 97a02382 2023-07-10 thomas .Pp
255 97a02382 2023-07-10 thomas The repository's
256 97a02382 2023-07-10 thomas .Xr got.conf 5
257 97a02382 2023-07-10 thomas and
258 97a02382 2023-07-10 thomas .Pa config
259 97a02382 2023-07-10 thomas files will be set up with the
260 97a02382 2023-07-10 thomas .Dq mirror
261 97a02382 2023-07-10 thomas option enabled, such that
262 97a02382 2023-07-10 thomas .Cm got fetch
263 97a02382 2023-07-10 thomas or
264 97a02382 2023-07-10 thomas .Xr git-fetch 1
265 97a02382 2023-07-10 thomas will write incoming changes directly to branches in the
266 97a02382 2023-07-10 thomas .Dq refs/heads/
267 97a02382 2023-07-10 thomas reference namespace, rather than to branches in the
268 97a02382 2023-07-10 thomas .Dq refs/remotes/
269 97a02382 2023-07-10 thomas namespace.
270 97a02382 2023-07-10 thomas This avoids the usual requirement of having to run
271 97a02382 2023-07-10 thomas .Cm got rebase
272 97a02382 2023-07-10 thomas or
273 97a02382 2023-07-10 thomas .Cm got merge
274 97a02382 2023-07-10 thomas after
275 97a02382 2023-07-10 thomas .Cm got fetch
276 97a02382 2023-07-10 thomas in order to make incoming changes appear on branches in the
277 97a02382 2023-07-10 thomas .Dq refs/heads/
278 97a02382 2023-07-10 thomas namespace.
279 97a02382 2023-07-10 thomas But maintaining custom changes in the cloned repository becomes difficult
280 97a02382 2023-07-10 thomas since such changes will be at risk of being discarded whenever incoming
281 97a02382 2023-07-10 thomas changes are fetched.
282 97a02382 2023-07-10 thomas .It Fl q
283 97a02382 2023-07-10 thomas Suppress progress reporting output.
284 97a02382 2023-07-10 thomas The same option will be passed to
285 97a02382 2023-07-10 thomas .Xr ssh 1
286 97a02382 2023-07-10 thomas if applicable.
287 97a02382 2023-07-10 thomas .It Fl R Ar reference
288 97a02382 2023-07-10 thomas In addition to the branches and tags that will be fetched, fetch an arbitrary
289 97a02382 2023-07-10 thomas .Ar reference
290 97a02382 2023-07-10 thomas from the remote repository's
291 97a02382 2023-07-10 thomas .Dq refs/
292 97a02382 2023-07-10 thomas namespace.
293 97a02382 2023-07-10 thomas This option may be specified multiple times to build a list of additional
294 97a02382 2023-07-10 thomas references to fetch.
295 97a02382 2023-07-10 thomas The specified
296 97a02382 2023-07-10 thomas .Ar reference
297 97a02382 2023-07-10 thomas may either be a path to a specific reference, or a reference namespace
298 97a02382 2023-07-10 thomas which will cause all references in this namespace to be fetched.
299 97a02382 2023-07-10 thomas .Pp
300 97a02382 2023-07-10 thomas Each reference will be mapped into the cloned repository's
301 97a02382 2023-07-10 thomas .Dq refs/remotes/
302 97a02382 2023-07-10 thomas namespace, unless the
303 97a02382 2023-07-10 thomas .Fl m
304 97a02382 2023-07-10 thomas option is used to mirror references directly into the cloned repository's
305 97a02382 2023-07-10 thomas .Dq refs/
306 97a02382 2023-07-10 thomas namespace.
307 97a02382 2023-07-10 thomas .Pp
308 97a02382 2023-07-10 thomas .Cm got clone
309 97a02382 2023-07-10 thomas will refuse to fetch references from the remote repository's
310 97a02382 2023-07-10 thomas .Dq refs/remotes/
311 97a02382 2023-07-10 thomas or
312 97a02382 2023-07-10 thomas .Dq refs/got/
313 97a02382 2023-07-10 thomas namespace.
314 97a02382 2023-07-10 thomas .It Fl v
315 97a02382 2023-07-10 thomas Verbose mode.
316 97a02382 2023-07-10 thomas Causes
317 97a02382 2023-07-10 thomas .Cm got clone
318 97a02382 2023-07-10 thomas to print debugging messages to standard error output.
319 97a02382 2023-07-10 thomas This option will be passed to
320 97a02382 2023-07-10 thomas .Xr ssh 1
321 97a02382 2023-07-10 thomas if applicable.
322 97a02382 2023-07-10 thomas Multiple -v options increase the verbosity.
323 97a02382 2023-07-10 thomas The maximum is 3.
324 97a02382 2023-07-10 thomas .El
325 97a02382 2023-07-10 thomas .Tg co
326 97a02382 2023-07-10 thomas .It Xo
327 97a02382 2023-07-10 thomas .Cm checkout
328 97a02382 2023-07-10 thomas .Op Fl Eq
329 97a02382 2023-07-10 thomas .Op Fl b Ar branch
330 97a02382 2023-07-10 thomas .Op Fl c Ar commit
331 97a02382 2023-07-10 thomas .Op Fl p Ar path-prefix
332 97a02382 2023-07-10 thomas .Ar repository-path
333 97a02382 2023-07-10 thomas .Op Ar work-tree-path
334 97a02382 2023-07-10 thomas .Xc
335 97a02382 2023-07-10 thomas .Dl Pq alias: Cm co
336 97a02382 2023-07-10 thomas Copy files from a repository into a new work tree.
337 97a02382 2023-07-10 thomas Show the status of each affected file, using the following status codes:
338 97a02382 2023-07-10 thomas .Bl -column YXZ description
339 97a02382 2023-07-10 thomas .It A Ta new file was added
340 97a02382 2023-07-10 thomas .It E Ta file already exists in work tree's meta-data
341 97a02382 2023-07-10 thomas .El
342 97a02382 2023-07-10 thomas .Pp
343 97a02382 2023-07-10 thomas If the
344 97a02382 2023-07-10 thomas .Ar work tree path
345 97a02382 2023-07-10 thomas is not specified, either use the last component of
346 97a02382 2023-07-10 thomas .Ar repository path ,
347 97a02382 2023-07-10 thomas or if a
348 97a02382 2023-07-10 thomas .Ar path prefix
349 97a02382 2023-07-10 thomas was specified use the last component of
350 97a02382 2023-07-10 thomas .Ar path prefix .
351 97a02382 2023-07-10 thomas .Pp
352 97a02382 2023-07-10 thomas The options for
353 97a02382 2023-07-10 thomas .Cm got checkout
354 97a02382 2023-07-10 thomas are as follows:
355 97a02382 2023-07-10 thomas .Bl -tag -width Ds
356 97a02382 2023-07-10 thomas .It Fl b Ar branch
357 97a02382 2023-07-10 thomas Check out files from a commit on the specified
358 97a02382 2023-07-10 thomas .Ar branch .
359 97a02382 2023-07-10 thomas If this option is not specified, a branch resolved via the repository's HEAD
360 97a02382 2023-07-10 thomas reference will be used.
361 97a02382 2023-07-10 thomas .It Fl c Ar commit
362 97a02382 2023-07-10 thomas Check out files from the specified
363 97a02382 2023-07-10 thomas .Ar commit
364 97a02382 2023-07-10 thomas on the selected branch.
365 97a02382 2023-07-10 thomas The expected argument is a commit ID SHA1 hash or an existing reference
366 97a02382 2023-07-10 thomas or tag name which will be resolved to a commit ID.
367 97a02382 2023-07-10 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
368 97a02382 2023-07-10 thomas automatically, provided the abbreviation is unique.
369 97a02382 2023-07-10 thomas If this option is not specified, the most recent commit on the selected
370 97a02382 2023-07-10 thomas branch will be used.
371 97a02382 2023-07-10 thomas .Pp
372 97a02382 2023-07-10 thomas If the specified
373 97a02382 2023-07-10 thomas .Ar commit
374 97a02382 2023-07-10 thomas is not contained in the selected branch, a different branch which contains
375 97a02382 2023-07-10 thomas this commit must be specified with the
376 97a02382 2023-07-10 thomas .Fl b
377 97a02382 2023-07-10 thomas option.
378 97a02382 2023-07-10 thomas If no such branch is known, a new branch must be created for this
379 97a02382 2023-07-10 thomas commit with
380 97a02382 2023-07-10 thomas .Cm got branch
381 97a02382 2023-07-10 thomas before
382 97a02382 2023-07-10 thomas .Cm got checkout
383 97a02382 2023-07-10 thomas can be used.
384 97a02382 2023-07-10 thomas Checking out work trees with an unknown branch is intentionally not supported.
385 97a02382 2023-07-10 thomas .It Fl E
386 97a02382 2023-07-10 thomas Proceed with the checkout operation even if the directory at
387 97a02382 2023-07-10 thomas .Ar work-tree-path
388 97a02382 2023-07-10 thomas is not empty.
389 97a02382 2023-07-10 thomas Existing files will be left intact.
390 97a02382 2023-07-10 thomas .It Fl p Ar path-prefix
391 97a02382 2023-07-10 thomas Restrict the work tree to a subset of the repository's tree hierarchy.
392 97a02382 2023-07-10 thomas Only files beneath the specified
393 97a02382 2023-07-10 thomas .Ar path-prefix
394 97a02382 2023-07-10 thomas will be checked out.
395 97a02382 2023-07-10 thomas .It Fl q
396 97a02382 2023-07-10 thomas Silence progress output.
397 97a02382 2023-07-10 thomas .El
398 97a02382 2023-07-10 thomas .Tg up
399 97a02382 2023-07-10 thomas .It Xo
400 97a02382 2023-07-10 thomas .Cm update
401 97a02382 2023-07-10 thomas .Op Fl q
402 97a02382 2023-07-10 thomas .Op Fl b Ar branch
403 97a02382 2023-07-10 thomas .Op Fl c Ar commit
404 97a02382 2023-07-10 thomas .Op Ar path ...
405 97a02382 2023-07-10 thomas .Xc
406 97a02382 2023-07-10 thomas .Dl Pq alias: Cm up
407 97a02382 2023-07-10 thomas Update an existing work tree to a different
408 97a02382 2023-07-10 thomas .Ar commit .
409 97a02382 2023-07-10 thomas Change existing files in the work tree as necessary to match file contents
410 97a02382 2023-07-10 thomas of this commit.
411 97a02382 2023-07-10 thomas Preserve any local changes in the work tree and merge them with the
412 97a02382 2023-07-10 thomas incoming changes.
413 97a02382 2023-07-10 thomas .Pp
414 97a02382 2023-07-10 thomas Files which already contain merge conflicts will not be updated to avoid
415 97a02382 2023-07-10 thomas further complications.
416 97a02382 2023-07-10 thomas Such files will be updated when
417 97a02382 2023-07-10 thomas .Cm got update
418 97a02382 2023-07-10 thomas is run again after merge conflicts have been resolved.
419 97a02382 2023-07-10 thomas If the conflicting changes are no longer needed, affected files can be
420 97a02382 2023-07-10 thomas reverted with
421 97a02382 2023-07-10 thomas .Cm got revert
422 97a02382 2023-07-10 thomas before running
423 97a02382 2023-07-10 thomas .Cm got update
424 97a02382 2023-07-10 thomas again.
425 97a02382 2023-07-10 thomas .Pp
426 97a02382 2023-07-10 thomas Show the status of each affected file, using the following status codes:
427 97a02382 2023-07-10 thomas .Bl -column YXZ description
428 97a02382 2023-07-10 thomas .It U Ta file was updated and contained no local changes
429 97a02382 2023-07-10 thomas .It G Ta file was updated and local changes were merged cleanly
430 97a02382 2023-07-10 thomas .It C Ta file was updated and conflicts occurred during merge
431 97a02382 2023-07-10 thomas .It D Ta file was deleted
432 97a02382 2023-07-10 thomas .It d Ta file's deletion was prevented by local modifications
433 97a02382 2023-07-10 thomas .It A Ta new file was added
434 97a02382 2023-07-10 thomas .It \(a~ Ta versioned file is obstructed by a non-regular file
435 97a02382 2023-07-10 thomas .It ! Ta a missing versioned file was restored
436 97a02382 2023-07-10 thomas .It # Ta file was not updated because it contains merge conflicts
437 97a02382 2023-07-10 thomas .It ? Ta changes destined for an unversioned file were not merged
438 97a02382 2023-07-10 thomas .El
439 97a02382 2023-07-10 thomas .Pp
440 97a02382 2023-07-10 thomas If no
441 97a02382 2023-07-10 thomas .Ar path
442 97a02382 2023-07-10 thomas is specified, update the entire work tree.
443 97a02382 2023-07-10 thomas Otherwise, restrict the update operation to files at or within the
444 97a02382 2023-07-10 thomas specified paths.
445 97a02382 2023-07-10 thomas Each path is required to exist in the update operation's target commit.
446 97a02382 2023-07-10 thomas Files in the work tree outside specified paths will remain unchanged and
447 97a02382 2023-07-10 thomas will retain their previously recorded base commit.
448 97a02382 2023-07-10 thomas Some
449 97a02382 2023-07-10 thomas .Nm
450 97a02382 2023-07-10 thomas commands may refuse to run while the work tree contains files from
451 97a02382 2023-07-10 thomas multiple base commits.
452 97a02382 2023-07-10 thomas The base commit of such a work tree can be made consistent by running
453 97a02382 2023-07-10 thomas .Cm got update
454 97a02382 2023-07-10 thomas across the entire work tree.
455 97a02382 2023-07-10 thomas Specifying a
456 97a02382 2023-07-10 thomas .Ar path
457 97a02382 2023-07-10 thomas is incompatible with the
458 97a02382 2023-07-10 thomas .Fl b
459 97a02382 2023-07-10 thomas option.
460 97a02382 2023-07-10 thomas .Pp
461 97a02382 2023-07-10 thomas .Cm got update
462 97a02382 2023-07-10 thomas cannot update paths with staged changes.
463 97a02382 2023-07-10 thomas If changes have been staged with
464 97a02382 2023-07-10 thomas .Cm got stage ,
465 97a02382 2023-07-10 thomas these changes must first be committed with
466 97a02382 2023-07-10 thomas .Cm got commit
467 97a02382 2023-07-10 thomas or unstaged with
468 97a02382 2023-07-10 thomas .Cm got unstage .
469 97a02382 2023-07-10 thomas .Pp
470 97a02382 2023-07-10 thomas The options for
471 97a02382 2023-07-10 thomas .Cm got update
472 97a02382 2023-07-10 thomas are as follows:
473 97a02382 2023-07-10 thomas .Bl -tag -width Ds
474 97a02382 2023-07-10 thomas .It Fl b Ar branch
475 97a02382 2023-07-10 thomas Switch the work tree's branch reference to the specified
476 97a02382 2023-07-10 thomas .Ar branch
477 97a02382 2023-07-10 thomas before updating the work tree.
478 97a02382 2023-07-10 thomas This option requires that all paths in the work tree are updated.
479 97a02382 2023-07-10 thomas .Pp
480 97a02382 2023-07-10 thomas As usual, any local changes in the work tree will be preserved.
481 97a02382 2023-07-10 thomas This can be useful when switching to a newly created branch in order
482 97a02382 2023-07-10 thomas to commit existing local changes to this branch.
483 97a02382 2023-07-10 thomas .Pp
484 97a02382 2023-07-10 thomas Any local changes must be dealt with separately in order to obtain a
485 97a02382 2023-07-10 thomas work tree with pristine file contents corresponding exactly to the specified
486 97a02382 2023-07-10 thomas .Ar branch .
487 97a02382 2023-07-10 thomas Such changes could first be committed to a different branch with
488 97a02382 2023-07-10 thomas .Cm got commit ,
489 97a02382 2023-07-10 thomas or could be discarded with
490 97a02382 2023-07-10 thomas .Cm got revert .
491 97a02382 2023-07-10 thomas .It Fl c Ar commit
492 97a02382 2023-07-10 thomas Update the work tree to the specified
493 97a02382 2023-07-10 thomas .Ar commit .
494 97a02382 2023-07-10 thomas The expected argument is a commit ID SHA1 hash or an existing reference
495 97a02382 2023-07-10 thomas or tag name which will be resolved to a commit ID.
496 97a02382 2023-07-10 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
497 97a02382 2023-07-10 thomas automatically, provided the abbreviation is unique.
498 97a02382 2023-07-10 thomas If this option is not specified, the most recent commit on the work tree's
499 97a02382 2023-07-10 thomas branch will be used.
500 97a02382 2023-07-10 thomas .It Fl q
501 97a02382 2023-07-10 thomas Silence progress output.
502 97a02382 2023-07-10 thomas .El
503 97a02382 2023-07-10 thomas .Tg st
504 97a02382 2023-07-10 thomas .It Xo
505 97a02382 2023-07-10 thomas .Cm status
506 97a02382 2023-07-10 thomas .Op Fl I
507 97a02382 2023-07-10 thomas .Op Fl S Ar status-codes
508 97a02382 2023-07-10 thomas .Op Fl s Ar status-codes
509 97a02382 2023-07-10 thomas .Op Ar path ...
510 97a02382 2023-07-10 thomas .Xc
511 97a02382 2023-07-10 thomas .Dl Pq alias: Cm st
512 97a02382 2023-07-10 thomas Show the current modification status of files in a work tree,
513 97a02382 2023-07-10 thomas using the following status codes:
514 97a02382 2023-07-10 thomas .Bl -column YXZ description
515 97a02382 2023-07-10 thomas .It M Ta modified file
516 97a02382 2023-07-10 thomas .It A Ta file scheduled for addition in next commit
517 97a02382 2023-07-10 thomas .It D Ta file scheduled for deletion in next commit
518 97a02382 2023-07-10 thomas .It C Ta modified or added file which contains merge conflicts
519 97a02382 2023-07-10 thomas .It ! Ta versioned file was expected on disk but is missing
520 97a02382 2023-07-10 thomas .It \(a~ Ta versioned file is obstructed by a non-regular file
521 97a02382 2023-07-10 thomas .It ? Ta unversioned item not tracked by
522 97a02382 2023-07-10 thomas .Nm
523 97a02382 2023-07-10 thomas .It m Ta modified file modes (executable bit only)
524 97a02382 2023-07-10 thomas .It N Ta non-existent
525 97a02382 2023-07-10 thomas .Ar path
526 97a02382 2023-07-10 thomas specified on the command line
527 97a02382 2023-07-10 thomas .El
528 97a02382 2023-07-10 thomas .Pp
529 97a02382 2023-07-10 thomas If no
530 97a02382 2023-07-10 thomas .Ar path
531 97a02382 2023-07-10 thomas is specified, show modifications in the entire work tree.
532 97a02382 2023-07-10 thomas Otherwise, show modifications at or within the specified paths.
533 97a02382 2023-07-10 thomas .Pp
534 97a02382 2023-07-10 thomas If changes have been staged with
535 97a02382 2023-07-10 thomas .Cm got stage ,
536 97a02382 2023-07-10 thomas staged changes are shown in the second output column, using the following
537 97a02382 2023-07-10 thomas status codes:
538 97a02382 2023-07-10 thomas .Bl -column YXZ description
539 97a02382 2023-07-10 thomas .It M Ta file modification is staged
540 97a02382 2023-07-10 thomas .It A Ta file addition is staged
541 97a02382 2023-07-10 thomas .It D Ta file deletion is staged
542 97a02382 2023-07-10 thomas .El
543 97a02382 2023-07-10 thomas .Pp
544 97a02382 2023-07-10 thomas Changes created on top of staged changes are indicated in the first column:
545 97a02382 2023-07-10 thomas .Bl -column YXZ description
546 97a02382 2023-07-10 thomas .It MM Ta file was modified after earlier changes have been staged
547 97a02382 2023-07-10 thomas .It MA Ta file was modified after having been staged for addition
548 97a02382 2023-07-10 thomas .El
549 97a02382 2023-07-10 thomas .Pp
550 97a02382 2023-07-10 thomas The options for
551 97a02382 2023-07-10 thomas .Cm got status
552 97a02382 2023-07-10 thomas are as follows:
553 97a02382 2023-07-10 thomas .Bl -tag -width Ds
554 97a02382 2023-07-10 thomas .It Fl I
555 97a02382 2023-07-10 thomas Show unversioned files even if they match an ignore pattern.
556 97a02382 2023-07-10 thomas .It Fl S Ar status-codes
557 97a02382 2023-07-10 thomas Suppress the output of files with a modification status matching any of the
558 97a02382 2023-07-10 thomas single-character status codes contained in the
559 97a02382 2023-07-10 thomas .Ar status-codes
560 97a02382 2023-07-10 thomas argument.
561 97a02382 2023-07-10 thomas Any combination of codes from the above list of possible status codes
562 97a02382 2023-07-10 thomas may be specified.
563 97a02382 2023-07-10 thomas For staged files, status codes displayed in either column will be matched.
564 97a02382 2023-07-10 thomas Cannot be used together with the
565 97a02382 2023-07-10 thomas .Fl s
566 97a02382 2023-07-10 thomas option.
567 97a02382 2023-07-10 thomas .It Fl s Ar status-codes
568 97a02382 2023-07-10 thomas Only show files with a modification status matching any of the
569 97a02382 2023-07-10 thomas single-character status codes contained in the
570 97a02382 2023-07-10 thomas .Ar status-codes
571 97a02382 2023-07-10 thomas argument.
572 97a02382 2023-07-10 thomas Any combination of codes from the above list of possible status codes
573 97a02382 2023-07-10 thomas may be specified.
574 97a02382 2023-07-10 thomas For staged files, status codes displayed in either column will be matched.
575 97a02382 2023-07-10 thomas Cannot be used together with the
576 97a02382 2023-07-10 thomas .Fl S
577 97a02382 2023-07-10 thomas option.
578 97a02382 2023-07-10 thomas .El
579 97a02382 2023-07-10 thomas .Pp
580 97a02382 2023-07-10 thomas For compatibility with
581 97a02382 2023-07-10 thomas .Xr cvs 1
582 97a02382 2023-07-10 thomas and
583 97a02382 2023-07-10 thomas .Xr git 1 ,
584 97a02382 2023-07-10 thomas .Cm got status
585 97a02382 2023-07-10 thomas reads
586 97a02382 2023-07-10 thomas .Xr glob 7
587 97a02382 2023-07-10 thomas patterns from
588 97a02382 2023-07-10 thomas .Pa .cvsignore
589 97a02382 2023-07-10 thomas and
590 97a02382 2023-07-10 thomas .Pa .gitignore
591 97a02382 2023-07-10 thomas files in each traversed directory and will not display unversioned files
592 97a02382 2023-07-10 thomas which match these patterns.
593 97a02382 2023-07-10 thomas Ignore patterns which end with a slash,
594 97a02382 2023-07-10 thomas .Dq / ,
595 97a02382 2023-07-10 thomas will only match directories.
596 97a02382 2023-07-10 thomas As an extension to
597 97a02382 2023-07-10 thomas .Xr glob 7
598 97a02382 2023-07-10 thomas matching rules,
599 97a02382 2023-07-10 thomas .Cm got status
600 97a02382 2023-07-10 thomas supports consecutive asterisks,
601 97a02382 2023-07-10 thomas .Dq ** ,
602 97a02382 2023-07-10 thomas which will match an arbitrary amount of directories.
603 97a02382 2023-07-10 thomas Unlike
604 97a02382 2023-07-10 thomas .Xr cvs 1 ,
605 97a02382 2023-07-10 thomas .Cm got status
606 97a02382 2023-07-10 thomas only supports a single ignore pattern per line.
607 97a02382 2023-07-10 thomas Unlike
608 97a02382 2023-07-10 thomas .Xr git 1 ,
609 97a02382 2023-07-10 thomas .Cm got status
610 97a02382 2023-07-10 thomas does not support negated ignore patterns prefixed with
611 97a02382 2023-07-10 thomas .Dq \&! ,
612 97a02382 2023-07-10 thomas and gives no special significance to the location of path component separators,
613 97a02382 2023-07-10 thomas .Dq / ,
614 97a02382 2023-07-10 thomas in a pattern.
615 97a02382 2023-07-10 thomas .It Xo
616 97a02382 2023-07-10 thomas .Cm log
617 97a02382 2023-07-10 thomas .Op Fl bdPpRs
618 97a02382 2023-07-10 thomas .Op Fl C Ar number
619 97a02382 2023-07-10 thomas .Op Fl c Ar commit
620 97a02382 2023-07-10 thomas .Op Fl l Ar N
621 97a02382 2023-07-10 thomas .Op Fl r Ar repository-path
622 97a02382 2023-07-10 thomas .Op Fl S Ar search-pattern
623 97a02382 2023-07-10 thomas .Op Fl x Ar commit
624 97a02382 2023-07-10 thomas .Op Ar path
625 97a02382 2023-07-10 thomas .Xc
626 97a02382 2023-07-10 thomas Display history of a repository.
627 97a02382 2023-07-10 thomas If a
628 97a02382 2023-07-10 thomas .Ar path
629 97a02382 2023-07-10 thomas is specified, show only commits which modified this path.
630 97a02382 2023-07-10 thomas If invoked in a work tree, the
631 97a02382 2023-07-10 thomas .Ar path
632 97a02382 2023-07-10 thomas is interpreted relative to the current working directory,
633 97a02382 2023-07-10 thomas and the work tree's path prefix is implicitly prepended.
634 97a02382 2023-07-10 thomas Otherwise, the path is interpreted relative to the repository root.
635 97a02382 2023-07-10 thomas .Pp
636 97a02382 2023-07-10 thomas The options for
637 97a02382 2023-07-10 thomas .Cm got log
638 97a02382 2023-07-10 thomas are as follows:
639 97a02382 2023-07-10 thomas .Bl -tag -width Ds
640 97a02382 2023-07-10 thomas .It Fl b
641 97a02382 2023-07-10 thomas Display individual commits which were merged into the current branch
642 97a02382 2023-07-10 thomas from other branches.
643 97a02382 2023-07-10 thomas By default,
644 97a02382 2023-07-10 thomas .Cm got log
645 97a02382 2023-07-10 thomas shows the linear history of the current branch only.
646 97a02382 2023-07-10 thomas .It Fl C Ar number
647 97a02382 2023-07-10 thomas Set the number of context lines shown in diffs with
648 97a02382 2023-07-10 thomas .Fl p .
649 97a02382 2023-07-10 thomas By default, 3 lines of context are shown.
650 97a02382 2023-07-10 thomas .It Fl c Ar commit
651 97a02382 2023-07-10 thomas Start traversing history at the specified
652 97a02382 2023-07-10 thomas .Ar commit .
653 97a02382 2023-07-10 thomas The expected argument is a commit ID SHA1 hash or an existing reference
654 97a02382 2023-07-10 thomas or tag name which will be resolved to a commit ID.
655 97a02382 2023-07-10 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
656 97a02382 2023-07-10 thomas automatically, provided the abbreviation is unique.
657 97a02382 2023-07-10 thomas If this option is not specified, default to the work tree's current branch
658 97a02382 2023-07-10 thomas if invoked in a work tree, or to the repository's HEAD reference.
659 97a02382 2023-07-10 thomas .It Fl d
660 97a02382 2023-07-10 thomas Display diffstat of changes introduced in each commit.
661 97a02382 2023-07-10 thomas Cannot be used with the
662 97a02382 2023-07-10 thomas .Fl s
663 97a02382 2023-07-10 thomas option.
664 97a02382 2023-07-10 thomas .It Fl l Ar N
665 97a02382 2023-07-10 thomas Limit history traversal to a given number of commits.
666 97a02382 2023-07-10 thomas If this option is not specified, a default limit value of zero is used,
667 97a02382 2023-07-10 thomas which is treated as an unbounded limit.
668 97a02382 2023-07-10 thomas The
669 97a02382 2023-07-10 thomas .Ev GOT_LOG_DEFAULT_LIMIT
670 97a02382 2023-07-10 thomas environment variable may be set to change this default value.
671 97a02382 2023-07-10 thomas .It Fl P
672 97a02382 2023-07-10 thomas Display the list of file paths changed in each commit, using the following
673 97a02382 2023-07-10 thomas status codes:
674 97a02382 2023-07-10 thomas .Bl -column YXZ description
675 97a02382 2023-07-10 thomas .It M Ta modified file
676 97a02382 2023-07-10 thomas .It D Ta file was deleted
677 97a02382 2023-07-10 thomas .It A Ta new file was added
678 97a02382 2023-07-10 thomas .It m Ta modified file modes (executable bit only)
679 97a02382 2023-07-10 thomas .El
680 97a02382 2023-07-10 thomas .Pp
681 97a02382 2023-07-10 thomas Cannot be used with the
682 97a02382 2023-07-10 thomas .Fl s
683 97a02382 2023-07-10 thomas option.
684 97a02382 2023-07-10 thomas .It Fl p
685 97a02382 2023-07-10 thomas Display the patch of modifications made in each commit.
686 97a02382 2023-07-10 thomas If a
687 97a02382 2023-07-10 thomas .Ar path
688 97a02382 2023-07-10 thomas is specified, only show the patch of modifications at or within this path.
689 97a02382 2023-07-10 thomas Cannot be used with the
690 97a02382 2023-07-10 thomas .Fl s
691 97a02382 2023-07-10 thomas option.
692 97a02382 2023-07-10 thomas .It Fl R
693 97a02382 2023-07-10 thomas Determine a set of commits to display as usual, but display these commits
694 97a02382 2023-07-10 thomas in reverse order.
695 97a02382 2023-07-10 thomas .It Fl r Ar repository-path
696 97a02382 2023-07-10 thomas Use the repository at the specified path.
697 97a02382 2023-07-10 thomas If not specified, assume the repository is located at or above the current
698 97a02382 2023-07-10 thomas working directory.
699 97a02382 2023-07-10 thomas If this directory is a
700 97a02382 2023-07-10 thomas .Nm
701 97a02382 2023-07-10 thomas work tree, use the repository path associated with this work tree.
702 97a02382 2023-07-10 thomas .It Fl S Ar search-pattern
703 97a02382 2023-07-10 thomas If specified, show only commits with a log message, author name,
704 97a02382 2023-07-10 thomas committer name, or ID SHA1 hash matched by the extended regular
705 97a02382 2023-07-10 thomas expression
706 97a02382 2023-07-10 thomas .Ar search-pattern .
707 97a02382 2023-07-10 thomas Lines in committed patches will be matched if
708 97a02382 2023-07-10 thomas .Fl p
709 97a02382 2023-07-10 thomas is specified.
710 97a02382 2023-07-10 thomas File paths changed by a commit will be matched if
711 97a02382 2023-07-10 thomas .Fl P
712 97a02382 2023-07-10 thomas is specified.
713 97a02382 2023-07-10 thomas Regular expression syntax is documented in
714 97a02382 2023-07-10 thomas .Xr re_format 7 .
715 97a02382 2023-07-10 thomas .It Fl s
716 97a02382 2023-07-10 thomas Display a short one-line summary of each commit, instead of the default
717 97a02382 2023-07-10 thomas history format.
718 97a02382 2023-07-10 thomas Cannot be used together with the
719 97a02382 2023-07-10 thomas .Fl p
720 97a02382 2023-07-10 thomas or
721 97a02382 2023-07-10 thomas .Fl P
722 97a02382 2023-07-10 thomas option.
723 97a02382 2023-07-10 thomas .It Fl x Ar commit
724 97a02382 2023-07-10 thomas Stop traversing commit history immediately after the specified
725 97a02382 2023-07-10 thomas .Ar commit
726 97a02382 2023-07-10 thomas has been traversed.
727 97a02382 2023-07-10 thomas This option has no effect if the specified
728 97a02382 2023-07-10 thomas .Ar commit
729 97a02382 2023-07-10 thomas is never traversed.
730 97a02382 2023-07-10 thomas .El
731 97a02382 2023-07-10 thomas .Tg di
732 97a02382 2023-07-10 thomas .It Xo
733 97a02382 2023-07-10 thomas .Cm diff
734 97a02382 2023-07-10 thomas .Op Fl adPsw
735 97a02382 2023-07-10 thomas .Op Fl C Ar number
736 97a02382 2023-07-10 thomas .Op Fl c Ar commit
737 97a02382 2023-07-10 thomas .Op Fl r Ar repository-path
738 97a02382 2023-07-10 thomas .Op Ar object1 Ar object2 | Ar path ...
739 97a02382 2023-07-10 thomas .Xc
740 97a02382 2023-07-10 thomas .Dl Pq alias: Cm di
741 97a02382 2023-07-10 thomas When invoked within a work tree without any arguments, display all
742 97a02382 2023-07-10 thomas local changes in the work tree.
743 97a02382 2023-07-10 thomas If one or more
744 97a02382 2023-07-10 thomas .Ar path
745 97a02382 2023-07-10 thomas arguments are specified, only show changes within the specified paths.
746 97a02382 2023-07-10 thomas .Pp
747 97a02382 2023-07-10 thomas If two arguments are provided, treat each argument as a reference, a tag
748 97a02382 2023-07-10 thomas name, or an object ID SHA1 hash, and display differences between the
749 97a02382 2023-07-10 thomas corresponding objects.
750 97a02382 2023-07-10 thomas Both objects must be of the same type (blobs, trees, or commits).
751 97a02382 2023-07-10 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
752 97a02382 2023-07-10 thomas automatically, provided the abbreviation is unique.
753 97a02382 2023-07-10 thomas If none of these interpretations produce a valid result or if the
754 97a02382 2023-07-10 thomas .Fl P
755 97a02382 2023-07-10 thomas option is used,
756 97a02382 2023-07-10 thomas and if
757 97a02382 2023-07-10 thomas .Cm got diff
758 97a02382 2023-07-10 thomas is running in a work tree, attempt to interpret the two arguments as paths.
759 97a02382 2023-07-10 thomas .Pp
760 97a02382 2023-07-10 thomas The options for
761 97a02382 2023-07-10 thomas .Cm got diff
762 97a02382 2023-07-10 thomas are as follows:
763 97a02382 2023-07-10 thomas .Bl -tag -width Ds
764 97a02382 2023-07-10 thomas .It Fl a
765 97a02382 2023-07-10 thomas Treat file contents as ASCII text even if binary data is detected.
766 97a02382 2023-07-10 thomas .It Fl C Ar number
767 97a02382 2023-07-10 thomas Set the number of context lines shown in the diff.
768 97a02382 2023-07-10 thomas By default, 3 lines of context are shown.
769 97a02382 2023-07-10 thomas .It Fl c Ar commit
770 97a02382 2023-07-10 thomas Show differences between commits in the repository.
771 97a02382 2023-07-10 thomas This option may be used up to two times.
772 97a02382 2023-07-10 thomas When used only once, show differences between the specified
773 97a02382 2023-07-10 thomas .Ar commit
774 97a02382 2023-07-10 thomas and its first parent commit.
775 97a02382 2023-07-10 thomas When used twice, show differences between the two specified commits.
776 97a02382 2023-07-10 thomas .Pp
777 97a02382 2023-07-10 thomas The expected argument is a commit ID SHA1 hash or an existing reference
778 97a02382 2023-07-10 thomas or tag name which will be resolved to a commit ID.
779 97a02382 2023-07-10 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
780 97a02382 2023-07-10 thomas automatically, provided the abbreviation is unique.
781 97a02382 2023-07-10 thomas .Pp
782 97a02382 2023-07-10 thomas If the
783 97a02382 2023-07-10 thomas .Fl c
784 97a02382 2023-07-10 thomas option is used, all non-option arguments will be interpreted as paths.
785 97a02382 2023-07-10 thomas If one or more such
786 97a02382 2023-07-10 thomas .Ar path
787 97a02382 2023-07-10 thomas arguments are provided, only show differences for the specified paths.
788 97a02382 2023-07-10 thomas .Pp
789 97a02382 2023-07-10 thomas Cannot be used together with the
790 97a02382 2023-07-10 thomas .Fl P
791 97a02382 2023-07-10 thomas option.
792 97a02382 2023-07-10 thomas .It Fl d
793 97a02382 2023-07-10 thomas Display diffstat of changes before the actual diff by annotating each file path
794 97a02382 2023-07-10 thomas or blob hash being diffed with the total number of lines added and removed.
795 97a02382 2023-07-10 thomas A summary line will display the total number of changes across all files.
796 97a02382 2023-07-10 thomas .It Fl P
797 97a02382 2023-07-10 thomas Interpret all arguments as paths only.
798 97a02382 2023-07-10 thomas This option can be used to resolve ambiguity in cases where paths
799 97a02382 2023-07-10 thomas look like tag names, reference names, or object IDs.
800 97a02382 2023-07-10 thomas This option is only valid when
801 97a02382 2023-07-10 thomas .Cm got diff
802 97a02382 2023-07-10 thomas is invoked in a work tree.
803 97a02382 2023-07-10 thomas .It Fl r Ar repository-path
804 97a02382 2023-07-10 thomas Use the repository at the specified path.
805 97a02382 2023-07-10 thomas If not specified, assume the repository is located at or above the current
806 97a02382 2023-07-10 thomas working directory.
807 97a02382 2023-07-10 thomas If this directory is a
808 97a02382 2023-07-10 thomas .Nm
809 97a02382 2023-07-10 thomas work tree, use the repository path associated with this work tree.
810 97a02382 2023-07-10 thomas .It Fl s
811 97a02382 2023-07-10 thomas Show changes staged with
812 97a02382 2023-07-10 thomas .Cm got stage
813 97a02382 2023-07-10 thomas instead of showing local changes in the work tree.
814 97a02382 2023-07-10 thomas This option is only valid when
815 97a02382 2023-07-10 thomas .Cm got diff
816 97a02382 2023-07-10 thomas is invoked in a work tree.
817 97a02382 2023-07-10 thomas .It Fl w
818 97a02382 2023-07-10 thomas Ignore whitespace-only changes.
819 97a02382 2023-07-10 thomas .El
820 97a02382 2023-07-10 thomas .Tg bl
821 97a02382 2023-07-10 thomas .It Xo
822 97a02382 2023-07-10 thomas .Cm blame
823 97a02382 2023-07-10 thomas .Op Fl c Ar commit
824 97a02382 2023-07-10 thomas .Op Fl r Ar repository-path
825 97a02382 2023-07-10 thomas .Ar path
826 97a02382 2023-07-10 thomas .Xc
827 97a02382 2023-07-10 thomas .Dl Pq alias: Cm bl
828 97a02382 2023-07-10 thomas Display line-by-line history of a file at the specified path.
829 97a02382 2023-07-10 thomas .Pp
830 97a02382 2023-07-10 thomas The options for
831 97a02382 2023-07-10 thomas .Cm got blame
832 97a02382 2023-07-10 thomas are as follows:
833 97a02382 2023-07-10 thomas .Bl -tag -width Ds
834 97a02382 2023-07-10 thomas .It Fl c Ar commit
835 97a02382 2023-07-10 thomas Start traversing history at the specified
836 97a02382 2023-07-10 thomas .Ar commit .
837 97a02382 2023-07-10 thomas The expected argument is a commit ID SHA1 hash or an existing reference
838 97a02382 2023-07-10 thomas or tag name which will be resolved to a commit ID.
839 97a02382 2023-07-10 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
840 97a02382 2023-07-10 thomas automatically, provided the abbreviation is unique.
841 97a02382 2023-07-10 thomas .It Fl r Ar repository-path
842 97a02382 2023-07-10 thomas Use the repository at the specified path.
843 97a02382 2023-07-10 thomas If not specified, assume the repository is located at or above the current
844 97a02382 2023-07-10 thomas working directory.
845 97a02382 2023-07-10 thomas If this directory is a
846 97a02382 2023-07-10 thomas .Nm
847 97a02382 2023-07-10 thomas work tree, use the repository path associated with this work tree.
848 97a02382 2023-07-10 thomas .El
849 97a02382 2023-07-10 thomas .Tg tr
850 97a02382 2023-07-10 thomas .It Xo
851 97a02382 2023-07-10 thomas .Cm tree
852 97a02382 2023-07-10 thomas .Op Fl iR
853 97a02382 2023-07-10 thomas .Op Fl c Ar commit
854 97a02382 2023-07-10 thomas .Op Fl r Ar repository-path
855 97a02382 2023-07-10 thomas .Op Ar path
856 97a02382 2023-07-10 thomas .Xc
857 97a02382 2023-07-10 thomas .Dl Pq alias: Cm tr
858 97a02382 2023-07-10 thomas Display a listing of files and directories at the specified
859 97a02382 2023-07-10 thomas directory path in the repository.
860 97a02382 2023-07-10 thomas Entries shown in this listing may carry one of the following trailing
861 97a02382 2023-07-10 thomas annotations:
862 97a02382 2023-07-10 thomas .Bl -column YXZ description
863 97a02382 2023-07-10 thomas .It @ Ta entry is a symbolic link
864 97a02382 2023-07-10 thomas .It / Ta entry is a directory
865 97a02382 2023-07-10 thomas .It * Ta entry is an executable file
866 97a02382 2023-07-10 thomas .It $ Ta entry is a Git submodule
867 97a02382 2023-07-10 thomas .El
868 97a02382 2023-07-10 thomas .Pp
869 97a02382 2023-07-10 thomas Symbolic link entries are also annotated with the target path of the link.
870 97a02382 2023-07-10 thomas .Pp
871 97a02382 2023-07-10 thomas If no
872 97a02382 2023-07-10 thomas .Ar path
873 97a02382 2023-07-10 thomas is specified, list the repository path corresponding to the current
874 97a02382 2023-07-10 thomas directory of the work tree, or the root directory of the repository
875 97a02382 2023-07-10 thomas if there is no work tree.
876 97a02382 2023-07-10 thomas .Pp
877 97a02382 2023-07-10 thomas The options for
878 97a02382 2023-07-10 thomas .Cm got tree
879 97a02382 2023-07-10 thomas are as follows:
880 97a02382 2023-07-10 thomas .Bl -tag -width Ds
881 97a02382 2023-07-10 thomas .It Fl c Ar commit
882 97a02382 2023-07-10 thomas List files and directories as they appear in the specified
883 97a02382 2023-07-10 thomas .Ar commit .
884 97a02382 2023-07-10 thomas The expected argument is a commit ID SHA1 hash or an existing reference
885 97a02382 2023-07-10 thomas or tag name which will be resolved to a commit ID.
886 97a02382 2023-07-10 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
887 97a02382 2023-07-10 thomas automatically, provided the abbreviation is unique.
888 97a02382 2023-07-10 thomas .It Fl i
889 97a02382 2023-07-10 thomas Show object IDs of files (blob objects) and directories (tree objects).
890 97a02382 2023-07-10 thomas .It Fl R
891 97a02382 2023-07-10 thomas Recurse into sub-directories in the repository.
892 97a02382 2023-07-10 thomas .It Fl r Ar repository-path
893 97a02382 2023-07-10 thomas Use the repository at the specified path.
894 97a02382 2023-07-10 thomas If not specified, assume the repository is located at or above the current
895 97a02382 2023-07-10 thomas working directory.
896 97a02382 2023-07-10 thomas If this directory is a
897 97a02382 2023-07-10 thomas .Nm
898 97a02382 2023-07-10 thomas work tree, use the repository path associated with this work tree.
899 97a02382 2023-07-10 thomas .El
900 5a445700 2023-07-17 thomas .It Xo
901 5a445700 2023-07-17 thomas .Cm tag
902 5a445700 2023-07-17 thomas .Op Fl lVv
903 5a445700 2023-07-17 thomas .Op Fl c Ar commit
904 5a445700 2023-07-17 thomas .Op Fl m Ar message
905 5a445700 2023-07-17 thomas .Op Fl r Ar repository-path
906 5a445700 2023-07-17 thomas .Op Fl s Ar signer-id
907 5a445700 2023-07-17 thomas .Ar name
908 5a445700 2023-07-17 thomas .Xc
909 5a445700 2023-07-17 thomas Manage tags in a repository.
910 5a445700 2023-07-17 thomas .Pp
911 5a445700 2023-07-17 thomas Tags are managed via references which live in the
912 5a445700 2023-07-17 thomas .Dq refs/tags/
913 5a445700 2023-07-17 thomas reference namespace.
914 5a445700 2023-07-17 thomas The
915 5a445700 2023-07-17 thomas .Cm got tag
916 5a445700 2023-07-17 thomas command operates on references in this namespace only.
917 5a445700 2023-07-17 thomas References in this namespace point at tag objects which contain a pointer
918 5a445700 2023-07-17 thomas to another object, a tag message, as well as author and timestamp information.
919 5a445700 2023-07-17 thomas .Pp
920 5a445700 2023-07-17 thomas Attempt to create a tag with the given
921 5a445700 2023-07-17 thomas .Ar name ,
922 5a445700 2023-07-17 thomas and make this tag point at the given
923 5a445700 2023-07-17 thomas .Ar commit .
924 5a445700 2023-07-17 thomas If no commit is specified, default to the latest commit on the work tree's
925 5a445700 2023-07-17 thomas current branch if invoked in a work tree, and to a commit resolved via
926 5a445700 2023-07-17 thomas the repository's HEAD reference otherwise.
927 5a445700 2023-07-17 thomas .Pp
928 5a445700 2023-07-17 thomas The options for
929 5a445700 2023-07-17 thomas .Cm got tag
930 5a445700 2023-07-17 thomas are as follows:
931 5a445700 2023-07-17 thomas .Bl -tag -width Ds
932 5a445700 2023-07-17 thomas .It Fl c Ar commit
933 5a445700 2023-07-17 thomas Make the newly created tag reference point at the specified
934 5a445700 2023-07-17 thomas .Ar commit .
935 5a445700 2023-07-17 thomas The expected
936 5a445700 2023-07-17 thomas .Ar commit
937 5a445700 2023-07-17 thomas argument is a commit ID SHA1 hash or an existing reference or tag name which
938 5a445700 2023-07-17 thomas will be resolved to a commit ID.
939 5a445700 2023-07-17 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
940 5a445700 2023-07-17 thomas automatically, provided the abbreviation is unique.
941 5a445700 2023-07-17 thomas .It Fl l
942 5a445700 2023-07-17 thomas List all existing tags in the repository instead of creating a new tag.
943 5a445700 2023-07-17 thomas If a
944 5a445700 2023-07-17 thomas .Ar name
945 5a445700 2023-07-17 thomas argument is passed, show only the tag with the given
946 5a445700 2023-07-17 thomas .Ar name .
947 5a445700 2023-07-17 thomas .It Fl m Ar message
948 5a445700 2023-07-17 thomas Use the specified tag message when creating the new tag.
949 5a445700 2023-07-17 thomas Without the
950 5a445700 2023-07-17 thomas .Fl m
951 5a445700 2023-07-17 thomas option,
952 5a445700 2023-07-17 thomas .Cm got tag
953 5a445700 2023-07-17 thomas opens a temporary file in an editor where a tag message can be written.
954 5a445700 2023-07-17 thomas Quitting the editor without saving the file will abort the tag operation.
955 5a445700 2023-07-17 thomas .It Fl r Ar repository-path
956 5a445700 2023-07-17 thomas Use the repository at the specified path.
957 5a445700 2023-07-17 thomas If not specified, assume the repository is located at or above the current
958 5a445700 2023-07-17 thomas working directory.
959 5a445700 2023-07-17 thomas If this directory is a
960 5a445700 2023-07-17 thomas .Nm
961 5a445700 2023-07-17 thomas work tree, use the repository path associated with this work tree.
962 5a445700 2023-07-17 thomas .It Fl s Ar signer-id
963 5a445700 2023-07-17 thomas While creating a new tag, sign this tag with the identity given in
964 5a445700 2023-07-17 thomas .Ar signer-id .
965 5a445700 2023-07-17 thomas .Pp
966 5a445700 2023-07-17 thomas For SSH-based signatures,
967 5a445700 2023-07-17 thomas .Ar signer-id
968 5a445700 2023-07-17 thomas is the path to a file which may refer to either a private SSH key,
969 5a445700 2023-07-17 thomas or a public SSH key with the private half available via
970 5a445700 2023-07-17 thomas .Xr ssh-agent 1 .
971 5a445700 2023-07-17 thomas .Cm got tag
972 5a445700 2023-07-17 thomas will sign the tag object by invoking
973 5a445700 2023-07-17 thomas .Xr ssh-keygen 1
974 5a445700 2023-07-17 thomas with the
975 5a445700 2023-07-17 thomas .Fl Y Cm sign
976 5a445700 2023-07-17 thomas command, using the signature namespace
977 5a445700 2023-07-17 thomas .Dq git
978 5a445700 2023-07-17 thomas for compatibility with
979 5a445700 2023-07-17 thomas .Xr git 1 .
980 5a445700 2023-07-17 thomas .It Fl V
981 5a445700 2023-07-17 thomas Verify tag object signatures.
982 5a445700 2023-07-17 thomas If a
983 5a445700 2023-07-17 thomas .Ar name
984 5a445700 2023-07-17 thomas is specified, show and verify the tag object with the provided name.
985 5a445700 2023-07-17 thomas Otherwise, list all tag objects and verify signatures where present.
986 5a445700 2023-07-17 thomas .Pp
987 5a445700 2023-07-17 thomas .Cm got tag
988 5a445700 2023-07-17 thomas verifies SSH-based signatures by invoking
989 5a445700 2023-07-17 thomas .Xr ssh-keygen 1
990 5a445700 2023-07-17 thomas with the options
991 5a445700 2023-07-17 thomas .Fl Y Cm verify Fl f Ar allowed_signers .
992 5a445700 2023-07-17 thomas A path to the
993 5a445700 2023-07-17 thomas .Ar allowed_signers
994 5a445700 2023-07-17 thomas file must be set in
995 5a445700 2023-07-17 thomas .Xr got.conf 5 ,
996 5a445700 2023-07-17 thomas otherwise verification is impossible.
997 5a445700 2023-07-17 thomas .It Fl v
998 5a445700 2023-07-17 thomas Verbose mode.
999 5a445700 2023-07-17 thomas During SSH signature creation and verification this option will be passed to
1000 5a445700 2023-07-17 thomas .Xr ssh-keygen 1 .
1001 5a445700 2023-07-17 thomas Multiple -v options increase the verbosity.
1002 5a445700 2023-07-17 thomas The maximum is 3.
1003 5a445700 2023-07-17 thomas .El
1004 5a445700 2023-07-17 thomas .Pp
1005 5a445700 2023-07-17 thomas By design, the
1006 5a445700 2023-07-17 thomas .Cm got tag
1007 5a445700 2023-07-17 thomas command will not delete tags or change existing tags.
1008 5a445700 2023-07-17 thomas If a tag must be deleted, the
1009 5a445700 2023-07-17 thomas .Cm got ref
1010 5a445700 2023-07-17 thomas command may be used to delete a tag's reference.
1011 5a445700 2023-07-17 thomas This should only be done if the tag has not already been copied to
1012 5a445700 2023-07-17 thomas another repository.
1013 5a445700 2023-07-17 thomas .It Xo
1014 5a445700 2023-07-17 thomas .Cm add
1015 5a445700 2023-07-17 thomas .Op Fl IR
1016 5a445700 2023-07-17 thomas .Ar path ...
1017 5a445700 2023-07-17 thomas .Xc
1018 5a445700 2023-07-17 thomas Schedule unversioned files in a work tree for addition to the
1019 5a445700 2023-07-17 thomas repository in the next commit.
1020 5a445700 2023-07-17 thomas By default, files which match a
1021 5a445700 2023-07-17 thomas .Cm got status
1022 5a445700 2023-07-17 thomas ignore pattern will not be added.
1023 5a445700 2023-07-17 thomas .Pp
1024 5a445700 2023-07-17 thomas If a
1025 5a445700 2023-07-17 thomas .Ar path
1026 5a445700 2023-07-17 thomas mentioned in the command line is not an unversioned file then
1027 5a445700 2023-07-17 thomas .Cm got add
1028 5a445700 2023-07-17 thomas may raise an error.
1029 5a445700 2023-07-17 thomas To avoid unnecessary errors from paths picked up by file globbing patterns
1030 5a445700 2023-07-17 thomas in the shell, paths in the argument list will be silently ignored if they
1031 5a445700 2023-07-17 thomas are not reported by
1032 5a445700 2023-07-17 thomas .Cm got status
1033 5a445700 2023-07-17 thomas at all, or if they are reported with one of the following status codes
1034 5a445700 2023-07-17 thomas and do not have changes staged via
1035 5a445700 2023-07-17 thomas .Cm got stage :
1036 5a445700 2023-07-17 thomas .Bl -column YXZ description
1037 5a445700 2023-07-17 thomas .It M Ta modified file
1038 5a445700 2023-07-17 thomas .It A Ta file scheduled for addition in next commit
1039 5a445700 2023-07-17 thomas .It C Ta modified or added file which contains merge conflicts
1040 5a445700 2023-07-17 thomas .It m Ta modified file modes (executable bit only)
1041 5a445700 2023-07-17 thomas .El
1042 5a445700 2023-07-17 thomas .Pp
1043 5a445700 2023-07-17 thomas The options for
1044 5a445700 2023-07-17 thomas .Cm got add
1045 5a445700 2023-07-17 thomas are as follows:
1046 5a445700 2023-07-17 thomas .Bl -tag -width Ds
1047 5a445700 2023-07-17 thomas .It Fl I
1048 5a445700 2023-07-17 thomas Add files even if they match a
1049 5a445700 2023-07-17 thomas .Cm got status
1050 5a445700 2023-07-17 thomas ignore pattern.
1051 5a445700 2023-07-17 thomas .It Fl R
1052 5a445700 2023-07-17 thomas Permit recursion into directories.
1053 5a445700 2023-07-17 thomas If this option is not specified,
1054 5a445700 2023-07-17 thomas .Cm got add
1055 5a445700 2023-07-17 thomas will refuse to run if a specified
1056 5a445700 2023-07-17 thomas .Ar path
1057 5a445700 2023-07-17 thomas is a directory.
1058 5a445700 2023-07-17 thomas .El
1059 97a02382 2023-07-10 thomas .Tg rm
1060 97a02382 2023-07-10 thomas .It Xo
1061 97a02382 2023-07-10 thomas .Cm remove
1062 97a02382 2023-07-10 thomas .Op Fl fkR
1063 97a02382 2023-07-10 thomas .Op Fl s Ar status-codes
1064 97a02382 2023-07-10 thomas .Ar path ...
1065 97a02382 2023-07-10 thomas .Xc
1066 97a02382 2023-07-10 thomas .Dl Pq alias: Cm rm
1067 97a02382 2023-07-10 thomas Remove versioned files from a work tree and schedule them for deletion
1068 97a02382 2023-07-10 thomas from the repository in the next commit.
1069 97a02382 2023-07-10 thomas .Pp
1070 97a02382 2023-07-10 thomas The options for
1071 97a02382 2023-07-10 thomas .Cm got remove
1072 97a02382 2023-07-10 thomas are as follows:
1073 97a02382 2023-07-10 thomas .Bl -tag -width Ds
1074 97a02382 2023-07-10 thomas .It Fl f
1075 97a02382 2023-07-10 thomas Perform the operation even if a file contains local modifications,
1076 97a02382 2023-07-10 thomas and do not raise an error if a specified
1077 97a02382 2023-07-10 thomas .Ar path
1078 97a02382 2023-07-10 thomas does not exist on disk.
1079 97a02382 2023-07-10 thomas .It Fl k
1080 97a02382 2023-07-10 thomas Keep affected files on disk.
1081 97a02382 2023-07-10 thomas .It Fl R
1082 97a02382 2023-07-10 thomas Permit recursion into directories.
1083 97a02382 2023-07-10 thomas If this option is not specified,
1084 97a02382 2023-07-10 thomas .Cm got remove
1085 97a02382 2023-07-10 thomas will refuse to run if a specified
1086 97a02382 2023-07-10 thomas .Ar path
1087 97a02382 2023-07-10 thomas is a directory.
1088 97a02382 2023-07-10 thomas .It Fl s Ar status-codes
1089 97a02382 2023-07-10 thomas Only delete files with a modification status matching one of the
1090 97a02382 2023-07-10 thomas single-character status codes contained in the
1091 97a02382 2023-07-10 thomas .Ar status-codes
1092 97a02382 2023-07-10 thomas argument.
1093 97a02382 2023-07-10 thomas The following status codes may be specified:
1094 97a02382 2023-07-10 thomas .Bl -column YXZ description
1095 97a02382 2023-07-10 thomas .It M Ta modified file (this implies the
1096 97a02382 2023-07-10 thomas .Fl f
1097 97a02382 2023-07-10 thomas option)
1098 97a02382 2023-07-10 thomas .It ! Ta versioned file expected on disk but missing
1099 97a02382 2023-07-10 thomas .El
1100 97a02382 2023-07-10 thomas .El
1101 97a02382 2023-07-10 thomas .Tg pa
1102 97a02382 2023-07-10 thomas .It Xo
1103 97a02382 2023-07-10 thomas .Cm patch
1104 97a02382 2023-07-10 thomas .Op Fl nR
1105 97a02382 2023-07-10 thomas .Op Fl c Ar commit
1106 97a02382 2023-07-10 thomas .Op Fl p Ar strip-count
1107 97a02382 2023-07-10 thomas .Op Ar patchfile
1108 97a02382 2023-07-10 thomas .Xc
1109 97a02382 2023-07-10 thomas .Dl Pq alias: Cm pa
1110 97a02382 2023-07-10 thomas Apply changes from
1111 97a02382 2023-07-10 thomas .Ar patchfile
1112 97a02382 2023-07-10 thomas to files in a work tree.
1113 97a02382 2023-07-10 thomas Files added or removed by a patch will be scheduled for addition or removal in
1114 97a02382 2023-07-10 thomas the work tree.
1115 97a02382 2023-07-10 thomas .Pp
1116 97a02382 2023-07-10 thomas The patch must be in the unified diff format as produced by
1117 97a02382 2023-07-10 thomas .Cm got diff ,
1118 97a02382 2023-07-10 thomas .Xr git-diff 1 ,
1119 97a02382 2023-07-10 thomas or by
1120 97a02382 2023-07-10 thomas .Xr diff 1
1121 97a02382 2023-07-10 thomas and
1122 97a02382 2023-07-10 thomas .Xr cvs 1
1123 97a02382 2023-07-10 thomas diff when invoked with their
1124 97a02382 2023-07-10 thomas .Fl u
1125 97a02382 2023-07-10 thomas options.
1126 97a02382 2023-07-10 thomas If no
1127 97a02382 2023-07-10 thomas .Ar patchfile
1128 97a02382 2023-07-10 thomas argument is provided, read unified diff data from standard input instead.
1129 97a02382 2023-07-10 thomas .Pp
1130 97a02382 2023-07-10 thomas If the
1131 97a02382 2023-07-10 thomas .Ar patchfile
1132 97a02382 2023-07-10 thomas contains multiple patches, then attempt to apply each of them in sequence.
1133 97a02382 2023-07-10 thomas .Pp
1134 97a02382 2023-07-10 thomas Show the status of each affected file, using the following status codes:
1135 97a02382 2023-07-10 thomas .Bl -column XYZ description
1136 97a02382 2023-07-10 thomas .It M Ta file was modified
1137 97a02382 2023-07-10 thomas .It G Ta file was merged using a merge-base found in the repository
1138 97a02382 2023-07-10 thomas .It C Ta file was merged and conflicts occurred during merge
1139 97a02382 2023-07-10 thomas .It D Ta file was deleted
1140 97a02382 2023-07-10 thomas .It A Ta file was added
1141 97a02382 2023-07-10 thomas .It # Ta failed to patch the file
1142 97a02382 2023-07-10 thomas .El
1143 97a02382 2023-07-10 thomas .Pp
1144 97a02382 2023-07-10 thomas If a change does not match at its exact line number, attempt to
1145 97a02382 2023-07-10 thomas apply it somewhere else in the file if a good spot can be found.
1146 97a02382 2023-07-10 thomas Otherwise, the patch will fail to apply.
1147 97a02382 2023-07-10 thomas .Pp
1148 97a02382 2023-07-10 thomas .Nm
1149 97a02382 2023-07-10 thomas .Cm patch
1150 97a02382 2023-07-10 thomas will refuse to apply a patch if certain preconditions are not met.
1151 97a02382 2023-07-10 thomas Files to be deleted must already be under version control, and must
1152 97a02382 2023-07-10 thomas not have been scheduled for deletion already.
1153 97a02382 2023-07-10 thomas Files to be added must not yet be under version control and must not
1154 97a02382 2023-07-10 thomas already be present on disk.
1155 97a02382 2023-07-10 thomas Files to be modified must already be under version control and may not
1156 97a02382 2023-07-10 thomas contain conflict markers.
1157 97a02382 2023-07-10 thomas .Pp
1158 97a02382 2023-07-10 thomas If an error occurs, the
1159 97a02382 2023-07-10 thomas .Cm patch
1160 97a02382 2023-07-10 thomas operation will be aborted.
1161 97a02382 2023-07-10 thomas Any changes made to the work tree up to this point will be left behind.
1162 97a02382 2023-07-10 thomas Such changes can be viewed with
1163 97a02382 2023-07-10 thomas .Cm got diff
1164 97a02382 2023-07-10 thomas and can be reverted with
1165 97a02382 2023-07-10 thomas .Cm got revert
1166 97a02382 2023-07-10 thomas if needed.
1167 97a02382 2023-07-10 thomas .Pp
1168 97a02382 2023-07-10 thomas The options for
1169 97a02382 2023-07-10 thomas .Cm got patch
1170 97a02382 2023-07-10 thomas are as follows:
1171 97a02382 2023-07-10 thomas .Bl -tag -width Ds
1172 97a02382 2023-07-10 thomas .It Fl c Ar commit
1173 97a02382 2023-07-10 thomas Attempt to locate files within the specified
1174 97a02382 2023-07-10 thomas .Ar commit
1175 97a02382 2023-07-10 thomas for use as a merge-base for 3-way merges.
1176 97a02382 2023-07-10 thomas Ideally, the specified
1177 97a02382 2023-07-10 thomas .Ar commit
1178 97a02382 2023-07-10 thomas should contain versions of files which the changes contained in the
1179 97a02382 2023-07-10 thomas .Ar patchfile
1180 97a02382 2023-07-10 thomas were based on.
1181 97a02382 2023-07-10 thomas Files will be located by path, relative to the repository root.
1182 97a02382 2023-07-10 thomas If the
1183 97a02382 2023-07-10 thomas .Fl p
1184 97a02382 2023-07-10 thomas option is used then leading path components will be stripped
1185 97a02382 2023-07-10 thomas before paths are looked up in the repository.
1186 97a02382 2023-07-10 thomas .Pp
1187 97a02382 2023-07-10 thomas If the
1188 97a02382 2023-07-10 thomas .Fl c
1189 97a02382 2023-07-10 thomas option is not used then
1190 97a02382 2023-07-10 thomas .Cm got patch
1191 97a02382 2023-07-10 thomas will attempt to locate merge-bases via object IDs found in
1192 97a02382 2023-07-10 thomas .Ar patchfile
1193 97a02382 2023-07-10 thomas meta-data, such as produced by
1194 97a02382 2023-07-10 thomas .Cm got diff
1195 97a02382 2023-07-10 thomas or
1196 97a02382 2023-07-10 thomas .Xr git-diff 1 .
1197 97a02382 2023-07-10 thomas Use of the
1198 97a02382 2023-07-10 thomas .Fl c
1199 97a02382 2023-07-10 thomas option is only recommended in the absence of such meta-data.
1200 97a02382 2023-07-10 thomas .Pp
1201 97a02382 2023-07-10 thomas In case no merge-base is available for a file, changes will be applied
1202 97a02382 2023-07-10 thomas without doing a 3-way merge.
1203 97a02382 2023-07-10 thomas Changes which do not apply cleanly may then be rejected entirely, rather
1204 97a02382 2023-07-10 thomas than producing merge conflicts in the patched target file.
1205 97a02382 2023-07-10 thomas .It Fl n
1206 97a02382 2023-07-10 thomas Do not make any modifications to the work tree.
1207 97a02382 2023-07-10 thomas This can be used to check whether a patch would apply without issues.
1208 97a02382 2023-07-10 thomas If the
1209 97a02382 2023-07-10 thomas .Ar patchfile
1210 97a02382 2023-07-10 thomas contains diffs that affect the same file multiple times, the results
1211 97a02382 2023-07-10 thomas displayed may be incorrect.
1212 97a02382 2023-07-10 thomas .It Fl p Ar strip-count
1213 97a02382 2023-07-10 thomas Specify the number of leading path components to strip from paths
1214 97a02382 2023-07-10 thomas parsed from
1215 97a02382 2023-07-10 thomas .Ar patchfile .
1216 97a02382 2023-07-10 thomas If the
1217 97a02382 2023-07-10 thomas .Fl p
1218 97a02382 2023-07-10 thomas option is not used,
1219 97a02382 2023-07-10 thomas .Sq a/
1220 97a02382 2023-07-10 thomas and
1221 97a02382 2023-07-10 thomas .Sq b/
1222 97a02382 2023-07-10 thomas path prefixes generated by
1223 97a02382 2023-07-10 thomas .Xr git-diff 1
1224 97a02382 2023-07-10 thomas will be recognized and stripped automatically.
1225 97a02382 2023-07-10 thomas .It Fl R
1226 97a02382 2023-07-10 thomas Reverse the patch before applying it.
1227 97a02382 2023-07-10 thomas .El
1228 97a02382 2023-07-10 thomas .Tg rv
1229 97a02382 2023-07-10 thomas .It Xo
1230 97a02382 2023-07-10 thomas .Cm revert
1231 97a02382 2023-07-10 thomas .Op Fl pR
1232 97a02382 2023-07-10 thomas .Op Fl F Ar response-script
1233 97a02382 2023-07-10 thomas .Ar path ...
1234 97a02382 2023-07-10 thomas .Xc
1235 97a02382 2023-07-10 thomas .Dl Pq alias: Cm rv
1236 97a02382 2023-07-10 thomas Revert any local changes in files at the specified paths in a work tree.
1237 97a02382 2023-07-10 thomas File contents will be overwritten with those contained in the
1238 97a02382 2023-07-10 thomas work tree's base commit.
1239 97a02382 2023-07-10 thomas There is no way to bring discarded changes back after
1240 97a02382 2023-07-10 thomas .Cm got revert !
1241 97a02382 2023-07-10 thomas .Pp
1242 97a02382 2023-07-10 thomas If a file was added with
1243 97a02382 2023-07-10 thomas .Cm got add ,
1244 97a02382 2023-07-10 thomas it will become an unversioned file again.
1245 97a02382 2023-07-10 thomas If a file was deleted with
1246 97a02382 2023-07-10 thomas .Cm got remove ,
1247 97a02382 2023-07-10 thomas it will be restored.
1248 97a02382 2023-07-10 thomas .Pp
1249 97a02382 2023-07-10 thomas The options for
1250 97a02382 2023-07-10 thomas .Cm got revert
1251 97a02382 2023-07-10 thomas are as follows:
1252 97a02382 2023-07-10 thomas .Bl -tag -width Ds
1253 97a02382 2023-07-10 thomas .It Fl F Ar response-script
1254 97a02382 2023-07-10 thomas With the
1255 97a02382 2023-07-10 thomas .Fl p
1256 97a02382 2023-07-10 thomas option, read
1257 97a02382 2023-07-10 thomas .Dq y ,
1258 97a02382 2023-07-10 thomas .Dq n ,
1259 97a02382 2023-07-10 thomas and
1260 97a02382 2023-07-10 thomas .Dq q
1261 97a02382 2023-07-10 thomas responses line-by-line from the specified
1262 97a02382 2023-07-10 thomas .Ar response-script
1263 97a02382 2023-07-10 thomas file instead of prompting interactively.
1264 97a02382 2023-07-10 thomas .It Fl p
1265 97a02382 2023-07-10 thomas Instead of reverting all changes in files, interactively select or reject
1266 97a02382 2023-07-10 thomas changes to revert based on
1267 97a02382 2023-07-10 thomas .Dq y
1268 97a02382 2023-07-10 thomas (revert change),
1269 97a02382 2023-07-10 thomas .Dq n
1270 97a02382 2023-07-10 thomas (keep change), and
1271 97a02382 2023-07-10 thomas .Dq q
1272 97a02382 2023-07-10 thomas (quit reverting this file) responses.
1273 97a02382 2023-07-10 thomas If a file is in modified status, individual patches derived from the
1274 97a02382 2023-07-10 thomas modified file content can be reverted.
1275 97a02382 2023-07-10 thomas Files in added or deleted status may only be reverted in their entirety.
1276 97a02382 2023-07-10 thomas .It Fl R
1277 97a02382 2023-07-10 thomas Permit recursion into directories.
1278 97a02382 2023-07-10 thomas If this option is not specified,
1279 97a02382 2023-07-10 thomas .Cm got revert
1280 97a02382 2023-07-10 thomas will refuse to run if a specified
1281 97a02382 2023-07-10 thomas .Ar path
1282 97a02382 2023-07-10 thomas is a directory.
1283 97a02382 2023-07-10 thomas .El
1284 97a02382 2023-07-10 thomas .Tg ci
1285 97a02382 2023-07-10 thomas .It Xo
1286 97a02382 2023-07-10 thomas .Cm commit
1287 97a02382 2023-07-10 thomas .Op Fl CNnS
1288 97a02382 2023-07-10 thomas .Op Fl A Ar author
1289 97a02382 2023-07-10 thomas .Op Fl F Ar path
1290 97a02382 2023-07-10 thomas .Op Fl m Ar message
1291 97a02382 2023-07-10 thomas .Op Ar path ...
1292 97a02382 2023-07-10 thomas .Xc
1293 97a02382 2023-07-10 thomas .Dl Pq alias: Cm ci
1294 97a02382 2023-07-10 thomas Create a new commit in the repository from changes in a work tree
1295 97a02382 2023-07-10 thomas and use this commit as the new base commit for the work tree.
1296 97a02382 2023-07-10 thomas If no
1297 97a02382 2023-07-10 thomas .Ar path
1298 97a02382 2023-07-10 thomas is specified, commit all changes in the work tree.
1299 97a02382 2023-07-10 thomas Otherwise, commit changes at or within the specified paths.
1300 97a02382 2023-07-10 thomas .Pp
1301 97a02382 2023-07-10 thomas If changes have been explicitly staged for commit with
1302 97a02382 2023-07-10 thomas .Cm got stage ,
1303 97a02382 2023-07-10 thomas only commit staged changes and reject any specified paths which
1304 97a02382 2023-07-10 thomas have not been staged.
1305 97a02382 2023-07-10 thomas .Pp
1306 97a02382 2023-07-10 thomas .Cm got commit
1307 97a02382 2023-07-10 thomas opens a temporary file in an editor where a log message can be written
1308 97a02382 2023-07-10 thomas unless the
1309 97a02382 2023-07-10 thomas .Fl m
1310 97a02382 2023-07-10 thomas option is used
1311 97a02382 2023-07-10 thomas or the
1312 97a02382 2023-07-10 thomas .Fl F
1313 97a02382 2023-07-10 thomas and
1314 97a02382 2023-07-10 thomas .Fl N
1315 97a02382 2023-07-10 thomas options are used together.
1316 bccae03f 2023-07-17 thomas Quitting the editor without saving the file will abort the commit operation.
1317 97a02382 2023-07-10 thomas .Pp
1318 97a02382 2023-07-10 thomas Show the status of each affected file, using the following status codes:
1319 97a02382 2023-07-10 thomas .Bl -column YXZ description
1320 97a02382 2023-07-10 thomas .It M Ta modified file
1321 97a02382 2023-07-10 thomas .It D Ta file was deleted
1322 97a02382 2023-07-10 thomas .It A Ta new file was added
1323 97a02382 2023-07-10 thomas .It m Ta modified file modes (executable bit only)
1324 97a02382 2023-07-10 thomas .El
1325 97a02382 2023-07-10 thomas .Pp
1326 97a02382 2023-07-10 thomas Files which are not part of the new commit will retain their previously
1327 97a02382 2023-07-10 thomas recorded base commit.
1328 97a02382 2023-07-10 thomas Some
1329 97a02382 2023-07-10 thomas .Nm
1330 97a02382 2023-07-10 thomas commands may refuse to run while the work tree contains files from
1331 97a02382 2023-07-10 thomas multiple base commits.
1332 97a02382 2023-07-10 thomas The base commit of such a work tree can be made consistent by running
1333 97a02382 2023-07-10 thomas .Cm got update
1334 97a02382 2023-07-10 thomas across the entire work tree.
1335 97a02382 2023-07-10 thomas .Pp
1336 97a02382 2023-07-10 thomas The
1337 97a02382 2023-07-10 thomas .Cm got commit
1338 97a02382 2023-07-10 thomas command requires the
1339 97a02382 2023-07-10 thomas .Ev GOT_AUTHOR
1340 97a02382 2023-07-10 thomas environment variable to be set,
1341 97a02382 2023-07-10 thomas unless an author has been configured in
1342 97a02382 2023-07-10 thomas .Xr got.conf 5
1343 97a02382 2023-07-10 thomas or Git's
1344 97a02382 2023-07-10 thomas .Dv user.name
1345 97a02382 2023-07-10 thomas and
1346 97a02382 2023-07-10 thomas .Dv user.email
1347 97a02382 2023-07-10 thomas configuration settings can be
1348 97a02382 2023-07-10 thomas obtained from the repository's
1349 97a02382 2023-07-10 thomas .Pa .git/config
1350 97a02382 2023-07-10 thomas file or from Git's global
1351 97a02382 2023-07-10 thomas .Pa ~/.gitconfig
1352 97a02382 2023-07-10 thomas configuration file.
1353 97a02382 2023-07-10 thomas .Pp
1354 97a02382 2023-07-10 thomas The options for
1355 97a02382 2023-07-10 thomas .Cm got commit
1356 97a02382 2023-07-10 thomas are as follows:
1357 97a02382 2023-07-10 thomas .Bl -tag -width Ds
1358 97a02382 2023-07-10 thomas .It Fl A Ar author
1359 97a02382 2023-07-10 thomas Set author information in the newly created commit to
1360 97a02382 2023-07-10 thomas .Ar author .
1361 97a02382 2023-07-10 thomas This is useful when committing changes on behalf of someone else.
1362 97a02382 2023-07-10 thomas The
1363 97a02382 2023-07-10 thomas .Ar author
1364 97a02382 2023-07-10 thomas argument must use the same format as the
1365 97a02382 2023-07-10 thomas .Ev GOT_AUTHOR
1366 97a02382 2023-07-10 thomas environment variable.
1367 97a02382 2023-07-10 thomas .Pp
1368 97a02382 2023-07-10 thomas In addition to storing author information, the newly created commit
1369 97a02382 2023-07-10 thomas object will retain
1370 97a02382 2023-07-10 thomas .Dq committer
1371 97a02382 2023-07-10 thomas information which is obtained, as usual, from the
1372 97a02382 2023-07-10 thomas .Ev GOT_AUTHOR
1373 97a02382 2023-07-10 thomas environment variable, or
1374 97a02382 2023-07-10 thomas .Xr got.conf 5 ,
1375 97a02382 2023-07-10 thomas or Git configuration settings.
1376 97a02382 2023-07-10 thomas .It Fl C
1377 97a02382 2023-07-10 thomas Allow committing files in conflicted status.
1378 97a02382 2023-07-10 thomas .Pp
1379 97a02382 2023-07-10 thomas Committing files with conflict markers should generally be avoided.
1380 97a02382 2023-07-10 thomas Cases where conflict markers must be stored in the repository for
1381 97a02382 2023-07-10 thomas some legitimate reason should be very rare.
1382 97a02382 2023-07-10 thomas There are usually ways to avoid storing conflict markers verbatim by
1383 97a02382 2023-07-10 thomas applying appropriate programming tricks.
1384 97a02382 2023-07-10 thomas .It Fl F Ar path
1385 97a02382 2023-07-10 thomas Use the prepared log message stored in the file found at
1386 97a02382 2023-07-10 thomas .Ar path
1387 97a02382 2023-07-10 thomas when creating the new commit.
1388 97a02382 2023-07-10 thomas .Cm got commit
1389 97a02382 2023-07-10 thomas opens a temporary file in an editor where the prepared log message can be
1390 97a02382 2023-07-10 thomas reviewed and edited further if needed.
1391 97a02382 2023-07-10 thomas Cannot be used together with the
1392 97a02382 2023-07-10 thomas .Fl m
1393 97a02382 2023-07-10 thomas option.
1394 97a02382 2023-07-10 thomas .It Fl m Ar message
1395 97a02382 2023-07-10 thomas Use the specified log message when creating the new commit.
1396 97a02382 2023-07-10 thomas Cannot be used together with the
1397 97a02382 2023-07-10 thomas .Fl F
1398 97a02382 2023-07-10 thomas option.
1399 97a02382 2023-07-10 thomas .It Fl N
1400 97a02382 2023-07-10 thomas This option prevents
1401 97a02382 2023-07-10 thomas .Cm got commit
1402 97a02382 2023-07-10 thomas from opening the commit message in an editor.
1403 97a02382 2023-07-10 thomas It has no effect unless it is used together with the
1404 97a02382 2023-07-10 thomas .Fl F
1405 97a02382 2023-07-10 thomas option and is intended for non-interactive use such as scripting.
1406 97a02382 2023-07-10 thomas .It Fl n
1407 97a02382 2023-07-10 thomas This option prevents
1408 97a02382 2023-07-10 thomas .Cm got commit
1409 97a02382 2023-07-10 thomas from generating a diff of the to-be-committed changes in a temporary file
1410 97a02382 2023-07-10 thomas which can be viewed while editing a commit message.
1411 97a02382 2023-07-10 thomas .It Fl S
1412 97a02382 2023-07-10 thomas Allow the addition of symbolic links which point outside of the path space
1413 97a02382 2023-07-10 thomas that is under version control.
1414 97a02382 2023-07-10 thomas By default,
1415 97a02382 2023-07-10 thomas .Cm got commit
1416 97a02382 2023-07-10 thomas will reject such symbolic links due to safety concerns.
1417 97a02382 2023-07-10 thomas As a precaution,
1418 97a02382 2023-07-10 thomas .Nm
1419 97a02382 2023-07-10 thomas may decide to represent such a symbolic link as a regular file which contains
1420 97a02382 2023-07-10 thomas the link's target path, rather than creating an actual symbolic link which
1421 97a02382 2023-07-10 thomas points outside of the work tree.
1422 97a02382 2023-07-10 thomas Use of this option is discouraged because external mechanisms such as
1423 97a02382 2023-07-10 thomas .Dq make obj
1424 97a02382 2023-07-10 thomas are better suited for managing symbolic links to paths not under
1425 97a02382 2023-07-10 thomas version control.
1426 97a02382 2023-07-10 thomas .El
1427 97a02382 2023-07-10 thomas .Pp
1428 97a02382 2023-07-10 thomas .Cm got commit
1429 97a02382 2023-07-10 thomas will refuse to run if certain preconditions are not met.
1430 97a02382 2023-07-10 thomas If the work tree's current branch is not in the
1431 97a02382 2023-07-10 thomas .Dq refs/heads/
1432 97a02382 2023-07-10 thomas reference namespace, new commits may not be created on this branch.
1433 97a02382 2023-07-10 thomas Local changes may only be committed if they are based on file content
1434 97a02382 2023-07-10 thomas found in the most recent commit on the work tree's branch.
1435 97a02382 2023-07-10 thomas If a path is found to be out of date,
1436 97a02382 2023-07-10 thomas .Cm got update
1437 97a02382 2023-07-10 thomas must be used first in order to merge local changes with changes made
1438 97a02382 2023-07-10 thomas in the repository.
1439 97a02382 2023-07-10 thomas .Tg cy
1440 97a02382 2023-07-10 thomas .It Xo
1441 97a02382 2023-07-10 thomas .Cm cherrypick
1442 97a02382 2023-07-10 thomas .Op Fl lX
1443 97a02382 2023-07-10 thomas .Op Ar commit
1444 97a02382 2023-07-10 thomas .Xc
1445 97a02382 2023-07-10 thomas .Dl Pq alias: Cm cy
1446 97a02382 2023-07-10 thomas Merge changes from a single
1447 97a02382 2023-07-10 thomas .Ar commit
1448 97a02382 2023-07-10 thomas into the work tree.
1449 97a02382 2023-07-10 thomas The specified
1450 97a02382 2023-07-10 thomas .Ar commit
1451 97a02382 2023-07-10 thomas should be on a different branch than the work tree's base commit.
1452 97a02382 2023-07-10 thomas The expected argument is a reference or a commit ID SHA1 hash.
1453 97a02382 2023-07-10 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
1454 97a02382 2023-07-10 thomas automatically, provided the abbreviation is unique.
1455 97a02382 2023-07-10 thomas .Pp
1456 97a02382 2023-07-10 thomas Show the status of each affected file, using the following status codes:
1457 97a02382 2023-07-10 thomas .Bl -column YXZ description
1458 97a02382 2023-07-10 thomas .It G Ta file was merged
1459 97a02382 2023-07-10 thomas .It C Ta file was merged and conflicts occurred during merge
1460 97a02382 2023-07-10 thomas .It ! Ta changes destined for a missing file were not merged
1461 97a02382 2023-07-10 thomas .It D Ta file was deleted
1462 97a02382 2023-07-10 thomas .It d Ta file's deletion was prevented by local modifications
1463 97a02382 2023-07-10 thomas .It A Ta new file was added
1464 97a02382 2023-07-10 thomas .It \(a~ Ta changes destined for a non-regular file were not merged
1465 97a02382 2023-07-10 thomas .It ? Ta changes destined for an unversioned file were not merged
1466 97a02382 2023-07-10 thomas .El
1467 97a02382 2023-07-10 thomas .Pp
1468 97a02382 2023-07-10 thomas The merged changes will appear as local changes in the work tree, which
1469 97a02382 2023-07-10 thomas may be viewed with
1470 97a02382 2023-07-10 thomas .Cm got diff ,
1471 97a02382 2023-07-10 thomas amended manually or with further
1472 97a02382 2023-07-10 thomas .Cm got cherrypick
1473 97a02382 2023-07-10 thomas commands,
1474 97a02382 2023-07-10 thomas committed with
1475 97a02382 2023-07-10 thomas .Cm got commit .
1476 97a02382 2023-07-10 thomas .Pp
1477 97a02382 2023-07-10 thomas If invoked in a work tree where no
1478 97a02382 2023-07-10 thomas .Cm rebase ,
1479 97a02382 2023-07-10 thomas .Cm histedit ,
1480 97a02382 2023-07-10 thomas or
1481 97a02382 2023-07-10 thomas .Cm merge
1482 97a02382 2023-07-10 thomas operation is taking place,
1483 97a02382 2023-07-10 thomas .Cm got cherrypick
1484 97a02382 2023-07-10 thomas creates a record of commits which have been merged into the work tree.
1485 97a02382 2023-07-10 thomas When a file changed by
1486 97a02382 2023-07-10 thomas .Cm got cherrypick
1487 97a02382 2023-07-10 thomas is committed with
1488 97a02382 2023-07-10 thomas .Cm got commit ,
1489 97a02382 2023-07-10 thomas the log messages of relevant merged commits will then appear in the editor,
1490 97a02382 2023-07-10 thomas where the messages should be further adjusted to convey the reasons for
1491 97a02382 2023-07-10 thomas cherrypicking the changes.
1492 97a02382 2023-07-10 thomas Upon exiting the editor, if the time stamp of the log message file
1493 97a02382 2023-07-10 thomas is unchanged or the log message is empty,
1494 97a02382 2023-07-10 thomas .Cm got commit
1495 97a02382 2023-07-10 thomas will fail with an unmodified or empty log message error.
1496 97a02382 2023-07-10 thomas .Pp
1497 97a02382 2023-07-10 thomas If all the changes in all files touched by a given commit are discarded,
1498 97a02382 2023-07-10 thomas e.g. with
1499 97a02382 2023-07-10 thomas .Cm got revert ,
1500 97a02382 2023-07-10 thomas this commit's log message record will also disappear.
1501 97a02382 2023-07-10 thomas .Pp
1502 97a02382 2023-07-10 thomas .Cm got cherrypick
1503 97a02382 2023-07-10 thomas will refuse to run if certain preconditions are not met.
1504 97a02382 2023-07-10 thomas If the work tree contains multiple base commits, it must first be updated
1505 97a02382 2023-07-10 thomas to a single base commit with
1506 97a02382 2023-07-10 thomas .Cm got update .
1507 97a02382 2023-07-10 thomas If any relevant files already contain merge conflicts, these
1508 97a02382 2023-07-10 thomas conflicts must be resolved first.
1509 97a02382 2023-07-10 thomas .Pp
1510 97a02382 2023-07-10 thomas The options for
1511 97a02382 2023-07-10 thomas .Nm
1512 97a02382 2023-07-10 thomas .Cm cherrypick
1513 97a02382 2023-07-10 thomas are as follows:
1514 97a02382 2023-07-10 thomas .Bl -tag -width Ds
1515 97a02382 2023-07-10 thomas .It Fl l
1516 97a02382 2023-07-10 thomas Display a list of commit log messages recorded by cherrypick operations,
1517 97a02382 2023-07-10 thomas represented by references in the
1518 97a02382 2023-07-10 thomas .Dq refs/got/worktree
1519 97a02382 2023-07-10 thomas reference namespace.
1520 97a02382 2023-07-10 thomas If a
1521 97a02382 2023-07-10 thomas .Ar commit
1522 97a02382 2023-07-10 thomas is specified, only show the log message of the specified commit.
1523 97a02382 2023-07-10 thomas .Pp
1524 97a02382 2023-07-10 thomas If invoked in a work tree, only log messages recorded by cherrypick operations
1525 97a02382 2023-07-10 thomas in the current work tree will be displayed.
1526 97a02382 2023-07-10 thomas Otherwise, all commit log messages will be displayed irrespective of the
1527 97a02382 2023-07-10 thomas work tree in which they were created.
1528 97a02382 2023-07-10 thomas This option cannot be used with
1529 97a02382 2023-07-10 thomas .Fl X .
1530 97a02382 2023-07-10 thomas .It Fl X
1531 97a02382 2023-07-10 thomas Delete log messages created by previous cherrypick operations, represented by
1532 97a02382 2023-07-10 thomas references in the
1533 97a02382 2023-07-10 thomas .Dq refs/got/worktree
1534 97a02382 2023-07-10 thomas reference namespace.
1535 97a02382 2023-07-10 thomas If a
1536 97a02382 2023-07-10 thomas .Ar commit
1537 97a02382 2023-07-10 thomas is specified, only delete the log message of the specified commit.
1538 97a02382 2023-07-10 thomas .Pp
1539 97a02382 2023-07-10 thomas If invoked in a work tree, only log messages recorded by cherrypick operations
1540 97a02382 2023-07-10 thomas in the current work tree will be deleted.
1541 97a02382 2023-07-10 thomas Otherwise, all commit log messages will be deleted irrespective of the
1542 97a02382 2023-07-10 thomas work tree in which they were created.
1543 97a02382 2023-07-10 thomas This option cannot be used with
1544 97a02382 2023-07-10 thomas .Fl l .
1545 97a02382 2023-07-10 thomas .El
1546 97a02382 2023-07-10 thomas .Pp
1547 97a02382 2023-07-10 thomas .Tg bo
1548 97a02382 2023-07-10 thomas .It Xo
1549 97a02382 2023-07-10 thomas .Cm backout
1550 97a02382 2023-07-10 thomas .Op Fl lX
1551 97a02382 2023-07-10 thomas .Op Ar commit
1552 97a02382 2023-07-10 thomas .Xc
1553 97a02382 2023-07-10 thomas .Dl Pq alias: Cm bo
1554 97a02382 2023-07-10 thomas Reverse-merge changes from a single
1555 97a02382 2023-07-10 thomas .Ar commit
1556 97a02382 2023-07-10 thomas into the work tree.
1557 97a02382 2023-07-10 thomas The specified
1558 97a02382 2023-07-10 thomas .Ar commit
1559 97a02382 2023-07-10 thomas should be on the same branch as the work tree's base commit.
1560 97a02382 2023-07-10 thomas The expected argument is a reference or a commit ID SHA1 hash.
1561 97a02382 2023-07-10 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
1562 97a02382 2023-07-10 thomas automatically, provided the abbreviation is unique.
1563 97a02382 2023-07-10 thomas .Pp
1564 97a02382 2023-07-10 thomas Show the status of each affected file, using the following status codes:
1565 97a02382 2023-07-10 thomas .Bl -column YXZ description
1566 97a02382 2023-07-10 thomas .It G Ta file was merged
1567 97a02382 2023-07-10 thomas .It C Ta file was merged and conflicts occurred during merge
1568 97a02382 2023-07-10 thomas .It ! Ta changes destined for a missing file were not merged
1569 97a02382 2023-07-10 thomas .It D Ta file was deleted
1570 97a02382 2023-07-10 thomas .It d Ta file's deletion was prevented by local modifications
1571 97a02382 2023-07-10 thomas .It A Ta new file was added
1572 97a02382 2023-07-10 thomas .It \(a~ Ta changes destined for a non-regular file were not merged
1573 97a02382 2023-07-10 thomas .It ? Ta changes destined for an unversioned file were not merged
1574 97a02382 2023-07-10 thomas .El
1575 97a02382 2023-07-10 thomas .Pp
1576 97a02382 2023-07-10 thomas The reverse-merged changes will appear as local changes in the work tree,
1577 97a02382 2023-07-10 thomas which may be viewed with
1578 97a02382 2023-07-10 thomas .Cm got diff ,
1579 97a02382 2023-07-10 thomas amended manually or with further
1580 97a02382 2023-07-10 thomas .Cm got backout
1581 97a02382 2023-07-10 thomas commands,
1582 97a02382 2023-07-10 thomas committed with
1583 97a02382 2023-07-10 thomas .Cm got commit .
1584 97a02382 2023-07-10 thomas .Pp
1585 97a02382 2023-07-10 thomas If invoked in a work tree where no
1586 97a02382 2023-07-10 thomas .Cm rebase ,
1587 97a02382 2023-07-10 thomas .Cm histedit ,
1588 97a02382 2023-07-10 thomas or
1589 97a02382 2023-07-10 thomas .Cm merge
1590 97a02382 2023-07-10 thomas operation is taking place,
1591 97a02382 2023-07-10 thomas .Cm got backout
1592 97a02382 2023-07-10 thomas creates a record of commits which have been reverse-merged into the work tree.
1593 97a02382 2023-07-10 thomas When a file changed by
1594 97a02382 2023-07-10 thomas .Cm got backout
1595 97a02382 2023-07-10 thomas is committed with
1596 97a02382 2023-07-10 thomas .Cm got commit ,
1597 97a02382 2023-07-10 thomas the log messages of relevant reverse-merged commits will then appear in
1598 97a02382 2023-07-10 thomas the editor, where the messages should be further adjusted to convey the
1599 97a02382 2023-07-10 thomas reasons for backing out the changes.
1600 97a02382 2023-07-10 thomas Upon exiting the editor, if the time stamp of the log message file
1601 97a02382 2023-07-10 thomas is unchanged or the log message is empty,
1602 97a02382 2023-07-10 thomas .Cm got commit
1603 97a02382 2023-07-10 thomas will fail with an unmodified or empty log message error.
1604 97a02382 2023-07-10 thomas .Pp
1605 97a02382 2023-07-10 thomas If all the changes in all files touched by a given commit are discarded,
1606 97a02382 2023-07-10 thomas e.g. with
1607 97a02382 2023-07-10 thomas .Cm got revert ,
1608 97a02382 2023-07-10 thomas this commit's log message record will also disappear.
1609 97a02382 2023-07-10 thomas .Pp
1610 97a02382 2023-07-10 thomas .Cm got backout
1611 97a02382 2023-07-10 thomas will refuse to run if certain preconditions are not met.
1612 97a02382 2023-07-10 thomas If the work tree contains multiple base commits, it must first be updated
1613 97a02382 2023-07-10 thomas to a single base commit with
1614 97a02382 2023-07-10 thomas .Cm got update .
1615 97a02382 2023-07-10 thomas If any relevant files already contain merge conflicts, these
1616 97a02382 2023-07-10 thomas conflicts must be resolved first.
1617 97a02382 2023-07-10 thomas .Pp
1618 97a02382 2023-07-10 thomas The options for
1619 97a02382 2023-07-10 thomas .Nm
1620 97a02382 2023-07-10 thomas .Cm backout
1621 97a02382 2023-07-10 thomas are as follows:
1622 97a02382 2023-07-10 thomas .Bl -tag -width Ds
1623 97a02382 2023-07-10 thomas .It Fl l
1624 97a02382 2023-07-10 thomas Display a list of commit log messages recorded by backout operations,
1625 97a02382 2023-07-10 thomas represented by references in the
1626 97a02382 2023-07-10 thomas .Dq refs/got/worktree
1627 97a02382 2023-07-10 thomas reference namespace.
1628 97a02382 2023-07-10 thomas If a
1629 97a02382 2023-07-10 thomas .Ar commit
1630 97a02382 2023-07-10 thomas is specified, only show the log message of the specified commit.
1631 97a02382 2023-07-10 thomas .Pp
1632 97a02382 2023-07-10 thomas If invoked in a work tree, only log messages recorded by backout operations
1633 97a02382 2023-07-10 thomas in the current work tree will be displayed.
1634 97a02382 2023-07-10 thomas Otherwise, all commit log messages will be displayed irrespective of the
1635 97a02382 2023-07-10 thomas work tree in which they were created.
1636 97a02382 2023-07-10 thomas This option cannot be used with
1637 97a02382 2023-07-10 thomas .Fl X .
1638 97a02382 2023-07-10 thomas .It Fl X
1639 97a02382 2023-07-10 thomas Delete log messages created by previous backout operations, represented by
1640 97a02382 2023-07-10 thomas references in the
1641 97a02382 2023-07-10 thomas .Dq refs/got/worktree
1642 97a02382 2023-07-10 thomas reference namespace.
1643 97a02382 2023-07-10 thomas If a
1644 97a02382 2023-07-10 thomas .Ar commit
1645 97a02382 2023-07-10 thomas is specified, only delete the log message of the specified commit.
1646 97a02382 2023-07-10 thomas .Pp
1647 97a02382 2023-07-10 thomas If invoked in a work tree, only log messages recorded by backout operations
1648 97a02382 2023-07-10 thomas in the current work tree will be deleted.
1649 97a02382 2023-07-10 thomas Otherwise, all commit log messages will be deleted irrespective of the
1650 97a02382 2023-07-10 thomas work tree in which they were created.
1651 97a02382 2023-07-10 thomas This option cannot be used with
1652 97a02382 2023-07-10 thomas .Fl l .
1653 97a02382 2023-07-10 thomas .El
1654 97a02382 2023-07-10 thomas .It Xo
1655 97a02382 2023-07-10 thomas .Cm cat
1656 97a02382 2023-07-10 thomas .Op Fl P
1657 97a02382 2023-07-10 thomas .Op Fl c Ar commit
1658 97a02382 2023-07-10 thomas .Op Fl r Ar repository-path
1659 97a02382 2023-07-10 thomas .Ar arg ...
1660 97a02382 2023-07-10 thomas .Xc
1661 97a02382 2023-07-10 thomas Parse and print contents of objects to standard output in a line-based
1662 97a02382 2023-07-10 thomas text format.
1663 97a02382 2023-07-10 thomas Content of commit, tree, and tag objects is printed in a way similar
1664 97a02382 2023-07-10 thomas to the actual content stored in such objects.
1665 97a02382 2023-07-10 thomas Blob object contents are printed as they would appear in files on disk.
1666 97a02382 2023-07-10 thomas .Pp
1667 97a02382 2023-07-10 thomas Attempt to interpret each argument as a reference, a tag name, or
1668 97a02382 2023-07-10 thomas an object ID SHA1 hash.
1669 97a02382 2023-07-10 thomas References will be resolved to an object ID.
1670 97a02382 2023-07-10 thomas Tag names will resolved to a tag object.
1671 97a02382 2023-07-10 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
1672 97a02382 2023-07-10 thomas automatically, provided the abbreviation is unique.
1673 97a02382 2023-07-10 thomas .Pp
1674 97a02382 2023-07-10 thomas If none of the above interpretations produce a valid result, or if the
1675 97a02382 2023-07-10 thomas .Fl P
1676 97a02382 2023-07-10 thomas option is used, attempt to interpret the argument as a path which will
1677 97a02382 2023-07-10 thomas be resolved to the ID of an object found at this path in the repository.
1678 97a02382 2023-07-10 thomas .Pp
1679 97a02382 2023-07-10 thomas The options for
1680 97a02382 2023-07-10 thomas .Cm got cat
1681 97a02382 2023-07-10 thomas are as follows:
1682 97a02382 2023-07-10 thomas .Bl -tag -width Ds
1683 97a02382 2023-07-10 thomas .It Fl c Ar commit
1684 97a02382 2023-07-10 thomas Look up paths in the specified
1685 97a02382 2023-07-10 thomas .Ar commit .
1686 97a02382 2023-07-10 thomas If this option is not used, paths are looked up in the commit resolved
1687 97a02382 2023-07-10 thomas via the repository's HEAD reference.
1688 97a02382 2023-07-10 thomas The expected argument is a commit ID SHA1 hash or an existing reference
1689 97a02382 2023-07-10 thomas or tag name which will be resolved to a commit ID.
1690 97a02382 2023-07-10 thomas An abbreviated hash argument will be expanded to a full SHA1 hash
1691 97a02382 2023-07-10 thomas automatically, provided the abbreviation is unique.
1692 97a02382 2023-07-10 thomas .It Fl P
1693 97a02382 2023-07-10 thomas Interpret all arguments as paths only.
1694 97a02382 2023-07-10 thomas This option can be used to resolve ambiguity in cases where paths
1695 97a02382 2023-07-10 thomas look like tag names, reference names, or object IDs.
1696 97a02382 2023-07-10 thomas .It Fl r Ar repository-path
1697 97a02382 2023-07-10 thomas Use the repository at the specified path.
1698 97a02382 2023-07-10 thomas If not specified, assume the repository is located at or above the current
1699 97a02382 2023-07-10 thomas working directory.
1700 97a02382 2023-07-10 thomas If this directory is a
1701 97a02382 2023-07-10 thomas .Nm
1702 97a02382 2023-07-10 thomas work tree, use the repository path associated with this work tree.
1703 97a02382 2023-07-10 thomas .El
1704 97a02382 2023-07-10 thomas .It Cm info Op Ar path ...
1705 97a02382 2023-07-10 thomas Display meta-data stored in a work tree.
1706 97a02382 2023-07-10 thomas See
1707 97a02382 2023-07-10 thomas .Xr got-worktree 5
1708 97a02382 2023-07-10 thomas for details.
1709 97a02382 2023-07-10 thomas .Pp
1710 97a02382 2023-07-10 thomas The work tree to use is resolved implicitly by walking upwards from the
1711 97a02382 2023-07-10 thomas current working directory.
1712 97a02382 2023-07-10 thomas .Pp
1713 97a02382 2023-07-10 thomas If one or more
1714 97a02382 2023-07-10 thomas .Ar path
1715 97a02382 2023-07-10 thomas arguments are specified, show additional per-file information for tracked
1716 97a02382 2023-07-10 thomas files located at or within these paths.
1717 97a02382 2023-07-10 thomas If a
1718 97a02382 2023-07-10 thomas .Ar path
1719 97a02382 2023-07-10 thomas argument corresponds to the work tree's root directory, display information
1720 97a02382 2023-07-10 thomas for all tracked files.
1721 97a02382 2023-07-10 thomas .El
1722 97a02382 2023-07-10 thomas .Sh ENVIRONMENT
1723 97a02382 2023-07-10 thomas .Bl -tag -width GOT_IGNORE_GITCONFIG
1724 97a02382 2023-07-10 thomas .It Ev GOT_AUTHOR
1725 97a02382 2023-07-10 thomas The author's name and email address, such as
1726 97a02382 2023-07-10 thomas .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
1727 97a02382 2023-07-10 thomas Used by the
1728 97a02382 2023-07-10 thomas .Cm got commit ,
1729 97a02382 2023-07-10 thomas .Cm got import ,
1730 97a02382 2023-07-10 thomas .Cm got rebase ,
1731 97a02382 2023-07-10 thomas .Cm got merge ,
1732 97a02382 2023-07-10 thomas and
1733 97a02382 2023-07-10 thomas .Cm got histedit
1734 97a02382 2023-07-10 thomas commands.
1735 97a02382 2023-07-10 thomas Because
1736 97a02382 2023-07-10 thomas .Xr git 1
1737 97a02382 2023-07-10 thomas may fail to parse commits without an email address in author data,
1738 97a02382 2023-07-10 thomas .Nm
1739 97a02382 2023-07-10 thomas attempts to reject
1740 97a02382 2023-07-10 thomas .Ev GOT_AUTHOR
1741 97a02382 2023-07-10 thomas environment variables with a missing email address.
1742 97a02382 2023-07-10 thomas .Pp
1743 97a02382 2023-07-10 thomas .Ev GOT_AUTHOR will be overridden by configuration settings in
1744 97a02382 2023-07-10 thomas .Xr got.conf 5
1745 97a02382 2023-07-10 thomas or by Git's
1746 97a02382 2023-07-10 thomas .Dv user.name
1747 97a02382 2023-07-10 thomas and
1748 97a02382 2023-07-10 thomas .Dv user.email
1749 97a02382 2023-07-10 thomas configuration settings in the repository's
1750 97a02382 2023-07-10 thomas .Pa .git/config
1751 97a02382 2023-07-10 thomas file.
1752 97a02382 2023-07-10 thomas The
1753 97a02382 2023-07-10 thomas .Dv user.name
1754 97a02382 2023-07-10 thomas and
1755 97a02382 2023-07-10 thomas .Dv user.email
1756 97a02382 2023-07-10 thomas configuration settings contained in Git's global
1757 97a02382 2023-07-10 thomas .Pa ~/.gitconfig
1758 97a02382 2023-07-10 thomas configuration file will only be used if neither
1759 97a02382 2023-07-10 thomas .Xr got.conf 5
1760 97a02382 2023-07-10 thomas nor the
1761 97a02382 2023-07-10 thomas .Ev GOT_AUTHOR
1762 97a02382 2023-07-10 thomas environment variable provide author information.
1763 97a02382 2023-07-10 thomas .It Ev GOT_IGNORE_GITCONFIG
1764 97a02382 2023-07-10 thomas If this variable is set then any remote repository definitions or author
1765 97a02382 2023-07-10 thomas information found in Git configuration files will be ignored.
1766 97a02382 2023-07-10 thomas .It Ev GOT_LOG_DEFAULT_LIMIT
1767 97a02382 2023-07-10 thomas The default limit on the number of commits traversed by
1768 97a02382 2023-07-10 thomas .Cm got log .
1769 97a02382 2023-07-10 thomas If set to zero, the limit is unbounded.
1770 97a02382 2023-07-10 thomas This variable will be silently ignored if it is set to a non-numeric value.
1771 97a02382 2023-07-10 thomas .It Ev VISUAL , EDITOR
1772 97a02382 2023-07-10 thomas The editor spawned by
1773 97a02382 2023-07-10 thomas .Cm got commit ,
1774 97a02382 2023-07-10 thomas .Cm got histedit ,
1775 97a02382 2023-07-10 thomas .Cm got import ,
1776 97a02382 2023-07-10 thomas or
1777 97a02382 2023-07-10 thomas .Cm got tag .
1778 97a02382 2023-07-10 thomas If not set, the
1779 97a02382 2023-07-10 thomas .Xr vi 1
1780 97a02382 2023-07-10 thomas text editor will be spawned.
1781 97a02382 2023-07-10 thomas .El
1782 97a02382 2023-07-10 thomas .Sh FILES
1783 97a02382 2023-07-10 thomas .Bl -tag -width packed-refs -compact
1784 97a02382 2023-07-10 thomas .It Pa got.conf
1785 97a02382 2023-07-10 thomas Repository-wide configuration settings for
1786 97a02382 2023-07-10 thomas .Nm .
1787 97a02382 2023-07-10 thomas If present, a
1788 97a02382 2023-07-10 thomas .Xr got.conf 5
1789 97a02382 2023-07-10 thomas configuration file located in the root directory of a Git repository
1790 97a02382 2023-07-10 thomas supersedes any relevant settings in Git's
1791 97a02382 2023-07-10 thomas .Pa config
1792 97a02382 2023-07-10 thomas file.
1793 97a02382 2023-07-10 thomas .Pp
1794 ad10f64e 2023-07-19 thomas .It Pa .cvg/got.conf
1795 97a02382 2023-07-10 thomas Worktree-specific configuration settings for
1796 97a02382 2023-07-10 thomas .Nm .
1797 97a02382 2023-07-10 thomas If present, a
1798 97a02382 2023-07-10 thomas .Xr got.conf 5
1799 97a02382 2023-07-10 thomas configuration file in the
1800 ad10f64e 2023-07-19 thomas .Pa .cvg
1801 97a02382 2023-07-10 thomas meta-data directory of a work tree supersedes any relevant settings in
1802 97a02382 2023-07-10 thomas the repository's
1803 97a02382 2023-07-10 thomas .Xr got.conf 5
1804 97a02382 2023-07-10 thomas configuration file and Git's
1805 97a02382 2023-07-10 thomas .Pa config
1806 97a02382 2023-07-10 thomas file.
1807 97a02382 2023-07-10 thomas .El
1808 97a02382 2023-07-10 thomas .Sh EXIT STATUS
1809 97a02382 2023-07-10 thomas .Ex -std got
1810 97a02382 2023-07-10 thomas .Sh EXAMPLES
1811 97a02382 2023-07-10 thomas Enable tab-completion of
1812 97a02382 2023-07-10 thomas .Nm
1813 97a02382 2023-07-10 thomas command names in
1814 97a02382 2023-07-10 thomas .Xr ksh 1 :
1815 97a02382 2023-07-10 thomas .Pp
1816 97a02382 2023-07-10 thomas .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
1817 97a02382 2023-07-10 thomas .Pp
1818 97a02382 2023-07-10 thomas Clone an existing Git repository for use with
1819 97a02382 2023-07-10 thomas .Nm :
1820 97a02382 2023-07-10 thomas .Pp
1821 97a02382 2023-07-10 thomas .Dl $ cd /var/git/
1822 97a02382 2023-07-10 thomas .Dl $ got clone ssh://git@github.com/openbsd/src.git
1823 97a02382 2023-07-10 thomas .Pp
1824 97a02382 2023-07-10 thomas Unfortunately, many of the popular Git hosting sites do not offer anonymous
1825 97a02382 2023-07-10 thomas access via SSH.
1826 97a02382 2023-07-10 thomas Such sites will require an account to be created, and a public SSH key to be
1827 97a02382 2023-07-10 thomas uploaded to this account, before repository access via ssh:// URLs will work.
1828 97a02382 2023-07-10 thomas .Pp
1829 97a02382 2023-07-10 thomas Use of HTTP URLs currently requires
1830 97a02382 2023-07-10 thomas .Xr git 1 :
1831 97a02382 2023-07-10 thomas .Pp
1832 97a02382 2023-07-10 thomas .Dl $ cd /var/git/
1833 97a02382 2023-07-10 thomas .Dl $ git clone --bare https://github.com/openbsd/src.git
1834 97a02382 2023-07-10 thomas .Pp
1835 97a02382 2023-07-10 thomas Alternatively, for quick and dirty local testing of
1836 97a02382 2023-07-10 thomas .Nm
1837 97a02382 2023-07-10 thomas a new Git repository could be created and populated with files,
1838 97a02382 2023-07-10 thomas e.g. from a temporary CVS checkout located at
1839 97a02382 2023-07-10 thomas .Pa /tmp/src :
1840 97a02382 2023-07-10 thomas .Pp
1841 97a02382 2023-07-10 thomas .Dl $ gotadmin init /var/git/src.git
1842 97a02382 2023-07-10 thomas .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
1843 97a02382 2023-07-10 thomas .Pp
1844 97a02382 2023-07-10 thomas Check out a work tree from the Git repository to /usr/src:
1845 97a02382 2023-07-10 thomas .Pp
1846 97a02382 2023-07-10 thomas .Dl $ got checkout /var/git/src.git /usr/src
1847 97a02382 2023-07-10 thomas .Pp
1848 97a02382 2023-07-10 thomas View local changes in a work tree directory:
1849 97a02382 2023-07-10 thomas .Pp
1850 97a02382 2023-07-10 thomas .Dl $ got diff | less
1851 97a02382 2023-07-10 thomas .Pp
1852 97a02382 2023-07-10 thomas In a work tree, display files in a potentially problematic state:
1853 97a02382 2023-07-10 thomas .Pp
1854 97a02382 2023-07-10 thomas .Dl $ got status -s 'C!~?'
1855 97a02382 2023-07-10 thomas .Pp
1856 97a02382 2023-07-10 thomas Interactively revert selected local changes in a work tree directory:
1857 97a02382 2023-07-10 thomas .Pp
1858 97a02382 2023-07-10 thomas .Dl $ got revert -p -R\ .
1859 97a02382 2023-07-10 thomas .Pp
1860 97a02382 2023-07-10 thomas In a work tree or a git repository directory, list all branch references:
1861 97a02382 2023-07-10 thomas .Pp
1862 97a02382 2023-07-10 thomas .Dl $ got branch -l
1863 97a02382 2023-07-10 thomas .Pp
1864 97a02382 2023-07-10 thomas As above, but list the most recently modified branches only:
1865 97a02382 2023-07-10 thomas .Pp
1866 97a02382 2023-07-10 thomas .Dl $ got branch -lt | head
1867 97a02382 2023-07-10 thomas .Pp
1868 97a02382 2023-07-10 thomas In a work tree or a git repository directory, create a new branch called
1869 97a02382 2023-07-10 thomas .Dq unified-buffer-cache
1870 97a02382 2023-07-10 thomas which is forked off the
1871 97a02382 2023-07-10 thomas .Dq master
1872 97a02382 2023-07-10 thomas branch:
1873 97a02382 2023-07-10 thomas .Pp
1874 97a02382 2023-07-10 thomas .Dl $ got branch -c master unified-buffer-cache
1875 97a02382 2023-07-10 thomas .Pp
1876 97a02382 2023-07-10 thomas Switch an existing work tree to the branch
1877 97a02382 2023-07-10 thomas .Dq unified-buffer-cache .
1878 97a02382 2023-07-10 thomas Local changes in the work tree will be preserved and merged if necessary:
1879 97a02382 2023-07-10 thomas .Pp
1880 97a02382 2023-07-10 thomas .Dl $ got update -b unified-buffer-cache
1881 97a02382 2023-07-10 thomas .Pp
1882 97a02382 2023-07-10 thomas Create a new commit from local changes in a work tree directory.
1883 97a02382 2023-07-10 thomas This new commit will become the head commit of the work tree's current branch:
1884 97a02382 2023-07-10 thomas .Pp
1885 97a02382 2023-07-10 thomas .Dl $ got commit
1886 97a02382 2023-07-10 thomas .Pp
1887 97a02382 2023-07-10 thomas In a work tree or a git repository directory, view changes committed in
1888 97a02382 2023-07-10 thomas the 3 most recent commits to the work tree's branch, or the branch resolved
1889 97a02382 2023-07-10 thomas via the repository's HEAD reference, respectively:
1890 97a02382 2023-07-10 thomas .Pp
1891 97a02382 2023-07-10 thomas .Dl $ got log -p -l 3
1892 97a02382 2023-07-10 thomas .Pp
1893 97a02382 2023-07-10 thomas As above, but display changes in the order in which
1894 97a02382 2023-07-10 thomas .Xr patch 1
1895 97a02382 2023-07-10 thomas could apply them in sequence:
1896 97a02382 2023-07-10 thomas .Pp
1897 97a02382 2023-07-10 thomas .Dl $ got log -p -l 3 -R
1898 97a02382 2023-07-10 thomas .Pp
1899 97a02382 2023-07-10 thomas In a work tree or a git repository directory, log the history of a subdirectory:
1900 97a02382 2023-07-10 thomas .Pp
1901 97a02382 2023-07-10 thomas .Dl $ got log sys/uvm
1902 97a02382 2023-07-10 thomas .Pp
1903 97a02382 2023-07-10 thomas While operating inside a work tree, paths are specified relative to the current
1904 97a02382 2023-07-10 thomas working directory, so this command will log the subdirectory
1905 97a02382 2023-07-10 thomas .Pa sys/uvm :
1906 97a02382 2023-07-10 thomas .Pp
1907 97a02382 2023-07-10 thomas .Dl $ cd sys/uvm && got log\ .
1908 97a02382 2023-07-10 thomas .Pp
1909 97a02382 2023-07-10 thomas And this command has the same effect:
1910 97a02382 2023-07-10 thomas .Pp
1911 97a02382 2023-07-10 thomas .Dl $ cd sys/dev/usb && got log ../../uvm
1912 97a02382 2023-07-10 thomas .Pp
1913 97a02382 2023-07-10 thomas And this command displays work tree meta-data about all tracked files:
1914 97a02382 2023-07-10 thomas .Pp
1915 97a02382 2023-07-10 thomas .Dl $ cd /usr/src
1916 97a02382 2023-07-10 thomas .Dl $ got info\ . | less
1917 97a02382 2023-07-10 thomas .Pp
1918 97a02382 2023-07-10 thomas Add new files and remove obsolete files in a work tree directory:
1919 97a02382 2023-07-10 thomas .Pp
1920 97a02382 2023-07-10 thomas .Dl $ got add sys/uvm/uvm_ubc.c
1921 97a02382 2023-07-10 thomas .Dl $ got remove sys/uvm/uvm_vnode.c
1922 97a02382 2023-07-10 thomas .Pp
1923 97a02382 2023-07-10 thomas Create a new commit from local changes in a work tree directory
1924 97a02382 2023-07-10 thomas with a pre-defined log message.
1925 97a02382 2023-07-10 thomas .Pp
1926 97a02382 2023-07-10 thomas .Dl $ got commit -m 'unify the buffer cache'
1927 97a02382 2023-07-10 thomas .Pp
1928 97a02382 2023-07-10 thomas Alternatively, create a new commit from local changes in a work tree
1929 97a02382 2023-07-10 thomas directory with a log message that has been prepared in the file
1930 97a02382 2023-07-10 thomas .Pa /tmp/msg :
1931 97a02382 2023-07-10 thomas .Pp
1932 97a02382 2023-07-10 thomas .Dl $ got commit -F /tmp/msg
1933 97a02382 2023-07-10 thomas .Pp
1934 97a02382 2023-07-10 thomas Update any work tree checked out from the
1935 97a02382 2023-07-10 thomas .Dq unified-buffer-cache
1936 97a02382 2023-07-10 thomas branch to the latest commit on this branch:
1937 97a02382 2023-07-10 thomas .Pp
1938 97a02382 2023-07-10 thomas .Dl $ got update
1939 97a02382 2023-07-10 thomas .Pp
1940 97a02382 2023-07-10 thomas Roll file content on the unified-buffer-cache branch back by one commit,
1941 97a02382 2023-07-10 thomas and then fetch the rolled-back change into the work tree as a local change
1942 97a02382 2023-07-10 thomas to be amended and perhaps committed again:
1943 97a02382 2023-07-10 thomas .Pp
1944 97a02382 2023-07-10 thomas .Dl $ got backout unified-buffer-cache
1945 97a02382 2023-07-10 thomas .Dl $ got commit -m 'roll back previous'
1946 97a02382 2023-07-10 thomas .Dl $ # now back out the previous backout :-)
1947 97a02382 2023-07-10 thomas .Dl $ got backout unified-buffer-cache
1948 97a02382 2023-07-10 thomas .Pp
1949 97a02382 2023-07-10 thomas Fetch new changes on the remote repository's
1950 97a02382 2023-07-10 thomas .Dq master
1951 97a02382 2023-07-10 thomas branch, making them visible on the local repository's
1952 97a02382 2023-07-10 thomas .Dq origin/master
1953 97a02382 2023-07-10 thomas branch:
1954 97a02382 2023-07-10 thomas .Pp
1955 97a02382 2023-07-10 thomas .Dl $ cd /usr/src
1956 97a02382 2023-07-10 thomas .Dl $ got fetch
1957 97a02382 2023-07-10 thomas .Pp
1958 97a02382 2023-07-10 thomas In a repository created with a HTTP URL and
1959 97a02382 2023-07-10 thomas .Cm git clone --bare
1960 97a02382 2023-07-10 thomas the
1961 97a02382 2023-07-10 thomas .Xr git-fetch 1
1962 97a02382 2023-07-10 thomas command must be used instead:
1963 97a02382 2023-07-10 thomas .Pp
1964 97a02382 2023-07-10 thomas .Dl $ cd /var/git/src.git
1965 97a02382 2023-07-10 thomas .Dl $ git fetch origin master:refs/remotes/origin/master
1966 97a02382 2023-07-10 thomas .Pp
1967 97a02382 2023-07-10 thomas Rebase the local
1968 97a02382 2023-07-10 thomas .Dq master
1969 97a02382 2023-07-10 thomas branch to merge the new changes that are now visible on the
1970 97a02382 2023-07-10 thomas .Dq origin/master
1971 97a02382 2023-07-10 thomas branch:
1972 97a02382 2023-07-10 thomas .Pp
1973 97a02382 2023-07-10 thomas .Dl $ cd /usr/src
1974 97a02382 2023-07-10 thomas .Dl $ got update -b origin/master
1975 97a02382 2023-07-10 thomas .Dl $ got rebase master
1976 97a02382 2023-07-10 thomas .Pp
1977 97a02382 2023-07-10 thomas Rebase the
1978 97a02382 2023-07-10 thomas .Dq unified-buffer-cache
1979 97a02382 2023-07-10 thomas branch on top of the new head commit of the
1980 97a02382 2023-07-10 thomas .Dq master
1981 97a02382 2023-07-10 thomas branch.
1982 97a02382 2023-07-10 thomas .Pp
1983 97a02382 2023-07-10 thomas .Dl $ got update -b master
1984 97a02382 2023-07-10 thomas .Dl $ got rebase unified-buffer-cache
1985 97a02382 2023-07-10 thomas .Pp
1986 97a02382 2023-07-10 thomas Create a patch from all changes on the unified-buffer-cache branch.
1987 97a02382 2023-07-10 thomas The patch can be mailed out for review and applied to
1988 97a02382 2023-07-10 thomas .Ox Ns 's
1989 97a02382 2023-07-10 thomas CVS tree:
1990 97a02382 2023-07-10 thomas .Pp
1991 97a02382 2023-07-10 thomas .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
1992 97a02382 2023-07-10 thomas .Pp
1993 97a02382 2023-07-10 thomas Edit the entire commit history of the
1994 97a02382 2023-07-10 thomas .Dq unified-buffer-cache
1995 97a02382 2023-07-10 thomas branch:
1996 97a02382 2023-07-10 thomas .Pp
1997 97a02382 2023-07-10 thomas .Dl $ got update -b unified-buffer-cache
1998 97a02382 2023-07-10 thomas .Dl $ got update -c master
1999 97a02382 2023-07-10 thomas .Dl $ got histedit
2000 97a02382 2023-07-10 thomas .Pp
2001 97a02382 2023-07-10 thomas Before working against existing branches in a repository cloned with
2002 97a02382 2023-07-10 thomas .Cm git clone --bare
2003 97a02382 2023-07-10 thomas instead of
2004 97a02382 2023-07-10 thomas .Cm got clone ,
2005 97a02382 2023-07-10 thomas a Git
2006 97a02382 2023-07-10 thomas .Dq refspec
2007 97a02382 2023-07-10 thomas must be configured to map all references in the remote repository
2008 97a02382 2023-07-10 thomas into the
2009 97a02382 2023-07-10 thomas .Dq refs/remotes
2010 97a02382 2023-07-10 thomas namespace of the local repository.
2011 97a02382 2023-07-10 thomas This can be achieved by setting Git's
2012 97a02382 2023-07-10 thomas .Pa remote.origin.fetch
2013 97a02382 2023-07-10 thomas configuration variable to the value
2014 97a02382 2023-07-10 thomas .Dq +refs/heads/*:refs/remotes/origin/*
2015 97a02382 2023-07-10 thomas with the
2016 97a02382 2023-07-10 thomas .Cm git config
2017 97a02382 2023-07-10 thomas command:
2018 97a02382 2023-07-10 thomas .Pp
2019 97a02382 2023-07-10 thomas .Dl $ cd /var/git/repo
2020 97a02382 2023-07-10 thomas .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2021 97a02382 2023-07-10 thomas .Pp
2022 97a02382 2023-07-10 thomas Additionally, the
2023 97a02382 2023-07-10 thomas .Dq mirror
2024 97a02382 2023-07-10 thomas option must be disabled:
2025 97a02382 2023-07-10 thomas .Pp
2026 97a02382 2023-07-10 thomas .Dl $ cd /var/git/repo
2027 97a02382 2023-07-10 thomas .Dl $ git config remote.origin.mirror false
2028 97a02382 2023-07-10 thomas .Pp
2029 97a02382 2023-07-10 thomas Alternatively, the following
2030 97a02382 2023-07-10 thomas .Xr git-fetch 1
2031 97a02382 2023-07-10 thomas configuration item can be added manually to the Git repository's
2032 97a02382 2023-07-10 thomas .Pa config
2033 97a02382 2023-07-10 thomas file:
2034 97a02382 2023-07-10 thomas .Pp
2035 97a02382 2023-07-10 thomas .Dl [remote \&"origin\&"]
2036 97a02382 2023-07-10 thomas .Dl url = ...
2037 97a02382 2023-07-10 thomas .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2038 97a02382 2023-07-10 thomas .Dl mirror = false
2039 97a02382 2023-07-10 thomas .Pp
2040 97a02382 2023-07-10 thomas This configuration leaves the local repository's
2041 97a02382 2023-07-10 thomas .Dq refs/heads
2042 97a02382 2023-07-10 thomas namespace free for use by local branches checked out with
2043 97a02382 2023-07-10 thomas .Cm got checkout
2044 97a02382 2023-07-10 thomas and, if needed, created with
2045 97a02382 2023-07-10 thomas .Cm got branch .
2046 97a02382 2023-07-10 thomas Branches in the
2047 97a02382 2023-07-10 thomas .Dq refs/remotes/origin
2048 97a02382 2023-07-10 thomas namespace can now be updated with incoming changes from the remote
2049 97a02382 2023-07-10 thomas repository with
2050 97a02382 2023-07-10 thomas .Cm got fetch
2051 97a02382 2023-07-10 thomas or
2052 97a02382 2023-07-10 thomas .Xr git-fetch 1
2053 97a02382 2023-07-10 thomas without extra command line arguments.
2054 97a02382 2023-07-10 thomas Newly fetched changes can be examined with
2055 97a02382 2023-07-10 thomas .Cm got log .
2056 97a02382 2023-07-10 thomas .Pp
2057 97a02382 2023-07-10 thomas Display changes on the remote repository's version of the
2058 97a02382 2023-07-10 thomas .Dq master
2059 97a02382 2023-07-10 thomas branch, as of the last time
2060 97a02382 2023-07-10 thomas .Cm got fetch
2061 97a02382 2023-07-10 thomas was run:
2062 97a02382 2023-07-10 thomas .Pp
2063 97a02382 2023-07-10 thomas .Dl $ got log -c origin/master | less
2064 97a02382 2023-07-10 thomas .Pp
2065 97a02382 2023-07-10 thomas As shown here, most commands accept abbreviated reference names such as
2066 97a02382 2023-07-10 thomas .Dq origin/master
2067 97a02382 2023-07-10 thomas instead of
2068 97a02382 2023-07-10 thomas .Dq refs/remotes/origin/master .
2069 97a02382 2023-07-10 thomas The latter is only needed in case of ambiguity.
2070 97a02382 2023-07-10 thomas .Pp
2071 97a02382 2023-07-10 thomas .Cm got rebase
2072 97a02382 2023-07-10 thomas can be used to merge changes which are visible on the
2073 97a02382 2023-07-10 thomas .Dq origin/master
2074 97a02382 2023-07-10 thomas branch into the
2075 97a02382 2023-07-10 thomas .Dq master
2076 97a02382 2023-07-10 thomas branch.
2077 97a02382 2023-07-10 thomas This will also merge local changes, if any, with the incoming changes:
2078 97a02382 2023-07-10 thomas .Pp
2079 97a02382 2023-07-10 thomas .Dl $ got update -b origin/master
2080 97a02382 2023-07-10 thomas .Dl $ got rebase master
2081 97a02382 2023-07-10 thomas .Pp
2082 97a02382 2023-07-10 thomas In order to make changes committed to the
2083 97a02382 2023-07-10 thomas .Dq unified-buffer-cache
2084 97a02382 2023-07-10 thomas visible on the
2085 97a02382 2023-07-10 thomas .Dq master
2086 97a02382 2023-07-10 thomas branch, the
2087 97a02382 2023-07-10 thomas .Dq unified-buffer-cache
2088 97a02382 2023-07-10 thomas branch can be rebased onto the
2089 97a02382 2023-07-10 thomas .Dq master
2090 97a02382 2023-07-10 thomas branch:
2091 97a02382 2023-07-10 thomas .Pp
2092 97a02382 2023-07-10 thomas .Dl $ got update -b master
2093 97a02382 2023-07-10 thomas .Dl $ got rebase unified-buffer-cache
2094 97a02382 2023-07-10 thomas .Pp
2095 97a02382 2023-07-10 thomas Changes on the
2096 97a02382 2023-07-10 thomas .Dq unified-buffer-cache
2097 97a02382 2023-07-10 thomas branch can now be made visible on the
2098 97a02382 2023-07-10 thomas .Dq master
2099 97a02382 2023-07-10 thomas branch with
2100 97a02382 2023-07-10 thomas .Cm got integrate .
2101 97a02382 2023-07-10 thomas Because the rebase operation switched the work tree to the
2102 97a02382 2023-07-10 thomas .Dq unified-buffer-cache
2103 97a02382 2023-07-10 thomas branch, the work tree must be switched back to the
2104 97a02382 2023-07-10 thomas .Dq master
2105 97a02382 2023-07-10 thomas branch first:
2106 97a02382 2023-07-10 thomas .Pp
2107 97a02382 2023-07-10 thomas .Dl $ got update -b master
2108 97a02382 2023-07-10 thomas .Dl $ got integrate unified-buffer-cache
2109 97a02382 2023-07-10 thomas .Pp
2110 97a02382 2023-07-10 thomas On the
2111 97a02382 2023-07-10 thomas .Dq master
2112 97a02382 2023-07-10 thomas branch, log messages for local changes can now be amended with
2113 97a02382 2023-07-10 thomas .Dq OK
2114 97a02382 2023-07-10 thomas by other developers and any other important new information:
2115 97a02382 2023-07-10 thomas .Pp
2116 97a02382 2023-07-10 thomas .Dl $ got update -c origin/master
2117 97a02382 2023-07-10 thomas .Dl $ got histedit -m
2118 97a02382 2023-07-10 thomas .Pp
2119 97a02382 2023-07-10 thomas If the remote repository offers write access, local changes on the
2120 97a02382 2023-07-10 thomas .Dq master
2121 97a02382 2023-07-10 thomas branch can be sent to the remote repository with
2122 97a02382 2023-07-10 thomas .Cm got send .
2123 97a02382 2023-07-10 thomas Usually,
2124 97a02382 2023-07-10 thomas .Cm got send
2125 97a02382 2023-07-10 thomas can be run without further arguments.
2126 97a02382 2023-07-10 thomas The arguments shown here match defaults, provided the work tree's
2127 97a02382 2023-07-10 thomas current branch is the
2128 97a02382 2023-07-10 thomas .Dq master
2129 97a02382 2023-07-10 thomas branch:
2130 97a02382 2023-07-10 thomas .Pp
2131 97a02382 2023-07-10 thomas .Dl $ got send -b master origin
2132 97a02382 2023-07-10 thomas .Pp
2133 97a02382 2023-07-10 thomas If the remote repository requires the HTTPS protocol, the
2134 97a02382 2023-07-10 thomas .Xr git-push 1
2135 97a02382 2023-07-10 thomas command must be used instead:
2136 97a02382 2023-07-10 thomas .Pp
2137 97a02382 2023-07-10 thomas .Dl $ cd /var/git/src.git
2138 97a02382 2023-07-10 thomas .Dl $ git push origin master
2139 97a02382 2023-07-10 thomas .Pp
2140 97a02382 2023-07-10 thomas When making contributions to projects which use the
2141 97a02382 2023-07-10 thomas .Dq pull request
2142 97a02382 2023-07-10 thomas workflow, SSH protocol repository access needs to be set up first.
2143 97a02382 2023-07-10 thomas Once an account has been created on a Git hosting site it should
2144 97a02382 2023-07-10 thomas be possible to upload a public SSH key for repository access
2145 97a02382 2023-07-10 thomas authentication.
2146 97a02382 2023-07-10 thomas .Pp
2147 97a02382 2023-07-10 thomas The
2148 97a02382 2023-07-10 thomas .Dq pull request
2149 97a02382 2023-07-10 thomas workflow will usually involve two remote repositories.
2150 97a02382 2023-07-10 thomas In the real-life example below, the
2151 97a02382 2023-07-10 thomas .Dq origin
2152 97a02382 2023-07-10 thomas repository was forked from the
2153 97a02382 2023-07-10 thomas .Dq upstream
2154 97a02382 2023-07-10 thomas repository by using the Git hosting site's web interface.
2155 97a02382 2023-07-10 thomas The
2156 97a02382 2023-07-10 thomas .Xr got.conf 5
2157 97a02382 2023-07-10 thomas file in the local repository describes both remote repositories:
2158 97a02382 2023-07-10 thomas .Bd -literal -offset indent
2159 97a02382 2023-07-10 thomas # Jelmers's repository, which accepts pull requests
2160 97a02382 2023-07-10 thomas remote "upstream" {
2161 97a02382 2023-07-10 thomas server git@github.com
2162 97a02382 2023-07-10 thomas protocol ssh
2163 97a02382 2023-07-10 thomas repository "/jelmer/dulwich"
2164 97a02382 2023-07-10 thomas branch { "master" }
2165 97a02382 2023-07-10 thomas }
2166 97a02382 2023-07-10 thomas
2167 97a02382 2023-07-10 thomas # Stefan's fork, used as the default remote repository
2168 97a02382 2023-07-10 thomas remote "origin" {
2169 97a02382 2023-07-10 thomas server git@github.com
2170 97a02382 2023-07-10 thomas protocol ssh
2171 97a02382 2023-07-10 thomas repository "/stspdotname/dulwich"
2172 97a02382 2023-07-10 thomas branch { "master" }
2173 97a02382 2023-07-10 thomas }
2174 97a02382 2023-07-10 thomas .Ed
2175 97a02382 2023-07-10 thomas .Pp
2176 97a02382 2023-07-10 thomas With this configuration, Stefan can create commits on
2177 97a02382 2023-07-10 thomas .Dq refs/heads/master
2178 97a02382 2023-07-10 thomas and send them to the
2179 97a02382 2023-07-10 thomas .Dq origin
2180 97a02382 2023-07-10 thomas repository by running:
2181 97a02382 2023-07-10 thomas .Pp
2182 97a02382 2023-07-10 thomas .Dl $ got send -b master origin
2183 97a02382 2023-07-10 thomas .Pp
2184 97a02382 2023-07-10 thomas The changes can now be proposed to Jelmer by opening a pull request
2185 97a02382 2023-07-10 thomas via the Git hosting site's web interface.
2186 97a02382 2023-07-10 thomas If Jelmer requests further changes to be made, additional commits
2187 97a02382 2023-07-10 thomas can be created on the
2188 97a02382 2023-07-10 thomas .Dq master
2189 97a02382 2023-07-10 thomas branch and be added to the pull request by running
2190 97a02382 2023-07-10 thomas .Cd got send
2191 97a02382 2023-07-10 thomas again.
2192 97a02382 2023-07-10 thomas .Pp
2193 97a02382 2023-07-10 thomas If Jelmer prefers additional commits to be
2194 97a02382 2023-07-10 thomas .Dq squashed
2195 97a02382 2023-07-10 thomas then the following commands can be used to achieve this:
2196 97a02382 2023-07-10 thomas .Pp
2197 97a02382 2023-07-10 thomas .Dl $ got update -b master
2198 97a02382 2023-07-10 thomas .Dl $ got update -c origin/master
2199 97a02382 2023-07-10 thomas .Dl $ got histedit -f
2200 97a02382 2023-07-10 thomas .Dl $ got send -f -b master origin
2201 97a02382 2023-07-10 thomas .Pp
2202 97a02382 2023-07-10 thomas In addition to reviewing the pull request in the web user interface,
2203 97a02382 2023-07-10 thomas Jelmer can fetch the pull request's branch into his local repository
2204 97a02382 2023-07-10 thomas and create a local branch which contains the proposed changes:
2205 97a02382 2023-07-10 thomas .Pp
2206 97a02382 2023-07-10 thomas .Dl $ got fetch -R refs/pull/1046/head origin
2207 97a02382 2023-07-10 thomas .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
2208 97a02382 2023-07-10 thomas .Pp
2209 97a02382 2023-07-10 thomas Once Jelmer has accepted the pull request, Stefan can fetch the
2210 97a02382 2023-07-10 thomas merged changes, and possibly several other new changes, by running:
2211 97a02382 2023-07-10 thomas .Pp
2212 97a02382 2023-07-10 thomas .Dl $ got fetch upstream
2213 97a02382 2023-07-10 thomas .Pp
2214 97a02382 2023-07-10 thomas The merged changes will now be visible under the reference
2215 97a02382 2023-07-10 thomas .Dq refs/remotes/upstream/master .
2216 97a02382 2023-07-10 thomas The local
2217 97a02382 2023-07-10 thomas .Dq master
2218 97a02382 2023-07-10 thomas branch can now be rebased on top of the latest changes
2219 97a02382 2023-07-10 thomas from upstream:
2220 97a02382 2023-07-10 thomas .Pp
2221 97a02382 2023-07-10 thomas .Dl $ got update -b upstream/master
2222 97a02382 2023-07-10 thomas .Dl $ got rebase master
2223 97a02382 2023-07-10 thomas .Pp
2224 97a02382 2023-07-10 thomas As an alternative to
2225 97a02382 2023-07-10 thomas .Cm got rebase ,
2226 97a02382 2023-07-10 thomas branches can be merged with
2227 97a02382 2023-07-10 thomas .Cm got merge :
2228 97a02382 2023-07-10 thomas .Pp
2229 97a02382 2023-07-10 thomas .Dl $ got update -b master
2230 97a02382 2023-07-10 thomas .Dl $ got merge upstream/master
2231 97a02382 2023-07-10 thomas .Pp
2232 97a02382 2023-07-10 thomas The question of whether to rebase or merge branches is philosophical.
2233 97a02382 2023-07-10 thomas When in doubt, refer to the software project's policies set by project
2234 97a02382 2023-07-10 thomas maintainers.
2235 97a02382 2023-07-10 thomas .Pp
2236 97a02382 2023-07-10 thomas As a final step, the forked repository's copy of the master branch needs
2237 97a02382 2023-07-10 thomas to be kept in sync by sending the new changes there:
2238 97a02382 2023-07-10 thomas .Pp
2239 97a02382 2023-07-10 thomas .Dl $ got send -f -b master origin
2240 97a02382 2023-07-10 thomas .Pp
2241 97a02382 2023-07-10 thomas If multiple pull requests need to be managed in parallel, a separate branch
2242 97a02382 2023-07-10 thomas must be created for each pull request with
2243 97a02382 2023-07-10 thomas .Cm got branch .
2244 97a02382 2023-07-10 thomas Each such branch can then be used as above, in place of
2245 97a02382 2023-07-10 thomas .Dq refs/heads/master .
2246 97a02382 2023-07-10 thomas Changes for any accepted pull requests will still appear under
2247 97a02382 2023-07-10 thomas .Dq refs/remotes/upstream/master,
2248 97a02382 2023-07-10 thomas regardless of which branch was used in the forked repository to
2249 97a02382 2023-07-10 thomas create a pull request.
2250 97a02382 2023-07-10 thomas .Sh SEE ALSO
2251 97a02382 2023-07-10 thomas .Xr gotadmin 1 ,
2252 97a02382 2023-07-10 thomas .Xr tog 1 ,
2253 97a02382 2023-07-10 thomas .Xr git-repository 5 ,
2254 97a02382 2023-07-10 thomas .Xr got-worktree 5 ,
2255 97a02382 2023-07-10 thomas .Xr got.conf 5 ,
2256 97a02382 2023-07-10 thomas .Xr gotwebd 8
2257 97a02382 2023-07-10 thomas .Sh AUTHORS
2258 97a02382 2023-07-10 thomas .An Anthony J. Bentley Aq Mt bentley@openbsd.org
2259 97a02382 2023-07-10 thomas .An Christian Weisgerber Aq Mt naddy@openbsd.org
2260 97a02382 2023-07-10 thomas .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
2261 97a02382 2023-07-10 thomas .An Josh Rickmar Aq Mt jrick@zettaport.com
2262 97a02382 2023-07-10 thomas .An Joshua Stein Aq Mt jcs@openbsd.org
2263 97a02382 2023-07-10 thomas .An Klemens Nanni Aq Mt kn@openbsd.org
2264 97a02382 2023-07-10 thomas .An Martin Pieuchot Aq Mt mpi@openbsd.org
2265 97a02382 2023-07-10 thomas .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
2266 97a02382 2023-07-10 thomas .An Omar Polo Aq Mt op@openbsd.org
2267 97a02382 2023-07-10 thomas .An Ori Bernstein Aq Mt ori@openbsd.org
2268 97a02382 2023-07-10 thomas .An Sebastien Marie Aq Mt semarie@openbsd.org
2269 97a02382 2023-07-10 thomas .An Stefan Sperling Aq Mt stsp@openbsd.org
2270 97a02382 2023-07-10 thomas .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
2271 97a02382 2023-07-10 thomas .An Theo Buehler Aq Mt tb@openbsd.org
2272 97a02382 2023-07-10 thomas .An Thomas Adam Aq Mt thomas@xteddy.org
2273 97a02382 2023-07-10 thomas .An Tracey Emery Aq Mt tracey@traceyemery.net
2274 97a02382 2023-07-10 thomas .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
2275 97a02382 2023-07-10 thomas .Pp
2276 97a02382 2023-07-10 thomas Parts of
2277 97a02382 2023-07-10 thomas .Nm ,
2278 97a02382 2023-07-10 thomas .Xr tog 1 ,
2279 97a02382 2023-07-10 thomas and
2280 97a02382 2023-07-10 thomas .Xr gotwebd 8
2281 97a02382 2023-07-10 thomas were derived from code under copyright by:
2282 97a02382 2023-07-10 thomas .Pp
2283 97a02382 2023-07-10 thomas .An Caldera International
2284 97a02382 2023-07-10 thomas .An Daniel Hartmeier
2285 97a02382 2023-07-10 thomas .An Esben Norby
2286 97a02382 2023-07-10 thomas .An Henning Brauer
2287 97a02382 2023-07-10 thomas .An HÃ¥kan Olsson
2288 97a02382 2023-07-10 thomas .An Ingo Schwarze
2289 97a02382 2023-07-10 thomas .An Jean-Francois Brousseau
2290 97a02382 2023-07-10 thomas .An Joris Vink
2291 97a02382 2023-07-10 thomas .An Jyri J. Virkki
2292 97a02382 2023-07-10 thomas .An Larry Wall
2293 97a02382 2023-07-10 thomas .An Markus Friedl
2294 97a02382 2023-07-10 thomas .An Niall O'Higgins
2295 97a02382 2023-07-10 thomas .An Niklas Hallqvist
2296 97a02382 2023-07-10 thomas .An Ray Lai
2297 97a02382 2023-07-10 thomas .An Ryan McBride
2298 97a02382 2023-07-10 thomas .An Theo de Raadt
2299 97a02382 2023-07-10 thomas .An Todd C. Miller
2300 97a02382 2023-07-10 thomas .An Xavier Santolaria
2301 97a02382 2023-07-10 thomas .Pp
2302 97a02382 2023-07-10 thomas .Nm
2303 97a02382 2023-07-10 thomas contains code contributed to the public domain by
2304 97a02382 2023-07-10 thomas .An Austin Appleby .
2305 97a02382 2023-07-10 thomas .Sh CAVEATS
2306 97a02382 2023-07-10 thomas .Nm
2307 97a02382 2023-07-10 thomas is a work-in-progress and some features remain to be implemented.
2308 97a02382 2023-07-10 thomas .Pp
2309 97a02382 2023-07-10 thomas At present, the user has to fall back on
2310 97a02382 2023-07-10 thomas .Xr git 1
2311 97a02382 2023-07-10 thomas to perform some tasks.
2312 97a02382 2023-07-10 thomas In particular:
2313 97a02382 2023-07-10 thomas .Bl -bullet
2314 97a02382 2023-07-10 thomas .It
2315 97a02382 2023-07-10 thomas Reading from remote repositories over HTTP or HTTPS protocols requires
2316 97a02382 2023-07-10 thomas .Xr git-clone 1
2317 97a02382 2023-07-10 thomas and
2318 97a02382 2023-07-10 thomas .Xr git-fetch 1 .
2319 97a02382 2023-07-10 thomas .It
2320 97a02382 2023-07-10 thomas Writing to remote repositories over HTTP or HTTPS protocols requires
2321 97a02382 2023-07-10 thomas .Xr git-push 1 .
2322 97a02382 2023-07-10 thomas .It
2323 97a02382 2023-07-10 thomas The creation of merge commits with more than two parent commits requires
2324 97a02382 2023-07-10 thomas .Xr git-merge 1 .
2325 97a02382 2023-07-10 thomas .It
2326 97a02382 2023-07-10 thomas In situations where files or directories were moved around
2327 97a02382 2023-07-10 thomas .Cm got
2328 97a02382 2023-07-10 thomas will not automatically merge changes to new locations and
2329 97a02382 2023-07-10 thomas .Xr git 1
2330 97a02382 2023-07-10 thomas will usually produce better results.
2331 97a02382 2023-07-10 thomas .El