Blob


1 .\"
2 .\" Copyright (c) 2017 Martin Pieuchot
3 .\" Copyright (c) 2018, 2019 Stefan Sperling
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
8 .\"
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\"
17 .Dd $Mdocdate$
18 .Dt GOT 1
19 .Os
20 .Sh NAME
21 .Nm got
22 .Nd game of trees
23 .Sh SYNOPSIS
24 .Nm
25 .Ar command
26 .Op Fl h
27 .Op Ar arg ...
28 .Sh DESCRIPTION
29 .Nm
30 is a version control system which stores the history of tracked files
31 in a Git repository, as used by the Git version control system.
32 This repository format is described in
33 .Xr git-repository 5 .
34 .Pp
35 .Nm
36 is a
37 .Dq distributed
38 version control system because every copy of a repository is writeable.
39 Modifications made to files can be synchronized between repositories
40 at any time.
41 .Pp
42 Files managed by
43 .Nm
44 must be checked out from the repository for modification.
45 Checked out files are stored in a
46 .Em work tree
47 which can be placed at an arbitrary directory in the filesystem hierarchy.
48 The on-disk format of this work tree is described in
49 .Xr got-worktree 5 .
50 .Pp
51 .Nm
52 provides global and command-specific options.
53 Global options must preceed the command name, and are as follows:
54 .Bl -tag -width tenletters
55 .It Fl h
56 Display usage information.
57 .El
58 .Pp
59 The commands for
60 .Nm
61 are as follows:
62 .Bl -tag -width checkout
63 .It Cm init Ar path
64 Create a new empty repository at the specified
65 .Ar path .
66 .Pp
67 After
68 .Cm got init ,
69 the
70 .Cm got import
71 command must be used to populate the empty repository before
72 .Cm got checkout
73 can be used.
74 .Pp
75 .It Cm import [ Fl b Ar branch ] [ Fl m Ar message ] [ Fl r Ar repository-path ] [ Fl I Ar pattern ] directory
76 Create an initial commit in a repository from the file hierarchy
77 within the specified
78 .Ar directory .
79 The created commit will not have any parent commits, i.e. it will be a
80 root commit.
81 Also create a new reference which provides a branch name for the newly
82 created commit.
83 .Pp
84 Show the path of each added file to indicate progress.
85 .Pp
86 The options for
87 .Cm got import
88 are as follows:
89 .Bl -tag -width Ds
90 .It Fl b Ar branch
91 Create the specified
92 .Ar branch
93 instead of creating the default branch
94 .Dq master .
95 Use of this option is required if the
96 .Dq master
97 branch already exists.
98 .It Fl m Ar message
99 Use the specified log message when creating the new commit.
100 Without the
101 .Fl m
102 option,
103 .Cm got import
104 opens a temporary file in an editor where a log message can be written.
105 .It Fl r Ar repository-path
106 Use the repository at the specified path.
107 If not specified, assume the repository is located at or above the current
108 working directory.
109 .It Fl I Ar pattern
110 Ignore files or directories with a name which matches the specified
111 .Ar pattern .
112 This option may be specified multiple times to build a list of ignore patterns.
113 The
114 .Ar pattern
115 follows the globbing rules documented in
116 .Xr glob 7 .
117 .El
118 .It Cm checkout [ Fl b Ar branch ] [ Fl c Ar commit ] [ Fl p Ar path-prefix ] repository-path [ work-tree-path ]
119 Copy files from a repository into a new work tree.
120 If the
121 .Ar work tree path
122 is not specified, either use the last component of
123 .Ar repository path ,
124 or if a
125 .Ar path prefix
126 was specified use the last component of
127 .Ar path prefix .
128 .Pp
129 The options for
130 .Cm got checkout
131 are as follows:
132 .Bl -tag -width Ds
133 .It Fl b Ar branch
134 Check out files from the specified
135 .Ar branch .
136 If this option is not specified, a branch resolved via the repository's HEAD
137 reference will be used.
138 .It Fl c Ar commit
139 Check out files from the specified
140 .Ar commit .
141 The expected argument is a commit ID SHA1 hash.
142 An abbreviated hash argument will be expanded to a full SHA1 hash
143 automatically, provided the abbreviation is unique.
144 If this option is not specified, the most recent commit on the selected
145 branch will be used.
146 .It Fl p Ar path-prefix
147 Restrict the work tree to a subset of the repository's tree hierarchy.
148 Only files beneath the specified
149 .Ar path-prefix
150 will be checked out.
151 .El
152 .It Cm co
153 Short alias for
154 .Cm checkout .
155 .It Cm update [ Fl b Ar branch ] [ Fl c Ar commit ] [ Ar path ]
156 Update an existing work tree to a different commit.
157 Show the status of each affected file, using the following status codes:
158 .Bl -column YXZ description
159 .It U Ta file was updated and contained no local changes
160 .It G Ta file was updated and local changes were merged cleanly
161 .It C Ta file was updated and conflicts occurred during merge
162 .It D Ta file was deleted
163 .It A Ta new file was added
164 .It ~ Ta versioned file is obstructed by a non-regular file
165 .It ! Ta a missing versioned file was restored
166 .El
167 .Pp
168 If a
169 .Ar path
170 is specified, restrict the update operation to files at or within this path.
171 The path is required to exist in the update operation's target commit.
172 Files in the work tree outside this path will remain unchanged and will
173 retain their previously recorded base commit.
174 Some
175 .Nm
176 commands may refuse to run while the work tree contains files from
177 multiple base commits.
178 The base commit of such a work tree can be made consistent by running
179 .Cm got update
180 across the entire work tree.
181 Specifying a
182 .Ar path
183 is incompatible with the
184 .Fl b
185 option.
186 .Pp
187 The options for
188 .Cm got update
189 are as follows:
190 .Bl -tag -width Ds
191 .It Fl b Ar branch
192 Switch the work tree's branch reference to the specified
193 .Ar branch
194 before updating the work tree.
195 This option requires that all paths in the work tree are updated.
196 .It Fl c Ar commit
197 Update the work tree to the specified
198 .Ar commit .
199 The expected argument is a commit ID SHA1 hash.
200 An abbreviated hash argument will be expanded to a full SHA1 hash
201 automatically, provided the abbreviation is unique.
202 If this option is not specified, the most recent commit on the work tree's
203 branch will be used.
204 .El
205 .It Cm up
206 Short alias for
207 .Cm update .
208 .It Cm status [ Ar path ]
209 Show the current modification status of files in a work tree,
210 using the following status codes:
211 .Bl -column YXZ description
212 .It M Ta modified file
213 .It A Ta file scheduled for addition in next commit
214 .It D Ta file scheduled for deletion in next commit
215 .It C Ta modified or added file which contains merge conflicts
216 .It ! Ta versioned file was expected on disk but is missing
217 .It ~ Ta versioned file is obstructed by a non-regular file
218 .It ? Ta unversioned item not tracked by
219 .Nm
220 .El
221 .Pp
222 If a
223 .Ar path
224 is specified, only show modifications within this path.
225 .It Cm st
226 Short alias for
227 .Cm status .
228 .It Cm log [ Fl b ] [ Fl c Ar commit ] [ Fl C Ar number ] [ Fl l Ar N ] [ Fl p ] [ Fl r Ar repository-path ] [ path ]
229 Display history of a repository.
230 If a
231 .Ar path
232 is specified, show only commits which modified this path.
233 .Pp
234 The options for
235 .Cm got log
236 are as follows:
237 .Bl -tag -width Ds
238 .It Fl b
239 Show the linear line of history of the current branch.
240 This option restricts history traversal to the first parent of each commit.
241 Commits which the branch was based on and merge commits which affected the
242 branch will be shown, but individual commits created on parallel branches
243 will be omitted.
244 .It Fl c Ar commit
245 Start traversing history at the specified
246 .Ar commit .
247 The expected argument is the name of a branch or a commit ID SHA1 hash.
248 An abbreviated hash argument will be expanded to a full SHA1 hash
249 automatically, provided the abbreviation is unique.
250 If this option is not specified, default to the work tree's current branch
251 if invoked in a work tree, or to the repository's HEAD reference.
252 .It Fl C Ar number
253 Set the number of context lines shown in diffs with
254 .Fl p .
255 By default, 3 lines of context are shown.
256 .It Fl l Ar N
257 Limit history traversal to a given number of commits.
258 .It Fl p
259 Display the patch of modifications made in each commit.
260 .It Fl r Ar repository-path
261 Use the repository at the specified path.
262 If not specified, assume the repository is located at or above the current
263 working directory.
264 If this directory is a
265 .Nm
266 work tree, use the repository path associated with this work tree.
267 .El
268 .It Cm diff [ Fl C Ar number ] [ Fl r Ar repository-path ] [ Ar object1 Ar object2 | Ar path ]
269 When invoked within a work tree with less than two arguments, display
270 uncommitted changes in the work tree.
271 If a
272 .Ar path
273 is specified, only show changes within this path.
274 .Pp
275 If two arguments are provided, treat each argument as a reference,
276 or an object ID SHA1 hash, and display differences between these objects.
277 Both objects must be of the same type (blobs, trees, or commits).
278 An abbreviated hash argument will be expanded to a full SHA1 hash
279 automatically, provided the abbreviation is unique.
280 .Pp
281 The options for
282 .Cm got diff
283 are as follows:
284 .Bl -tag -width Ds
285 .It Fl C Ar number
286 Set the number of context lines shown in the diff.
287 By default, 3 lines of context are shown.
288 .It Fl r Ar repository-path
289 Use the repository at the specified path.
290 If not specified, assume the repository is located at or above the current
291 working directory.
292 If this directory is a
293 .Nm
294 work tree, use the repository path associated with this work tree.
295 .El
296 .It Cm blame [ Fl c Ar commit ] [ Fl r Ar repository-path ] Ar path
297 Display line-by-line history of a file at the specified path.
298 .Pp
299 The options for
300 .Cm got blame
301 are as follows:
302 .Bl -tag -width Ds
303 .It Fl c Ar commit
304 Start traversing history at the specified
305 .Ar commit .
306 The expected argument is the name of a branch or a commit ID SHA1 hash.
307 An abbreviated hash argument will be expanded to a full SHA1 hash
308 automatically, provided the abbreviation is unique.
309 .It Fl r Ar repository-path
310 Use the repository at the specified path.
311 If not specified, assume the repository is located at or above the current
312 working directory.
313 If this directory is a
314 .Nm
315 work tree, use the repository path associated with this work tree.
316 .El
317 .It Cm tree [ Fl c Ar commit ] [ Fl r Ar repository-path ] [ Fl i ] [ Fl R] [ Ar path ]
318 Display a listing of files and directories at the specified
319 directory path in the repository.
320 Entries shown in this listing may carry one of the following trailing
321 annotations:
322 .Bl -column YXZ description
323 .It / Ta entry is a directory
324 .It * Ta entry is an executable file
325 .El
326 .Pp
327 If no
328 .Ar path
329 is specified, list the repository path corresponding to the current
330 directory of the work tree, or the root directory of the repository
331 if there is no work tree.
332 .Pp
333 The options for
334 .Cm got tree
335 are as follows:
336 .Bl -tag -width Ds
337 .It Fl c Ar commit
338 List files and directories as they appear in the specified
339 .Ar commit .
340 The expected argument is the name of a branch or a commit ID SHA1 hash.
341 An abbreviated hash argument will be expanded to a full SHA1 hash
342 automatically, provided the abbreviation is unique.
343 .It Fl r Ar repository-path
344 Use the repository at the specified path.
345 If not specified, assume the repository is located at or above the current
346 working directory.
347 If this directory is a
348 .Nm
349 work tree, use the repository path associated with this work tree.
350 .It Fl i
351 Show object IDs of files (blob objects) and directories (tree objects).
352 .It Fl R
353 Recurse into sub-directories in the repository.
354 .El
355 .It Cm ref [ Fl r Ar repository-path ] [ Fl l ] [ Fl d Ar name ] [ Ar name Ar target ]
356 Manage references in a repository.
357 .Pp
358 If no options are passed, expect two arguments and attempt to create,
359 or update, the reference with the given
360 .Ar name ,
361 and make it point at the given
362 .Ar target .
363 The target may be an object ID SHA1 hash or an existing reference which
364 will be resolved to an object ID.
365 An abbreviated hash argument will be expanded to a full SHA1 hash
366 automatically, provided the abbreviation is unique.
367 .Pp
368 The options for
369 .Cm got ref
370 are as follows:
371 .Bl -tag -width Ds
372 .It Fl r Ar repository-path
373 Use the repository at the specified path.
374 If not specified, assume the repository is located at or above the current
375 working directory.
376 If this directory is a
377 .Nm
378 work tree, use the repository path associated with this work tree.
379 .It Fl l
380 List all existing references in the repository.
381 .It Fl d Ar name
382 Delete the reference with the specified name from the repository.
383 .El
384 .It Cm branch [ Fl r Ar repository-path ] [ Fl l ] [ Fl d Ar name ] [ Ar name [ Ar base-branch ] ]
385 Manage branches in a repository.
386 .Pp
387 Branches are managed via references which live in the
388 .Dq refs/heads/
389 reference namespace.
390 The
391 .Cm got branch
392 command operates on references in this namespace only.
393 .Pp
394 If no options are passed, expect one or two arguments and attempt to create
395 a branch with the given
396 .Ar name ,
397 and make it point at the given
398 .Ar base-branch .
399 If no
400 .Ar base-branch
401 is specified, default to the work tree's current branch if invoked in a
402 work tree, or to the repository's HEAD reference.
403 .Pp
404 The options for
405 .Cm got branch
406 are as follows:
407 .Bl -tag -width Ds
408 .It Fl r Ar repository-path
409 Use the repository at the specified path.
410 If not specified, assume the repository is located at or above the current
411 working directory.
412 If this directory is a
413 .Nm
414 work tree, use the repository path associated with this work tree.
415 .It Fl l
416 List all existing branches in the repository.
417 .Pp
418 If invoked in a work tree, the work tree's current branch is shown
419 with one the following annotations:
420 .Bl -column YXZ description
421 .It * Ta work tree's base commit matches the branch tip
422 .It ~ Ta work tree's base commit is out-of-date
423 .El
424 .It Fl d Ar name
425 Delete the branch with the specified name from the repository.
426 Only the branch reference is deleted.
427 Any commit, tree, and blob objects belonging to the branch
428 remain in the repository and may be removed separately with
429 Git's garbage collector.
430 .El
431 .It Cm br
432 Short alias for
433 .Cm branch .
434 .It Cm add Ar file-path ...
435 Schedule unversioned files in a work tree for addition to the
436 repository in the next commit.
437 .It Cm remove Ar file-path ...
438 Remove versioned files from a work tree and schedule them for deletion
439 from the repository in the next commit.
440 .Pp
441 The options for
442 .Cm got remove
443 are as follows:
444 .Bl -tag -width Ds
445 .It Fl f
446 Perform the operation even if a file contains uncommitted modifications.
447 .El
448 .It Cm rm
449 Short alias for
450 .Cm remove .
451 .It Cm revert Ar file-path ...
452 Revert any uncommited changes in files at the specified paths.
453 File contents will be overwritten with those contained in the
454 work tree's base commit. There is no way to bring discarded
455 changes back after
456 .Cm got revert !
457 .Pp
458 If a file was added with
459 .Cm got add
460 it will become an unversioned file again.
461 If a file was deleted with
462 .Cm got remove
463 it will be restored.
464 .It Cm rv
465 Short alias for
466 .Cm revert .
467 .It Cm commit [ Fl m Ar message ] [ file-path ]
468 Create a new commit in the repository from local changes in a work tree
469 and use this commit as the new base commit for the work tree.
470 .Pp
471 Show the status of each affected file, using the following status codes:
472 .Bl -column YXZ description
473 .It M Ta modified file
474 .It D Ta file was deleted
475 .It A Ta new file was added
476 .El
477 .Pp
478 Files without local changes will retain their previously recorded base
479 commit.
480 Some
481 .Nm
482 commands may refuse to run while the work tree contains files from
483 multiple base commits.
484 The base commit of such a work tree can be made consistent by running
485 .Cm got update
486 across the entire work tree.
487 .Pp
488 The
489 .Cm got commit
490 command requires the
491 .Ev GOT_AUTHOR
492 environment variable to be set.
493 .Pp
494 The options for
495 .Cm got commit
496 are as follows:
497 .Bl -tag -width Ds
498 .It Fl m Ar message
499 Use the specified log message when creating the new commit.
500 Without the
501 .Fl m
502 option,
503 .Cm got commit
504 opens a temporary file in an editor where a log message can be written.
505 .El
506 .It Cm ci
507 Short alias for
508 .Cm commit .
509 .It Cm cherrypick Ar commit
510 Merge changes from a single
511 .Ar commit
512 into the work tree.
513 The specified
514 .Ar commit
515 must be on a different branch than the work tree's base commit.
516 The expected argument is a reference or a commit ID SHA1 hash.
517 An abbreviated hash argument will be expanded to a full SHA1 hash
518 automatically, provided the abbreviation is unique.
519 .Pp
520 Show the status of each affected file, using the following status codes:
521 .Bl -column YXZ description
522 .It G Ta file was merged
523 .It C Ta file was merged and conflicts occurred during merge
524 .It ! Ta changes destined for a missing file were not merged
525 .It D Ta file was deleted
526 .It d Ta file's deletion was obstructed by local modifications
527 .It A Ta new file was added
528 .It ~ Ta changes destined for a non-regular file were not merged
529 .El
530 .Pp
531 The merged changes will appear as local changes in the work tree, which
532 may be viewed with
533 .Cm got diff ,
534 amended manually or with further
535 .Cm got cherrypick
536 comands,
537 committed with
538 .Cm got commit ,
539 or discarded again with
540 .Cm got revert .
541 .Pp
542 .Cm got cherrypick
543 will refuse to run if certain preconditions are not met.
544 If the work tree contains multiple base commits it must first be updated
545 to a single base commit with
546 .Cm got update .
547 If the work tree already contains files with merge conflicts, these
548 conflicts must be resolved first.
549 .It Cm cy
550 Short alias for
551 .Cm cherrypick .
552 .It Cm backout Ar commit
553 Reverse-merge changes from a single
554 .Ar commit
555 into the work tree.
556 The specified
557 .Ar commit
558 must be on the same branch as the work tree's base commit.
559 The expected argument is a reference or a commit ID SHA1 hash.
560 An abbreviated hash argument will be expanded to a full SHA1 hash
561 automatically, provided the abbreviation is unique.
562 .Pp
563 Show the status of each affected file, using the following status codes:
564 .Bl -column YXZ description
565 .It G Ta file was merged
566 .It C Ta file was merged and conflicts occurred during merge
567 .It ! Ta changes destined for a missing file were not merged
568 .It D Ta file was deleted
569 .It d Ta file's deletion was obstructed by local modifications
570 .It A Ta new file was added
571 .It ~ Ta changes destined for a non-regular file were not merged
572 .El
573 .Pp
574 The reverse-merged changes will appear as local changes in the work tree,
575 which may be viewed with
576 .Cm got diff ,
577 amended manually or with further
578 .Cm got backout
579 comands,
580 committed with
581 .Cm got commit ,
582 or discarded again with
583 .Cm got revert .
584 .Pp
585 .Cm got backout
586 will refuse to run if certain preconditions are not met.
587 If the work tree contains multiple base commits it must first be updated
588 to a single base commit with
589 .Cm got update .
590 If the work tree already contains files with merge conflicts, these
591 conflicts must be resolved first.
592 .It Cm bo
593 Short alias for
594 .Cm backout .
595 .It Cm rebase [ Fl a ] [ Fl c] [ Ar branch ]
596 Rebase commits on the specified
597 .Ar branch
598 onto the tip of the current branch of the work tree.
599 The
600 .Ar branch
601 must share common ancestry with the work tree's current branch.
602 Rebasing begins with the first descendent commit of the youngest
603 common ancestor commit shared by the specified
604 .Ar branch
605 and the work tree's current branch, and stops once the tip commit
606 of the specified
607 .Ar branch
608 has been rebased.
609 .Pp
610 Rebased commits are accumulated on a temporary branch and represent
611 the same changes with the same log messages as their counterparts
612 on the original
613 .Ar branch ,
614 but with different commit IDs.
615 Once rebasing has completed successfully, the temporary branch becomes
616 the new version of the specified
617 .Ar branch
618 and the work tree is automatically switched to it.
619 .Pp
620 While rebasing commits, show the status of each affected file,
621 using the following status codes:
622 .Bl -column YXZ description
623 .It G Ta file was merged
624 .It C Ta file was merged and conflicts occurred during merge
625 .It ! Ta changes destined for a missing file were not merged
626 .It D Ta file was deleted
627 .It d Ta file's deletion was obstructed by local modifications
628 .It A Ta new file was added
629 .It ~ Ta changes destined for a non-regular file were not merged
630 .El
631 .Pp
632 If merge conflicts occur the rebase operation is interrupted and may
633 be continued once conflicts have been resolved.
634 Alternatively, the rebase operation may be aborted which will leave
635 .Ar branch
636 unmodified and the work tree switched back to its original branch.
637 .Pp
638 If a merge conflict is resolved in a way which renders the merged
639 change into a no-op change, the corresponding commit will be elided
640 when the rebase operation continues.
641 .Pp
642 .Cm got rebase
643 will refuse to run if certain preconditions are not met.
644 If the work tree contains multiple base commits it must first be updated
645 to a single base commit with
646 .Cm got update .
647 If the work tree contains local changes, these changes must first be
648 committed with
649 .Cm got commit
650 or reverted with
651 .Cm got revert .
652 If the
653 .Ar branch
654 contains changes to files outside of the work tree's path prefix,
655 the work tree cannot be used to rebase this branch.
656 .Pp
657 The
658 .Cm got update
659 and
660 .Cm got commit
661 commands will refuse to run while a rebase operation is in progress.
662 Other commands which manipulate the work tree may be used for
663 conflict resolution purposes.
664 .Pp
665 The options for
666 .Cm got rebase
667 are as follows:
668 .Bl -tag -width Ds
669 .It Fl a
670 Abort an interrupted rebase operation.
671 If this option is used, no further command-line arguments are allowed.
672 .It Fl c
673 Continue an interrupted rebase operation.
674 If this option is used, no further command-line arguments are allowed.
675 .El
676 .It Cm rb
677 Short alias for
678 .Cm rebase .
679 .El
680 .Sh ENVIRONMENT
681 .Bl -tag -width GOT_AUTHOR
682 .It Ev GOT_AUTHOR
683 The author's name and email address for
684 .Cm got commit ,
685 for example:
686 .An Stefan Sperling Aq Mt stsp@openbsd.org
687 .It Ev VISUAL, Ev EDITOR
688 The editor spawned by
689 .Cm got commit .
690 .El
691 .Sh EXIT STATUS
692 .Ex -std got
693 .Sh EXAMPLES
694 Clone an existing Git repository for use with
695 .Nm .
696 This step currently requires
697 .Xr git 1 :
698 .Pp
699 .Dl $ cd /var/git/
700 .Dl $ git clone --bare https://github.com/openbsd/src.git
701 .Pp
702 Alternatively, for quick and dirty local testing of
703 .Nm
704 a new Git repository could be created and populated with files,
705 e.g. from a temporary CVS checkout located at
706 .Pa /tmp/src :
707 .Pp
708 .Dl $ got init /var/git/src.git
709 .Dl $ got import -r /var/src.git -I CVS -I obj /tmp/src
710 .Pp
711 Check out a work tree from the Git repository to /usr/src:
712 .Pp
713 .Dl $ got checkout /var/git/src.git /usr/src
714 .Pp
715 View local changes in a work tree directory:
716 .Pp
717 .Dl $ got status
718 .Dl $ got diff | less
719 .Pp
720 In a work tree or a git repository directory, list all branch references:
721 .Pp
722 .Dl $ got branch -l
723 .Pp
724 In a work tree or a git repository directory, create a new branch called
725 .Dq unified-buffer-cache
726 which is forked off the
727 .Dq master
728 branch:
729 .Pp
730 .Dl $ got branch unified-buffer-cache master
731 .Pp
732 Switch an existing work tree to the branch
733 .Dq unified-buffer-cache .
734 Local changes in the work tree will be preserved and merged if necessary:
735 .Pp
736 .Dl $ got update -b unified-buffer-cache
737 .Pp
738 Create a new commit from local changes in a work tree directory.
739 This new commit will become the head commit of the work tree's current branch:
740 .Pp
741 .Dl $ got commit
742 .Pp
743 In a work tree or a git repository directory, view changes committed in
744 the 3 most recent commits to the work tree's branch, or the branch resolved
745 via the repository's HEAD reference, respectively:
746 .Pp
747 .Dl $ got log -p -l 3 -b
748 .Pp
749 Add new files and remove obsolete files in a work tree directory:
750 .Pp
751 .Dl $ got add sys/uvm/uvm_ubc.c
752 .Dl $ got remove sys/uvm/uvm_vnode.c
753 .Pp
754 Create a new commit from local changes in a work tree directory
755 with a pre-defined log message.
756 .Pp
757 .Dl $ got commit -m 'unify the buffer cache'
758 .Pp
759 Update any work tree checked out from the
760 .Dq unified-buffer-cache
761 branch to the latest commit on this branch:
762 .Pp
763 .Dl $ got update
764 .Pp
765 Fetch new upstream commits into the local repository's master branch.
766 This step currently requires
767 .Xr git 1 :
768 .Pp
769 .Dl $ cd /var/git/src.git
770 .Dl $ git fetch origin master:master
771 .Pp
772 Rebase the
773 .Dq unified-buffer-cache
774 branch on top of the new head commit of the
775 .Dq master
776 branch.
777 .Pp
778 .Dl $ got update -b master
779 .Dl $ got rebase unified-buffer-cache
780 .Pp
781 Create a patch from all changes on the unified-buffer-cache branch.
782 The patch can be mailed out for review and applied to OpenBSD's CVS tree:
783 .Pp
784 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
785 .Pp
786 .Sh SEE ALSO
787 .Xr git-repository 5
788 .Xr got-worktree 5
789 .Sh AUTHORS
790 .An Stefan Sperling Aq Mt stsp@openbsd.org
791 .An Martin Pieuchot Aq Mt mpi@openbsd.org
792 .An joshua stein Aq Mt jcs@openbsd.org
793 .Sh CAVEATS
794 .Nm
795 is a work-in-progress and many commands remain to be implemented.
796 At present, the user has to fall back on
797 .Xr git 1
798 to perform tasks related to repository administration and tasks
799 which require a network connection.
800 .Pp
801 When working against a repository created with
802 .Dq git clone --bare ,
803 local commits to the
804 .Dq master
805 branch are discouraged, for now, if changes committed to the upstream
806 repository need to be tracked.
807 See the EXAMPLES section.
808 Future built-in
809 .Cm clone
810 and
811 .Cm fetch
812 commands should alleviate this problem.