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