Blob


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