2 5c860e29 2018-03-12 stsp .\" Copyright (c) 2017 Martin Pieuchot
3 5d56da81 2019-01-13 stsp .\" Copyright (c) 2018, 2019 Stefan Sperling
5 5c860e29 2018-03-12 stsp .\" Permission to use, copy, modify, and distribute this software for any
6 5c860e29 2018-03-12 stsp .\" purpose with or without fee is hereby granted, provided that the above
7 5c860e29 2018-03-12 stsp .\" copyright notice and this permission notice appear in all copies.
9 5c860e29 2018-03-12 stsp .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 5c860e29 2018-03-12 stsp .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 5c860e29 2018-03-12 stsp .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 5c860e29 2018-03-12 stsp .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 5c860e29 2018-03-12 stsp .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 5c860e29 2018-03-12 stsp .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 5c860e29 2018-03-12 stsp .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 5c860e29 2018-03-12 stsp .Dd $Mdocdate$
22 eb7dbff5 2019-05-09 stsp .Nd game of trees
23 5c860e29 2018-03-12 stsp .Sh SYNOPSIS
27 5c860e29 2018-03-12 stsp .Op Ar arg ...
28 5c860e29 2018-03-12 stsp .Sh DESCRIPTION
30 4dfb2f0f 2019-03-26 stsp is a version control system which stores the history of tracked files
31 4dfb2f0f 2019-03-26 stsp in a Git repository, as used by the Git version control system.
32 285dc8a4 2018-03-13 stsp This repository format is described in
33 5e5560e1 2018-08-01 stsp .Xr git-repository 5 .
37 ae73e26f 2019-03-26 stsp .Dq distributed
38 4129c201 2018-03-13 stsp version control system because every copy of a repository is writeable.
39 4129c201 2018-03-13 stsp Modifications made to files can be synchronized between repositories
40 97925469 2018-03-17 stsp at any time.
42 285dc8a4 2018-03-13 stsp Files managed by
44 4129c201 2018-03-13 stsp must be checked out from the repository for modification.
45 285dc8a4 2018-03-13 stsp Checked out files are stored in a
46 285dc8a4 2018-03-13 stsp .Em work tree
47 c5867b47 2018-03-13 stsp which can be placed at an arbitrary directory in the filesystem hierarchy.
48 fb2921d0 2019-03-26 stsp The on-disk format of this work tree is described in
49 285dc8a4 2018-03-13 stsp .Xr got-worktree 5 .
52 285dc8a4 2018-03-13 stsp provides global and command-specific options.
53 285dc8a4 2018-03-13 stsp Global options must preceed the command name, and are as follows:
54 1b6b95a8 2018-03-12 stsp .Bl -tag -width tenletters
56 1b6b95a8 2018-03-12 stsp Display usage information.
59 38e11793 2018-06-13 stsp The commands for
61 38e11793 2018-06-13 stsp are as follows:
62 0bb8a95e 2018-03-12 stsp .Bl -tag -width checkout
63 2c7829a4 2019-06-17 stsp .It Cm init Ar path
64 2c7829a4 2019-06-17 stsp Create a new empty repository at the specified
68 3ce1b845 2019-07-15 stsp .Cm got init ,
70 3ce1b845 2019-07-15 stsp .Cm got import
71 3ce1b845 2019-07-15 stsp command must be used to populate the empty repository before
72 3ce1b845 2019-07-15 stsp .Cm got checkout
73 3ce1b845 2019-07-15 stsp can be used.
75 3ce1b845 2019-07-15 stsp .It Cm import [ Fl b Ar branch ] [ Fl m Ar message ] [ Fl r Ar repository-path ] [ Fl I Ar pattern ] directory
76 3ce1b845 2019-07-15 stsp Create an initial commit in a repository from the file hierarchy
77 3ce1b845 2019-07-15 stsp within the specified
78 3ce1b845 2019-07-15 stsp .Ar directory .
79 3ce1b845 2019-07-15 stsp The created commit will not have any parent commits, i.e. it will be a
80 3ce1b845 2019-07-15 stsp root commit.
81 3ce1b845 2019-07-15 stsp Also create a new reference which provides a branch name for the newly
82 3ce1b845 2019-07-15 stsp created commit.
83 21a44f98 2019-07-15 stsp Show the path of each imported file to indicate progress.
86 21a44f98 2019-07-15 stsp .Cm got import
87 21a44f98 2019-07-15 stsp command requires the
88 21a44f98 2019-07-15 stsp .Ev GOT_AUTHOR
89 21a44f98 2019-07-15 stsp environment variable to be set.
91 3ce1b845 2019-07-15 stsp The options for
92 3ce1b845 2019-07-15 stsp .Cm got import
93 3ce1b845 2019-07-15 stsp are as follows:
94 3ce1b845 2019-07-15 stsp .Bl -tag -width Ds
95 3ce1b845 2019-07-15 stsp .It Fl b Ar branch
96 3ce1b845 2019-07-15 stsp Create the specified
98 3ce1b845 2019-07-15 stsp instead of creating the default branch
99 3ce1b845 2019-07-15 stsp .Dq master .
100 3ce1b845 2019-07-15 stsp Use of this option is required if the
102 3ce1b845 2019-07-15 stsp branch already exists.
103 3ce1b845 2019-07-15 stsp .It Fl m Ar message
104 3ce1b845 2019-07-15 stsp Use the specified log message when creating the new commit.
105 3ce1b845 2019-07-15 stsp Without the
108 3ce1b845 2019-07-15 stsp .Cm got import
109 3ce1b845 2019-07-15 stsp opens a temporary file in an editor where a log message can be written.
110 3ce1b845 2019-07-15 stsp .It Fl r Ar repository-path
111 3ce1b845 2019-07-15 stsp Use the repository at the specified path.
112 3ce1b845 2019-07-15 stsp If not specified, assume the repository is located at or above the current
113 3ce1b845 2019-07-15 stsp working directory.
114 3ce1b845 2019-07-15 stsp .It Fl I Ar pattern
115 3ce1b845 2019-07-15 stsp Ignore files or directories with a name which matches the specified
116 3ce1b845 2019-07-15 stsp .Ar pattern .
117 3ce1b845 2019-07-15 stsp This option may be specified multiple times to build a list of ignore patterns.
119 3ce1b845 2019-07-15 stsp .Ar pattern
120 3ce1b845 2019-07-15 stsp follows the globbing rules documented in
121 3ce1b845 2019-07-15 stsp .Xr glob 7 .
123 08573d5b 2019-05-14 stsp .It Cm checkout [ Fl b Ar branch ] [ Fl c Ar commit ] [ Fl p Ar path-prefix ] repository-path [ work-tree-path ]
124 0bb8a95e 2018-03-12 stsp Copy files from a repository into a new work tree.
126 5d7c1dab 2018-04-01 stsp .Ar work tree path
127 c844a238 2019-02-06 stsp is not specified, either use the last component of
128 5d7c1dab 2018-04-01 stsp .Ar repository path ,
130 5d7c1dab 2018-04-01 stsp .Ar path prefix
131 c844a238 2019-02-06 stsp was specified use the last component of
132 5d7c1dab 2018-04-01 stsp .Ar path prefix .
134 38e11793 2018-06-13 stsp The options for
135 38e11793 2018-06-13 stsp .Cm got checkout
136 38e11793 2018-06-13 stsp are as follows:
137 38e11793 2018-06-13 stsp .Bl -tag -width Ds
138 08573d5b 2019-05-14 stsp .It Fl b Ar branch
139 08573d5b 2019-05-14 stsp Check out files from the specified
140 08573d5b 2019-05-14 stsp .Ar branch .
141 08573d5b 2019-05-14 stsp If this option is not specified, a branch resolved via the repository's HEAD
142 08573d5b 2019-05-14 stsp reference will be used.
143 8069f636 2019-01-12 stsp .It Fl c Ar commit
144 8069f636 2019-01-12 stsp Check out files from the specified
145 8069f636 2019-01-12 stsp .Ar commit .
146 0e1b0230 2019-07-07 stsp The expected argument is a commit ID SHA1 hash.
147 0e1b0230 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
148 0e1b0230 2019-07-07 stsp automatically, provided the abbreviation is unique.
149 08573d5b 2019-05-14 stsp If this option is not specified, the most recent commit on the selected
150 08573d5b 2019-05-14 stsp branch will be used.
151 38e11793 2018-06-13 stsp .It Fl p Ar path-prefix
152 38e11793 2018-06-13 stsp Restrict the work tree to a subset of the repository's tree hierarchy.
153 38e11793 2018-06-13 stsp Only files beneath the specified
154 38e11793 2018-06-13 stsp .Ar path-prefix
155 38e11793 2018-06-13 stsp will be checked out.
158 97b3a7be 2019-07-09 stsp Short alias for
159 97b3a7be 2019-07-09 stsp .Cm checkout .
160 024e9686 2019-05-14 stsp .It Cm update [ Fl b Ar branch ] [ Fl c Ar commit ] [ Ar path ]
161 024e9686 2019-05-14 stsp Update an existing work tree to a different commit.
162 7f838b36 2019-02-08 stsp Show the status of each affected file, using the following status codes:
163 7f838b36 2019-02-08 stsp .Bl -column YXZ description
164 7f838b36 2019-02-08 stsp .It U Ta file was updated and contained no local changes
165 7f838b36 2019-02-08 stsp .It G Ta file was updated and local changes were merged cleanly
166 7f838b36 2019-02-08 stsp .It C Ta file was updated and conflicts occurred during merge
167 7f838b36 2019-02-08 stsp .It D Ta file was deleted
168 7f838b36 2019-02-08 stsp .It A Ta new file was added
169 7f838b36 2019-02-08 stsp .It ~ Ta versioned file is obstructed by a non-regular file
170 a378724f 2019-02-10 stsp .It ! Ta a missing versioned file was restored
175 c4cdcb68 2019-04-03 stsp is specified, restrict the update operation to files at or within this path.
176 f2cf8fbb 2019-04-04 stsp The path is required to exist in the update operation's target commit.
177 f2cf8fbb 2019-04-04 stsp Files in the work tree outside this path will remain unchanged and will
178 f2cf8fbb 2019-04-04 stsp retain their previously recorded base commit.
181 f2cf8fbb 2019-04-04 stsp commands may refuse to run while the work tree contains files from
182 c4cdcb68 2019-04-03 stsp multiple base commits.
183 f2cf8fbb 2019-04-04 stsp The base commit of such a work tree can be made consistent by running
184 47ec7be7 2019-05-12 stsp .Cm got update
185 47ec7be7 2019-05-12 stsp across the entire work tree.
186 024e9686 2019-05-14 stsp Specifying a
188 024e9686 2019-05-14 stsp is incompatible with the
192 507dc3bb 2018-12-29 stsp The options for
193 507dc3bb 2018-12-29 stsp .Cm got update
194 507dc3bb 2018-12-29 stsp are as follows:
195 507dc3bb 2018-12-29 stsp .Bl -tag -width Ds
196 024e9686 2019-05-14 stsp .It Fl b Ar branch
197 024e9686 2019-05-14 stsp Switch the work tree's branch reference to the specified
199 024e9686 2019-05-14 stsp before updating the work tree.
200 024e9686 2019-05-14 stsp This option requires that all paths in the work tree are updated.
201 507dc3bb 2018-12-29 stsp .It Fl c Ar commit
202 507dc3bb 2018-12-29 stsp Update the work tree to the specified
203 507dc3bb 2018-12-29 stsp .Ar commit .
204 a54b6686 2019-06-28 stsp The expected argument is a commit ID SHA1 hash.
205 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
206 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
207 024e9686 2019-05-14 stsp If this option is not specified, the most recent commit on the work tree's
208 024e9686 2019-05-14 stsp branch will be used.
211 97b3a7be 2019-07-09 stsp Short alias for
212 97b3a7be 2019-07-09 stsp .Cm update .
213 927df6b7 2019-02-10 stsp .It Cm status [ Ar path ]
214 6cd959e6 2019-03-26 stsp Show the current modification status of files in a work tree,
215 6bad629b 2019-02-04 stsp using the following status codes:
216 6bad629b 2019-02-04 stsp .Bl -column YXZ description
217 6bad629b 2019-02-04 stsp .It M Ta modified file
218 079890a9 2019-03-26 stsp .It A Ta file scheduled for addition in next commit
219 079890a9 2019-03-26 stsp .It D Ta file scheduled for deletion in next commit
220 7154f6ce 2019-03-27 stsp .It C Ta modified or added file which contains merge conflicts
221 6bad629b 2019-02-04 stsp .It ! Ta versioned file was expected on disk but is missing
222 0dbc2271 2019-02-05 stsp .It ~ Ta versioned file is obstructed by a non-regular file
223 6bad629b 2019-02-04 stsp .It ? Ta unversioned item not tracked by
229 927df6b7 2019-02-10 stsp is specified, only show modifications within this path.
231 97b3a7be 2019-07-09 stsp Short alias for
232 97b3a7be 2019-07-09 stsp .Cm status .
233 f400486b 2019-07-15 stsp .It Cm log [ Fl c Ar commit ] [ Fl C Ar number ] [ Fl f ] [ Fl l Ar N ] [ Fl p ] [ Fl r Ar repository-path ] [ path ]
234 38e11793 2018-06-13 stsp Display history of a repository.
237 04ca23f4 2018-07-16 stsp is specified, show only commits which modified this path.
239 38e11793 2018-06-13 stsp The options for
240 38e11793 2018-06-13 stsp .Cm got log
241 38e11793 2018-06-13 stsp are as follows:
242 38e11793 2018-06-13 stsp .Bl -tag -width Ds
243 38e11793 2018-06-13 stsp .It Fl c Ar commit
244 38e11793 2018-06-13 stsp Start traversing history at the specified
245 38e11793 2018-06-13 stsp .Ar commit .
246 a54b6686 2019-06-28 stsp The expected argument is the name of a branch or a commit ID SHA1 hash.
247 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
248 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
249 1cc14b9f 2019-05-14 stsp If this option is not specified, default to the work tree's current branch
250 1cc14b9f 2019-05-14 stsp if invoked in a work tree, or to the repository's HEAD reference.
251 c0cc5c62 2018-10-18 stsp .It Fl C Ar number
252 c0cc5c62 2018-10-18 stsp Set the number of context lines shown in diffs with
254 c0cc5c62 2018-10-18 stsp By default, 3 lines of context are shown.
256 cc54c501 2019-07-15 stsp Restrict history traversal to the first parent of each commit.
257 cc54c501 2019-07-15 stsp This shows the linear history of the current branch only.
258 cc54c501 2019-07-15 stsp Merge commits which affected the current branch will be shown but
259 cc54c501 2019-07-15 stsp individual commits which originated on other branches will be omitted.
260 6238ee32 2018-06-13 stsp .It Fl l Ar N
261 6238ee32 2018-06-13 stsp Limit history traversal to a given number of commits.
263 6238ee32 2018-06-13 stsp Display the patch of modifications made in each commit.
264 04ca23f4 2018-07-16 stsp .It Fl r Ar repository-path
265 04ca23f4 2018-07-16 stsp Use the repository at the specified path.
266 04ca23f4 2018-07-16 stsp If not specified, assume the repository is located at or above the current
267 04ca23f4 2018-07-16 stsp working directory.
268 e9cf2e30 2019-02-05 stsp If this directory is a
270 e9cf2e30 2019-02-05 stsp work tree, use the repository path associated with this work tree.
272 927df6b7 2019-02-10 stsp .It Cm diff [ Fl C Ar number ] [ Fl r Ar repository-path ] [ Ar object1 Ar object2 | Ar path ]
273 927df6b7 2019-02-10 stsp When invoked within a work tree with less than two arguments, display
274 927df6b7 2019-02-10 stsp uncommitted changes in the work tree.
277 927df6b7 2019-02-10 stsp is specified, only show changes within this path.
279 e02e74af 2019-05-28 stsp If two arguments are provided, treat each argument as a reference,
280 a54b6686 2019-06-28 stsp or an object ID SHA1 hash, and display differences between these objects.
281 3f8b7d6a 2018-04-01 stsp Both objects must be of the same type (blobs, trees, or commits).
282 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
283 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
285 c0cc5c62 2018-10-18 stsp The options for
286 c0cc5c62 2018-10-18 stsp .Cm got diff
287 c0cc5c62 2018-10-18 stsp are as follows:
288 c0cc5c62 2018-10-18 stsp .Bl -tag -width Ds
289 c0cc5c62 2018-10-18 stsp .It Fl C Ar number
290 c0cc5c62 2018-10-18 stsp Set the number of context lines shown in the diff.
291 c0cc5c62 2018-10-18 stsp By default, 3 lines of context are shown.
292 b72f483a 2019-02-05 stsp .It Fl r Ar repository-path
293 b72f483a 2019-02-05 stsp Use the repository at the specified path.
294 b72f483a 2019-02-05 stsp If not specified, assume the repository is located at or above the current
295 b72f483a 2019-02-05 stsp working directory.
296 b72f483a 2019-02-05 stsp If this directory is a
298 b72f483a 2019-02-05 stsp work tree, use the repository path associated with this work tree.
300 1ff8e573 2018-08-02 stsp .It Cm blame [ Fl c Ar commit ] [ Fl r Ar repository-path ] Ar path
301 1ff8e573 2018-08-02 stsp Display line-by-line history of a file at the specified path.
303 1ff8e573 2018-08-02 stsp The options for
304 1ff8e573 2018-08-02 stsp .Cm got blame
305 1ff8e573 2018-08-02 stsp are as follows:
306 1ff8e573 2018-08-02 stsp .Bl -tag -width Ds
307 1ff8e573 2018-08-02 stsp .It Fl c Ar commit
308 1ff8e573 2018-08-02 stsp Start traversing history at the specified
309 1ff8e573 2018-08-02 stsp .Ar commit .
310 a54b6686 2019-06-28 stsp The expected argument is the name of a branch or a commit ID SHA1 hash.
311 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
312 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
313 1ff8e573 2018-08-02 stsp .It Fl r Ar repository-path
314 1ff8e573 2018-08-02 stsp Use the repository at the specified path.
315 1ff8e573 2018-08-02 stsp If not specified, assume the repository is located at or above the current
316 1ff8e573 2018-08-02 stsp working directory.
317 0c06baac 2019-02-05 stsp If this directory is a
319 0c06baac 2019-02-05 stsp work tree, use the repository path associated with this work tree.
321 c1669e2e 2019-01-09 stsp .It Cm tree [ Fl c Ar commit ] [ Fl r Ar repository-path ] [ Fl i ] [ Fl R] [ Ar path ]
322 5de5890b 2018-10-18 stsp Display a listing of files and directories at the specified
323 5de5890b 2018-10-18 stsp directory path in the repository.
324 db0c2996 2019-02-10 stsp Entries shown in this listing may carry one of the following trailing
325 db0c2996 2019-02-10 stsp annotations:
326 db0c2996 2019-02-10 stsp .Bl -column YXZ description
327 db0c2996 2019-02-10 stsp .It / Ta entry is a directory
328 db0c2996 2019-02-10 stsp .It * Ta entry is an executable file
333 0c849583 2019-02-05 stsp is specified, list the repository path corresponding to the current
334 0c849583 2019-02-05 stsp directory of the work tree, or the root directory of the repository
335 0c849583 2019-02-05 stsp if there is no work tree.
337 5de5890b 2018-10-18 stsp The options for
338 5de5890b 2018-10-18 stsp .Cm got tree
339 5de5890b 2018-10-18 stsp are as follows:
340 5de5890b 2018-10-18 stsp .Bl -tag -width Ds
341 5de5890b 2018-10-18 stsp .It Fl c Ar commit
342 5de5890b 2018-10-18 stsp List files and directories as they appear in the specified
343 5de5890b 2018-10-18 stsp .Ar commit .
344 a54b6686 2019-06-28 stsp The expected argument is the name of a branch or a commit ID SHA1 hash.
345 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
346 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
347 5de5890b 2018-10-18 stsp .It Fl r Ar repository-path
348 5de5890b 2018-10-18 stsp Use the repository at the specified path.
349 5de5890b 2018-10-18 stsp If not specified, assume the repository is located at or above the current
350 5de5890b 2018-10-18 stsp working directory.
351 0c849583 2019-02-05 stsp If this directory is a
353 0c849583 2019-02-05 stsp work tree, use the repository path associated with this work tree.
355 5de5890b 2018-10-18 stsp Show object IDs of files (blob objects) and directories (tree objects).
357 0c849583 2019-02-05 stsp Recurse into sub-directories in the repository.
359 d83d9d5c 2019-05-13 stsp .It Cm ref [ Fl r Ar repository-path ] [ Fl l ] [ Fl d Ar name ] [ Ar name Ar target ]
360 d0eebce4 2019-03-11 stsp Manage references in a repository.
362 d0eebce4 2019-03-11 stsp If no options are passed, expect two arguments and attempt to create,
363 d0eebce4 2019-03-11 stsp or update, the reference with the given
365 d0eebce4 2019-03-11 stsp and make it point at the given
366 d83d9d5c 2019-05-13 stsp .Ar target .
367 a54b6686 2019-06-28 stsp The target may be an object ID SHA1 hash or an existing reference which
368 a54b6686 2019-06-28 stsp will be resolved to an object ID.
369 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
370 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
372 d0eebce4 2019-03-11 stsp The options for
373 d0eebce4 2019-03-11 stsp .Cm got ref
374 d0eebce4 2019-03-11 stsp are as follows:
375 d0eebce4 2019-03-11 stsp .Bl -tag -width Ds
376 d0eebce4 2019-03-11 stsp .It Fl r Ar repository-path
377 d0eebce4 2019-03-11 stsp Use the repository at the specified path.
378 d0eebce4 2019-03-11 stsp If not specified, assume the repository is located at or above the current
379 d0eebce4 2019-03-11 stsp working directory.
380 d0eebce4 2019-03-11 stsp If this directory is a
382 d0eebce4 2019-03-11 stsp work tree, use the repository path associated with this work tree.
384 d0eebce4 2019-03-11 stsp List all existing references in the repository.
385 d0eebce4 2019-03-11 stsp .It Fl d Ar name
386 d0eebce4 2019-03-11 stsp Delete the reference with the specified name from the repository.
388 4e759de4 2019-06-26 stsp .It Cm branch [ Fl r Ar repository-path ] [ Fl l ] [ Fl d Ar name ] [ Ar name [ Ar base-branch ] ]
389 4e759de4 2019-06-26 stsp Manage branches in a repository.
391 4e759de4 2019-06-26 stsp Branches are managed via references which live in the
392 4e759de4 2019-06-26 stsp .Dq refs/heads/
393 4e759de4 2019-06-26 stsp reference namespace.
395 4e759de4 2019-06-26 stsp .Cm got branch
396 4e759de4 2019-06-26 stsp command operates on references in this namespace only.
398 4e759de4 2019-06-26 stsp If no options are passed, expect one or two arguments and attempt to create
399 4e759de4 2019-06-26 stsp a branch with the given
401 4e759de4 2019-06-26 stsp and make it point at the given
402 4e759de4 2019-06-26 stsp .Ar base-branch .
404 4e759de4 2019-06-26 stsp .Ar base-branch
405 4e759de4 2019-06-26 stsp is specified, default to the work tree's current branch if invoked in a
406 4e759de4 2019-06-26 stsp work tree, or to the repository's HEAD reference.
408 4e759de4 2019-06-26 stsp The options for
409 4e759de4 2019-06-26 stsp .Cm got branch
410 4e759de4 2019-06-26 stsp are as follows:
411 4e759de4 2019-06-26 stsp .Bl -tag -width Ds
412 4e759de4 2019-06-26 stsp .It Fl r Ar repository-path
413 4e759de4 2019-06-26 stsp Use the repository at the specified path.
414 4e759de4 2019-06-26 stsp If not specified, assume the repository is located at or above the current
415 4e759de4 2019-06-26 stsp working directory.
416 4e759de4 2019-06-26 stsp If this directory is a
418 4e759de4 2019-06-26 stsp work tree, use the repository path associated with this work tree.
420 4e759de4 2019-06-26 stsp List all existing branches in the repository.
422 ba882ee3 2019-07-11 stsp If invoked in a work tree, the work tree's current branch is shown
423 ba882ee3 2019-07-11 stsp with one the following annotations:
424 ba882ee3 2019-07-11 stsp .Bl -column YXZ description
425 ba882ee3 2019-07-11 stsp .It * Ta work tree's base commit matches the branch tip
426 ba882ee3 2019-07-11 stsp .It ~ Ta work tree's base commit is out-of-date
428 4e759de4 2019-06-26 stsp .It Fl d Ar name
429 4e759de4 2019-06-26 stsp Delete the branch with the specified name from the repository.
430 7acfb25b 2019-07-11 stsp Only the branch reference is deleted.
431 7acfb25b 2019-07-11 stsp Any commit, tree, and blob objects belonging to the branch
432 74d012d1 2019-07-11 stsp remain in the repository and may be removed separately with
433 ce33d90e 2019-07-14 stsp Git's garbage collector.
436 97b3a7be 2019-07-09 stsp Short alias for
437 97b3a7be 2019-07-09 stsp .Cm branch .
438 fbb7e5c7 2019-05-11 stsp .It Cm add Ar file-path ...
439 8125ddca 2019-05-11 stsp Schedule unversioned files in a work tree for addition to the
440 d00136be 2019-03-26 stsp repository in the next commit.
441 648e4ef7 2019-07-09 stsp .It Cm remove Ar file-path ...
442 17ed4618 2019-06-02 stsp Remove versioned files from a work tree and schedule them for deletion
443 2ec1f75b 2019-03-26 stsp from the repository in the next commit.
445 2ec1f75b 2019-03-26 stsp The options for
446 86d25a1b 2019-07-11 stsp .Cm got remove
447 2ec1f75b 2019-03-26 stsp are as follows:
448 2ec1f75b 2019-03-26 stsp .Bl -tag -width Ds
450 17ed4618 2019-06-02 stsp Perform the operation even if a file contains uncommitted modifications.
453 648e4ef7 2019-07-09 stsp Short alias for
454 648e4ef7 2019-07-09 stsp .Cm remove .
455 e20a8b6f 2019-06-04 stsp .It Cm revert Ar file-path ...
456 e20a8b6f 2019-06-04 stsp Revert any uncommited changes in files at the specified paths.
457 a129376b 2019-03-28 stsp File contents will be overwritten with those contained in the
458 a129376b 2019-03-28 stsp work tree's base commit. There is no way to bring discarded
459 a129376b 2019-03-28 stsp changes back after
460 a129376b 2019-03-28 stsp .Cm got revert !
462 e20a8b6f 2019-06-04 stsp If a file was added with
463 a129376b 2019-03-28 stsp .Cm got add
464 a129376b 2019-03-28 stsp it will become an unversioned file again.
465 e20a8b6f 2019-06-04 stsp If a file was deleted with
466 86d25a1b 2019-07-11 stsp .Cm got remove
467 a129376b 2019-03-28 stsp it will be restored.
469 97b3a7be 2019-07-09 stsp Short alias for
470 97b3a7be 2019-07-09 stsp .Cm revert .
471 74ff3f23 2019-07-07 stsp .It Cm commit [ Fl m Ar message ] [ file-path ]
472 15cd91f7 2019-05-12 stsp Create a new commit in the repository from local changes in a work tree
473 15cd91f7 2019-05-12 stsp and use this commit as the new base commit for the work tree.
475 15cd91f7 2019-05-12 stsp Show the status of each affected file, using the following status codes:
476 15cd91f7 2019-05-12 stsp .Bl -column YXZ description
477 15cd91f7 2019-05-12 stsp .It M Ta modified file
478 15cd91f7 2019-05-12 stsp .It D Ta file was deleted
479 15cd91f7 2019-05-12 stsp .It A Ta new file was added
482 15cd91f7 2019-05-12 stsp Files without local changes will retain their previously recorded base
486 15cd91f7 2019-05-12 stsp commands may refuse to run while the work tree contains files from
487 15cd91f7 2019-05-12 stsp multiple base commits.
488 15cd91f7 2019-05-12 stsp The base commit of such a work tree can be made consistent by running
489 47ec7be7 2019-05-12 stsp .Cm got update
490 47ec7be7 2019-05-12 stsp across the entire work tree.
493 15cd91f7 2019-05-12 stsp .Cm got commit
494 15cd91f7 2019-05-12 stsp command requires the
495 74416c47 2019-05-09 stsp .Ev GOT_AUTHOR
496 74416c47 2019-05-09 stsp environment variable to be set.
498 74416c47 2019-05-09 stsp The options for
499 74416c47 2019-05-09 stsp .Cm got commit
500 74416c47 2019-05-09 stsp are as follows:
501 74416c47 2019-05-09 stsp .Bl -tag -width Ds
502 74ff3f23 2019-07-07 stsp .It Fl m Ar message
503 74416c47 2019-05-09 stsp Use the specified log message when creating the new commit.
504 23594da9 2019-05-13 stsp Without the
507 23594da9 2019-05-13 stsp .Cm got commit
508 23594da9 2019-05-13 stsp opens a temporary file in an editor where a log message can be written.
511 97b3a7be 2019-07-09 stsp Short alias for
512 97b3a7be 2019-07-09 stsp .Cm commit .
513 234035bc 2019-06-01 stsp .It Cm cherrypick Ar commit
514 234035bc 2019-06-01 stsp Merge changes from a single
516 234035bc 2019-06-01 stsp into the work tree.
517 234035bc 2019-06-01 stsp The specified
519 234035bc 2019-06-01 stsp must be on a different branch than the work tree's base commit.
520 a54b6686 2019-06-28 stsp The expected argument is a reference or a commit ID SHA1 hash.
521 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
522 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
524 234035bc 2019-06-01 stsp Show the status of each affected file, using the following status codes:
525 234035bc 2019-06-01 stsp .Bl -column YXZ description
526 234035bc 2019-06-01 stsp .It G Ta file was merged
527 234035bc 2019-06-01 stsp .It C Ta file was merged and conflicts occurred during merge
528 234035bc 2019-06-01 stsp .It ! Ta changes destined for a missing file were not merged
529 234035bc 2019-06-01 stsp .It D Ta file was deleted
530 2b92fad7 2019-06-02 stsp .It d Ta file's deletion was obstructed by local modifications
531 234035bc 2019-06-01 stsp .It A Ta new file was added
532 2b92fad7 2019-06-02 stsp .It ~ Ta changes destined for a non-regular file were not merged
535 234035bc 2019-06-01 stsp The merged changes will appear as local changes in the work tree, which
536 234035bc 2019-06-01 stsp may be viewed with
537 234035bc 2019-06-01 stsp .Cm got diff ,
538 234035bc 2019-06-01 stsp amended manually or with further
539 234035bc 2019-06-01 stsp .Cm got cherrypick
541 234035bc 2019-06-01 stsp committed with
542 234035bc 2019-06-01 stsp .Cm got commit ,
543 234035bc 2019-06-01 stsp or discarded again with
544 234035bc 2019-06-01 stsp .Cm got revert .
546 234035bc 2019-06-01 stsp .Cm got cherrypick
547 234035bc 2019-06-01 stsp will refuse to run if certain preconditions are not met.
548 234035bc 2019-06-01 stsp If the work tree contains multiple base commits it must first be updated
549 234035bc 2019-06-01 stsp to a single base commit with
550 234035bc 2019-06-01 stsp .Cm got update .
551 234035bc 2019-06-01 stsp If the work tree already contains files with merge conflicts, these
552 234035bc 2019-06-01 stsp conflicts must be resolved first.
554 97b3a7be 2019-07-09 stsp Short alias for
555 97b3a7be 2019-07-09 stsp .Cm cherrypick .
556 5ef14e63 2019-06-02 stsp .It Cm backout Ar commit
557 5ef14e63 2019-06-02 stsp Reverse-merge changes from a single
559 5ef14e63 2019-06-02 stsp into the work tree.
560 5ef14e63 2019-06-02 stsp The specified
562 5ef14e63 2019-06-02 stsp must be on the same branch as the work tree's base commit.
563 a54b6686 2019-06-28 stsp The expected argument is a reference or a commit ID SHA1 hash.
564 0db75f06 2019-07-07 stsp An abbreviated hash argument will be expanded to a full SHA1 hash
565 0db75f06 2019-07-07 stsp automatically, provided the abbreviation is unique.
567 5ef14e63 2019-06-02 stsp Show the status of each affected file, using the following status codes:
568 5ef14e63 2019-06-02 stsp .Bl -column YXZ description
569 5ef14e63 2019-06-02 stsp .It G Ta file was merged
570 5ef14e63 2019-06-02 stsp .It C Ta file was merged and conflicts occurred during merge
571 5ef14e63 2019-06-02 stsp .It ! Ta changes destined for a missing file were not merged
572 5ef14e63 2019-06-02 stsp .It D Ta file was deleted
573 5ef14e63 2019-06-02 stsp .It d Ta file's deletion was obstructed by local modifications
574 5ef14e63 2019-06-02 stsp .It A Ta new file was added
575 5ef14e63 2019-06-02 stsp .It ~ Ta changes destined for a non-regular file were not merged
578 5ef14e63 2019-06-02 stsp The reverse-merged changes will appear as local changes in the work tree,
579 5ef14e63 2019-06-02 stsp which may be viewed with
580 5ef14e63 2019-06-02 stsp .Cm got diff ,
581 5ef14e63 2019-06-02 stsp amended manually or with further
582 778a73c2 2019-07-12 stsp .Cm got backout
584 5ef14e63 2019-06-02 stsp committed with
585 5ef14e63 2019-06-02 stsp .Cm got commit ,
586 5ef14e63 2019-06-02 stsp or discarded again with
587 5ef14e63 2019-06-02 stsp .Cm got revert .
589 92228c38 2019-06-02 stsp .Cm got backout
590 92228c38 2019-06-02 stsp will refuse to run if certain preconditions are not met.
591 92228c38 2019-06-02 stsp If the work tree contains multiple base commits it must first be updated
592 92228c38 2019-06-02 stsp to a single base commit with
593 92228c38 2019-06-02 stsp .Cm got update .
594 92228c38 2019-06-02 stsp If the work tree already contains files with merge conflicts, these
595 92228c38 2019-06-02 stsp conflicts must be resolved first.
597 97b3a7be 2019-07-09 stsp Short alias for
598 97b3a7be 2019-07-09 stsp .Cm backout .
599 cd98404f 2019-07-14 stsp .It Cm rebase [ Fl a ] [ Fl c] [ Ar branch ]
600 818c7501 2019-07-11 stsp Rebase commits on the specified
602 818c7501 2019-07-11 stsp onto the tip of the current branch of the work tree.
605 818c7501 2019-07-11 stsp must share common ancestry with the work tree's current branch.
606 f09e2405 2019-07-11 stsp Rebasing begins with the first descendent commit of the youngest
607 f09e2405 2019-07-11 stsp common ancestor commit shared by the specified
609 818c7501 2019-07-11 stsp and the work tree's current branch, and stops once the tip commit
610 f09e2405 2019-07-11 stsp of the specified
612 f09e2405 2019-07-11 stsp has been rebased.
614 818c7501 2019-07-11 stsp Rebased commits are accumulated on a temporary branch and represent
615 f09e2405 2019-07-11 stsp the same changes with the same log messages as their counterparts
616 f09e2405 2019-07-11 stsp on the original
617 818c7501 2019-07-11 stsp .Ar branch ,
618 818c7501 2019-07-11 stsp but with different commit IDs.
619 818c7501 2019-07-11 stsp Once rebasing has completed successfully, the temporary branch becomes
620 f09e2405 2019-07-11 stsp the new version of the specified
622 818c7501 2019-07-11 stsp and the work tree is automatically switched to it.
624 818c7501 2019-07-11 stsp While rebasing commits, show the status of each affected file,
625 818c7501 2019-07-11 stsp using the following status codes:
626 818c7501 2019-07-11 stsp .Bl -column YXZ description
627 818c7501 2019-07-11 stsp .It G Ta file was merged
628 818c7501 2019-07-11 stsp .It C Ta file was merged and conflicts occurred during merge
629 818c7501 2019-07-11 stsp .It ! Ta changes destined for a missing file were not merged
630 818c7501 2019-07-11 stsp .It D Ta file was deleted
631 818c7501 2019-07-11 stsp .It d Ta file's deletion was obstructed by local modifications
632 818c7501 2019-07-11 stsp .It A Ta new file was added
633 818c7501 2019-07-11 stsp .It ~ Ta changes destined for a non-regular file were not merged
636 f09e2405 2019-07-11 stsp If merge conflicts occur the rebase operation is interrupted and may
637 f09e2405 2019-07-11 stsp be continued once conflicts have been resolved.
638 818c7501 2019-07-11 stsp Alternatively, the rebase operation may be aborted which will leave
640 818c7501 2019-07-11 stsp unmodified and the work tree switched back to its original branch.
642 ff0d2220 2019-07-11 stsp If a merge conflict is resolved in a way which renders the merged
643 f09e2405 2019-07-11 stsp change into a no-op change, the corresponding commit will be elided
644 f09e2405 2019-07-11 stsp when the rebase operation continues.
646 818c7501 2019-07-11 stsp .Cm got rebase
647 818c7501 2019-07-11 stsp will refuse to run if certain preconditions are not met.
648 818c7501 2019-07-11 stsp If the work tree contains multiple base commits it must first be updated
649 818c7501 2019-07-11 stsp to a single base commit with
650 818c7501 2019-07-11 stsp .Cm got update .
651 f09e2405 2019-07-11 stsp If the work tree contains local changes, these changes must first be
652 f09e2405 2019-07-11 stsp committed with
653 f09e2405 2019-07-11 stsp .Cm got commit
654 f09e2405 2019-07-11 stsp or reverted with
655 f09e2405 2019-07-11 stsp .Cm got revert .
658 64c6d990 2019-07-11 stsp contains changes to files outside of the work tree's path prefix,
659 64c6d990 2019-07-11 stsp the work tree cannot be used to rebase this branch.
662 7d5807f4 2019-07-11 stsp .Cm got update
664 7d5807f4 2019-07-11 stsp .Cm got commit
665 7d5807f4 2019-07-11 stsp commands will refuse to run while a rebase operation is in progress.
666 7d5807f4 2019-07-11 stsp Other commands which manipulate the work tree may be used for
667 7d5807f4 2019-07-11 stsp conflict resolution purposes.
669 818c7501 2019-07-11 stsp The options for
670 818c7501 2019-07-11 stsp .Cm got rebase
671 818c7501 2019-07-11 stsp are as follows:
672 818c7501 2019-07-11 stsp .Bl -tag -width Ds
674 818c7501 2019-07-11 stsp Abort an interrupted rebase operation.
675 cd98404f 2019-07-14 stsp If this option is used, no further command-line arguments are allowed.
677 06067b48 2019-07-11 stsp Continue an interrupted rebase operation.
678 cd98404f 2019-07-14 stsp If this option is used, no further command-line arguments are allowed.
681 818c7501 2019-07-11 stsp Short alias for
682 818c7501 2019-07-11 stsp .Cm rebase .
684 74416c47 2019-05-09 stsp .Sh ENVIRONMENT
685 74416c47 2019-05-09 stsp .Bl -tag -width GOT_AUTHOR
686 74416c47 2019-05-09 stsp .It Ev GOT_AUTHOR
687 74416c47 2019-05-09 stsp The author's name and email address for
688 21a44f98 2019-07-15 stsp .Cm got commit
690 21a44f98 2019-07-15 stsp .Cm got import ,
691 74416c47 2019-05-09 stsp for example:
692 74416c47 2019-05-09 stsp .An Stefan Sperling Aq Mt stsp@openbsd.org
693 23594da9 2019-05-13 stsp .It Ev VISUAL, Ev EDITOR
694 23594da9 2019-05-13 stsp The editor spawned by
695 23594da9 2019-05-13 stsp .Cm got commit .
697 5c860e29 2018-03-12 stsp .Sh EXIT STATUS
698 5c860e29 2018-03-12 stsp .Ex -std got
699 97925469 2018-03-17 stsp .Sh EXAMPLES
700 fa6e0e48 2019-05-23 stsp Clone an existing Git repository for use with
702 fa6e0e48 2019-05-23 stsp This step currently requires
703 fa6e0e48 2019-05-23 stsp .Xr git 1 :
705 fa6e0e48 2019-05-23 stsp .Dl $ cd /var/git/
706 fa6e0e48 2019-05-23 stsp .Dl $ git clone --bare https://github.com/openbsd/src.git
708 3ce1b845 2019-07-15 stsp Alternatively, for quick and dirty local testing of
710 3ce1b845 2019-07-15 stsp a new Git repository could be created and populated with files,
711 3ce1b845 2019-07-15 stsp e.g. from a temporary CVS checkout located at
712 3ce1b845 2019-07-15 stsp .Pa /tmp/src :
714 3ce1b845 2019-07-15 stsp .Dl $ got init /var/git/src.git
715 2930ef13 2019-07-15 stsp .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
717 3ce1b845 2019-07-15 stsp Check out a work tree from the Git repository to /usr/src:
719 fa6e0e48 2019-05-23 stsp .Dl $ got checkout /var/git/src.git /usr/src
721 e70c17ce 2019-05-22 stsp View local changes in a work tree directory:
723 e70c17ce 2019-05-22 stsp .Dl $ got status
724 e70c17ce 2019-05-22 stsp .Dl $ got diff | less
726 e70c17ce 2019-05-22 stsp In a work tree or a git repository directory, list all branch references:
728 4e759de4 2019-06-26 stsp .Dl $ got branch -l
730 fa6e0e48 2019-05-23 stsp In a work tree or a git repository directory, create a new branch called
731 e70c17ce 2019-05-22 stsp .Dq unified-buffer-cache
732 d83d9d5c 2019-05-13 stsp which is forked off the
736 4e759de4 2019-06-26 stsp .Dl $ got branch unified-buffer-cache master
738 e70c17ce 2019-05-22 stsp Switch an existing work tree to the branch
739 e70c17ce 2019-05-22 stsp .Dq unified-buffer-cache .
740 e70c17ce 2019-05-22 stsp Local changes in the work tree will be preserved and merged if necessary:
742 e70c17ce 2019-05-22 stsp .Dl $ got update -b unified-buffer-cache
744 fa6e0e48 2019-05-23 stsp Create a new commit from local changes in a work tree directory.
745 fa6e0e48 2019-05-23 stsp This new commit will become the head commit of the work tree's current branch:
747 fa6e0e48 2019-05-23 stsp .Dl $ got commit
749 fa6e0e48 2019-05-23 stsp In a work tree or a git repository directory, view changes committed in
750 fa6e0e48 2019-05-23 stsp the 3 most recent commits to the work tree's branch, or the branch resolved
751 fa6e0e48 2019-05-23 stsp via the repository's HEAD reference, respectively:
753 cc54c501 2019-07-15 stsp .Dl $ got log -p -l 3 -f
755 e70c17ce 2019-05-22 stsp Add new files and remove obsolete files in a work tree directory:
757 fa6e0e48 2019-05-23 stsp .Dl $ got add sys/uvm/uvm_ubc.c
758 86d25a1b 2019-07-11 stsp .Dl $ got remove sys/uvm/uvm_vnode.c
760 e70c17ce 2019-05-22 stsp Create a new commit from local changes in a work tree directory
761 e70c17ce 2019-05-22 stsp with a pre-defined log message.
763 e70c17ce 2019-05-22 stsp .Dl $ got commit -m 'unify the buffer cache'
765 e70c17ce 2019-05-22 stsp Update any work tree checked out from the
766 e70c17ce 2019-05-22 stsp .Dq unified-buffer-cache
767 e70c17ce 2019-05-22 stsp branch to the latest commit on this branch:
769 fa6e0e48 2019-05-23 stsp .Dl $ got update
771 9221fb1e 2019-06-26 stsp Fetch new upstream commits into the local repository's master branch.
772 9221fb1e 2019-06-26 stsp This step currently requires
773 9221fb1e 2019-06-26 stsp .Xr git 1 :
775 fa6e0e48 2019-05-23 stsp .Dl $ cd /var/git/src.git
776 fa6e0e48 2019-05-23 stsp .Dl $ git fetch origin master:master
779 fa6e0e48 2019-05-23 stsp .Dq unified-buffer-cache
780 fa6e0e48 2019-05-23 stsp branch on top of the new head commit of the
784 818c7501 2019-07-11 stsp .Dl $ got update -b master
785 818c7501 2019-07-11 stsp .Dl $ got rebase unified-buffer-cache
787 7d7ffedb 2019-07-14 stsp Create a patch from all changes on the unified-buffer-cache branch.
788 7d7ffedb 2019-07-14 stsp The patch can be mailed out for review and applied to OpenBSD's CVS tree:
790 7d7ffedb 2019-07-14 stsp .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
792 5c860e29 2018-03-12 stsp .Sh SEE ALSO
793 5e5560e1 2018-08-01 stsp .Xr git-repository 5
794 285dc8a4 2018-03-13 stsp .Xr got-worktree 5
795 1a208aaf 2018-04-01 stsp .Sh AUTHORS
796 1a208aaf 2018-04-01 stsp .An Stefan Sperling Aq Mt stsp@openbsd.org
797 1a208aaf 2018-04-01 stsp .An Martin Pieuchot Aq Mt mpi@openbsd.org
798 72e28b48 2019-05-14 stsp .An joshua stein Aq Mt jcs@openbsd.org
799 fa6e0e48 2019-05-23 stsp .Sh CAVEATS
801 fa6e0e48 2019-05-23 stsp is a work-in-progress and many commands remain to be implemented.
802 fa6e0e48 2019-05-23 stsp At present, the user has to fall back on
804 b48be8cf 2019-07-14 stsp to perform tasks related to repository administration and tasks
805 b48be8cf 2019-07-14 stsp which require a network connection.
807 fa6e0e48 2019-05-23 stsp When working against a repository created with
808 fa6e0e48 2019-05-23 stsp .Dq git clone --bare ,
809 fa6e0e48 2019-05-23 stsp local commits to the
811 fa6e0e48 2019-05-23 stsp branch are discouraged, for now, if changes committed to the upstream
812 fa6e0e48 2019-05-23 stsp repository need to be tracked.
813 fa6e0e48 2019-05-23 stsp See the EXAMPLES section.
814 723bd6d4 2019-07-14 stsp Future built-in
818 723bd6d4 2019-07-14 stsp commands should alleviate this problem.