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