Blob


1 .\"
2 .\" Copyright (c) 2017 Martin Pieuchot
3 .\" Copyright (c) 2018, 2019, 2020 Stefan Sperling
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
8 .\"
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\"
17 .Dd $Mdocdate$
18 .Dt GOT 1
19 .Os
20 .Sh NAME
21 .Nm got
22 .Nd Game of Trees
23 .Sh SYNOPSIS
24 .Nm
25 .Ar command
26 .Op Fl h
27 .Op Ar arg ...
28 .Sh DESCRIPTION
29 .Nm
30 is a version control system which stores the history of tracked files
31 in a Git repository, as used by the Git version control system.
32 This repository format is described in
33 .Xr git-repository 5 .
34 .Pp
35 .Nm
36 is a
37 .Dq distributed
38 version control system because every copy of a repository is writeable.
39 Modifications made to files can be synchronized between repositories
40 at any time.
41 .Pp
42 Files managed by
43 .Nm
44 must be checked out from the repository for modification.
45 Checked out files are stored in a
46 .Em work tree
47 which can be placed at an arbitrary directory in the filesystem hierarchy.
48 The on-disk format of this work tree is described in
49 .Xr got-worktree 5 .
50 .Pp
51 .Nm
52 provides global and command-specific options.
53 Global options must precede the command name, and are as follows:
54 .Bl -tag -width tenletters
55 .It Fl h
56 Display usage information and exit immediately.
57 .It Fl V , -version
58 Display program version and exit immediately.
59 .El
60 .Pp
61 The commands for
62 .Nm
63 are as follows:
64 .Bl -tag -width checkout
65 .It Cm init Ar repository-path
66 Create a new empty repository at the specified
67 .Ar repository-path .
68 .Pp
69 After
70 .Cm got init ,
71 the
72 .Cm got import
73 command must be used to populate the empty repository before
74 .Cm got checkout
75 can be used.
76 .It Cm import Oo Fl b Ar branch Oc Oo Fl m Ar message Oc Oo Fl r Ar repository-path Oc Oo Fl I Ar pattern Oc Ar directory
77 Create an initial commit in a repository from the file hierarchy
78 within the specified
79 .Ar directory .
80 The created commit will not have any parent commits, i.e. it will be a
81 root commit.
82 Also create a new reference which provides a branch name for the newly
83 created commit.
84 Show the path of each imported file to indicate progress.
85 .Pp
86 The
87 .Cm got import
88 command requires the
89 .Ev GOT_AUTHOR
90 environment variable to be set,
91 unless an author has been configured in
92 .Xr got.conf 5
93 or Git's
94 .Dv user.name
95 and
96 .Dv user.email
97 configuration settings can be obtained from the repository's
98 .Pa .git/config
99 file or from Git's global
100 .Pa ~/.gitconfig
101 configuration file.
102 .Pp
103 The options for
104 .Cm got import
105 are as follows:
106 .Bl -tag -width Ds
107 .It Fl b Ar branch
108 Create the specified
109 .Ar branch
110 instead of creating the default branch
111 .Dq main .
112 Use of this option is required if the
113 .Dq main
114 branch already exists.
115 .It Fl m Ar message
116 Use the specified log message when creating the new commit.
117 Without the
118 .Fl m
119 option,
120 .Cm got import
121 opens a temporary file in an editor where a log message can be written.
122 .It Fl r Ar repository-path
123 Use the repository at the specified path.
124 If not specified, assume the repository is located at or above the current
125 working directory.
126 .It Fl I Ar pattern
127 Ignore files or directories with a name which matches the specified
128 .Ar pattern .
129 This option may be specified multiple times to build a list of ignore patterns.
130 The
131 .Ar pattern
132 follows the globbing rules documented in
133 .Xr glob 7 .
134 .El
135 .It Cm im
136 Short alias for
137 .Cm import .
138 .It Cm clone Oo Fl a Oc Oo Fl b Ar branch Oc Oo Fl l Oc Oo Fl m Oc Oo Fl q Oc Oo Fl v Oc Oo Fl R Ar reference Oc Ar repository-URL Op Ar directory
139 Clone a Git repository at the specified
140 .Ar repository-URL
141 into the specified
142 .Ar directory .
143 If no
144 .Ar directory
145 is specified the directory name will be derived from the name of the
146 cloned repository.
147 .Cm got clone
148 will refuse to run if the
149 .Ar directory
150 already exists.
151 .Pp
152 The
153 .Ar repository-URL
154 specifies a protocol scheme, a server hostname, an optional port number
155 separated from the hostname by a colon, and a path to the repository on
156 the server:
157 .Lk scheme://hostname:port/path/to/repository
158 .Pp
159 The following protocol schemes are supported:
160 .Bl -tag -width git+ssh
161 .It git
162 The Git protocol as implemented by the
163 .Xr git-daemon 1
164 server.
165 Use of this protocol is discouraged since it supports neither authentication
166 nor encryption.
167 .It git+ssh
168 The Git protocol wrapped in an authenticated and encrypted
169 .Xr ssh 1
170 tunnel.
171 With this protocol the hostname may contain an embedded username for
172 .Xr ssh 1
173 to use:
174 .Mt user@hostname
175 .It ssh
176 Short alias for git+ssh.
177 .El
178 .Pp
179 Objects in the cloned repository are stored in a pack file which is downloaded
180 from the server.
181 This pack file will then be indexed to facilitate access to the objects stored
182 within.
183 If any objects in the pack file are stored in deltified form, all deltas will
184 be fully resolved in order to compute the ID of such objects.
185 This can take some time.
186 More details about the pack file format are documented in
187 .Xr git-repository 5 .
188 .Pp
189 .Cm got clone
190 creates a remote repository entry in the
191 .Xr got.conf 5
192 and
193 .Pa config
194 files of the cloned repository to store the
195 .Ar repository-url
196 and any
197 .Ar branch
198 or
199 .Ar reference
200 arguments for future use by
201 .Cm got fetch
202 or
203 .Xr git-fetch 1 .
204 .Pp
205 The options for
206 .Cm got clone
207 are as follows:
208 .Bl -tag -width Ds
209 .It Fl a
210 Fetch all branches from the remote repository's
211 .Dq refs/heads/
212 reference namespace and set
213 .Cm fetch-all-branches
214 in the cloned repository's
215 .Xr got.conf 5
216 file for future use by
217 .Cm got fetch .
218 If this option is not specified, a branch resolved via the remote
219 repository's HEAD reference will be fetched.
220 Cannot be used together with the
221 .Fl b
222 option.
223 .It Fl b Ar branch
224 Fetch the specified
225 .Ar branch
226 from the remote repository's
227 .Dq refs/heads/
228 reference namespace.
229 This option may be specified multiple times to build a list of branches
230 to fetch.
231 If the branch corresponding to the remote repository's HEAD reference is not
232 in this list, the cloned repository's HEAD reference will be set to the first
233 branch which was fetched.
234 If this option is not specified, a branch resolved via the remote
235 repository's HEAD reference will be fetched.
236 Cannot be used together with the
237 .Fl a
238 option.
239 .It Fl l
240 List branches and tags available for fetching from the remote repository
241 and exit immediately.
242 Cannot be used together with any of the other options except
243 .Fl q
244 and
245 .Fl v .
246 .It Fl m
247 Create the cloned repository as a mirror of the original repository.
248 This is useful if the cloned repository will not be used to store
249 locally created commits.
250 .Pp
251 The repository's
252 .Xr got.conf 5
253 and
254 .Pa config
255 files will be set up with the
256 .Dq mirror
257 option enabled, such that
258 .Cm got fetch
259 or
260 .Xr git-fetch 1
261 will write incoming changes directly to branches in the
262 .Dq refs/heads/
263 reference namespace, rather than to branches in the
264 .Dq refs/remotes/
265 namespace.
266 This avoids the usual requirement of having to run
267 .Cm got rebase
268 after
269 .Cm got fetch
270 in order to make incoming changes appear on branches in the
271 .Dq refs/heads/
272 namespace.
273 But maintaining custom changes in the cloned repository becomes difficult
274 since such changes will be at risk of being discarded whenever incoming
275 changes are fetched.
276 .It Fl q
277 Suppress progress reporting output.
278 The same option will be passed to
279 .Xr ssh 1
280 if applicable.
281 .It Fl v
282 Verbose mode.
283 Causes
284 .Cm got clone
285 to print debugging messages to standard error output.
286 This option will be passed to
287 .Xr ssh 1
288 if applicable.
289 Multiple -v options increase the verbosity.
290 The maximum is 3.
291 .It Fl R Ar reference
292 In addition to the branches and tags that will be fetched, fetch an arbitrary
293 .Ar reference
294 from the remote repository's
295 .Dq refs/
296 namespace.
297 This option may be specified multiple times to build a list of additional
298 references to fetch.
299 The specified
300 .Ar reference
301 may either be a path to a specific reference, or a reference namespace
302 which will cause all references in this namespace to be fetched.
303 .Pp
304 Each reference will be mapped into the cloned repository's
305 .Dq refs/remotes/
306 namespace, unless the
307 .Fl m
308 option is used to mirror references directly into the cloned repository's
309 .Dq refs/
310 namespace.
311 .Pp
312 .Cm got clone
313 will refuse to fetch references from the remote repository's
314 .Dq refs/remotes/
315 or
316 .Dq refs/got/
317 namespace.
318 .El
319 .It Cm cl
320 Short alias for
321 .Cm clone .
322 .It Cm fetch Oo Fl a Oc Oo Fl b Ar branch Oc Oo Fl d Oc Oo Fl l Oc Oo Fl r Ar repository-path Oc Oo Fl t Oc Oo Fl q Oc Oo Fl v Oc Oo Fl R Ar reference Oc Oo Fl X Oc Op Ar remote-repository
323 Fetch new changes from a remote repository.
324 If no
325 .Ar remote-repository
326 is specified,
327 .Dq origin
328 will be used.
329 The remote repository's URL is obtained from the corresponding entry in
330 .Xr got.conf 5
331 or Git's
332 .Pa config
333 file of the local repository, as created by
334 .Cm got clone .
335 .Pp
336 New changes will be stored in a separate pack file downloaded from the server.
337 Optionally, separate pack files stored in the repository can be combined with
338 .Xr git-repack 1 .
339 .Pp
340 By default, branch references in the
341 .Dq refs/remotes/
342 reference namespace will be updated to point at the newly fetched commits.
343 The
344 .Cm got rebase
345 command can then be used to make new changes visible on branches in the
346 .Dq refs/heads/
347 namespace, merging incoming changes with the changes on those branches
348 as necessary.
349 .Pp
350 If the repository was created as a mirror with
351 .Cm got clone -m
352 then all branches in the
353 .Dq refs/heads/
354 namespace will be updated directly to match the corresponding branches in
355 the remote repository.
356 If those branches contained local commits, these commits will no longer be
357 reachable via a reference and will therefore be at risk of being discarded
358 by Git's garbage collector or
359 .Cm gotadmin cleanup .
360 Maintaining custom changes in a mirror repository is therefore discouraged.
361 .Pp
362 In any case, references in the
363 .Dq refs/tags/
364 namespace will always be fetched and mapped directly to local references
365 in the same namespace.
366 .Pp
367 The options for
368 .Cm got fetch
369 are as follows:
370 .Bl -tag -width Ds
371 .It Fl a
372 Fetch all branches from the remote repository's
373 .Dq refs/heads/
374 reference namespace.
375 This option can be enabled by default for specific repositories in
376 .Xr got.conf 5 .
377 If this option is not specified, a branch resolved via the remote
378 repository's HEAD reference will be fetched.
379 Cannot be used together with the
380 .Fl b
381 option.
382 .It Fl b Ar branch
383 Fetch the specified
384 .Ar branch
385 from the remote repository's
386 .Dq refs/heads/
387 reference namespace.
388 This option may be specified multiple times to build a list of branches
389 to fetch.
390 If this option is not specified, a branch resolved via the remote
391 repository's HEAD reference will be fetched.
392 Cannot be used together with the
393 .Fl a
394 option.
395 .It Fl d
396 Delete branches and tags from the local repository which are no longer
397 present in the remote repository.
398 Only references are deleted.
399 Any commit, tree, tag, and blob objects belonging to deleted branches or
400 tags remain in the repository and may be removed separately with
401 Git's garbage collector or
402 .Cm gotadmin cleanup .
403 .It Fl l
404 List branches and tags available for fetching from the remote repository
405 and exit immediately.
406 Cannot be used together with any of the other options except
407 .Fl v ,
408 .Fl q ,
409 and
410 .Fl r .
411 .It Fl t
412 Allow existing references in the
413 .Dq refs/tags
414 namespace to be updated if they have changed on the server.
415 If not specified, only new tag references will be created.
416 .It Fl r Ar repository-path
417 Use the repository at the specified path.
418 If not specified, assume the repository is located at or above the current
419 working directory.
420 If this directory is a
421 .Nm
422 work tree, use the repository path associated with this work tree.
423 .It Fl q
424 Suppress progress reporting output.
425 The same option will be passed to
426 .Xr ssh 1
427 if applicable.
428 .It Fl v
429 Verbose mode.
430 Causes
431 .Cm got fetch
432 to print debugging messages to standard error output.
433 The same option will be passed to
434 .Xr ssh 1
435 if applicable.
436 Multiple -v options increase the verbosity.
437 The maximum is 3.
438 .It Fl R Ar reference
439 In addition to the branches and tags that will be fetched, fetch an arbitrary
440 .Ar reference
441 from the remote repository's
442 .Dq refs/
443 namespace.
444 This option may be specified multiple times to build a list of additional
445 references to fetch.
446 The specified
447 .Ar reference
448 may either be a path to a specific reference, or a reference namespace
449 which will cause all references in this namespace to be fetched.
450 .Pp
451 Each reference will be mapped into the local repository's
452 .Dq refs/remotes/
453 namespace, unless the local repository was created as a mirror with
454 .Cm got clone -m
455 in which case references will be mapped directly into the local repository's
456 .Dq refs/
457 namespace.
458 .Pp
459 Once a reference has been fetched, a branch based on it can be created with
460 .Cm got branch
461 if needed.
462 .Pp
463 .Cm got fetch
464 will refuse to fetch references from the remote repository's
465 .Dq refs/remotes/
466 or
467 .Dq refs/got/
468 namespace.
469 .It Fl X
470 Delete all references which correspond to a particular
471 .Ar remote-repository
472 instead of fetching new changes.
473 This can be useful when a remote repository is being removed from
474 .Xr got.conf 5 .
475 .Pp
476 With
477 .Fl X ,
478 the
479 .Ar remote-repository
480 argument is mandatory and no other options except
481 .Fl r ,
482 .Fl v ,
483 and
484 .Fl q
485 are allowed.
486 .Pp
487 Only references are deleted.
488 Any commit, tree, tag, and blob objects fetched from a remote repository
489 will generally be stored in pack files and may be removed separately with
490 .Xr git-repack 1
491 and Git's garbage collector.
492 .El
493 .It Cm fe
494 Short alias for
495 .Cm fetch .
496 .It Cm checkout Oo Fl E Oc Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl p Ar path-prefix Oc Oo Fl q Oc Ar repository-path Op Ar work-tree-path
497 Copy files from a repository into a new work tree.
498 Show the status of each affected file, using the following status codes:
499 .Bl -column YXZ description
500 .It A Ta new file was added
501 .It E Ta file already exists in work tree's meta-data
502 .El
503 .Pp
504 If the
505 .Ar work tree path
506 is not specified, either use the last component of
507 .Ar repository path ,
508 or if a
509 .Ar path prefix
510 was specified use the last component of
511 .Ar path prefix .
512 .Pp
513 The options for
514 .Cm got checkout
515 are as follows:
516 .Bl -tag -width Ds
517 .It Fl E
518 Proceed with the checkout operation even if the directory at
519 .Ar work-tree-path
520 is not empty.
521 Existing files will be left intact.
522 .It Fl b Ar branch
523 Check out files from a commit on the specified
524 .Ar branch .
525 If this option is not specified, a branch resolved via the repository's HEAD
526 reference will be used.
527 .It Fl c Ar commit
528 Check out files from the specified
529 .Ar commit
530 on the selected branch.
531 The expected argument is a commit ID SHA1 hash or an existing reference
532 or tag name which will be resolved to a commit ID.
533 An abbreviated hash argument will be expanded to a full SHA1 hash
534 automatically, provided the abbreviation is unique.
535 If this option is not specified, the most recent commit on the selected
536 branch will be used.
537 .Pp
538 If the specified
539 .Ar commit
540 is not contained in the selected branch, a different branch which contains
541 this commit must be specified with the
542 .Fl b
543 option.
544 If no such branch is known a new branch must be created for this
545 commit with
546 .Cm got branch
547 before
548 .Cm got checkout
549 can be used.
550 Checking out work trees with an unknown branch is intentionally not supported.
551 .It Fl p Ar path-prefix
552 Restrict the work tree to a subset of the repository's tree hierarchy.
553 Only files beneath the specified
554 .Ar path-prefix
555 will be checked out.
556 .It Fl q
557 Silence progress output.
558 .El
559 .It Cm co
560 Short alias for
561 .Cm checkout .
562 .It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl q Oc Op Ar path ...
563 Update an existing work tree to a different
564 .Ar commit .
565 Change existing files in the work tree as necessary to match file contents
566 of this commit.
567 Preserve any local changes in the work tree and merge them with the
568 incoming changes.
569 .Pp
570 Files which already contain merge conflicts will not be updated to avoid
571 further complications.
572 Such files will be updated when
573 .Cm got update
574 is run again after merge conflicts have been resolved.
575 If the conflicting changes are no longer needed affected files can be
576 reverted with
577 .Cm got revert
578 before running
579 .Cm got update
580 again.
581 .Pp
582 Show the status of each affected file, using the following status codes:
583 .Bl -column YXZ description
584 .It U Ta file was updated and contained no local changes
585 .It G Ta file was updated and local changes were merged cleanly
586 .It C Ta file was updated and conflicts occurred during merge
587 .It D Ta file was deleted
588 .It A Ta new file was added
589 .It \(a~ Ta versioned file is obstructed by a non-regular file
590 .It ! Ta a missing versioned file was restored
591 .It # Ta file was not updated because it contains merge conflicts
592 .It ? Ta changes destined for an unversioned file were not merged
593 .El
594 .Pp
595 If no
596 .Ar path
597 is specified, update the entire work tree.
598 Otherwise, restrict the update operation to files at or within the
599 specified paths.
600 Each path is required to exist in the update operation's target commit.
601 Files in the work tree outside specified paths will remain unchanged and
602 will retain their previously recorded base commit.
603 Some
604 .Nm
605 commands may refuse to run while the work tree contains files from
606 multiple base commits.
607 The base commit of such a work tree can be made consistent by running
608 .Cm got update
609 across the entire work tree.
610 Specifying a
611 .Ar path
612 is incompatible with the
613 .Fl b
614 option.
615 .Pp
616 .Cm got update
617 cannot update paths with staged changes.
618 If changes have been staged with
619 .Cm got stage ,
620 these changes must first be committed with
621 .Cm got commit
622 or unstaged with
623 .Cm got unstage .
624 .Pp
625 The options for
626 .Cm got update
627 are as follows:
628 .Bl -tag -width Ds
629 .It Fl b Ar branch
630 Switch the work tree's branch reference to the specified
631 .Ar branch
632 before updating the work tree.
633 This option requires that all paths in the work tree are updated.
634 .Pp
635 As usual, any local changes in the work tree will be preserved.
636 This can be useful when switching to a newly created branch in order
637 to commit existing local changes to this branch.
638 .Pp
639 Any local changes must be dealt with separately in order to obtain a
640 work tree with pristine file contents corresponding exactly to the specified
641 .Ar branch .
642 Such changes could first be committed to a different branch with
643 .Cm got commit ,
644 or could be discarded with
645 .Cm got revert .
646 .It Fl c Ar commit
647 Update the work tree to the specified
648 .Ar commit .
649 The expected argument is a commit ID SHA1 hash or an existing reference
650 or tag name which will be resolved to a commit ID.
651 An abbreviated hash argument will be expanded to a full SHA1 hash
652 automatically, provided the abbreviation is unique.
653 If this option is not specified, the most recent commit on the work tree's
654 branch will be used.
655 .It Fl q
656 Silence progress output.
657 .El
658 .It Cm up
659 Short alias for
660 .Cm update .
661 .It Cm status Oo Fl I Oc Oo Fl s Ar status-codes Oc Oo Fl S Ar status-codes Oc Op Ar path ...
662 Show the current modification status of files in a work tree,
663 using the following status codes:
664 .Bl -column YXZ description
665 .It M Ta modified file
666 .It A Ta file scheduled for addition in next commit
667 .It D Ta file scheduled for deletion in next commit
668 .It C Ta modified or added file which contains merge conflicts
669 .It ! Ta versioned file was expected on disk but is missing
670 .It \(a~ Ta versioned file is obstructed by a non-regular file
671 .It ? Ta unversioned item not tracked by
672 .Nm
673 .It m Ta modified file modes (executable bit only)
674 .It N Ta non-existent
675 .Ar path
676 specified on the command line
677 .El
678 .Pp
679 If no
680 .Ar path
681 is specified, show modifications in the entire work tree.
682 Otherwise, show modifications at or within the specified paths.
683 .Pp
684 If changes have been staged with
685 .Cm got stage ,
686 staged changes are shown in the second output column, using the following
687 status codes:
688 .Bl -column YXZ description
689 .It M Ta file modification is staged
690 .It A Ta file addition is staged
691 .It D Ta file deletion is staged
692 .El
693 .Pp
694 Changes created on top of staged changes are indicated in the first column:
695 .Bl -column YXZ description
696 .It MM Ta file was modified after earlier changes have been staged
697 .It MA Ta file was modified after having been staged for addition
698 .El
699 .Pp
700 The options for
701 .Cm got status
702 are as follows:
703 .Bl -tag -width Ds
704 .It Fl I
705 Show unversioned files even if they match an ignore pattern.
706 .It Fl s Ar status-codes
707 Only show files with a modification status matching any of the
708 single-character status codes contained in the
709 .Ar status-codes
710 argument.
711 Any combination of codes from the above list of possible status codes
712 may be specified.
713 For staged files, status codes displayed in either column will be matched.
714 Cannot be used together with the
715 .Fl S
716 option.
717 .It Fl S Ar status-codes
718 Suppress the output of files with a modification status matching any of the
719 single-character status codes contained in the
720 .Ar status-codes
721 argument.
722 Any combination of codes from the above list of possible status codes
723 may be specified.
724 For staged files, status codes displayed in either column will be matched.
725 Cannot be used together with the
726 .Fl s
727 option.
728 .El
729 .Pp
730 For compatibility with
731 .Xr cvs 1
732 and
733 .Xr git 1 ,
734 .Cm got status
735 reads
736 .Xr glob 7
737 patterns from
738 .Pa .cvsignore
739 and
740 .Pa .gitignore
741 files in each traversed directory and will not display unversioned files
742 which match these patterns.
743 As an extension to
744 .Xr glob 7
745 matching rules,
746 .Cm got status
747 supports consecutive asterisks,
748 .Dq ** ,
749 which will match an arbitrary amount of directories.
750 Unlike
751 .Xr cvs 1 ,
752 .Cm got status
753 only supports a single ignore pattern per line.
754 Unlike
755 .Xr git 1 ,
756 .Cm got status
757 does not support negated ignore patterns prefixed with
758 .Dq \&! ,
759 and gives no special significance to the location of path component separators,
760 .Dq / ,
761 in a pattern.
762 .It Cm st
763 Short alias for
764 .Cm status .
765 .It Cm log Oo Fl b Oc Oo Fl c Ar commit Oc Oo Fl C Ar number Oc Oo Fl l Ar N Oc Oo Fl p Oc Oo Fl P Oc Oo Fl s Ar search-pattern Oc Oo Fl r Ar repository-path Oc Oo Fl R Oc Oo Fl x Ar commit Oc Op Ar path
766 Display history of a repository.
767 If a
768 .Ar path
769 is specified, show only commits which modified this path.
770 If invoked in a work tree, the
771 .Ar path
772 is interpreted relative to the current working directory,
773 and the work tree's path prefix is implicitly prepended.
774 Otherwise, the path is interpreted relative to the repository root.
775 .Pp
776 The options for
777 .Cm got log
778 are as follows:
779 .Bl -tag -width Ds
780 .It Fl b
781 Display individual commits which were merged into the current branch
782 from other branches.
783 By default,
784 .Cm got log
785 shows the linear history of the current branch only.
786 .It Fl c Ar commit
787 Start traversing history at the specified
788 .Ar commit .
789 The expected argument is a commit ID SHA1 hash or an existing reference
790 or tag name which will be resolved to a commit ID.
791 An abbreviated hash argument will be expanded to a full SHA1 hash
792 automatically, provided the abbreviation is unique.
793 If this option is not specified, default to the work tree's current branch
794 if invoked in a work tree, or to the repository's HEAD reference.
795 .It Fl C Ar number
796 Set the number of context lines shown in diffs with
797 .Fl p .
798 By default, 3 lines of context are shown.
799 .It Fl l Ar N
800 Limit history traversal to a given number of commits.
801 If this option is not specified, a default limit value of zero is used,
802 which is treated as an unbounded limit.
803 The
804 .Ev GOT_LOG_DEFAULT_LIMIT
805 environment variable may be set to change this default value.
806 .It Fl p
807 Display the patch of modifications made in each commit.
808 If a
809 .Ar path
810 is specified, only show the patch of modifications at or within this path.
811 .It Fl P
812 Display the list of file paths changed in each commit, using the following
813 status codes:
814 .Bl -column YXZ description
815 .It M Ta modified file
816 .It D Ta file was deleted
817 .It A Ta new file was added
818 .It m Ta modified file modes (executable bit only)
819 .El
820 .It Fl s Ar search-pattern
821 If specified, show only commits with a log message matched by the extended
822 regular expression
823 .Ar search-pattern .
824 When used together with
825 .Fl P
826 then the file paths changed by a commit can be matched as well.
827 Regular expression syntax is documented in
828 .Xr re_format 7 .
829 .It Fl r Ar repository-path
830 Use the repository at the specified path.
831 If not specified, assume the repository is located at or above the current
832 working directory.
833 If this directory is a
834 .Nm
835 work tree, use the repository path associated with this work tree.
836 .It Fl R
837 Determine a set of commits to display as usual, but display these commits
838 in reverse order.
839 .It Fl x Ar commit
840 Stop traversing commit history immediately after the specified
841 .Ar commit
842 has been traversed.
843 This option has no effect if the specified
844 .Ar commit
845 is never traversed.
846 .El
847 .It Cm diff Oo Fl a Oc Oo Fl C Ar number Oc Oo Fl r Ar repository-path Oc Oo Fl s Oc Oo Fl w Oc Op Ar object1 Ar object2 | Ar path
848 When invoked within a work tree with less than two arguments, display
849 local changes in the work tree.
850 If a
851 .Ar path
852 is specified, only show changes within this path.
853 .Pp
854 If two arguments are provided, treat each argument as a reference, a tag
855 name, or an object ID SHA1 hash, and display differences between the
856 corresponding objects.
857 Both objects must be of the same type (blobs, trees, or commits).
858 An abbreviated hash argument will be expanded to a full SHA1 hash
859 automatically, provided the abbreviation is unique.
860 .Pp
861 The options for
862 .Cm got diff
863 are as follows:
864 .Bl -tag -width Ds
865 .It Fl a
866 Treat file contents as ASCII text even if binary data is detected.
867 .It Fl C Ar number
868 Set the number of context lines shown in the diff.
869 By default, 3 lines of context are shown.
870 .It Fl r Ar repository-path
871 Use the repository at the specified path.
872 If not specified, assume the repository is located at or above the current
873 working directory.
874 If this directory is a
875 .Nm
876 work tree, use the repository path associated with this work tree.
877 .It Fl s
878 Show changes staged with
879 .Cm got stage
880 instead of showing local changes in the work tree.
881 This option is only valid when
882 .Cm got diff
883 is invoked in a work tree.
884 .It Fl w
885 Ignore whitespace-only changes.
886 .El
887 .It Cm di
888 Short alias for
889 .Cm diff .
890 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
891 Display line-by-line history of a file at the specified path.
892 .Pp
893 The options for
894 .Cm got blame
895 are as follows:
896 .Bl -tag -width Ds
897 .It Fl c Ar commit
898 Start traversing history at the specified
899 .Ar commit .
900 The expected argument is a commit ID SHA1 hash or an existing reference
901 or tag name which will be resolved to a commit ID.
902 An abbreviated hash argument will be expanded to a full SHA1 hash
903 automatically, provided the abbreviation is unique.
904 .It Fl r Ar repository-path
905 Use the repository at the specified path.
906 If not specified, assume the repository is located at or above the current
907 working directory.
908 If this directory is a
909 .Nm
910 work tree, use the repository path associated with this work tree.
911 .El
912 .It Cm bl
913 Short alias for
914 .Cm blame .
915 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl i Oc Oo Fl R Oc Op Ar path
916 Display a listing of files and directories at the specified
917 directory path in the repository.
918 Entries shown in this listing may carry one of the following trailing
919 annotations:
920 .Bl -column YXZ description
921 .It @ Ta entry is a symbolic link
922 .It / Ta entry is a directory
923 .It * Ta entry is an executable file
924 .It $ Ta entry is a Git submodule
925 .El
926 .Pp
927 Symbolic link entries are also annotated with the target path of the link.
928 .Pp
929 If no
930 .Ar path
931 is specified, list the repository path corresponding to the current
932 directory of the work tree, or the root directory of the repository
933 if there is no work tree.
934 .Pp
935 The options for
936 .Cm got tree
937 are as follows:
938 .Bl -tag -width Ds
939 .It Fl c Ar commit
940 List files and directories as they appear in the specified
941 .Ar commit .
942 The expected argument is a commit ID SHA1 hash or an existing reference
943 or tag name which will be resolved to a commit ID.
944 An abbreviated hash argument will be expanded to a full SHA1 hash
945 automatically, provided the abbreviation is unique.
946 .It Fl r Ar repository-path
947 Use the repository at the specified path.
948 If not specified, assume the repository is located at or above the current
949 working directory.
950 If this directory is a
951 .Nm
952 work tree, use the repository path associated with this work tree.
953 .It Fl i
954 Show object IDs of files (blob objects) and directories (tree objects).
955 .It Fl R
956 Recurse into sub-directories in the repository.
957 .El
958 .It Cm tr
959 Short alias for
960 .Cm tree .
961 .It Cm ref Oo Fl r Ar repository-path Oc Oo Fl l Oc Oo Fl c Ar object Oc Oo Fl s Ar reference Oc Oo Fl d Oc Op Ar name
962 Manage references in a repository.
963 .Pp
964 References may be listed, created, deleted, and changed.
965 When creating, deleting, or changing a reference the specified
966 .Ar name
967 must be an absolute reference name, i.e. it must begin with
968 .Dq refs/ .
969 .Pp
970 The options for
971 .Cm got ref
972 are as follows:
973 .Bl -tag -width Ds
974 .It Fl r Ar repository-path
975 Use the repository at the specified path.
976 If not specified, assume the repository is located at or above the current
977 working directory.
978 If this directory is a
979 .Nm
980 work tree, use the repository path associated with this work tree.
981 .It Fl l
982 List references in the repository.
983 If no
984 .Ar name
985 is specified, list all existing references in the repository.
986 If
987 .Ar name
988 is a reference namespace, list all references in this namespace.
989 Otherwise, show only the reference with the given
990 .Ar name .
991 Cannot be used together with any other options except
992 .Fl r .
993 .It Fl c Ar object
994 Create a reference or change an existing reference.
995 The reference with the specified
996 .Ar name
997 will point at the specified
998 .Ar object .
999 The expected
1000 .Ar object
1001 argument is a ID SHA1 hash or an existing reference or tag name which will
1002 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
1003 Cannot be used together with any other options except
1004 .Fl r .
1005 .It Fl s Ar reference
1006 Create a symbolic reference, or change an existing symbolic reference.
1007 The symbolic reference with the specified
1008 .Ar name
1009 will point at the specified
1010 .Ar reference
1011 which must already exist in the repository.
1012 Care should be taken not to create loops between references when
1013 this option is used.
1014 Cannot be used together with any other options except
1015 .Fl r .
1016 .It Fl d
1017 Delete the reference with the specified
1018 .Ar name
1019 from the repository.
1020 Any commit, tree, tag, and blob objects belonging to deleted references
1021 remain in the repository and may be removed separately with
1022 Git's garbage collector or
1023 .Cm gotadmin cleanup .
1024 Cannot be used together with any other options except
1025 .Fl r .
1026 .El
1027 .It Cm branch Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl l Oc Oo Fl d Ar name Oc Oo Fl n Oc Op Ar name
1028 Create, list, or delete branches.
1029 .Pp
1030 Local branches are managed via references which live in the
1031 .Dq refs/heads/
1032 reference namespace.
1033 The
1034 .Cm got branch
1035 command creates references in this namespace only.
1036 .Pp
1037 When deleting branches the specified
1038 .Ar name
1039 is searched in the
1040 .Dq refs/heads
1041 reference namespace first.
1042 If no corresponding branch is found the
1043 .Dq refs/remotes
1044 namespace will be searched next.
1045 .Pp
1046 If invoked in a work tree without any arguments, print the name of the
1047 work tree's current branch.
1048 .Pp
1049 If a
1050 .Ar name
1051 argument is passed, attempt to create a branch reference with the given name.
1052 By default the new branch reference will point at the latest commit on the
1053 work tree's current branch if invoked in a work tree, and otherwise to a commit
1054 resolved via the repository's HEAD reference.
1055 .Pp
1056 If invoked in a work tree, once the branch was created successfully
1057 switch the work tree's head reference to the newly created branch and
1058 update files across the entire work tree, just like
1059 .Cm got update -b Ar name
1060 would do.
1061 Show the status of each affected file, using the following status codes:
1062 .Bl -column YXZ description
1063 .It U Ta file was updated and contained no local changes
1064 .It G Ta file was updated and local changes were merged cleanly
1065 .It C Ta file was updated and conflicts occurred during merge
1066 .It D Ta file was deleted
1067 .It A Ta new file was added
1068 .It \(a~ Ta versioned file is obstructed by a non-regular file
1069 .It ! Ta a missing versioned file was restored
1070 .El
1071 .Pp
1072 The options for
1073 .Cm got branch
1074 are as follows:
1075 .Bl -tag -width Ds
1076 .It Fl c Ar commit
1077 Make a newly created branch reference point at the specified
1078 .Ar commit .
1079 The expected
1080 .Ar commit
1081 argument is a commit ID SHA1 hash or an existing reference
1082 or tag name which will be resolved to a commit ID.
1083 .It Fl r Ar repository-path
1084 Use the repository at the specified path.
1085 If not specified, assume the repository is located at or above the current
1086 working directory.
1087 If this directory is a
1088 .Nm
1089 work tree, use the repository path associated with this work tree.
1090 .It Fl l
1091 List all existing branches in the repository, including copies of remote
1092 repositories' branches in the
1093 .Dq refs/remotes/
1094 reference namespace.
1095 .Pp
1096 If invoked in a work tree, the work tree's current branch is shown
1097 with one the following annotations:
1098 .Bl -column YXZ description
1099 .It * Ta work tree's base commit matches the branch tip
1100 .It \(a~ Ta work tree's base commit is out-of-date
1101 .El
1102 .It Fl d Ar name
1103 Delete the branch with the specified
1104 .Ar name
1105 from the
1106 .Dq refs/heads
1108 .Dq refs/remotes
1109 reference namespace.
1110 .Pp
1111 Only the branch reference is deleted.
1112 Any commit, tree, and blob objects belonging to the branch
1113 remain in the repository and may be removed separately with
1114 Git's garbage collector or
1115 .Cm gotadmin cleanup .
1116 .It Fl n
1117 Do not switch and update the work tree after creating a new branch.
1118 .El
1119 .It Cm br
1120 Short alias for
1121 .Cm branch .
1122 .It Cm tag Oo Fl c Ar commit Oc Oo Fl m Ar message Oc Oo Fl r Ar repository-path Oc Oo Fl l Oc Ar name
1123 Manage tags in a repository.
1124 .Pp
1125 Tags are managed via references which live in the
1126 .Dq refs/tags/
1127 reference namespace.
1128 The
1129 .Cm got tag
1130 command operates on references in this namespace only.
1131 References in this namespace point at tag objects which contain a pointer
1132 to another object, a tag message, as well as author and timestamp information.
1133 .Pp
1134 Attempt to create a tag with the given
1135 .Ar name ,
1136 and make this tag point at the given
1137 .Ar commit .
1138 If no commit is specified, default to the latest commit on the work tree's
1139 current branch if invoked in a work tree, and to a commit resolved via
1140 the repository's HEAD reference otherwise.
1141 .Pp
1142 The options for
1143 .Cm got tag
1144 are as follows:
1145 .Bl -tag -width Ds
1146 .It Fl c Ar commit
1147 Make the newly created tag reference point at the specified
1148 .Ar commit .
1149 The expected
1150 .Ar commit
1151 argument is a commit ID SHA1 hash or an existing reference or tag name which
1152 will be resolved to a commit ID.
1153 An abbreviated hash argument will be expanded to a full SHA1 hash
1154 automatically, provided the abbreviation is unique.
1155 .It Fl m Ar message
1156 Use the specified tag message when creating the new tag.
1157 Without the
1158 .Fl m
1159 option,
1160 .Cm got tag
1161 opens a temporary file in an editor where a tag message can be written.
1162 .It Fl r Ar repository-path
1163 Use the repository at the specified path.
1164 If not specified, assume the repository is located at or above the current
1165 working directory.
1166 If this directory is a
1167 .Nm
1168 work tree, use the repository path associated with this work tree.
1169 .It Fl l
1170 List all existing tags in the repository instead of creating a new tag.
1171 If this option is used, no other command-line arguments are allowed.
1172 .El
1173 .Pp
1174 By design, the
1175 .Cm got tag
1176 command will not delete tags or change existing tags.
1177 If a tag must be deleted, the
1178 .Cm got ref
1179 command may be used to delete a tag's reference.
1180 This should only be done if the tag has not already been copied to
1181 another repository.
1182 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1183 Schedule unversioned files in a work tree for addition to the
1184 repository in the next commit.
1185 By default, files which match a
1186 .Cm got status
1187 ignore pattern will not be added.
1188 .Pp
1189 The options for
1190 .Cm got add
1191 are as follows:
1192 .Bl -tag -width Ds
1193 .It Fl R
1194 Permit recursion into directories.
1195 If this option is not specified,
1196 .Cm got add
1197 will refuse to run if a specified
1198 .Ar path
1199 is a directory.
1200 .It Fl I
1201 Add files even if they match a
1202 .Cm got status
1203 ignore pattern.
1204 .El
1205 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
1206 Remove versioned files from a work tree and schedule them for deletion
1207 from the repository in the next commit.
1208 .Pp
1209 The options for
1210 .Cm got remove
1211 are as follows:
1212 .Bl -tag -width Ds
1213 .It Fl f
1214 Perform the operation even if a file contains local modifications.
1215 .It Fl k
1216 Keep affected files on disk.
1217 .It Fl R
1218 Permit recursion into directories.
1219 If this option is not specified,
1220 .Cm got remove
1221 will refuse to run if a specified
1222 .Ar path
1223 is a directory.
1224 .It Fl s Ar status-codes
1225 Only delete files with a modification status matching one of the
1226 single-character status codes contained in the
1227 .Ar status-codes
1228 argument.
1229 The following status codes may be specified:
1230 .Bl -column YXZ description
1231 .It M Ta modified file (this implies the
1232 .Fl f
1233 option)
1234 .It ! Ta versioned file expected on disk but missing
1235 .El
1236 .El
1237 .It Cm rm
1238 Short alias for
1239 .Cm remove .
1240 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1241 Revert any local changes in files at the specified paths in a work tree.
1242 File contents will be overwritten with those contained in the
1243 work tree's base commit.
1244 There is no way to bring discarded changes back after
1245 .Cm got revert !
1246 .Pp
1247 If a file was added with
1248 .Cm got add
1249 it will become an unversioned file again.
1250 If a file was deleted with
1251 .Cm got remove
1252 it will be restored.
1253 .Pp
1254 The options for
1255 .Cm got revert
1256 are as follows:
1257 .Bl -tag -width Ds
1258 .It Fl p
1259 Instead of reverting all changes in files, interactively select or reject
1260 changes to revert based on
1261 .Dq y
1262 (revert change),
1263 .Dq n
1264 (keep change), and
1265 .Dq q
1266 (quit reverting this file) responses.
1267 If a file is in modified status, individual patches derived from the
1268 modified file content can be reverted.
1269 Files in added or deleted status may only be reverted in their entirety.
1270 .It Fl F Ar response-script
1271 With the
1272 .Fl p
1273 option, read
1274 .Dq y ,
1275 .Dq n ,
1276 and
1277 .Dq q
1278 responses line-by-line from the specified
1279 .Ar response-script
1280 file instead of prompting interactively.
1281 .It Fl R
1282 Permit recursion into directories.
1283 If this option is not specified,
1284 .Cm got revert
1285 will refuse to run if a specified
1286 .Ar path
1287 is a directory.
1288 .El
1289 .It Cm rv
1290 Short alias for
1291 .Cm revert .
1292 .It Cm commit Oo Fl F Ar path Oc Oo Fl m Ar message Oc Oo Fl N Oc Oo Fl S Oc Op Ar path ...
1293 Create a new commit in the repository from changes in a work tree
1294 and use this commit as the new base commit for the work tree.
1295 If no
1296 .Ar path
1297 is specified, commit all changes in the work tree.
1298 Otherwise, commit changes at or within the specified paths.
1299 .Pp
1300 If changes have been explicitly staged for commit with
1301 .Cm got stage ,
1302 only commit staged changes and reject any specified paths which
1303 have not been staged.
1304 .Pp
1305 .Cm got commit
1306 opens a temporary file in an editor where a log message can be written
1307 unless the
1308 .Fl m
1309 option is used
1310 or the
1311 .Fl F
1312 and
1313 .Fl N
1314 options are used together.
1315 .Pp
1316 Show the status of each affected file, using the following status codes:
1317 .Bl -column YXZ description
1318 .It M Ta modified file
1319 .It D Ta file was deleted
1320 .It A Ta new file was added
1321 .It m Ta modified file modes (executable bit only)
1322 .El
1323 .Pp
1324 Files which are not part of the new commit will retain their previously
1325 recorded base commit.
1326 Some
1327 .Nm
1328 commands may refuse to run while the work tree contains files from
1329 multiple base commits.
1330 The base commit of such a work tree can be made consistent by running
1331 .Cm got update
1332 across the entire work tree.
1333 .Pp
1334 The
1335 .Cm got commit
1336 command requires the
1337 .Ev GOT_AUTHOR
1338 environment variable to be set,
1339 unless an author has been configured in
1340 .Xr got.conf 5
1341 or Git's
1342 .Dv user.name
1343 and
1344 .Dv user.email
1345 configuration settings can be
1346 obtained from the repository's
1347 .Pa .git/config
1348 file or from Git's global
1349 .Pa ~/.gitconfig
1350 configuration file.
1351 .Pp
1352 The options for
1353 .Cm got commit
1354 are as follows:
1355 .Bl -tag -width Ds
1356 .It Fl F Ar path
1357 Use the prepared log message stored in the file found at
1358 .Ar path
1359 when creating the new commit.
1360 .Cm got commit
1361 opens a temporary file in an editor where the prepared log message can be
1362 reviewed and edited further if needed.
1363 Cannot be used together with the
1364 .Fl m
1365 option.
1366 .It Fl m Ar message
1367 Use the specified log message when creating the new commit.
1368 Cannot be used together with the
1369 .Fl F
1370 option.
1371 .It Fl N
1372 This option prevents
1373 .Cm got commit
1374 from opening the commit message in an editor.
1375 It has no effect unless it is used together with the
1376 .Fl F
1377 option and is intended for non-interactive use such as scripting.
1378 .It Fl S
1379 Allow the addition of symbolic links which point outside of the path space
1380 that is under version control.
1381 By default,
1382 .Cm got commit
1383 will reject such symbolic links due to safety concerns.
1384 As a precaution,
1385 .Nm
1386 may decide to represent such a symbolic link as a regular file which contains
1387 the link's target path, rather than creating an actual symbolic link which
1388 points outside of the work tree.
1389 Use of this option is discouraged because external mechanisms such as
1390 .Dq make obj
1391 are better suited for managing symbolic links to paths not under
1392 version control.
1393 .El
1394 .Pp
1395 .Cm got commit
1396 will refuse to run if certain preconditions are not met.
1397 If the work tree's current branch is not in the
1398 .Dq refs/heads/
1399 reference namespace, new commits may not be created on this branch.
1400 Local changes may only be committed if they are based on file content
1401 found in the most recent commit on the work tree's branch.
1402 If a path is found to be out of date,
1403 .Cm got update
1404 must be used first in order to merge local changes with changes made
1405 in the repository.
1406 .It Cm ci
1407 Short alias for
1408 .Cm commit .
1409 .It Cm send Oo Fl a Oc Oo Fl b Ar branch Oc Oo Fl d Ar branch Oc Oo Fl f Oc Oo Fl r Ar repository-path Oc Oo Fl t Ar tag Oc Oo Fl T Oc Oo Fl q Oc Oo Fl v Oc Op Ar remote-repository
1410 Send new changes to a remote repository.
1411 If no
1412 .Ar remote-repository
1413 is specified,
1414 .Dq origin
1415 will be used.
1416 The remote repository's URL is obtained from the corresponding entry in
1417 .Xr got.conf 5
1418 or Git's
1419 .Pa config
1420 file of the local repository, as created by
1421 .Cm got clone .
1422 .Pp
1423 All objects corresponding to new changes will be written to a temporary
1424 pack file which is then uploaded to the server.
1425 Upon success, references in the
1426 .Dq refs/remotes/
1427 reference namespace of the local repository will be updated to point at
1428 the commits which have been sent.
1429 .Pp
1430 By default, changes will only be sent if they are based on up-to-date
1431 copies of relevant branches in the remote repository.
1432 If any changes to be sent are based on out-of-date copies or would
1433 otherwise break linear history of existing branches, new changes must
1434 be fetched from the server with
1435 .Cm got fetch
1436 and local branches must be rebased with
1437 .Cm got rebase
1438 before
1439 .Cm got send
1440 can succeed.
1441 The
1442 .Fl f
1443 option can be used to make exceptions to these requirements.
1444 .Pp
1445 The options for
1446 .Cm got send
1447 are as follows:
1448 .Bl -tag -width Ds
1449 .It Fl a
1450 Send all branches from the local repository's
1451 .Dq refs/heads/
1452 reference namespace.
1453 The
1454 .Fl a
1455 option is equivalent to listing all branches with multiple
1456 .Fl b
1457 options.
1458 Cannot be used together with the
1459 .Fl b
1460 option.
1461 .It Fl b Ar branch
1462 Send the specified
1463 .Ar branch
1464 from the local repository's
1465 .Dq refs/heads/
1466 reference namespace.
1467 This option may be specified multiple times to build a list of branches
1468 to send.
1469 If this option is not specified, default to the work tree's current branch
1470 if invoked in a work tree, or to the repository's HEAD reference.
1471 Cannot be used together with the
1472 .Fl a
1473 option.
1474 .It Fl d Ar branch
1475 Delete the specified
1476 .Ar branch
1477 from the remote repository's
1478 .Dq refs/heads/
1479 reference namespace.
1480 This option may be specified multiple times to build a list of branches
1481 to delete.
1482 .Pp
1483 Only references are deleted.
1484 Any commit, tree, tag, and blob objects belonging to deleted branches
1485 may become subject to deletion by Git's garbage collector running on
1486 the server.
1487 .Pp
1488 Requesting deletion of branches results in an error if the server
1489 does not support this feature or disallows the deletion of branches
1490 based on its configuration.
1491 .It Fl f
1492 Attempt to force the server to overwrite existing branches or tags
1493 in the remote repository, even when
1494 .Cm got fetch
1495 and
1496 .Cm got rebase
1497 would usually be required before changes can be sent.
1498 The server may reject forced requests regardless, depending on its
1499 configuration.
1500 .Pp
1501 Any commit, tree, tag, and blob objects belonging to overwritten branches
1502 or tags may become subject to deletion by Git's garbage collector running
1503 on the server.
1504 .Pp
1505 The
1506 .Dq refs/tags
1507 reference namespace is globally shared between all repositories.
1508 Use of the
1509 .Fl f
1510 option to overwrite tags is discouraged because it can lead to
1511 inconsistencies between the tags present in different repositories.
1512 In general, creating a new tag with a different name is recommended
1513 instead of overwriting an existing tag.
1514 .Pp
1515 Use of the
1516 .Fl f
1517 option is particularly discouraged if changes being sent are based
1518 on an out-of-date copy of a branch in the remote repository.
1519 Instead of using the
1520 .Fl f
1521 option, new changes should
1522 be fetched with
1523 .Cm got fetch
1524 and local branches should be rebased with
1525 .Cm got rebase ,
1526 followed by another attempt to send the changes.
1527 .Pp
1528 The
1529 .Fl f
1530 option should only be needed in situations where the remote repository's
1531 copy of a branch or tag is known to be out-of-date and is considered
1532 disposable.
1533 The risks of creating inconsistencies between different repositories
1534 should also be taken into account.
1535 .It Fl r Ar repository-path
1536 Use the repository at the specified path.
1537 If not specified, assume the repository is located at or above the current
1538 working directory.
1539 If this directory is a
1540 .Nm
1541 work tree, use the repository path associated with this work tree.
1542 .It Fl t Ar tag
1543 Send the specified
1544 .Ar tag
1545 from the local repository's
1546 .Dq refs/tags/
1547 reference namespace, in addition to any branches that are being sent.
1548 The
1549 .Fl t
1550 option may be specified multiple times to build a list of tags to send.
1551 No tags will be sent if the
1552 .Fl t
1553 option is not used.
1554 .Pp
1555 Raise an error if the specified
1556 .Ar tag
1557 already exists in the remote repository, unless the
1558 .Fl f
1559 option is used to overwrite the server's copy of the tag.
1560 In general, creating a new tag with a different name is recommended
1561 instead of overwriting an existing tag.
1562 .Pp
1563 Cannot be used together with the
1564 .Fl T
1565 option.
1566 .It Fl T
1567 Attempt to send all tags from the local repository's
1568 .Dq refs/tags/
1569 reference namespace.
1570 The
1571 .Fl T
1572 option is equivalent to listing all tags with multiple
1573 .Fl t
1574 options.
1575 Cannot be used together with the
1576 .Fl t
1577 option.
1578 .It Fl q
1579 Suppress progress reporting output.
1580 The same option will be passed to
1581 .Xr ssh 1
1582 if applicable.
1583 .It Fl v
1584 Verbose mode.
1585 Causes
1586 .Cm got send
1587 to print debugging messages to standard error output.
1588 The same option will be passed to
1589 .Xr ssh 1
1590 if applicable.
1591 Multiple -v options increase the verbosity.
1592 The maximum is 3.
1593 .El
1594 .It Cm se
1595 Short alias for
1596 .Cm send .
1597 .It Cm cherrypick Ar commit
1598 Merge changes from a single
1599 .Ar commit
1600 into the work tree.
1601 The specified
1602 .Ar commit
1603 should be on a different branch than the work tree's base commit.
1604 The expected argument is a reference or a commit ID SHA1 hash.
1605 An abbreviated hash argument will be expanded to a full SHA1 hash
1606 automatically, provided the abbreviation is unique.
1607 .Pp
1608 Show the status of each affected file, using the following status codes:
1609 .Bl -column YXZ description
1610 .It G Ta file was merged
1611 .It C Ta file was merged and conflicts occurred during merge
1612 .It ! Ta changes destined for a missing file were not merged
1613 .It D Ta file was deleted
1614 .It d Ta file's deletion was prevented by local modifications
1615 .It A Ta new file was added
1616 .It \(a~ Ta changes destined for a non-regular file were not merged
1617 .It ? Ta changes destined for an unversioned file were not merged
1618 .El
1619 .Pp
1620 The merged changes will appear as local changes in the work tree, which
1621 may be viewed with
1622 .Cm got diff ,
1623 amended manually or with further
1624 .Cm got cherrypick
1625 commands,
1626 committed with
1627 .Cm got commit ,
1628 or discarded again with
1629 .Cm got revert .
1630 .Pp
1631 .Cm got cherrypick
1632 will refuse to run if certain preconditions are not met.
1633 If the work tree contains multiple base commits it must first be updated
1634 to a single base commit with
1635 .Cm got update .
1636 If any relevant files already contain merge conflicts, these
1637 conflicts must be resolved first.
1638 .It Cm cy
1639 Short alias for
1640 .Cm cherrypick .
1641 .It Cm backout Ar commit
1642 Reverse-merge changes from a single
1643 .Ar commit
1644 into the work tree.
1645 The specified
1646 .Ar commit
1647 should be on the same branch as the work tree's base commit.
1648 The expected argument is a reference or a commit ID SHA1 hash.
1649 An abbreviated hash argument will be expanded to a full SHA1 hash
1650 automatically, provided the abbreviation is unique.
1651 .Pp
1652 Show the status of each affected file, using the following status codes:
1653 .Bl -column YXZ description
1654 .It G Ta file was merged
1655 .It C Ta file was merged and conflicts occurred during merge
1656 .It ! Ta changes destined for a missing file were not merged
1657 .It D Ta file was deleted
1658 .It d Ta file's deletion was prevented by local modifications
1659 .It A Ta new file was added
1660 .It \(a~ Ta changes destined for a non-regular file were not merged
1661 .It ? Ta changes destined for an unversioned file were not merged
1662 .El
1663 .Pp
1664 The reverse-merged changes will appear as local changes in the work tree,
1665 which may be viewed with
1666 .Cm got diff ,
1667 amended manually or with further
1668 .Cm got backout
1669 commands,
1670 committed with
1671 .Cm got commit ,
1672 or discarded again with
1673 .Cm got revert .
1674 .Pp
1675 .Cm got backout
1676 will refuse to run if certain preconditions are not met.
1677 If the work tree contains multiple base commits it must first be updated
1678 to a single base commit with
1679 .Cm got update .
1680 If any relevant files already contain merge conflicts, these
1681 conflicts must be resolved first.
1682 .It Cm bo
1683 Short alias for
1684 .Cm backout .
1685 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Oo Fl l Oc Oo Fl X Oc Op Ar branch
1686 Rebase commits on the specified
1687 .Ar branch
1688 onto the tip of the current branch of the work tree.
1689 The
1690 .Ar branch
1691 must share common ancestry with the work tree's current branch.
1692 Rebasing begins with the first descendant commit of the youngest
1693 common ancestor commit shared by the specified
1694 .Ar branch
1695 and the work tree's current branch, and stops once the tip commit
1696 of the specified
1697 .Ar branch
1698 has been rebased.
1699 .Pp
1700 When
1701 .Cm got rebase
1702 is used as intended, the specified
1703 .Ar branch
1704 represents a local commit history and may already contain changes
1705 that are not yet visible in any other repositories.
1706 The work tree's current branch, which must be set with
1707 .Cm got update -b
1708 before starting the
1709 .Cm rebase
1710 operation, represents a branch from a remote repository which shares
1711 a common history with the specified
1712 .Ar branch
1713 but has progressed, and perhaps diverged, due to commits added to the
1714 remote repository.
1715 .Pp
1716 Rebased commits are accumulated on a temporary branch which the work tree
1717 will remain switched to throughout the entire rebase operation.
1718 Commits on this branch represent the same changes with the same log
1719 messages as their counterparts on the original
1720 .Ar branch ,
1721 but with different commit IDs.
1722 Once rebasing has completed successfully, the temporary branch becomes
1723 the new version of the specified
1724 .Ar branch
1725 and the work tree is automatically switched to it.
1726 .Pp
1727 Old commits in their pre-rebase state are automatically backed up in the
1728 .Dq refs/got/backup/rebase
1729 reference namespace.
1730 As long as these references are not removed older versions of rebased
1731 commits will remain in the repository and can be viewed with the
1732 .Cm got rebase -l
1733 command.
1734 Removal of these references makes objects which become unreachable via
1735 any reference subject to removal by Git's garbage collector or
1736 .Cm gotadmin cleanup .
1737 .Pp
1738 While rebasing commits, show the status of each affected file,
1739 using the following status codes:
1740 .Bl -column YXZ description
1741 .It G Ta file was merged
1742 .It C Ta file was merged and conflicts occurred during merge
1743 .It ! Ta changes destined for a missing file were not merged
1744 .It D Ta file was deleted
1745 .It d Ta file's deletion was prevented by local modifications
1746 .It A Ta new file was added
1747 .It \(a~ Ta changes destined for a non-regular file were not merged
1748 .It ? Ta changes destined for an unversioned file were not merged
1749 .El
1750 .Pp
1751 If merge conflicts occur the rebase operation is interrupted and may
1752 be continued once conflicts have been resolved.
1753 If any files with destined changes are found to be missing or unversioned,
1754 or if files could not be deleted due to differences in deleted content,
1755 the rebase operation will be interrupted to prevent potentially incomplete
1756 changes from being committed to the repository without user intervention.
1757 The work tree may be modified as desired and the rebase operation can be
1758 continued once the changes present in the work tree are considered complete.
1759 Alternatively, the rebase operation may be aborted which will leave
1760 .Ar branch
1761 unmodified and the work tree switched back to its original branch.
1762 .Pp
1763 If a merge conflict is resolved in a way which renders the merged
1764 change into a no-op change, the corresponding commit will be elided
1765 when the rebase operation continues.
1766 .Pp
1767 .Cm got rebase
1768 will refuse to run if certain preconditions are not met.
1769 If the work tree is not yet fully updated to the tip commit of its
1770 branch then the work tree must first be updated with
1771 .Cm got update .
1772 If changes have been staged with
1773 .Cm got stage ,
1774 these changes must first be committed with
1775 .Cm got commit
1776 or unstaged with
1777 .Cm got unstage .
1778 If the work tree contains local changes, these changes must first be
1779 committed with
1780 .Cm got commit
1781 or reverted with
1782 .Cm got revert .
1783 If the
1784 .Ar branch
1785 contains changes to files outside of the work tree's path prefix,
1786 the work tree cannot be used to rebase this branch.
1787 .Pp
1788 The
1789 .Cm got update
1790 and
1791 .Cm got commit
1792 commands will refuse to run while a rebase operation is in progress.
1793 Other commands which manipulate the work tree may be used for
1794 conflict resolution purposes.
1795 .Pp
1796 The options for
1797 .Cm got rebase
1798 are as follows:
1799 .Bl -tag -width Ds
1800 .It Fl a
1801 Abort an interrupted rebase operation.
1802 If this option is used, no other command-line arguments are allowed.
1803 .It Fl c
1804 Continue an interrupted rebase operation.
1805 If this option is used, no other command-line arguments are allowed.
1806 .It Fl l
1807 Show a list of past rebase operations, represented by references in the
1808 .Dq refs/got/backup/rebase
1809 reference namespace.
1810 .Pp
1811 Display the author, date, and log message of each backed up commit,
1812 the object ID of the corresponding post-rebase commit, and
1813 the object ID of their common ancestor commit.
1814 Given these object IDs,
1815 the
1816 .Cm got log
1817 command with the
1818 .Fl c
1819 and
1820 .Fl x
1821 options can be used to examine the history of either version of the branch,
1822 and the
1823 .Cm got branch
1824 command with the
1825 .Fl c
1826 option can be used to create a new branch from a pre-rebase state if desired.
1827 .Pp
1828 If a
1829 .Ar branch
1830 is specified, only show commits which at some point in time represented this
1831 branch.
1832 Otherwise, list all backed up commits for any branches.
1833 .Pp
1834 If this option is used,
1835 .Cm got rebase
1836 does not require a work tree.
1837 None of the other options can be used together with
1838 .Fl l .
1839 .It Fl X
1840 Delete backups created by past rebase operations, represented by references
1841 in the
1842 .Dq refs/got/backup/rebase
1843 reference namespace.
1844 .Pp
1845 If a
1846 .Ar branch
1847 is specified, only delete backups which at some point in time represented
1848 this branch.
1849 Otherwise, delete all references found within
1850 .Dq refs/got/backup/rebase .
1851 .Pp
1852 Any commit, tree, tag, and blob objects belonging to deleted backups
1853 remain in the repository and may be removed separately with
1854 Git's garbage collector or
1855 .Cm gotadmin cleanup .
1856 .Pp
1857 If this option is used,
1858 .Cm got rebase
1859 does not require a work tree.
1860 None of the other options can be used together with
1861 .Fl X .
1862 .El
1863 .It Cm rb
1864 Short alias for
1865 .Cm rebase .
1866 .It Cm histedit Oo Fl a Oc Oo Fl c Oc Oo Fl f Oc Oo Fl F Ar histedit-script Oc Oo Fl m Oc Oo Fl l Oc Oo Fl X Oc Op Ar branch
1867 Edit commit history between the work tree's current base commit and
1868 the tip commit of the work tree's current branch.
1869 .Pp
1870 Before starting a
1871 .Cm histedit
1872 operation the work tree's current branch must be set with
1873 .Cm got update -b
1874 to the branch which should be edited, unless this branch is already the
1875 current branch of the work tree.
1876 The tip of this branch represents the upper bound (inclusive) of commits
1877 touched by the
1878 .Cm histedit
1879 operation.
1880 .Pp
1881 Furthermore, the work tree's base commit
1882 must be set with
1883 .Cm got update -c
1884 to a point in this branch's commit history where editing should begin.
1885 This commit represents the lower bound (non-inclusive) of commits touched
1886 by the
1887 .Cm histedit
1888 operation.
1889 .Pp
1890 Editing of commit history is controlled via a
1891 .Ar histedit script
1892 which can be written in an editor based on a template, passed on the
1893 command line, or generated with the
1894 .Fl f
1896 .Fl m
1897 options.
1898 .Pp
1899 The format of the histedit script is line-based.
1900 Each line in the script begins with a command name, followed by
1901 whitespace and an argument.
1902 For most commands, the expected argument is a commit ID SHA1 hash.
1903 Any remaining text on the line is ignored.
1904 Lines which begin with the
1905 .Sq #
1906 character are ignored entirely.
1907 .Pp
1908 The available commands are as follows:
1909 .Bl -column YXZ pick-commit
1910 .It pick Ar commit Ta Use the specified commit as it is.
1911 .It edit Ar commit Ta Use the specified commit but once changes have been
1912 merged into the work tree interrupt the histedit operation for amending.
1913 .It fold Ar commit Ta Combine the specified commit with the next commit
1914 listed further below that will be used.
1915 .It drop Ar commit Ta Remove this commit from the edited history.
1916 .It mesg Ar log-message Ta Use the specified single-line log message for
1917 the commit on the previous line.
1918 If the log message argument is left empty, open an editor where a new
1919 log message can be written.
1920 .El
1921 .Pp
1922 Every commit in the history being edited must be mentioned in the script.
1923 Lines may be re-ordered to change the order of commits in the edited history.
1924 No commit may be listed more than once.
1925 .Pp
1926 Edited commits are accumulated on a temporary branch which the work tree
1927 will remain switched to throughout the entire histedit operation.
1928 Once history editing has completed successfully, the temporary branch becomes
1929 the new version of the work tree's branch and the work tree is automatically
1930 switched to it.
1931 .Pp
1932 Old commits in their pre-histedit state are automatically backed up in the
1933 .Dq refs/got/backup/histedit
1934 reference namespace.
1935 As long as these references are not removed older versions of edited
1936 commits will remain in the repository and can be viewed with the
1937 .Cm got histedit -l
1938 command.
1939 Removal of these references makes objects which become unreachable via
1940 any reference subject to removal by Git's garbage collector or
1941 .Cm gotadmin cleanup .
1942 .Pp
1943 While merging commits, show the status of each affected file,
1944 using the following status codes:
1945 .Bl -column YXZ description
1946 .It G Ta file was merged
1947 .It C Ta file was merged and conflicts occurred during merge
1948 .It ! Ta changes destined for a missing file were not merged
1949 .It D Ta file was deleted
1950 .It d Ta file's deletion was prevented by local modifications
1951 .It A Ta new file was added
1952 .It \(a~ Ta changes destined for a non-regular file were not merged
1953 .It ? Ta changes destined for an unversioned file were not merged
1954 .El
1955 .Pp
1956 If merge conflicts occur the histedit operation is interrupted and may
1957 be continued once conflicts have been resolved.
1958 If any files with destined changes are found to be missing or unversioned,
1959 or if files could not be deleted due to differences in deleted content,
1960 the histedit operation will be interrupted to prevent potentially incomplete
1961 changes from being committed to the repository without user intervention.
1962 The work tree may be modified as desired and the histedit operation can be
1963 continued once the changes present in the work tree are considered complete.
1964 Alternatively, the histedit operation may be aborted which will leave
1965 the work tree switched back to its original branch.
1966 .Pp
1967 If a merge conflict is resolved in a way which renders the merged
1968 change into a no-op change, the corresponding commit will be elided
1969 when the histedit operation continues.
1970 .Pp
1971 .Cm got histedit
1972 will refuse to run if certain preconditions are not met.
1973 If the work tree's current branch is not in the
1974 .Dq refs/heads/
1975 reference namespace, the history of the branch may not be edited.
1976 If the work tree contains multiple base commits it must first be updated
1977 to a single base commit with
1978 .Cm got update .
1979 If changes have been staged with
1980 .Cm got stage ,
1981 these changes must first be committed with
1982 .Cm got commit
1983 or unstaged with
1984 .Cm got unstage .
1985 If the work tree contains local changes, these changes must first be
1986 committed with
1987 .Cm got commit
1988 or reverted with
1989 .Cm got revert .
1990 If the edited history contains changes to files outside of the work tree's
1991 path prefix, the work tree cannot be used to edit the history of this branch.
1992 .Pp
1993 The
1994 .Cm got update ,
1995 .Cm got rebase ,
1996 and
1997 .Cm got integrate
1998 commands will refuse to run while a histedit operation is in progress.
1999 Other commands which manipulate the work tree may be used, and the
2000 .Cm got commit
2001 command may be used to commit arbitrary changes to the temporary branch
2002 while the histedit operation is interrupted.
2003 .Pp
2004 The options for
2005 .Cm got histedit
2006 are as follows:
2007 .Bl -tag -width Ds
2008 .It Fl a
2009 Abort an interrupted histedit operation.
2010 If this option is used, no other command-line arguments are allowed.
2011 .It Fl c
2012 Continue an interrupted histedit operation.
2013 If this option is used, no other command-line arguments are allowed.
2014 .It Fl f
2015 Fold all commits into a single commit.
2016 This option is a quick equivalent to a histedit script which folds all
2017 commits, combining them all into one commit.
2018 The
2019 .Fl f
2020 option can only be used when starting a new histedit operation.
2021 If this option is used, no other command-line arguments are allowed.
2022 .It Fl F Ar histedit-script
2023 Use the specified
2024 .Ar histedit-script
2025 instead of opening a temporary file in an editor where a histedit script
2026 can be written.
2027 .It Fl m
2028 Edit log messages only.
2029 This option is a quick equivalent to a histedit script which edits
2030 only log messages but otherwise leaves every picked commit as-is.
2031 The
2032 .Fl m
2033 option can only be used when starting a new histedit operation.
2034 If this option is used, no other command-line arguments are allowed.
2035 .It Fl l
2036 Show a list of past histedit operations, represented by references in the
2037 .Dq refs/got/backup/histedit
2038 reference namespace.
2039 .Pp
2040 Display the author, date, and log message of each backed up commit,
2041 the object ID of the corresponding post-histedit commit, and
2042 the object ID of their common ancestor commit.
2043 Given these object IDs,
2044 the
2045 .Cm got log
2046 command with the
2047 .Fl c
2048 and
2049 .Fl x
2050 options can be used to examine the history of either version of the branch,
2051 and the
2052 .Cm got branch
2053 command with the
2054 .Fl c
2055 option can be used to create a new branch from a pre-histedit state if desired.
2056 .Pp
2057 If a
2058 .Ar branch
2059 is specified, only show commits which at some point in time represented this
2060 branch.
2061 Otherwise, list all backed up commits for any branches.
2062 .Pp
2063 If this option is used,
2064 .Cm got histedit
2065 does not require a work tree.
2066 None of the other options can be used together with
2067 .Fl l .
2068 .It Fl X
2069 Delete backups created by past histedit operations, represented by references
2070 in the
2071 .Dq refs/got/backup/histedit
2072 reference namespace.
2073 .Pp
2074 If a
2075 .Ar branch
2076 is specified, only delete backups which at some point in time represented
2077 this branch.
2078 Otherwise, delete all references found within
2079 .Dq refs/got/backup/histedit .
2080 .Pp
2081 Any commit, tree, tag, and blob objects belonging to deleted backups
2082 remain in the repository and may be removed separately with
2083 Git's garbage collector or
2084 .Cm gotadmin cleanup .
2085 .Pp
2086 If this option is used,
2087 .Cm got histedit
2088 does not require a work tree.
2089 None of the other options can be used together with
2090 .Fl X .
2091 .El
2092 .It Cm he
2093 Short alias for
2094 .Cm histedit .
2095 .It Cm integrate Ar branch
2096 Integrate the specified
2097 .Ar branch
2098 into the work tree's current branch.
2099 Files in the work tree are updated to match the contents on the integrated
2100 .Ar branch ,
2101 and the reference of the work tree's branch is changed to point at the
2102 head commit of the integrated
2103 .Ar branch .
2104 .Pp
2105 Both branches can be considered equivalent after integration since they
2106 will be pointing at the same commit.
2107 Both branches remain available for future work, if desired.
2108 In case the integrated
2109 .Ar branch
2110 is no longer needed it may be deleted with
2111 .Cm got branch -d .
2112 .Pp
2113 Show the status of each affected file, using the following status codes:
2114 .Bl -column YXZ description
2115 .It U Ta file was updated
2116 .It D Ta file was deleted
2117 .It A Ta new file was added
2118 .It \(a~ Ta versioned file is obstructed by a non-regular file
2119 .It ! Ta a missing versioned file was restored
2120 .El
2121 .Pp
2122 .Cm got integrate
2123 will refuse to run if certain preconditions are not met.
2124 Most importantly, the
2125 .Ar branch
2126 must have been rebased onto the work tree's current branch with
2127 .Cm got rebase
2128 before it can be integrated, in order to linearize commit history and
2129 resolve merge conflicts.
2130 If the work tree contains multiple base commits it must first be updated
2131 to a single base commit with
2132 .Cm got update .
2133 If changes have been staged with
2134 .Cm got stage ,
2135 these changes must first be committed with
2136 .Cm got commit
2137 or unstaged with
2138 .Cm got unstage .
2139 If the work tree contains local changes, these changes must first be
2140 committed with
2141 .Cm got commit
2142 or reverted with
2143 .Cm got revert .
2144 .It Cm ig
2145 Short alias for
2146 .Cm integrate .
2147 .It Cm merge Oo Fl a Oc Oo Fl c Oc Oo Fl n Oc Op Ar branch
2148 Create a merge commit based on the current branch of the work tree and
2149 the specified
2150 .Ar branch .
2151 If a linear project history is desired, then use of
2152 .Cm got rebase
2153 should be preferred over
2154 .Cm got merge .
2155 However, even strictly linear projects may require merge commits in order
2156 to merge in new versions of third-party code stored on vendor branches
2157 created with
2158 .Cm got import .
2159 .Pp
2160 Merge commits are commits based on multiple parent commits.
2161 The tip commit of the work tree's current branch, which must be set with
2162 .Cm got update -b
2163 before starting the
2164 .Cm merge
2165 operation, will be used as the first parent.
2166 The tip commit of the specified
2167 .Ar branch
2168 will be used as the second parent.
2169 .Pp
2170 No ancestral relationship between the two branches is required.
2171 If the two branches have already been merged previously, only new changes
2172 will be merged.
2173 .Pp
2174 It is not possible to create merge commits with more than two parents.
2175 If more than one branch needs to be merged, then multiple merge commits
2176 with two parents each can be created in sequence.
2177 .Pp
2178 While merging changes found on the
2179 .Ar branch
2180 into the work tree, show the status of each affected file,
2181 using the following status codes:
2182 .Bl -column YXZ description
2183 .It G Ta file was merged
2184 .It C Ta file was merged and conflicts occurred during merge
2185 .It ! Ta changes destined for a missing file were not merged
2186 .It D Ta file was deleted
2187 .It d Ta file's deletion was prevented by local modifications
2188 .It A Ta new file was added
2189 .It \(a~ Ta changes destined for a non-regular file were not merged
2190 .It ? Ta changes destined for an unversioned file were not merged
2191 .El
2192 .Pp
2193 If merge conflicts occur, the merge operation is interrupted and conflicts
2194 must be resolved before the merge operation can continue.
2195 If any files with destined changes are found to be missing or unversioned,
2196 or if files could not be deleted due to differences in deleted content,
2197 the merge operation will be interrupted to prevent potentially incomplete
2198 changes from being committed to the repository without user intervention.
2199 The work tree may be modified as desired and the merge can be continued
2200 once the changes present in the work tree are considered complete.
2201 Alternatively, the merge operation may be aborted which will leave
2202 the work tree's current branch unmodified.
2203 .Pp
2204 If a merge conflict is resolved in a way which renders all merged
2205 changes into no-op changes, the merge operation cannot continue
2206 and must be aborted.
2207 .Pp
2208 .Cm got merge
2209 will refuse to run if certain preconditions are not met.
2210 If history of the
2211 .Ar branch
2212 is based on the work tree's current branch, then no merge commit can
2213 be created and
2214 .Cm got integrate
2215 may be used to integrate the
2216 .Ar branch
2217 instead.
2218 If the work tree is not yet fully updated to the tip commit of its
2219 branch, then the work tree must first be updated with
2220 .Cm got update .
2221 If the work tree contains multiple base commits it must first be updated
2222 to a single base commit with
2223 .Cm got update .
2224 If changes have been staged with
2225 .Cm got stage ,
2226 these changes must first be committed with
2227 .Cm got commit
2228 or unstaged with
2229 .Cm got unstage .
2230 If the work tree contains local changes, these changes must first be
2231 committed with
2232 .Cm got commit
2233 or reverted with
2234 .Cm got revert .
2235 If the
2236 .Ar branch
2237 contains changes to files outside of the work tree's path prefix,
2238 the work tree cannot be used to merge this branch.
2239 .Pp
2240 The
2241 .Cm got update ,
2242 .Cm got commit ,
2243 .Cm got rebase ,
2244 .Cm got histedit ,
2245 .Cm got integrate ,
2246 and
2247 .Cm got stage
2248 commands will refuse to run while a merge operation is in progress.
2249 Other commands which manipulate the work tree may be used for
2250 conflict resolution purposes.
2251 .Pp
2252 The options for
2253 .Cm got merge
2254 are as follows:
2255 .Bl -tag -width Ds
2256 .It Fl a
2257 Abort an interrupted merge operation.
2258 If this option is used, no other command-line arguments are allowed.
2259 .It Fl c
2260 Continue an interrupted merge operation.
2261 If this option is used, no other command-line arguments are allowed.
2262 .It Fl n
2263 Merge changes into the work tree as usual but do not create a merge
2264 commit immediately.
2265 The merge result can be adjusted as desired before a merge commit is
2266 created with
2267 .Cm got merge -c .
2268 Alternatively, the merge may be aborted with
2269 .Cm got merge -a .
2270 .El
2271 .It Cm mg
2272 Short alias for
2273 .Cm merge .
2274 .It Cm stage Oo Fl l Oc Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl S Oc Op Ar path ...
2275 Stage local changes for inclusion in the next commit.
2276 If no
2277 .Ar path
2278 is specified, stage all changes in the work tree.
2279 Otherwise, stage changes at or within the specified paths.
2280 Paths may be staged if they are added, modified, or deleted according to
2281 .Cm got status .
2282 .Pp
2283 Show the status of each affected file, using the following status codes:
2284 .Bl -column YXZ description
2285 .It A Ta file addition has been staged
2286 .It M Ta file modification has been staged
2287 .It D Ta file deletion has been staged
2288 .El
2289 .Pp
2290 Staged file contents are saved in newly created blob objects in the repository.
2291 These blobs will be referred to by tree objects once staged changes have been
2292 committed.
2293 .Pp
2294 Staged changes affect the behaviour of
2295 .Cm got commit ,
2296 .Cm got status ,
2297 and
2298 .Cm got diff .
2299 While paths with staged changes exist, the
2300 .Cm got commit
2301 command will refuse to commit any paths which do not have staged changes.
2302 Local changes created on top of staged changes can only be committed if
2303 the path is staged again, or if the staged changes are committed first.
2304 The
2305 .Cm got status
2306 command will show both local changes and staged changes.
2307 The
2308 .Cm got diff
2309 command is able to display local changes relative to staged changes,
2310 and to display staged changes relative to the repository.
2311 The
2312 .Cm got revert
2313 command cannot revert staged changes but may be used to revert
2314 local changes created on top of staged changes.
2315 .Pp
2316 The options for
2317 .Cm got stage
2318 are as follows:
2319 .Bl -tag -width Ds
2320 .It Fl l
2321 Instead of staging new changes, list paths which are already staged,
2322 along with the IDs of staged blob objects and stage status codes.
2323 If paths were provided in the command line show the staged paths
2324 among the specified paths.
2325 Otherwise, show all staged paths.
2326 .It Fl p
2327 Instead of staging the entire content of a changed file, interactively
2328 select or reject changes for staging based on
2329 .Dq y
2330 (stage change),
2331 .Dq n
2332 (reject change), and
2333 .Dq q
2334 (quit staging this file) responses.
2335 If a file is in modified status, individual patches derived from the
2336 modified file content can be staged.
2337 Files in added or deleted status may only be staged or rejected in
2338 their entirety.
2339 .It Fl F Ar response-script
2340 With the
2341 .Fl p
2342 option, read
2343 .Dq y ,
2344 .Dq n ,
2345 and
2346 .Dq q
2347 responses line-by-line from the specified
2348 .Ar response-script
2349 file instead of prompting interactively.
2350 .It Fl S
2351 Allow staging of symbolic links which point outside of the path space
2352 that is under version control.
2353 By default,
2354 .Cm got stage
2355 will reject such symbolic links due to safety concerns.
2356 As a precaution,
2357 .Nm
2358 may decide to represent such a symbolic link as a regular file which contains
2359 the link's target path, rather than creating an actual symbolic link which
2360 points outside of the work tree.
2361 Use of this option is discouraged because external mechanisms such as
2362 .Dq make obj
2363 are better suited for managing symbolic links to paths not under
2364 version control.
2365 .El
2366 .Pp
2367 .Cm got stage
2368 will refuse to run if certain preconditions are not met.
2369 If a file contains merge conflicts, these conflicts must be resolved first.
2370 If a file is found to be out of date relative to the head commit on the
2371 work tree's current branch, the file must be updated with
2372 .Cm got update
2373 before it can be staged (however, this does not prevent the file from
2374 becoming out-of-date at some point after having been staged).
2375 .Pp
2376 The
2377 .Cm got update ,
2378 .Cm got rebase ,
2379 and
2380 .Cm got histedit
2381 commands will refuse to run while staged changes exist.
2382 If staged changes cannot be committed because a staged path
2383 is out of date, the path must be unstaged with
2384 .Cm got unstage
2385 before it can be updated with
2386 .Cm got update ,
2387 and may then be staged again if necessary.
2388 .It Cm sg
2389 Short alias for
2390 .Cm stage .
2391 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
2392 Merge staged changes back into the work tree and put affected paths
2393 back into non-staged status.
2394 If no
2395 .Ar path
2396 is specified, unstage all staged changes across the entire work tree.
2397 Otherwise, unstage changes at or within the specified paths.
2398 .Pp
2399 Show the status of each affected file, using the following status codes:
2400 .Bl -column YXZ description
2401 .It G Ta file was unstaged
2402 .It C Ta file was unstaged and conflicts occurred during merge
2403 .It ! Ta changes destined for a missing file were not merged
2404 .It D Ta file was staged as deleted and still is deleted
2405 .It d Ta file's deletion was prevented by local modifications
2406 .It \(a~ Ta changes destined for a non-regular file were not merged
2407 .El
2408 .Pp
2409 The options for
2410 .Cm got unstage
2411 are as follows:
2412 .Bl -tag -width Ds
2413 .It Fl p
2414 Instead of unstaging the entire content of a changed file, interactively
2415 select or reject changes for unstaging based on
2416 .Dq y
2417 (unstage change),
2418 .Dq n
2419 (keep change staged), and
2420 .Dq q
2421 (quit unstaging this file) responses.
2422 If a file is staged in modified status, individual patches derived from the
2423 staged file content can be unstaged.
2424 Files staged in added or deleted status may only be unstaged in their entirety.
2425 .It Fl F Ar response-script
2426 With the
2427 .Fl p
2428 option, read
2429 .Dq y ,
2430 .Dq n ,
2431 and
2432 .Dq q
2433 responses line-by-line from the specified
2434 .Ar response-script
2435 file instead of prompting interactively.
2436 .El
2437 .It Cm ug
2438 Short alias for
2439 .Cm unstage .
2440 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
2441 Parse and print contents of objects to standard output in a line-based
2442 text format.
2443 Content of commit, tree, and tag objects is printed in a way similar
2444 to the actual content stored in such objects.
2445 Blob object contents are printed as they would appear in files on disk.
2446 .Pp
2447 Attempt to interpret each argument as a reference, a tag name, or
2448 an object ID SHA1 hash.
2449 References will be resolved to an object ID.
2450 Tag names will resolved to a tag object.
2451 An abbreviated hash argument will be expanded to a full SHA1 hash
2452 automatically, provided the abbreviation is unique.
2453 .Pp
2454 If none of the above interpretations produce a valid result, or if the
2455 .Fl P
2456 option is used, attempt to interpret the argument as a path which will
2457 be resolved to the ID of an object found at this path in the repository.
2458 .Pp
2459 The options for
2460 .Cm got cat
2461 are as follows:
2462 .Bl -tag -width Ds
2463 .It Fl c Ar commit
2464 Look up paths in the specified
2465 .Ar commit .
2466 If this option is not used, paths are looked up in the commit resolved
2467 via the repository's HEAD reference.
2468 The expected argument is a commit ID SHA1 hash or an existing reference
2469 or tag name which will be resolved to a commit ID.
2470 An abbreviated hash argument will be expanded to a full SHA1 hash
2471 automatically, provided the abbreviation is unique.
2472 .It Fl r Ar repository-path
2473 Use the repository at the specified path.
2474 If not specified, assume the repository is located at or above the current
2475 working directory.
2476 If this directory is a
2477 .Nm
2478 work tree, use the repository path associated with this work tree.
2479 .It Fl P
2480 Interpret all arguments as paths only.
2481 This option can be used to resolve ambiguity in cases where paths
2482 look like tag names, reference names, or object IDs.
2483 .El
2484 .It Cm info Op Ar path ...
2485 Display meta-data stored in a work tree.
2486 See
2487 .Xr got-worktree 5
2488 for details.
2489 .Pp
2490 The work tree to use is resolved implicitly by walking upwards from the
2491 current working directory.
2492 .Pp
2493 If one or more
2494 .Ar path
2495 arguments are specified, show additional per-file information for tracked
2496 files located at or within these paths.
2497 If a
2498 .Ar path
2499 argument corresponds to the work tree's root directory, display information
2500 for all tracked files.
2501 .El
2502 .Sh ENVIRONMENT
2503 .Bl -tag -width GOT_AUTHOR
2504 .It Ev GOT_AUTHOR
2505 The author's name and email address for
2506 .Cm got commit
2507 and
2508 .Cm got import ,
2509 for example:
2510 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
2511 Because
2512 .Xr git 1
2513 may fail to parse commits without an email address in author data,
2514 .Nm
2515 attempts to reject
2516 .Ev GOT_AUTHOR
2517 environment variables with a missing email address.
2518 .Pp
2519 .Ev GOT_AUTHOR will be overridden by configuration settings in
2520 .Xr got.conf 5
2521 or by Git's
2522 .Dv user.name
2523 and
2524 .Dv user.email
2525 configuration settings in the repository's
2526 .Pa .git/config
2527 file.
2528 The
2529 .Dv user.name
2530 and
2531 .Dv user.email
2532 configuration settings contained in Git's global
2533 .Pa ~/.gitconfig
2534 configuration file will only be used if neither
2535 .Xr got.conf 5
2536 nor the
2537 .Ev GOT_AUTHOR
2538 environment variable provide author information.
2539 .It Ev VISUAL , EDITOR
2540 The editor spawned by
2541 .Cm got commit ,
2542 .Cm got histedit ,
2543 .Cm got import ,
2545 .Cm got tag .
2546 If not set, the
2547 .Xr ed 1
2548 text editor will be spawned in order to give
2549 .Xr ed 1
2550 the attention it deserves.
2551 .It Ev GOT_LOG_DEFAULT_LIMIT
2552 The default limit on the number of commits traversed by
2553 .Cm got log .
2554 If set to zero, the limit is unbounded.
2555 This variable will be silently ignored if it is set to a non-numeric value.
2556 .El
2557 .Sh FILES
2558 .Bl -tag -width packed-refs -compact
2559 .It Pa got.conf
2560 Repository-wide configuration settings for
2561 .Nm .
2562 If present, a
2563 .Xr got.conf 5
2564 configuration file located in the root directory of a Git repository
2565 supersedes any relevant settings in Git's
2566 .Pa config
2567 file.
2568 .Pp
2569 .It Pa .got/got.conf
2570 Worktree-specific configuration settings for
2571 .Nm .
2572 If present, a
2573 .Xr got.conf 5
2574 configuration file in the
2575 .Pa .got
2576 meta-data directory of a work tree supersedes any relevant settings in
2577 the repository's
2578 .Xr got.conf 5
2579 configuration file and Git's
2580 .Pa config
2581 file.
2582 .El
2583 .Sh EXIT STATUS
2584 .Ex -std got
2585 .Sh EXAMPLES
2586 Enable tab-completion of
2587 .Nm
2588 command names in
2589 .Xr ksh 1 :
2590 .Pp
2591 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
2592 .Pp
2593 Clone an existing Git repository for use with
2594 .Nm .
2595 .Pp
2596 .Dl $ cd /var/git/
2597 .Dl $ got clone ssh://git@github.com/openbsd/src.git
2598 .Pp
2599 Use of HTTP URLs currently requires
2600 .Xr git 1 :
2601 .Pp
2602 .Dl $ cd /var/git/
2603 .Dl $ git clone --bare https://github.com/openbsd/src.git
2604 .Pp
2605 Alternatively, for quick and dirty local testing of
2606 .Nm
2607 a new Git repository could be created and populated with files,
2608 e.g. from a temporary CVS checkout located at
2609 .Pa /tmp/src :
2610 .Pp
2611 .Dl $ got init /var/git/src.git
2612 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
2613 .Pp
2614 Check out a work tree from the Git repository to /usr/src:
2615 .Pp
2616 .Dl $ got checkout /var/git/src.git /usr/src
2617 .Pp
2618 View local changes in a work tree directory:
2619 .Pp
2620 .Dl $ got diff | less
2621 .Pp
2622 In a work tree, display files in a potentially problematic state:
2623 .Pp
2624 .Dl $ got status -s 'C!~?'
2625 .Pp
2626 Interactively revert selected local changes in a work tree directory:
2627 .Pp
2628 .Dl $ got revert -p -R\ .
2629 .Pp
2630 In a work tree or a git repository directory, list all branch references:
2631 .Pp
2632 .Dl $ got branch -l
2633 .Pp
2634 In a work tree or a git repository directory, create a new branch called
2635 .Dq unified-buffer-cache
2636 which is forked off the
2637 .Dq master
2638 branch:
2639 .Pp
2640 .Dl $ got branch -c master unified-buffer-cache
2641 .Pp
2642 Switch an existing work tree to the branch
2643 .Dq unified-buffer-cache .
2644 Local changes in the work tree will be preserved and merged if necessary:
2645 .Pp
2646 .Dl $ got update -b unified-buffer-cache
2647 .Pp
2648 Create a new commit from local changes in a work tree directory.
2649 This new commit will become the head commit of the work tree's current branch:
2650 .Pp
2651 .Dl $ got commit
2652 .Pp
2653 In a work tree or a git repository directory, view changes committed in
2654 the 3 most recent commits to the work tree's branch, or the branch resolved
2655 via the repository's HEAD reference, respectively:
2656 .Pp
2657 .Dl $ got log -p -l 3
2658 .Pp
2659 As above, but display changes in the order in which
2660 .Xr patch 1
2661 could apply them in sequence:
2662 .Pp
2663 .Dl $ got log -p -l 3 -R
2664 .Pp
2665 In a work tree or a git repository directory, log the history of a subdirectory:
2666 .Pp
2667 .Dl $ got log sys/uvm
2668 .Pp
2669 While operating inside a work tree, paths are specified relative to the current
2670 working directory, so this command will log the subdirectory
2671 .Pa sys/uvm :
2672 .Pp
2673 .Dl $ cd sys/uvm && got log\ .
2674 .Pp
2675 And this command has the same effect:
2676 .Pp
2677 .Dl $ cd sys/dev/usb && got log ../../uvm
2678 .Pp
2679 And this command displays work tree meta-data about all tracked files:
2680 .Pp
2681 .Dl $ cd /usr/src
2682 .Dl $ got info\ . | less
2683 .Pp
2684 Add new files and remove obsolete files in a work tree directory:
2685 .Pp
2686 .Dl $ got add sys/uvm/uvm_ubc.c
2687 .Dl $ got remove sys/uvm/uvm_vnode.c
2688 .Pp
2689 Create a new commit from local changes in a work tree directory
2690 with a pre-defined log message.
2691 .Pp
2692 .Dl $ got commit -m 'unify the buffer cache'
2693 .Pp
2694 Alternatively, create a new commit from local changes in a work tree
2695 directory with a log message that has been prepared in the file
2696 .Pa /tmp/msg :
2697 .Pp
2698 .Dl $ got commit -F /tmp/msg
2699 .Pp
2700 Update any work tree checked out from the
2701 .Dq unified-buffer-cache
2702 branch to the latest commit on this branch:
2703 .Pp
2704 .Dl $ got update
2705 .Pp
2706 Roll file content on the unified-buffer-cache branch back by one commit,
2707 and then fetch the rolled-back change into the work tree as a local change
2708 to be amended and perhaps committed again:
2709 .Pp
2710 .Dl $ got backout unified-buffer-cache
2711 .Dl $ got commit -m 'roll back previous'
2712 .Dl $ # now back out the previous backout :-)
2713 .Dl $ got backout unified-buffer-cache
2714 .Pp
2715 Fetch new changes on the remote repository's
2716 .Dq master
2717 branch, making them visible on the local repository's
2718 .Dq origin/master
2719 branch:
2720 .Pp
2721 .Dl $ cd /usr/src
2722 .Dl $ got fetch
2723 .Pp
2724 In a repository created with a HTTP URL and
2725 .Cm git clone --bare
2726 the
2727 .Xr git-fetch 1
2728 command must be used instead:
2729 .Pp
2730 .Dl $ cd /var/git/src.git
2731 .Dl $ git fetch origin master:refs/remotes/origin/master
2732 .Pp
2733 Rebase the local
2734 .Dq master
2735 branch to merge the new changes that are now visible on the
2736 .Dq origin/master
2737 branch:
2738 .Pp
2739 .Dl $ cd /usr/src
2740 .Dl $ got update -b origin/master
2741 .Dl $ got rebase master
2742 .Pp
2743 Rebase the
2744 .Dq unified-buffer-cache
2745 branch on top of the new head commit of the
2746 .Dq master
2747 branch.
2748 .Pp
2749 .Dl $ got update -b master
2750 .Dl $ got rebase unified-buffer-cache
2751 .Pp
2752 Create a patch from all changes on the unified-buffer-cache branch.
2753 The patch can be mailed out for review and applied to
2754 .Ox Ns 's
2755 CVS tree:
2756 .Pp
2757 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2758 .Pp
2759 Edit the entire commit history of the
2760 .Dq unified-buffer-cache
2761 branch:
2762 .Pp
2763 .Dl $ got update -b unified-buffer-cache
2764 .Dl $ got update -c master
2765 .Dl $ got histedit
2766 .Pp
2767 Before working against existing branches in a repository cloned with
2768 .Cm git clone --bare
2769 instead of
2770 .Cm got clone ,
2771 a Git
2772 .Dq refspec
2773 must be configured to map all references in the remote repository
2774 into the
2775 .Dq refs/remotes
2776 namespace of the local repository.
2777 This can be achieved by setting Git's
2778 .Pa remote.origin.fetch
2779 configuration variable to the value
2780 .Dq +refs/heads/*:refs/remotes/origin/*
2781 with the
2782 .Cm git config
2783 command:
2784 .Pp
2785 .Dl $ cd /var/git/repo
2786 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2787 .Pp
2788 Additionally, the
2789 .Dq mirror
2790 option must be disabled:
2791 .Pp
2792 .Dl $ cd /var/git/repo
2793 .Dl $ git config remote.origin.mirror false
2794 .Pp
2795 Alternatively, the following
2796 .Xr git-fetch 1
2797 configuration item can be added manually to the Git repository's
2798 .Pa config
2799 file:
2800 .Pp
2801 .Dl [remote \&"origin\&"]
2802 .Dl url = ...
2803 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2804 .Dl mirror = false
2805 .Pp
2806 This configuration leaves the local repository's
2807 .Dq refs/heads
2808 namespace free for use by local branches checked out with
2809 .Cm got checkout
2810 and, if needed, created with
2811 .Cm got branch .
2812 Branches in the
2813 .Dq refs/remotes/origin
2814 namespace can now be updated with incoming changes from the remote
2815 repository with
2816 .Cm got fetch
2818 .Xr git-fetch 1
2819 without extra command line arguments.
2820 Newly fetched changes can be examined with
2821 .Cm got log .
2822 .Pp
2823 Display changes on the remote repository's version of the
2824 .Dq master
2825 branch, as of the last time
2826 .Cm got fetch
2827 was run:
2828 .Pp
2829 .Dl $ got log -c origin/master | less
2830 .Pp
2831 As shown here, most commands accept abbreviated reference names such as
2832 .Dq origin/master
2833 instead of
2834 .Dq refs/remotes/origin/master .
2835 The latter is only needed in case of ambiguity.
2836 .Pp
2837 .Cm got rebase
2838 must be used to merge changes which are visible on the
2839 .Dq origin/master
2840 branch into the
2841 .Dq master
2842 branch.
2843 This will also merge local changes, if any, with the incoming changes:
2844 .Pp
2845 .Dl $ got update -b origin/master
2846 .Dl $ got rebase master
2847 .Pp
2848 In order to make changes committed to the
2849 .Dq unified-buffer-cache
2850 visible on the
2851 .Dq master
2852 branch, the
2853 .Dq unified-buffer-cache
2854 branch must first be rebased onto the
2855 .Dq master
2856 branch:
2857 .Pp
2858 .Dl $ got update -b master
2859 .Dl $ got rebase unified-buffer-cache
2860 .Pp
2861 Changes on the
2862 .Dq unified-buffer-cache
2863 branch can now be made visible on the
2864 .Dq master
2865 branch with
2866 .Cm got integrate .
2867 Because the rebase operation switched the work tree to the
2868 .Dq unified-buffer-cache
2869 branch the work tree must be switched back to the
2870 .Dq master
2871 branch first:
2872 .Pp
2873 .Dl $ got update -b master
2874 .Dl $ got integrate unified-buffer-cache
2875 .Pp
2876 On the
2877 .Dq master
2878 branch, log messages for local changes can now be amended with
2879 .Dq OK
2880 by other developers and any other important new information:
2881 .Pp
2882 .Dl $ got update -c origin/master
2883 .Dl $ got histedit -m
2884 .Pp
2885 If the remote repository offers write access local changes on the
2886 .Dq master
2887 branch can be sent to the remote repository with
2888 .Cm got send.
2889 Usually,
2890 .Cm got send
2891 can be run without further arguments.
2892 The arguments shown here match defaults, provided the work tree's
2893 current branch is the
2894 .Dq master
2895 branch:
2896 .Pp
2897 .Dl $ got send -b master origin
2898 .Pp
2899 If the remote repository requires the HTTPS protocol the
2900 .Xr git-push 1
2901 command must be used instead:
2902 .Pp
2903 .Dl $ cd /var/git/src.git
2904 .Dl $ git push origin master
2905 .Sh SEE ALSO
2906 .Xr gotadmin 1 ,
2907 .Xr tog 1 ,
2908 .Xr git-repository 5 ,
2909 .Xr got-worktree 5 ,
2910 .Xr got.conf 5
2911 .Sh AUTHORS
2912 .An Stefan Sperling Aq Mt stsp@openbsd.org
2913 .An Martin Pieuchot Aq Mt mpi@openbsd.org
2914 .An Joshua Stein Aq Mt jcs@openbsd.org
2915 .An Ori Bernstein Aq Mt ori@openbsd.org
2916 .Sh CAVEATS
2917 .Nm
2918 is a work-in-progress and some features remain to be implemented.
2919 .Pp
2920 At present, the user has to fall back on
2921 .Xr git 1
2922 to perform some tasks.
2923 In particular:
2924 .Bl -bullet
2925 .It
2926 Reading from remote repositories over HTTP or HTTPS protocols requires
2927 .Xr git-clone 1
2928 and
2929 .Xr git-fetch 1 .
2930 .It
2931 Writing to remote repositories over HTTP or HTTPS protocols requires
2932 .Xr git-push 1 .
2933 .It
2934 The creation of merge commits with more than two parent commits requires
2935 .Xr git-merge 1 .
2936 .It
2937 In situations where files or directories were moved around
2938 .Cm got
2939 will not automatically merge changes to new locations and
2940 .Xr git 1
2941 will usually produce better results.
2942 .El