Blame


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