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 precede the command name, and are as follows:
54 .Bl -tag -width tenletters
55 .It Fl h
56 Display usage information and exit immediately.
57 .It Fl V
58 Display program version and exit immediately.
59 .El
60 .Pp
61 The commands for
62 .Nm
63 are as follows:
64 .Bl -tag -width checkout
65 .It Cm init Ar repository-path
66 Create a new empty repository at the specified
67 .Ar repository-path .
68 .Pp
69 After
70 .Cm got init ,
71 the
72 .Cm got import
73 command must be used to populate the empty repository before
74 .Cm got checkout
75 can be used.
76 .It Cm in
77 Short alias for
78 .Cm init .
79 .It Cm import Oo Fl b Ar branch Oc Oo Fl m Ar message Oc Oo Fl r Ar repository-path Oc Oo Fl I Ar pattern Oc Ar directory
80 Create an initial commit in a repository from the file hierarchy
81 within the specified
82 .Ar directory .
83 The created commit will not have any parent commits, i.e. it will be a
84 root commit.
85 Also create a new reference which provides a branch name for the newly
86 created commit.
87 Show the path of each imported file to indicate progress.
88 .Pp
89 The
90 .Cm got import
91 command requires the
92 .Ev GOT_AUTHOR
93 environment variable to be set,
94 unless Git's
95 .Dv user.name
96 and
97 .Dv user.email
98 configuration settings can be obtained from the repository's
99 .Pa .git/config
100 file or from Git's global
101 .Pa ~/.gitconfig
102 configuration file.
103 .Pp
104 The options for
105 .Cm got import
106 are as follows:
107 .Bl -tag -width Ds
108 .It Fl b Ar branch
109 Create the specified
110 .Ar branch
111 instead of creating the default branch
112 .Dq main .
113 Use of this option is required if the
114 .Dq main
115 branch already exists.
116 .It Fl m Ar message
117 Use the specified log message when creating the new commit.
118 Without the
119 .Fl m
120 option,
121 .Cm got import
122 opens a temporary file in an editor where a log message can be written.
123 .It Fl r Ar repository-path
124 Use the repository at the specified path.
125 If not specified, assume the repository is located at or above the current
126 working directory.
127 .It Fl I Ar pattern
128 Ignore files or directories with a name which matches the specified
129 .Ar pattern .
130 This option may be specified multiple times to build a list of ignore patterns.
131 The
132 .Ar pattern
133 follows the globbing rules documented in
134 .Xr glob 7 .
135 .El
136 .It Cm im
137 Short alias for
138 .Cm import .
139 .It Cm checkout Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl p Ar path-prefix Oc Ar repository-path Op Ar work-tree-path
140 Copy files from a repository into a new work tree.
141 If the
142 .Ar work tree path
143 is not specified, either use the last component of
144 .Ar repository path ,
145 or if a
146 .Ar path prefix
147 was specified use the last component of
148 .Ar path prefix .
149 .Pp
150 The options for
151 .Cm got checkout
152 are as follows:
153 .Bl -tag -width Ds
154 .It Fl b Ar branch
155 Check out files from a commit on the specified
156 .Ar branch .
157 If this option is not specified, a branch resolved via the repository's HEAD
158 reference will be used.
159 .It Fl c Ar commit
160 Check out files from the specified
161 .Ar commit
162 on the selected branch.
163 The expected argument is a commit ID SHA1 hash or an existing reference
164 or tag name which will be resolved to a commit ID.
165 An abbreviated hash argument will be expanded to a full SHA1 hash
166 automatically, provided the abbreviation is unique.
167 If this option is not specified, the most recent commit on the selected
168 branch will be used.
169 .It Fl p Ar path-prefix
170 Restrict the work tree to a subset of the repository's tree hierarchy.
171 Only files beneath the specified
172 .Ar path-prefix
173 will be checked out.
174 .El
175 .It Cm co
176 Short alias for
177 .Cm checkout .
178 .It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Op Ar path ...
179 Update an existing work tree to a different commit.
180 Show the status of each affected file, using the following status codes:
181 .Bl -column YXZ description
182 .It U Ta file was updated and contained no local changes
183 .It G Ta file was updated and local changes were merged cleanly
184 .It C Ta file was updated and conflicts occurred during merge
185 .It D Ta file was deleted
186 .It A Ta new file was added
187 .It \(a~ Ta versioned file is obstructed by a non-regular file
188 .It ! Ta a missing versioned file was restored
189 .El
190 .Pp
191 If no
192 .Ar path
193 is specified, update the entire work tree.
194 Otherwise, restrict the update operation to files at or within the
195 specified paths.
196 Each path is required to exist in the update operation's target commit.
197 Files in the work tree outside specified paths will remain unchanged and
198 will retain their previously recorded base commit.
199 Some
200 .Nm
201 commands may refuse to run while the work tree contains files from
202 multiple base commits.
203 The base commit of such a work tree can be made consistent by running
204 .Cm got update
205 across the entire work tree.
206 Specifying a
207 .Ar path
208 is incompatible with the
209 .Fl b
210 option.
211 .Pp
212 .Cm got update
213 cannot update paths with staged changes.
214 If changes have been staged with
215 .Cm got stage ,
216 these changes must first be committed with
217 .Cm got commit
218 or unstaged with
219 .Cm got unstage .
220 .Pp
221 The options for
222 .Cm got update
223 are as follows:
224 .Bl -tag -width Ds
225 .It Fl b Ar branch
226 Switch the work tree's branch reference to the specified
227 .Ar branch
228 before updating the work tree.
229 This option requires that all paths in the work tree are updated.
230 .It Fl c Ar commit
231 Update the work tree to the specified
232 .Ar commit .
233 The expected argument is a commit ID SHA1 hash or an existing reference
234 or tag name which will be resolved to a commit ID.
235 An abbreviated hash argument will be expanded to a full SHA1 hash
236 automatically, provided the abbreviation is unique.
237 If this option is not specified, the most recent commit on the work tree's
238 branch will be used.
239 .El
240 .It Cm up
241 Short alias for
242 .Cm update .
243 .It Cm status Op Ar path ...
244 Show the current modification status of files in a work tree,
245 using the following status codes:
246 .Bl -column YXZ description
247 .It M Ta modified file
248 .It A Ta file scheduled for addition in next commit
249 .It D Ta file scheduled for deletion in next commit
250 .It C Ta modified or added file which contains merge conflicts
251 .It ! Ta versioned file was expected on disk but is missing
252 .It \(a~ Ta versioned file is obstructed by a non-regular file
253 .It ? Ta unversioned item not tracked by
254 .Nm
255 .It m Ta modified file modes (executable bit only)
256 .It N Ta non-existent
257 .Ar path
258 specified on the command line
259 .El
260 .Pp
261 If no
262 .Ar path
263 is specified, show modifications in the entire work tree.
264 Otherwise, show modifications at or within the specified paths.
265 .Pp
266 If changes have been staged with
267 .Cm got stage ,
268 staged changes are shown in the second output column, using the following
269 status codes:
270 .Bl -column YXZ description
271 .It M Ta file modification is staged
272 .It A Ta file addition is staged
273 .It D Ta file deletion is staged
274 .El
275 .Pp
276 Changes created on top of staged changes are indicated in the first column:
277 .Bl -column YXZ description
278 .It MM Ta file was modified after earlier changes have been staged
279 .It MA Ta file was modified after having been staged for addition
280 .El
281 .Pp
282 For compatibility with
283 .Xr cvs 1
284 and
285 .Xr git 1 ,
286 .Cm got status
287 reads
288 .Xr glob 7
289 patterns from
290 .Pa .cvsignore
291 and
292 .Pa .gitignore
293 files in each traversed directory and will not display unversioned files
294 which match these patterns.
295 As an extension to
296 .Xr glob 7
297 matching rules,
298 .Cm got status
299 supports consecutive asterisks,
300 .Dq ** ,
301 which will match an arbitrary amount of directories.
302 Unlike
303 .Xr cvs 1 ,
304 .Cm got status
305 only supports a single ignore pattern per line.
306 Unlike
307 .Xr git 1 ,
308 .Cm got status
309 does not support negated ignore patterns prefixed with
310 .Dq \&! ,
311 and gives no special significance to the location of path component separators,
312 .Dq / ,
313 in a pattern.
314 .It Cm st
315 Short alias for
316 .Cm status .
317 .It Cm log Oo Fl c Ar commit Oc Oo Fl C Ar number Oc Oo Fl f Oc Oo Fl l Ar N Oc Oo Fl p Oc Oo Fl r Ar repository-path Oc Op Ar path
318 Display history of a repository.
319 If a
320 .Ar path
321 is specified, show only commits which modified this path.
322 .Pp
323 The options for
324 .Cm got log
325 are as follows:
326 .Bl -tag -width Ds
327 .It Fl c Ar commit
328 Start traversing history at the specified
329 .Ar commit .
330 The expected argument is a commit ID SHA1 hash or an existing reference
331 or tag name which will be resolved to a commit ID.
332 An abbreviated hash argument will be expanded to a full SHA1 hash
333 automatically, provided the abbreviation is unique.
334 If this option is not specified, default to the work tree's current branch
335 if invoked in a work tree, or to the repository's HEAD reference.
336 .It Fl C Ar number
337 Set the number of context lines shown in diffs with
338 .Fl p .
339 By default, 3 lines of context are shown.
340 .It Fl f
341 Restrict history traversal to the first parent of each commit.
342 This shows the linear history of the current branch only.
343 Merge commits which affected the current branch will be shown but
344 individual commits which originated on other branches will be omitted.
345 .It Fl l Ar N
346 Limit history traversal to a given number of commits.
347 If this option is not specified, a default limit value of zero is used,
348 which is treated as an unbounded limit.
349 The
350 .Ev GOT_LOG_DEFAULT_LIMIT
351 environment variable may be set to change this default value.
352 .It Fl p
353 Display the patch of modifications made in each commit.
354 If a
355 .Ar path
356 is specified, only show the patch of modifications at or within this path.
357 .It Fl r Ar repository-path
358 Use the repository at the specified path.
359 If not specified, assume the repository is located at or above the current
360 working directory.
361 If this directory is a
362 .Nm
363 work tree, use the repository path associated with this work tree.
364 .El
365 .It Cm diff Oo Fl C Ar number Oc Oo Fl r Ar repository-path Oc Oo Fl s Oc Oo Fl w Oc Op Ar object1 Ar object2 | Ar path
366 When invoked within a work tree with less than two arguments, display
367 uncommitted changes in the work tree.
368 If a
369 .Ar path
370 is specified, only show changes within this path.
371 .Pp
372 If two arguments are provided, treat each argument as a reference, a tag
373 name, or an object ID SHA1 hash, and display differences between the
374 corresponding objects.
375 Both objects must be of the same type (blobs, trees, or commits).
376 An abbreviated hash argument will be expanded to a full SHA1 hash
377 automatically, provided the abbreviation is unique.
378 .Pp
379 The options for
380 .Cm got diff
381 are as follows:
382 .Bl -tag -width Ds
383 .It Fl C Ar number
384 Set the number of context lines shown in the diff.
385 By default, 3 lines of context are shown.
386 .It Fl r Ar repository-path
387 Use the repository at the specified path.
388 If not specified, assume the repository is located at or above the current
389 working directory.
390 If this directory is a
391 .Nm
392 work tree, use the repository path associated with this work tree.
393 .It Fl s
394 Show changes staged with
395 .Cm got stage
396 instead of showing local changes.
397 This option is only valid when
398 .Cm got diff
399 is invoked in a work tree.
400 .It Fl w
401 Ignore whitespace-only changes.
402 .El
403 .It Cm di
404 Short alias for
405 .Cm diff .
406 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
407 Display line-by-line history of a file at the specified path.
408 .Pp
409 The options for
410 .Cm got blame
411 are as follows:
412 .Bl -tag -width Ds
413 .It Fl c Ar commit
414 Start traversing history at the specified
415 .Ar commit .
416 The expected argument is a commit ID SHA1 hash or an existing reference
417 or tag name which will be resolved to a commit ID.
418 An abbreviated hash argument will be expanded to a full SHA1 hash
419 automatically, provided the abbreviation is unique.
420 .It Fl r Ar repository-path
421 Use the repository at the specified path.
422 If not specified, assume the repository is located at or above the current
423 working directory.
424 If this directory is a
425 .Nm
426 work tree, use the repository path associated with this work tree.
427 .El
428 .It Cm bl
429 Short alias for
430 .Cm blame .
431 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl i Oc Oo Fl R Oc Op Ar path
432 Display a listing of files and directories at the specified
433 directory path in the repository.
434 Entries shown in this listing may carry one of the following trailing
435 annotations:
436 .Bl -column YXZ description
437 .It @ Ta entry is a symbolic link
438 .It / Ta entry is a directory
439 .It * Ta entry is an executable file
440 .It $ Ta entry is a Git submodule
441 .El
442 .Pp
443 If no
444 .Ar path
445 is specified, list the repository path corresponding to the current
446 directory of the work tree, or the root directory of the repository
447 if there is no work tree.
448 .Pp
449 The options for
450 .Cm got tree
451 are as follows:
452 .Bl -tag -width Ds
453 .It Fl c Ar commit
454 List files and directories as they appear in the specified
455 .Ar commit .
456 The expected argument is a commit ID SHA1 hash or an existing reference
457 or tag name which will be resolved to a commit ID.
458 An abbreviated hash argument will be expanded to a full SHA1 hash
459 automatically, provided the abbreviation is unique.
460 .It Fl r Ar repository-path
461 Use the repository at the specified path.
462 If not specified, assume the repository is located at or above the current
463 working directory.
464 If this directory is a
465 .Nm
466 work tree, use the repository path associated with this work tree.
467 .It Fl i
468 Show object IDs of files (blob objects) and directories (tree objects).
469 .It Fl R
470 Recurse into sub-directories in the repository.
471 .El
472 .It Cm tr
473 Short alias for
474 .Cm tree .
475 .It Cm ref Oo Fl r Ar repository-path Oc Oo Fl l Oc Oo Fl d Ar name Oc Oo Fl s Oc Op Ar name Ar target
476 Manage references in a repository.
477 .Pp
478 If no options are passed, expect two arguments and attempt to create,
479 or update, the reference with the given
480 .Ar name ,
481 and make it point at the given
482 .Ar target .
483 The name must be an absolute reference name, i.e. it must begin with
484 .Dq refs/ .
485 The target may be an object ID SHA1 hash or an existing reference which
486 will be resolved to an object ID.
487 An abbreviated hash argument will be expanded to a full SHA1 hash
488 automatically, provided the abbreviation is unique.
489 .Pp
490 The options for
491 .Cm got ref
492 are as follows:
493 .Bl -tag -width Ds
494 .It Fl r Ar repository-path
495 Use the repository at the specified path.
496 If not specified, assume the repository is located at or above the current
497 working directory.
498 If this directory is a
499 .Nm
500 work tree, use the repository path associated with this work tree.
501 .It Fl l
502 List all existing references in the repository.
503 .It Fl d Ar name
504 Delete the reference with the specified name from the repository.
505 .It Fl s
506 Create a symbolic reference pointing at the specified
507 .Ar target ,
508 which must be an existing reference.
509 Care should be taken not to create loops between references when
510 this option is used.
511 .El
512 .It Cm branch Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl l Oc Oo Fl d Ar name Oc Op Ar name
513 Manage branches in a repository.
514 .Pp
515 Branches are managed via references which live in the
516 .Dq refs/heads/
517 reference namespace.
518 The
519 .Cm got branch
520 command operates on references in this namespace only.
521 .Pp
522 If invoked in a work tree without any arguments, print the name of the
523 work tree's current branch.
524 If a
525 .Ar name
526 argument is passed, attempt to create a branch reference with the given name.
527 By default the new branch reference will point at the latest commit on the
528 work tree's current branch if invoked in a work tree, and otherwise to a commit
529 resolved via the repository's HEAD reference.
530 .Pp
531 The options for
532 .Cm got branch
533 are as follows:
534 .Bl -tag -width Ds
535 .It Fl c Ar commit
536 Make a newly created branch reference point at the specified
537 .Ar commit .
538 The expected
539 .Ar commit
540 argument is a commit ID SHA1 hash or an existing reference
541 or tag name which will be resolved to a commit ID.
542 .It Fl r Ar repository-path
543 Use the repository at the specified path.
544 If not specified, assume the repository is located at or above the current
545 working directory.
546 If this directory is a
547 .Nm
548 work tree, use the repository path associated with this work tree.
549 .It Fl l
550 List all existing branches in the repository.
551 If invoked in a work tree, the work tree's current branch is shown
552 with one the following annotations:
553 .Bl -column YXZ description
554 .It * Ta work tree's base commit matches the branch tip
555 .It \(a~ Ta work tree's base commit is out-of-date
556 .El
557 .It Fl d Ar name
558 Delete the branch with the specified name from the repository.
559 Only the branch reference is deleted.
560 Any commit, tree, and blob objects belonging to the branch
561 remain in the repository and may be removed separately with
562 Git's garbage collector.
563 .El
564 .It Cm br
565 Short alias for
566 .Cm branch .
567 .It Cm tag Oo Fl m Ar message Oc Oo Fl r Ar repository-path Oc Oo Fl l Oc Ar name Op Ar commit Oc
568 Manage tags in a repository.
569 .Pp
570 Tags are managed via references which live in the
571 .Dq refs/tags/
572 reference namespace.
573 The
574 .Cm got tag
575 command operates on references in this namespace only.
576 References in this namespace point at tag objects which contain a pointer
577 to another object, a tag message, as well as author and timestamp information.
578 .Pp
579 Expect one or two arguments and attempt to create a tag with the given
580 .Ar name ,
581 and make this tag point at the given
582 .Ar commit .
583 If no commit is specified, default to the latest commit on the work tree's
584 current branch if invoked in a work tree, and to a commit resolved via
585 the repository's HEAD reference otherwise.
586 Otherwise, the expected argument is a commit ID SHA1 hash or an existing
587 reference or tag name which will be resolved to a commit ID.
588 An abbreviated hash argument will be expanded to a full SHA1 hash
589 automatically, provided the abbreviation is unique.
590 .Pp
591 The options for
592 .Cm got tag
593 are as follows:
594 .Bl -tag -width Ds
595 .It Fl m Ar message
596 Use the specified tag message when creating the new tag
597 Without the
598 .Fl m
599 option,
600 .Cm got tag
601 opens a temporary file in an editor where a tag message can be written.
602 .It Fl r Ar repository-path
603 Use the repository at the specified path.
604 If not specified, assume the repository is located at or above the current
605 working directory.
606 If this directory is a
607 .Nm
608 work tree, use the repository path associated with this work tree.
609 .It Fl l
610 List all existing tags in the repository instead of creating a new tag.
611 If this option is used, no other command-line arguments are allowed.
612 .El
613 .Pp
614 By design, the
615 .Cm got tag
616 command will not delete tags or change existing tags.
617 If a tag must be deleted, the
618 .Cm got ref
619 command may be used to delete a tag's reference.
620 This should only be done if the tag has not already been copied to
621 another repository.
622 .It Cm add Ar file-path ...
623 Schedule unversioned files in a work tree for addition to the
624 repository in the next commit.
625 .It Cm remove Ar file-path ...
626 Remove versioned files from a work tree and schedule them for deletion
627 from the repository in the next commit.
628 .Pp
629 The options for
630 .Cm got remove
631 are as follows:
632 .Bl -tag -width Ds
633 .It Fl f
634 Perform the operation even if a file contains uncommitted modifications.
635 .El
636 .It Cm rm
637 Short alias for
638 .Cm remove .
639 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
640 Revert any uncommitted changes in files at the specified paths.
641 File contents will be overwritten with those contained in the
642 work tree's base commit.
643 There is no way to bring discarded changes back after
644 .Cm got revert !
645 .Pp
646 If a file was added with
647 .Cm got add
648 it will become an unversioned file again.
649 If a file was deleted with
650 .Cm got remove
651 it will be restored.
652 .Pp
653 The options for
654 .Cm got revert
655 are as follows:
656 .Bl -tag -width Ds
657 .It Fl p
658 Instead of reverting all changes in files, interactively select or reject
659 changes to revert based on
660 .Dq y
661 (revert change),
662 .Dq n
663 (keep change), and
664 .Dq q
665 (quit reverting this file) responses.
666 If a file is in modified status, individual patches derived from the
667 modified file content can be reverted.
668 Files in added or deleted status may only be reverted in their entirety.
669 .It Fl F Ar response-script
670 With the
671 .Fl p
672 option, read
673 .Dq y ,
674 .Dq n ,
675 and
676 .Dq q
677 responses line-by-line from the specified
678 .Ar response-script
679 file instead of prompting interactively.
680 .It Fl R
681 Permit recursion into directories.
682 If this option is not specified,
683 .Cm got revert
684 will refuse to run if a specified
685 .Ar path
686 is a directory.
687 .El
688 .It Cm rv
689 Short alias for
690 .Cm revert .
691 .It Cm commit Oo Fl m Ar message Oc Op Ar path ...
692 Create a new commit in the repository from changes in a work tree
693 and use this commit as the new base commit for the work tree.
694 If no
695 .Ar path
696 is specified, commit all changes in the work tree.
697 Otherwise, commit changes at or within the specified paths.
698 .Pp
699 If changes have been explicitly staged for commit with
700 .Cm got stage ,
701 only commit staged changes and reject any specified paths which
702 have not been staged.
703 .Pp
704 Show the status of each affected file, using the following status codes:
705 .Bl -column YXZ description
706 .It M Ta modified file
707 .It D Ta file was deleted
708 .It A Ta new file was added
709 .It m Ta modified file modes (executable bit only)
710 .El
711 .Pp
712 Files which are not part of the new commit will retain their previously
713 recorded base commit.
714 Some
715 .Nm
716 commands may refuse to run while the work tree contains files from
717 multiple base commits.
718 The base commit of such a work tree can be made consistent by running
719 .Cm got update
720 across the entire work tree.
721 .Pp
722 The
723 .Cm got commit
724 command requires the
725 .Ev GOT_AUTHOR
726 environment variable to be set,
727 unless Git's
728 .Dv user.name
729 and
730 .Dv user.email
731 configuration settings can be
732 obtained from the repository's
733 .Pa .git/config
734 file or from Git's global
735 .Pa ~/.gitconfig
736 configuration file.
737 .Pp
738 The options for
739 .Cm got commit
740 are as follows:
741 .Bl -tag -width Ds
742 .It Fl m Ar message
743 Use the specified log message when creating the new commit.
744 Without the
745 .Fl m
746 option,
747 .Cm got commit
748 opens a temporary file in an editor where a log message can be written.
749 .El
750 .Pp
751 .Cm got commit
752 will refuse to run if certain preconditions are not met.
753 If the work tree's current branch is not in the
754 .Dq refs/heads/
755 reference namespace, new commits may not be created on this branch.
756 Local changes may only be committed if they are based on file content
757 found in the most recent commit on the work tree's branch.
758 If a path is found to be out of date,
759 .Cm got update
760 must be used first in order to merge local changes with changes made
761 in the repository.
762 .It Cm ci
763 Short alias for
764 .Cm commit .
765 .It Cm cherrypick Ar commit
766 Merge changes from a single
767 .Ar commit
768 into the work tree.
769 The specified
770 .Ar commit
771 must be on a different branch than the work tree's base commit.
772 The expected argument is a reference or a commit ID SHA1 hash.
773 An abbreviated hash argument will be expanded to a full SHA1 hash
774 automatically, provided the abbreviation is unique.
775 .Pp
776 Show the status of each affected file, using the following status codes:
777 .Bl -column YXZ description
778 .It G Ta file was merged
779 .It C Ta file was merged and conflicts occurred during merge
780 .It ! Ta changes destined for a missing file were not merged
781 .It D Ta file was deleted
782 .It d Ta file's deletion was obstructed by local modifications
783 .It A Ta new file was added
784 .It \(a~ Ta changes destined for a non-regular file were not merged
785 .El
786 .Pp
787 The merged changes will appear as local changes in the work tree, which
788 may be viewed with
789 .Cm got diff ,
790 amended manually or with further
791 .Cm got cherrypick
792 commands,
793 committed with
794 .Cm got commit ,
795 or discarded again with
796 .Cm got revert .
797 .Pp
798 .Cm got cherrypick
799 will refuse to run if certain preconditions are not met.
800 If the work tree contains multiple base commits it must first be updated
801 to a single base commit with
802 .Cm got update .
803 If the work tree already contains files with merge conflicts, these
804 conflicts must be resolved first.
805 .It Cm cy
806 Short alias for
807 .Cm cherrypick .
808 .It Cm backout Ar commit
809 Reverse-merge changes from a single
810 .Ar commit
811 into the work tree.
812 The specified
813 .Ar commit
814 must be on the same branch as the work tree's base commit.
815 The expected argument is a reference or a commit ID SHA1 hash.
816 An abbreviated hash argument will be expanded to a full SHA1 hash
817 automatically, provided the abbreviation is unique.
818 .Pp
819 Show the status of each affected file, using the following status codes:
820 .Bl -column YXZ description
821 .It G Ta file was merged
822 .It C Ta file was merged and conflicts occurred during merge
823 .It ! Ta changes destined for a missing file were not merged
824 .It D Ta file was deleted
825 .It d Ta file's deletion was obstructed by local modifications
826 .It A Ta new file was added
827 .It \(a~ Ta changes destined for a non-regular file were not merged
828 .El
829 .Pp
830 The reverse-merged changes will appear as local changes in the work tree,
831 which may be viewed with
832 .Cm got diff ,
833 amended manually or with further
834 .Cm got backout
835 commands,
836 committed with
837 .Cm got commit ,
838 or discarded again with
839 .Cm got revert .
840 .Pp
841 .Cm got backout
842 will refuse to run if certain preconditions are not met.
843 If the work tree contains multiple base commits it must first be updated
844 to a single base commit with
845 .Cm got update .
846 If the work tree already contains files with merge conflicts, these
847 conflicts must be resolved first.
848 .It Cm bo
849 Short alias for
850 .Cm backout .
851 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Op Ar branch
852 Rebase commits on the specified
853 .Ar branch
854 onto the tip of the current branch of the work tree.
855 The
856 .Ar branch
857 must share common ancestry with the work tree's current branch.
858 Rebasing begins with the first descendant commit of the youngest
859 common ancestor commit shared by the specified
860 .Ar branch
861 and the work tree's current branch, and stops once the tip commit
862 of the specified
863 .Ar branch
864 has been rebased.
865 .Pp
866 Rebased commits are accumulated on a temporary branch which the work tree
867 will remain switched to throughout the entire rebase operation.
868 Commits on this branch represent the same changes with the same log
869 messages as their counterparts on the original
870 .Ar branch ,
871 but with different commit IDs.
872 Once rebasing has completed successfully, the temporary branch becomes
873 the new version of the specified
874 .Ar branch
875 and the work tree is automatically switched to it.
876 .Pp
877 While rebasing commits, show the status of each affected file,
878 using the following status codes:
879 .Bl -column YXZ description
880 .It G Ta file was merged
881 .It C Ta file was merged and conflicts occurred during merge
882 .It ! Ta changes destined for a missing file were not merged
883 .It D Ta file was deleted
884 .It d Ta file's deletion was obstructed by local modifications
885 .It A Ta new file was added
886 .It \(a~ Ta changes destined for a non-regular file were not merged
887 .El
888 .Pp
889 If merge conflicts occur the rebase operation is interrupted and may
890 be continued once conflicts have been resolved.
891 Alternatively, the rebase operation may be aborted which will leave
892 .Ar branch
893 unmodified and the work tree switched back to its original branch.
894 .Pp
895 If a merge conflict is resolved in a way which renders the merged
896 change into a no-op change, the corresponding commit will be elided
897 when the rebase operation continues.
898 .Pp
899 .Cm got rebase
900 will refuse to run if certain preconditions are not met.
901 If the work tree contains multiple base commits it must first be updated
902 to a single base commit with
903 .Cm got update .
904 If changes have been staged with
905 .Cm got stage ,
906 these changes must first be committed with
907 .Cm got commit
908 or unstaged with
909 .Cm got unstage .
910 If the work tree contains local changes, these changes must first be
911 committed with
912 .Cm got commit
913 or reverted with
914 .Cm got revert .
915 If the
916 .Ar branch
917 contains changes to files outside of the work tree's path prefix,
918 the work tree cannot be used to rebase this branch.
919 .Pp
920 The
921 .Cm got update
922 and
923 .Cm got commit
924 commands will refuse to run while a rebase operation is in progress.
925 Other commands which manipulate the work tree may be used for
926 conflict resolution purposes.
927 .Pp
928 The options for
929 .Cm got rebase
930 are as follows:
931 .Bl -tag -width Ds
932 .It Fl a
933 Abort an interrupted rebase operation.
934 If this option is used, no other command-line arguments are allowed.
935 .It Fl c
936 Continue an interrupted rebase operation.
937 If this option is used, no other command-line arguments are allowed.
938 .El
939 .It Cm rb
940 Short alias for
941 .Cm rebase .
942 .It Cm histedit Oo Fl a Oc Oo Fl c Oc Op Fl F Ar histedit-script
943 Edit commit history between the work tree's current base commit and
944 the tip commit of the work tree's current branch.
945 .Pp
946 Editing of commit history is controlled via a
947 .Ar histedit script
948 which can be edited interactively or passed on the command line.
949 The format of the histedit script is line-based.
950 Each line in the script begins with a command name, followed by
951 whitespace and an argument.
952 For most commands, the expected argument is a commit ID SHA1 hash.
953 Any remaining text on the line is ignored.
954 Lines which begin with the
955 .Sq #
956 character are ignored entirely.
957 .Pp
958 The available commands are as follows:
959 .Bl -column YXZ pick-commit
960 .It pick Ar commit Ta Use the specified commit as it is.
961 .It edit Ar commit Ta Use the specified commit but once changes have been
962 merged into the work tree interrupt the histedit operation for amending.
963 .It fold Ar commit Ta Combine the specified commit with the next commit
964 listed further below that will be used.
965 .It drop Ar commit Ta Remove this commit from the edited history.
966 .It mesg Ar log-message Ta Use the specified single-line log message for
967 the commit on the previous line.
968 If the log message argument is left empty, open an editor where a new
969 log message can be written.
970 .El
971 .Pp
972 Every commit in the history being edited must be mentioned in the script.
973 Lines may be re-ordered to change the order of commits in the edited history.
974 .Pp
975 Edited commits are accumulated on a temporary branch which the work tree
976 will remain switched to throughout the entire histedit operation.
977 Once history editing has completed successfully, the temporary branch becomes
978 the new version of the work tree's branch and the work tree is automatically
979 switched to it.
980 .Pp
981 While merging commits, show the status of each affected file,
982 using the following status codes:
983 .Bl -column YXZ description
984 .It G Ta file was merged
985 .It C Ta file was merged and conflicts occurred during merge
986 .It ! Ta changes destined for a missing file were not merged
987 .It D Ta file was deleted
988 .It d Ta file's deletion was obstructed by local modifications
989 .It A Ta new file was added
990 .It \(a~ Ta changes destined for a non-regular file were not merged
991 .El
992 .Pp
993 If merge conflicts occur the histedit operation is interrupted and may
994 be continued once conflicts have been resolved.
995 Alternatively, the histedit operation may be aborted which will leave
996 the work tree switched back to its original branch.
997 .Pp
998 If a merge conflict is resolved in a way which renders the merged
999 change into a no-op change, the corresponding commit will be elided
1000 when the histedit operation continues.
1001 .Pp
1002 .Cm got histedit
1003 will refuse to run if certain preconditions are not met.
1004 If the work tree's current branch is not in the
1005 .Dq refs/heads/
1006 reference namespace, the history of the branch may not be edited.
1007 If the work tree contains multiple base commits it must first be updated
1008 to a single base commit with
1009 .Cm got update .
1010 If changes have been staged with
1011 .Cm got stage ,
1012 these changes must first be committed with
1013 .Cm got commit
1014 or unstaged with
1015 .Cm got unstage .
1016 If the work tree contains local changes, these changes must first be
1017 committed with
1018 .Cm got commit
1019 or reverted with
1020 .Cm got revert .
1021 If the edited history contains changes to files outside of the work tree's
1022 path prefix, the work tree cannot be used to edit the history of this branch.
1023 .Pp
1024 The
1025 .Cm got update
1026 command will refuse to run while a histedit operation is in progress.
1027 Other commands which manipulate the work tree may be used, and the
1028 .Cm got commit
1029 command may be used to commit arbitrary changes to the temporary branch
1030 while the histedit operation is interrupted.
1031 .Pp
1032 The options for
1033 .Cm got histedit
1034 are as follows:
1035 .Bl -tag -width Ds
1036 .It Fl a
1037 Abort an interrupted histedit operation.
1038 If this option is used, no other command-line arguments are allowed.
1039 .It Fl c
1040 Continue an interrupted histedit operation.
1041 If this option is used, no other command-line arguments are allowed.
1042 .El
1043 .It Cm he
1044 Short alias for
1045 .Cm histedit .
1046 .It Cm integrate Ar branch
1047 Integrate the specified
1048 .Ar branch
1049 into the work tree's current branch.
1050 Files in the work tree are updated to match the contents on the integrated
1051 .Ar branch ,
1052 and the reference of the work tree's branch is changed to point at the
1053 head commit of the integrated
1054 .Ar branch .
1055 .Pp
1056 Both branches can be considered equivalent after integration since they
1057 will be pointing at the same commit.
1058 Both branches remain available for future work, if desired.
1059 In case the integrated
1060 .Ar branch
1061 is no longer needed it may be deleted with
1062 .Cm got branch -d .
1063 .Pp
1064 Show the status of each affected file, using the following status codes:
1065 .Bl -column YXZ description
1066 .It U Ta file was updated
1067 .It D Ta file was deleted
1068 .It A Ta new file was added
1069 .It \(a~ Ta versioned file is obstructed by a non-regular file
1070 .It ! Ta a missing versioned file was restored
1071 .El
1072 .Pp
1073 .Cm got integrate
1074 will refuse to run if certain preconditions are not met.
1075 Most importantly, the
1076 .Ar branch
1077 must have been rebased onto the work tree's current branch with
1078 .Cm got rebase
1079 before it can be integrated, in order to linearize commit history and
1080 resolve merge conflicts.
1081 If the work tree contains multiple base commits it must first be updated
1082 to a single base commit with
1083 .Cm got update .
1084 If changes have been staged with
1085 .Cm got stage ,
1086 these changes must first be committed with
1087 .Cm got commit
1088 or unstaged with
1089 .Cm got unstage .
1090 If the work tree contains local changes, these changes must first be
1091 committed with
1092 .Cm got commit
1093 or reverted with
1094 .Cm got revert .
1095 .It Cm ig
1096 Short alias for
1097 .Cm integrate .
1098 .It Cm stage Oo Fl l Oc Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
1099 Stage local changes for inclusion in the next commit.
1100 If no
1101 .Ar path
1102 is specified, stage all changes in the work tree.
1103 Otherwise, stage changes at or within the specified paths.
1104 Paths may be staged if they are added, modified, or deleted according to
1105 .Cm got status .
1106 .Pp
1107 Show the status of each affected file, using the following status codes:
1108 .Bl -column YXZ description
1109 .It A Ta file addition has been staged
1110 .It M Ta file modification has been staged
1111 .It D Ta file deletion has been staged
1112 .El
1113 .Pp
1114 Staged file contents are saved in newly created blob objects in the repository.
1115 These blobs will be referred to by tree objects once staged changes have been
1116 committed.
1117 .Pp
1118 Staged changes affect the behaviour of
1119 .Cm got commit ,
1120 .Cm got status ,
1121 and
1122 .Cm got diff .
1123 While paths with staged changes exist, the
1124 .Cm got commit
1125 command will refuse to commit any paths which do not have staged changes.
1126 Local changes created on top of staged changes can only be committed if
1127 the path is staged again, or if the staged changes are committed first.
1128 The
1129 .Cm got status
1130 command will show both local changes and staged changes.
1131 The
1132 .Cm got diff
1133 command is able to display local changes relative to staged changes,
1134 and to display staged changes relative to the repository.
1135 The
1136 .Cm got revert
1137 command cannot revert staged changes but may be used to revert
1138 local changes created on top of staged changes.
1139 .Pp
1140 The options for
1141 .Cm got stage
1142 are as follows:
1143 .Bl -tag -width Ds
1144 .It Fl l
1145 Instead of staging new changes, list paths which are already staged,
1146 along with the IDs of staged blob objects and stage status codes.
1147 If paths were provided in the command line show the staged paths
1148 among the specified paths.
1149 Otherwise, show all staged paths.
1150 .It Fl p
1151 Instead of staging the entire content of a changed file, interactively
1152 select or reject changes for staging based on
1153 .Dq y
1154 (stage change),
1155 .Dq n
1156 (reject change), and
1157 .Dq q
1158 (quit staging this file) responses.
1159 If a file is in modified status, individual patches derived from the
1160 modified file content can be staged.
1161 Files in added or deleted status may only be staged or rejected in
1162 their entirety.
1163 .It Fl F Ar response-script
1164 With the
1165 .Fl p
1166 option, read
1167 .Dq y ,
1168 .Dq n ,
1169 and
1170 .Dq q
1171 responses line-by-line from the specified
1172 .Ar response-script
1173 file instead of prompting interactively.
1174 .El
1175 .Pp
1176 .Cm got stage
1177 will refuse to run if certain preconditions are not met.
1178 If a file contains merge conflicts, these conflicts must be resolved first.
1179 If a file is found to be out of date relative to the head commit on the
1180 work tree's current branch, the file must be updated with
1181 .Cm got update
1182 before it can be staged (however, this does not prevent the file from
1183 becoming out-of-date at some point after having been staged).
1184 .Pp
1185 The
1186 .Cm got update ,
1187 .Cm got rebase ,
1188 and
1189 .Cm got histedit
1190 commands will refuse to run while staged changes exist.
1191 If staged changes cannot be committed because a staged path
1192 is out of date, the path must be unstaged with
1193 .Cm got unstage
1194 before it can be updated with
1195 .Cm got update ,
1196 and may then be staged again if necessary.
1197 .It Cm sg
1198 Short alias for
1199 .Cm stage .
1200 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
1201 Merge staged changes back into the work tree and put affected paths
1202 back into non-staged status.
1203 If no
1204 .Ar path
1205 is specified, unstage all staged changes across the entire work tree.
1206 Otherwise, unstage changes at or within the specified paths.
1207 .Pp
1208 Show the status of each affected file, using the following status codes:
1209 .Bl -column YXZ description
1210 .It G Ta file was unstaged
1211 .It C Ta file was unstaged and conflicts occurred during merge
1212 .It ! Ta changes destined for a missing file were not merged
1213 .It D Ta file was staged as deleted and still is deleted
1214 .It d Ta file's deletion was obstructed by local modifications
1215 .It \(a~ Ta changes destined for a non-regular file were not merged
1216 .El
1217 .Pp
1218 The options for
1219 .Cm got unstage
1220 are as follows:
1221 .Bl -tag -width Ds
1222 .It Fl p
1223 Instead of unstaging the entire content of a changed file, interactively
1224 select or reject changes for unstaging based on
1225 .Dq y
1226 (unstage change),
1227 .Dq n
1228 (keep change staged), and
1229 .Dq q
1230 (quit unstaging this file) responses.
1231 If a file is staged in modified status, individual patches derived from the
1232 staged file content can be unstaged.
1233 Files staged in added or deleted status may only be unstaged in their entirety.
1234 .It Fl F Ar response-script
1235 With the
1236 .Fl p
1237 option, read
1238 .Dq y ,
1239 .Dq n ,
1240 and
1241 .Dq q
1242 responses line-by-line from the specified
1243 .Ar response-script
1244 file instead of prompting interactively.
1245 .El
1246 .It Cm ug
1247 Short alias for
1248 .Cm unstage .
1249 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
1250 Parse and print contents of objects to standard output in a line-based
1251 text format.
1252 Content of commit, tree, and tag objects is printed in a way similar
1253 to the actual content stored in such objects.
1254 Blob object contents are printed as they would appear in files on disk.
1255 .Pp
1256 Attempt to interpret each argument as a reference, a tag name, or
1257 an object ID SHA1 hash.
1258 References will be resolved to an object ID.
1259 Tag names will resolved to a tag object.
1260 An abbreviated hash argument will be expanded to a full SHA1 hash
1261 automatically, provided the abbreviation is unique.
1262 .Pp
1263 If none of the above interpretations produce a valid result, or if the
1264 .Fl P
1265 option is used, attempt to interpret the argument as a path which will
1266 be resolved to the ID of an object found at this path in the repository.
1267 .Pp
1268 The options for
1269 .Cm got cat
1270 are as follows:
1271 .Bl -tag -width Ds
1272 .It Fl c Ar commit
1273 Look up paths in the specified
1274 .Ar commit .
1275 If this option is not used, paths are looked up in the commit resolved
1276 via the repository's HEAD reference.
1277 The expected argument is a commit ID SHA1 hash or an existing reference
1278 or tag name which will be resolved to a commit ID.
1279 An abbreviated hash argument will be expanded to a full SHA1 hash
1280 automatically, provided the abbreviation is unique.
1281 .It Fl r Ar repository-path
1282 Use the repository at the specified path.
1283 If not specified, assume the repository is located at or above the current
1284 working directory.
1285 If this directory is a
1286 .Nm
1287 work tree, use the repository path associated with this work tree.
1288 .It Fl P
1289 Interpret all arguments as paths only.
1290 This option can be used to resolve ambiguity in cases where paths
1291 look like tag names, reference names, or object IDs.
1292 .El
1293 .El
1294 .Sh ENVIRONMENT
1295 .Bl -tag -width GOT_AUTHOR
1296 .It Ev GOT_AUTHOR
1297 The author's name and email address for
1298 .Cm got commit
1299 and
1300 .Cm got import ,
1301 for example:
1302 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
1303 Because
1304 .Xr git 1
1305 may fail to parse commits without an email address in author data,
1306 .Nm
1307 attempts to reject
1308 .Ev GOT_AUTHOR
1309 environment variables with a missing email address.
1310 .Pp
1311 If present, Git's
1312 .Dv user.name
1313 and
1314 .Dv user.email
1315 configuration settings in the repository's
1316 .Pa .git/config
1317 file will override the value of
1318 .Ev GOT_AUTHOR .
1319 However, the
1320 .Dv user.name
1321 and
1322 .Dv user.email
1323 configuration settings contained in Git's global
1324 .Pa ~/.gitconfig
1325 configuration file will be used only if the
1326 .Ev GOT_AUTHOR
1327 environment variable is
1328 .Em not
1329 set.
1330 .It Ev VISUAL , EDITOR
1331 The editor spawned by
1332 .Cm got commit ,
1333 .Cm got import ,
1335 .Cm got tag .
1336 .It Ev GOT_LOG_DEFAULT_LIMIT
1337 The default limit on the number of commits traversed by
1338 .Cm got log .
1339 If set to zero, the limit is unbounded.
1340 This variable will be silently ignored if it is set to a non-numeric value.
1341 .El
1342 .Sh EXIT STATUS
1343 .Ex -std got
1344 .Sh EXAMPLES
1345 Clone an existing Git repository for use with
1346 .Nm .
1347 This step currently requires
1348 .Xr git 1 :
1349 .Pp
1350 .Dl $ cd /var/git/
1351 .Dl $ git clone --bare https://github.com/openbsd/src.git
1352 .Pp
1353 Alternatively, for quick and dirty local testing of
1354 .Nm
1355 a new Git repository could be created and populated with files,
1356 e.g. from a temporary CVS checkout located at
1357 .Pa /tmp/src :
1358 .Pp
1359 .Dl $ got init /var/git/src.git
1360 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
1361 .Pp
1362 Check out a work tree from the Git repository to /usr/src:
1363 .Pp
1364 .Dl $ got checkout /var/git/src.git /usr/src
1365 .Pp
1366 View local changes in a work tree directory:
1367 .Pp
1368 .Dl $ got status
1369 .Dl $ got diff | less
1370 .Pp
1371 Interactively revert selected local changes in a work tree directory:
1372 .Pp
1373 .Dl $ got revert -p -R\ .
1374 .Pp
1375 In a work tree or a git repository directory, list all branch references:
1376 .Pp
1377 .Dl $ got branch -l
1378 .Pp
1379 In a work tree or a git repository directory, create a new branch called
1380 .Dq unified-buffer-cache
1381 which is forked off the
1382 .Dq master
1383 branch:
1384 .Pp
1385 .Dl $ got branch unified-buffer-cache master
1386 .Pp
1387 Switch an existing work tree to the branch
1388 .Dq unified-buffer-cache .
1389 Local changes in the work tree will be preserved and merged if necessary:
1390 .Pp
1391 .Dl $ got update -b unified-buffer-cache
1392 .Pp
1393 Create a new commit from local changes in a work tree directory.
1394 This new commit will become the head commit of the work tree's current branch:
1395 .Pp
1396 .Dl $ got commit
1397 .Pp
1398 In a work tree or a git repository directory, view changes committed in
1399 the 3 most recent commits to the work tree's branch, or the branch resolved
1400 via the repository's HEAD reference, respectively:
1401 .Pp
1402 .Dl $ got log -p -l 3 -f
1403 .Pp
1404 Add new files and remove obsolete files in a work tree directory:
1405 .Pp
1406 .Dl $ got add sys/uvm/uvm_ubc.c
1407 .Dl $ got remove sys/uvm/uvm_vnode.c
1408 .Pp
1409 Create a new commit from local changes in a work tree directory
1410 with a pre-defined log message.
1411 .Pp
1412 .Dl $ got commit -m 'unify the buffer cache'
1413 .Pp
1414 Update any work tree checked out from the
1415 .Dq unified-buffer-cache
1416 branch to the latest commit on this branch:
1417 .Pp
1418 .Dl $ got update
1419 .Pp
1420 Roll file content on the unified-buffer-cache branch back by one commit,
1421 and then fetch the rolled-back change into the work tree as a local change
1422 to be amended and perhaps committed again:
1423 .Pp
1424 .Dl $ got backout unified-buffer-cache
1425 .Dl $ got commit -m 'roll back previous'
1426 .Dl $ # now back out the previous backout :-)
1427 .Dl $ got backout unified-buffer-cache
1428 .Pp
1429 Fetch new upstream commits into the local repository's master branch.
1430 This step currently requires
1431 .Xr git 1 :
1432 .Pp
1433 .Dl $ cd /var/git/src.git
1434 .Dl $ git fetch origin master:master
1435 .Pp
1436 Rebase the
1437 .Dq unified-buffer-cache
1438 branch on top of the new head commit of the
1439 .Dq master
1440 branch.
1441 .Pp
1442 .Dl $ got update -b master
1443 .Dl $ got rebase unified-buffer-cache
1444 .Pp
1445 Create a patch from all changes on the unified-buffer-cache branch.
1446 The patch can be mailed out for review and applied to
1447 .Ox Ns 's
1448 CVS tree:
1449 .Pp
1450 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
1451 .Pp
1452 Edit the entire commit history of the
1453 .Dq unified-buffer-cache
1454 branch:
1455 .Pp
1456 .Dl $ got update -b unified-buffer-cache
1457 .Dl $ got update -c master
1458 .Dl $ got histedit
1459 .Pp
1460 Additional steps are necessary if local changes need to be pushed back
1461 to the remote repository, which currently requires
1462 .Cm git fetch
1463 and
1464 .Cm git push .
1465 Before working against existing branches in a repository cloned with
1466 .Dq git clone --bare ,
1467 a Git
1468 .Dq refspec
1469 must be configured to map all references in the remote repository
1470 into the
1471 .Dq refs/remotes
1472 namespace of the local repository.
1473 This can achieved by setting Git's
1474 .Pa remote.origin.fetch
1475 configuration variable to the value
1476 .Dq +refs/heads/*:refs/remotes/origin/*
1477 with the
1478 .Cm git config
1479 command:
1480 .Pp
1481 .Dl $ cd /var/git/repo
1482 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
1483 .Pp
1484 Alternatively, the following
1485 .Pa fetch
1486 configuration item can be added manually to the Git repository's
1487 .Pa config
1488 file:
1489 .Pp
1490 .Dl [remote "origin"]
1491 .Dl url = ...
1492 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
1493 .Pp
1494 This configuration leaves the local repository's
1495 .Dq refs/heads
1496 namespace free for use by local branches checked out with
1497 .Cm got checkout
1498 and, if needed, created with
1499 .Cm got branch .
1500 .Pp
1501 Branches in the
1502 .Dq remotes/origin
1503 namespace can be updated with incoming changes from the remote
1504 repository with
1505 .Cm git fetch :
1506 .Pp
1507 .Dl $ cd /var/git/repo
1508 .Dl $ git fetch
1509 .Pp
1510 Before outgoing changes on the local
1511 .Dq master
1512 branch can be pushed to the remote repository, the local
1513 .Dq master
1514 branch must be rebased onto the
1515 .Dq origin/master
1516 branch:
1517 .Pp
1518 .Dl $ got update -b origin/master
1519 .Dl $ got rebase master
1520 .Pp
1521 Changes on the local
1522 .Dq master
1523 branch can then be pushed to the remote
1524 repository with
1525 .Cm git push :
1526 .Pp
1527 .Dl $ cd /var/git/repo
1528 .Dl $ git push origin master
1529 .Pp
1530 In order to merge changes committed to the
1531 .Dq unified-buffer-cache
1532 branch back into the
1533 .Dq master
1534 branch, the
1535 .Dq unified-buffer-cache
1536 branch must first be rebased onto the
1537 .Dq master
1538 branch:
1539 .Pp
1540 .Dl $ got update -b master
1541 .Dl $ got rebase unified-buffer-cache
1542 .Pp
1543 Changes on the
1544 .Dq unified-buffer-cache
1545 branch can now be made visible on the
1546 .Dq master
1547 branch with
1548 .Cm got integrate .
1549 Because the rebase operation switched the work tree to the
1550 .Dq unified-buffer-cache
1551 branch, the work tree must be switched back to the
1552 .Dq master
1553 branch before the
1554 .Dq unified-buffer-cache
1555 branch can be integrated into
1556 .Dq master :
1557 .Pp
1558 .Dl $ got update -b master
1559 .Dl $ got integrate unified-buffer-cache
1560 .Pp
1561 .Sh SEE ALSO
1562 .Xr tog 1 ,
1563 .Xr git-repository 5 ,
1564 .Xr got-worktree 5
1565 .Sh AUTHORS
1566 .An Stefan Sperling Aq Mt stsp@openbsd.org
1567 .An Martin Pieuchot Aq Mt mpi@openbsd.org
1568 .An Joshua Stein Aq Mt jcs@openbsd.org
1569 .Sh CAVEATS
1570 .Nm
1571 is a work-in-progress and many commands remain to be implemented.
1572 At present, the user has to fall back on
1573 .Xr git 1
1574 to perform many tasks, in particular tasks related to repository
1575 administration and tasks which require a network connection.