Blame


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