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