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 commit 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 commit
870 Show differences between commits in the repository.
871 This options may be used up to two times.
872 When used only once, show differences between the specified
873 .Ar commit
874 and its first parent commit.
875 When used twice, show differences between the two specified commits.
876 .Pp
877 The expected argument is a commit ID SHA1 hash or an existing reference
878 or tag name which will be resolved to a commit ID.
879 An abbreviated hash argument will be expanded to a full SHA1 hash
880 automatically, provided the abbreviation is unique.
881 .Pp
882 If the
883 .Fl c
884 option is used, all non-option arguments will be interpreted as paths.
885 If one or more such
886 .Ar path
887 arguments are provided, only show differences for the specified paths.
888 .Pp
889 Cannot be used together with the
890 .Fl P
891 option.
892 .Pp
893 .It Fl C Ar number
894 Set the number of context lines shown in the diff.
895 By default, 3 lines of context are shown.
896 .It Fl r Ar repository-path
897 Use the repository at the specified path.
898 If not specified, assume the repository is located at or above the current
899 working directory.
900 If this directory is a
901 .Nm
902 work tree, use the repository path associated with this work tree.
903 .It Fl s
904 Show changes staged with
905 .Cm got stage
906 instead of showing local changes in the work tree.
907 This option is only valid when
908 .Cm got diff
909 is invoked in a work tree.
910 .It Fl P
911 Interpret all arguments as paths only.
912 This option can be used to resolve ambiguity in cases where paths
913 look like tag names, reference names, or object IDs.
914 This option is only valid when
915 .Cm got diff
916 is invoked in a work tree.
917 .It Fl w
918 Ignore whitespace-only changes.
919 .El
920 .Tg bl
921 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
922 .Dl (alias: Cm bl )
923 Display line-by-line history of a file at the specified path.
924 .Pp
925 The options for
926 .Cm got blame
927 are as follows:
928 .Bl -tag -width Ds
929 .It Fl c Ar commit
930 Start traversing history at the specified
931 .Ar commit .
932 The expected argument is a commit ID SHA1 hash or an existing reference
933 or tag name which will be resolved to a commit ID.
934 An abbreviated hash argument will be expanded to a full SHA1 hash
935 automatically, provided the abbreviation is unique.
936 .It Fl r Ar repository-path
937 Use the repository at the specified path.
938 If not specified, assume the repository is located at or above the current
939 working directory.
940 If this directory is a
941 .Nm
942 work tree, use the repository path associated with this work tree.
943 .El
944 .Tg tr
945 .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
946 .Dl (alias: Cm tr )
947 Display a listing of files and directories at the specified
948 directory path in the repository.
949 Entries shown in this listing may carry one of the following trailing
950 annotations:
951 .Bl -column YXZ description
952 .It @ Ta entry is a symbolic link
953 .It / Ta entry is a directory
954 .It * Ta entry is an executable file
955 .It $ Ta entry is a Git submodule
956 .El
957 .Pp
958 Symbolic link entries are also annotated with the target path of the link.
959 .Pp
960 If no
961 .Ar path
962 is specified, list the repository path corresponding to the current
963 directory of the work tree, or the root directory of the repository
964 if there is no work tree.
965 .Pp
966 The options for
967 .Cm got tree
968 are as follows:
969 .Bl -tag -width Ds
970 .It Fl c Ar commit
971 List files and directories as they appear in the specified
972 .Ar commit .
973 The expected argument is a commit ID SHA1 hash or an existing reference
974 or tag name which will be resolved to a commit ID.
975 An abbreviated hash argument will be expanded to a full SHA1 hash
976 automatically, provided the abbreviation is unique.
977 .It Fl r Ar repository-path
978 Use the repository at the specified path.
979 If not specified, assume the repository is located at or above the current
980 working directory.
981 If this directory is a
982 .Nm
983 work tree, use the repository path associated with this work tree.
984 .It Fl i
985 Show object IDs of files (blob objects) and directories (tree objects).
986 .It Fl R
987 Recurse into sub-directories in the repository.
988 .El
989 .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
990 Manage references in a repository.
991 .Pp
992 References may be listed, created, deleted, and changed.
993 When creating, deleting, or changing a reference the specified
994 .Ar name
995 must be an absolute reference name, i.e. it must begin with
996 .Dq refs/ .
997 .Pp
998 The options for
999 .Cm got ref
1000 are as follows:
1001 .Bl -tag -width Ds
1002 .It Fl r Ar repository-path
1003 Use the repository at the specified path.
1004 If not specified, assume the repository is located at or above the current
1005 working directory.
1006 If this directory is a
1007 .Nm
1008 work tree, use the repository path associated with this work tree.
1009 .It Fl l
1010 List references in the repository.
1011 If no
1012 .Ar name
1013 is specified, list all existing references in the repository.
1015 .Ar name
1016 is a reference namespace, list all references in this namespace.
1017 Otherwise, show only the reference with the given
1018 .Ar name .
1019 Cannot be used together with any other options except
1020 .Fl r .
1021 .It Fl c Ar object
1022 Create a reference or change an existing reference.
1023 The reference with the specified
1024 .Ar name
1025 will point at the specified
1026 .Ar object .
1027 The expected
1028 .Ar object
1029 argument is a ID SHA1 hash or an existing reference or tag name which will
1030 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
1031 Cannot be used together with any other options except
1032 .Fl r .
1033 .It Fl s Ar reference
1034 Create a symbolic reference, or change an existing symbolic reference.
1035 The symbolic reference with the specified
1036 .Ar name
1037 will point at the specified
1038 .Ar reference
1039 which must already exist in the repository.
1040 Care should be taken not to create loops between references when
1041 this option is used.
1042 Cannot be used together with any other options except
1043 .Fl r .
1044 .It Fl d
1045 Delete the reference with the specified
1046 .Ar name
1047 from the repository.
1048 Any commit, tree, tag, and blob objects belonging to deleted references
1049 remain in the repository and may be removed separately with
1050 Git's garbage collector or
1051 .Cm gotadmin cleanup .
1052 Cannot be used together with any other options except
1053 .Fl r .
1054 .El
1055 .Tg br
1056 .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
1057 .Dl (alias: Cm br )
1058 Create, list, or delete branches.
1059 .Pp
1060 Local branches are managed via references which live in the
1061 .Dq refs/heads/
1062 reference namespace.
1063 The
1064 .Cm got branch
1065 command creates references in this namespace only.
1066 .Pp
1067 When deleting branches the specified
1068 .Ar name
1069 is searched in the
1070 .Dq refs/heads
1071 reference namespace first.
1072 If no corresponding branch is found the
1073 .Dq refs/remotes
1074 namespace will be searched next.
1075 .Pp
1076 If invoked in a work tree without any arguments, print the name of the
1077 work tree's current branch.
1078 .Pp
1079 If a
1080 .Ar name
1081 argument is passed, attempt to create a branch reference with the given name.
1082 By default the new branch reference will point at the latest commit on the
1083 work tree's current branch if invoked in a work tree, and otherwise to a commit
1084 resolved via the repository's HEAD reference.
1085 .Pp
1086 If invoked in a work tree, once the branch was created successfully
1087 switch the work tree's head reference to the newly created branch and
1088 update files across the entire work tree, just like
1089 .Cm got update -b Ar name
1090 would do.
1091 Show the status of each affected file, using the following status codes:
1092 .Bl -column YXZ description
1093 .It U Ta file was updated and contained no local changes
1094 .It G Ta file was updated and local changes were merged cleanly
1095 .It C Ta file was updated and conflicts occurred during merge
1096 .It D Ta file was deleted
1097 .It A Ta new file was added
1098 .It \(a~ Ta versioned file is obstructed by a non-regular file
1099 .It ! Ta a missing versioned file was restored
1100 .El
1101 .Pp
1102 The options for
1103 .Cm got branch
1104 are as follows:
1105 .Bl -tag -width Ds
1106 .It Fl c Ar commit
1107 Make a newly created branch reference point at the specified
1108 .Ar commit .
1109 The expected
1110 .Ar commit
1111 argument is a commit ID SHA1 hash or an existing reference
1112 or tag name which will be resolved to a commit ID.
1113 .It Fl r Ar repository-path
1114 Use the repository at the specified path.
1115 If not specified, assume the repository is located at or above the current
1116 working directory.
1117 If this directory is a
1118 .Nm
1119 work tree, use the repository path associated with this work tree.
1120 .It Fl l
1121 List all existing branches in the repository, including copies of remote
1122 repositories' branches in the
1123 .Dq refs/remotes/
1124 reference namespace.
1125 .Pp
1126 If invoked in a work tree, the work tree's current branch is shown
1127 with one the following annotations:
1128 .Bl -column YXZ description
1129 .It * Ta work tree's base commit matches the branch tip
1130 .It \(a~ Ta work tree's base commit is out-of-date
1131 .El
1132 .It Fl d Ar name
1133 Delete the branch with the specified
1134 .Ar name
1135 from the
1136 .Dq refs/heads
1138 .Dq refs/remotes
1139 reference namespace.
1140 .Pp
1141 Only the branch reference is deleted.
1142 Any commit, tree, and blob objects belonging to the branch
1143 remain in the repository and may be removed separately with
1144 Git's garbage collector or
1145 .Cm gotadmin cleanup .
1146 .It Fl n
1147 Do not switch and update the work tree after creating a new branch.
1148 .El
1149 .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
1150 Manage tags in a repository.
1151 .Pp
1152 Tags are managed via references which live in the
1153 .Dq refs/tags/
1154 reference namespace.
1155 The
1156 .Cm got tag
1157 command operates on references in this namespace only.
1158 References in this namespace point at tag objects which contain a pointer
1159 to another object, a tag message, as well as author and timestamp information.
1160 .Pp
1161 Attempt to create a tag with the given
1162 .Ar name ,
1163 and make this tag point at the given
1164 .Ar commit .
1165 If no commit is specified, default to the latest commit on the work tree's
1166 current branch if invoked in a work tree, and to a commit resolved via
1167 the repository's HEAD reference otherwise.
1168 .Pp
1169 The options for
1170 .Cm got tag
1171 are as follows:
1172 .Bl -tag -width Ds
1173 .It Fl c Ar commit
1174 Make the newly created tag reference point at the specified
1175 .Ar commit .
1176 The expected
1177 .Ar commit
1178 argument is a commit ID SHA1 hash or an existing reference or tag name which
1179 will be resolved to a commit ID.
1180 An abbreviated hash argument will be expanded to a full SHA1 hash
1181 automatically, provided the abbreviation is unique.
1182 .It Fl m Ar message
1183 Use the specified tag message when creating the new tag.
1184 Without the
1185 .Fl m
1186 option,
1187 .Cm got tag
1188 opens a temporary file in an editor where a tag message can be written.
1189 .It Fl r Ar repository-path
1190 Use the repository at the specified path.
1191 If not specified, assume the repository is located at or above the current
1192 working directory.
1193 If this directory is a
1194 .Nm
1195 work tree, use the repository path associated with this work tree.
1196 .It Fl l
1197 List all existing tags in the repository instead of creating a new tag.
1198 If this option is used, no other command-line arguments are allowed.
1199 .El
1200 .Pp
1201 By design, the
1202 .Cm got tag
1203 command will not delete tags or change existing tags.
1204 If a tag must be deleted, the
1205 .Cm got ref
1206 command may be used to delete a tag's reference.
1207 This should only be done if the tag has not already been copied to
1208 another repository.
1209 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1210 Schedule unversioned files in a work tree for addition to the
1211 repository in the next commit.
1212 By default, files which match a
1213 .Cm got status
1214 ignore pattern will not be added.
1215 .Pp
1216 The options for
1217 .Cm got add
1218 are as follows:
1219 .Bl -tag -width Ds
1220 .It Fl R
1221 Permit recursion into directories.
1222 If this option is not specified,
1223 .Cm got add
1224 will refuse to run if a specified
1225 .Ar path
1226 is a directory.
1227 .It Fl I
1228 Add files even if they match a
1229 .Cm got status
1230 ignore pattern.
1231 .El
1232 .Tg rm
1233 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
1234 .Dl (alias: Cm rm )
1235 Remove versioned files from a work tree and schedule them for deletion
1236 from the repository in the next commit.
1237 .Pp
1238 The options for
1239 .Cm got remove
1240 are as follows:
1241 .Bl -tag -width Ds
1242 .It Fl f
1243 Perform the operation even if a file contains local modifications.
1244 .It Fl k
1245 Keep affected files on disk.
1246 .It Fl R
1247 Permit recursion into directories.
1248 If this option is not specified,
1249 .Cm got remove
1250 will refuse to run if a specified
1251 .Ar path
1252 is a directory.
1253 .It Fl s Ar status-codes
1254 Only delete files with a modification status matching one of the
1255 single-character status codes contained in the
1256 .Ar status-codes
1257 argument.
1258 The following status codes may be specified:
1259 .Bl -column YXZ description
1260 .It M Ta modified file (this implies the
1261 .Fl f
1262 option)
1263 .It ! Ta versioned file expected on disk but missing
1264 .El
1265 .El
1266 .Tg rv
1267 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1268 .Dl (alias: Cm rv )
1269 Revert any local changes in files at the specified paths in a work tree.
1270 File contents will be overwritten with those contained in the
1271 work tree's base commit.
1272 There is no way to bring discarded changes back after
1273 .Cm got revert !
1274 .Pp
1275 If a file was added with
1276 .Cm got add
1277 it will become an unversioned file again.
1278 If a file was deleted with
1279 .Cm got remove
1280 it will be restored.
1281 .Pp
1282 The options for
1283 .Cm got revert
1284 are as follows:
1285 .Bl -tag -width Ds
1286 .It Fl p
1287 Instead of reverting all changes in files, interactively select or reject
1288 changes to revert based on
1289 .Dq y
1290 (revert change),
1291 .Dq n
1292 (keep change), and
1293 .Dq q
1294 (quit reverting this file) responses.
1295 If a file is in modified status, individual patches derived from the
1296 modified file content can be reverted.
1297 Files in added or deleted status may only be reverted in their entirety.
1298 .It Fl F Ar response-script
1299 With the
1300 .Fl p
1301 option, read
1302 .Dq y ,
1303 .Dq n ,
1304 and
1305 .Dq q
1306 responses line-by-line from the specified
1307 .Ar response-script
1308 file instead of prompting interactively.
1309 .It Fl R
1310 Permit recursion into directories.
1311 If this option is not specified,
1312 .Cm got revert
1313 will refuse to run if a specified
1314 .Ar path
1315 is a directory.
1316 .El
1317 .Tg ci
1318 .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 ...
1319 .Dl (alias: Cm ci )
1320 Create a new commit in the repository from changes in a work tree
1321 and use this commit as the new base commit for the work tree.
1322 If no
1323 .Ar path
1324 is specified, commit all changes in the work tree.
1325 Otherwise, commit changes at or within the specified paths.
1326 .Pp
1327 If changes have been explicitly staged for commit with
1328 .Cm got stage ,
1329 only commit staged changes and reject any specified paths which
1330 have not been staged.
1331 .Pp
1332 .Cm got commit
1333 opens a temporary file in an editor where a log message can be written
1334 unless the
1335 .Fl m
1336 option is used
1337 or the
1338 .Fl F
1339 and
1340 .Fl N
1341 options are used together.
1342 .Pp
1343 Show the status of each affected file, using the following status codes:
1344 .Bl -column YXZ description
1345 .It M Ta modified file
1346 .It D Ta file was deleted
1347 .It A Ta new file was added
1348 .It m Ta modified file modes (executable bit only)
1349 .El
1350 .Pp
1351 Files which are not part of the new commit will retain their previously
1352 recorded base commit.
1353 Some
1354 .Nm
1355 commands may refuse to run while the work tree contains files from
1356 multiple base commits.
1357 The base commit of such a work tree can be made consistent by running
1358 .Cm got update
1359 across the entire work tree.
1360 .Pp
1361 The
1362 .Cm got commit
1363 command requires the
1364 .Ev GOT_AUTHOR
1365 environment variable to be set,
1366 unless an author has been configured in
1367 .Xr got.conf 5
1368 or Git's
1369 .Dv user.name
1370 and
1371 .Dv user.email
1372 configuration settings can be
1373 obtained from the repository's
1374 .Pa .git/config
1375 file or from Git's global
1376 .Pa ~/.gitconfig
1377 configuration file.
1378 .Pp
1379 The options for
1380 .Cm got commit
1381 are as follows:
1382 .Bl -tag -width Ds
1383 .It Fl F Ar path
1384 Use the prepared log message stored in the file found at
1385 .Ar path
1386 when creating the new commit.
1387 .Cm got commit
1388 opens a temporary file in an editor where the prepared log message can be
1389 reviewed and edited further if needed.
1390 Cannot be used together with the
1391 .Fl m
1392 option.
1393 .It Fl m Ar message
1394 Use the specified log message when creating the new commit.
1395 Cannot be used together with the
1396 .Fl F
1397 option.
1398 .It Fl N
1399 This option prevents
1400 .Cm got commit
1401 from opening the commit message in an editor.
1402 It has no effect unless it is used together with the
1403 .Fl F
1404 option and is intended for non-interactive use such as scripting.
1405 .It Fl S
1406 Allow the addition of symbolic links which point outside of the path space
1407 that is under version control.
1408 By default,
1409 .Cm got commit
1410 will reject such symbolic links due to safety concerns.
1411 As a precaution,
1412 .Nm
1413 may decide to represent such a symbolic link as a regular file which contains
1414 the link's target path, rather than creating an actual symbolic link which
1415 points outside of the work tree.
1416 Use of this option is discouraged because external mechanisms such as
1417 .Dq make obj
1418 are better suited for managing symbolic links to paths not under
1419 version control.
1420 .El
1421 .Pp
1422 .Cm got commit
1423 will refuse to run if certain preconditions are not met.
1424 If the work tree's current branch is not in the
1425 .Dq refs/heads/
1426 reference namespace, new commits may not be created on this branch.
1427 Local changes may only be committed if they are based on file content
1428 found in the most recent commit on the work tree's branch.
1429 If a path is found to be out of date,
1430 .Cm got update
1431 must be used first in order to merge local changes with changes made
1432 in the repository.
1433 .Tg se
1434 .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
1435 .Dl (alias: Cm se )
1436 Send new changes to a remote repository.
1437 If no
1438 .Ar remote-repository
1439 is specified,
1440 .Dq origin
1441 will be used.
1442 The remote repository's URL is obtained from the corresponding entry in
1443 .Xr got.conf 5
1444 or Git's
1445 .Pa config
1446 file of the local repository, as created by
1447 .Cm got clone .
1448 .Pp
1449 All objects corresponding to new changes will be written to a temporary
1450 pack file which is then uploaded to the server.
1451 Upon success, references in the
1452 .Dq refs/remotes/
1453 reference namespace of the local repository will be updated to point at
1454 the commits which have been sent.
1455 .Pp
1456 By default, changes will only be sent if they are based on up-to-date
1457 copies of relevant branches in the remote repository.
1458 If any changes to be sent are based on out-of-date copies or would
1459 otherwise break linear history of existing branches, new changes must
1460 be fetched from the server with
1461 .Cm got fetch
1462 and local branches must be rebased with
1463 .Cm got rebase
1464 before
1465 .Cm got send
1466 can succeed.
1467 The
1468 .Fl f
1469 option can be used to make exceptions to these requirements.
1470 .Pp
1471 The options for
1472 .Cm got send
1473 are as follows:
1474 .Bl -tag -width Ds
1475 .It Fl a
1476 Send all branches from the local repository's
1477 .Dq refs/heads/
1478 reference namespace.
1479 The
1480 .Fl a
1481 option is equivalent to listing all branches with multiple
1482 .Fl b
1483 options.
1484 Cannot be used together with the
1485 .Fl b
1486 option.
1487 .It Fl b Ar branch
1488 Send the specified
1489 .Ar branch
1490 from the local repository's
1491 .Dq refs/heads/
1492 reference namespace.
1493 This option may be specified multiple times to build a list of branches
1494 to send.
1495 If this option is not specified, default to the work tree's current branch
1496 if invoked in a work tree, or to the repository's HEAD reference.
1497 Cannot be used together with the
1498 .Fl a
1499 option.
1500 .It Fl d Ar branch
1501 Delete the specified
1502 .Ar branch
1503 from the remote repository's
1504 .Dq refs/heads/
1505 reference namespace.
1506 This option may be specified multiple times to build a list of branches
1507 to delete.
1508 .Pp
1509 Only references are deleted.
1510 Any commit, tree, tag, and blob objects belonging to deleted branches
1511 may become subject to deletion by Git's garbage collector running on
1512 the server.
1513 .Pp
1514 Requesting deletion of branches results in an error if the server
1515 does not support this feature or disallows the deletion of branches
1516 based on its configuration.
1517 .It Fl f
1518 Attempt to force the server to overwrite existing branches or tags
1519 in the remote repository, even when
1520 .Cm got fetch
1521 and
1522 .Cm got rebase
1523 would usually be required before changes can be sent.
1524 The server may reject forced requests regardless, depending on its
1525 configuration.
1526 .Pp
1527 Any commit, tree, tag, and blob objects belonging to overwritten branches
1528 or tags may become subject to deletion by Git's garbage collector running
1529 on the server.
1530 .Pp
1531 The
1532 .Dq refs/tags
1533 reference namespace is globally shared between all repositories.
1534 Use of the
1535 .Fl f
1536 option to overwrite tags is discouraged because it can lead to
1537 inconsistencies between the tags present in different repositories.
1538 In general, creating a new tag with a different name is recommended
1539 instead of overwriting an existing tag.
1540 .Pp
1541 Use of the
1542 .Fl f
1543 option is particularly discouraged if changes being sent are based
1544 on an out-of-date copy of a branch in the remote repository.
1545 Instead of using the
1546 .Fl f
1547 option, new changes should
1548 be fetched with
1549 .Cm got fetch
1550 and local branches should be rebased with
1551 .Cm got rebase ,
1552 followed by another attempt to send the changes.
1553 .Pp
1554 The
1555 .Fl f
1556 option should only be needed in situations where the remote repository's
1557 copy of a branch or tag is known to be out-of-date and is considered
1558 disposable.
1559 The risks of creating inconsistencies between different repositories
1560 should also be taken into account.
1561 .It Fl r Ar repository-path
1562 Use the repository at the specified path.
1563 If not specified, assume the repository is located at or above the current
1564 working directory.
1565 If this directory is a
1566 .Nm
1567 work tree, use the repository path associated with this work tree.
1568 .It Fl t Ar tag
1569 Send the specified
1570 .Ar tag
1571 from the local repository's
1572 .Dq refs/tags/
1573 reference namespace, in addition to any branches that are being sent.
1574 The
1575 .Fl t
1576 option may be specified multiple times to build a list of tags to send.
1577 No tags will be sent if the
1578 .Fl t
1579 option is not used.
1580 .Pp
1581 Raise an error if the specified
1582 .Ar tag
1583 already exists in the remote repository, unless the
1584 .Fl f
1585 option is used to overwrite the server's copy of the tag.
1586 In general, creating a new tag with a different name is recommended
1587 instead of overwriting an existing tag.
1588 .Pp
1589 Cannot be used together with the
1590 .Fl T
1591 option.
1592 .It Fl T
1593 Attempt to send all tags from the local repository's
1594 .Dq refs/tags/
1595 reference namespace.
1596 The
1597 .Fl T
1598 option is equivalent to listing all tags with multiple
1599 .Fl t
1600 options.
1601 Cannot be used together with the
1602 .Fl t
1603 option.
1604 .It Fl q
1605 Suppress progress reporting output.
1606 The same option will be passed to
1607 .Xr ssh 1
1608 if applicable.
1609 .It Fl v
1610 Verbose mode.
1611 Causes
1612 .Cm got send
1613 to print debugging messages to standard error output.
1614 The same option will be passed to
1615 .Xr ssh 1
1616 if applicable.
1617 Multiple -v options increase the verbosity.
1618 The maximum is 3.
1619 .El
1620 .Tg cy
1621 .It Cm cherrypick Ar commit
1622 .Dl (alias: Cm cy )
1623 Merge changes from a single
1624 .Ar commit
1625 into the work tree.
1626 The specified
1627 .Ar commit
1628 should be on a different branch than the work tree's base commit.
1629 The expected argument is a reference or a commit ID SHA1 hash.
1630 An abbreviated hash argument will be expanded to a full SHA1 hash
1631 automatically, provided the abbreviation is unique.
1632 .Pp
1633 Show the status of each affected file, using the following status codes:
1634 .Bl -column YXZ description
1635 .It G Ta file was merged
1636 .It C Ta file was merged and conflicts occurred during merge
1637 .It ! Ta changes destined for a missing file were not merged
1638 .It D Ta file was deleted
1639 .It d Ta file's deletion was prevented by local modifications
1640 .It A Ta new file was added
1641 .It \(a~ Ta changes destined for a non-regular file were not merged
1642 .It ? Ta changes destined for an unversioned file were not merged
1643 .El
1644 .Pp
1645 The merged changes will appear as local changes in the work tree, which
1646 may be viewed with
1647 .Cm got diff ,
1648 amended manually or with further
1649 .Cm got cherrypick
1650 commands,
1651 committed with
1652 .Cm got commit ,
1653 or discarded again with
1654 .Cm got revert .
1655 .Pp
1656 .Cm got cherrypick
1657 will refuse to run if certain preconditions are not met.
1658 If the work tree contains multiple base commits it must first be updated
1659 to a single base commit with
1660 .Cm got update .
1661 If any relevant files already contain merge conflicts, these
1662 conflicts must be resolved first.
1663 .Tg bo
1664 .It Cm backout Ar commit
1665 .Dl (alias: Cm bo )
1666 Reverse-merge changes from a single
1667 .Ar commit
1668 into the work tree.
1669 The specified
1670 .Ar commit
1671 should be on the same branch as the work tree's base commit.
1672 The expected argument is a reference or a commit ID SHA1 hash.
1673 An abbreviated hash argument will be expanded to a full SHA1 hash
1674 automatically, provided the abbreviation is unique.
1675 .Pp
1676 Show the status of each affected file, using the following status codes:
1677 .Bl -column YXZ description
1678 .It G Ta file was merged
1679 .It C Ta file was merged and conflicts occurred during merge
1680 .It ! Ta changes destined for a missing file were not merged
1681 .It D Ta file was deleted
1682 .It d Ta file's deletion was prevented by local modifications
1683 .It A Ta new file was added
1684 .It \(a~ Ta changes destined for a non-regular file were not merged
1685 .It ? Ta changes destined for an unversioned file were not merged
1686 .El
1687 .Pp
1688 The reverse-merged changes will appear as local changes in the work tree,
1689 which may be viewed with
1690 .Cm got diff ,
1691 amended manually or with further
1692 .Cm got backout
1693 commands,
1694 committed with
1695 .Cm got commit ,
1696 or discarded again with
1697 .Cm got revert .
1698 .Pp
1699 .Cm got backout
1700 will refuse to run if certain preconditions are not met.
1701 If the work tree contains multiple base commits it must first be updated
1702 to a single base commit with
1703 .Cm got update .
1704 If any relevant files already contain merge conflicts, these
1705 conflicts must be resolved first.
1706 .Tg rb
1707 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Oo Fl l Oc Oo Fl X Oc Op Ar branch
1708 .Dl (alias: Cm rb )
1709 Rebase commits on the specified
1710 .Ar branch
1711 onto the tip of the current branch of the work tree.
1712 The
1713 .Ar branch
1714 must share common ancestry with the work tree's current branch.
1715 Rebasing begins with the first descendant commit of the youngest
1716 common ancestor commit shared by the specified
1717 .Ar branch
1718 and the work tree's current branch, and stops once the tip commit
1719 of the specified
1720 .Ar branch
1721 has been rebased.
1722 .Pp
1723 When
1724 .Cm got rebase
1725 is used as intended, the specified
1726 .Ar branch
1727 represents a local commit history and may already contain changes
1728 that are not yet visible in any other repositories.
1729 The work tree's current branch, which must be set with
1730 .Cm got update -b
1731 before starting the
1732 .Cm rebase
1733 operation, represents a branch from a remote repository which shares
1734 a common history with the specified
1735 .Ar branch
1736 but has progressed, and perhaps diverged, due to commits added to the
1737 remote repository.
1738 .Pp
1739 Rebased commits are accumulated on a temporary branch which the work tree
1740 will remain switched to throughout the entire rebase operation.
1741 Commits on this branch represent the same changes with the same log
1742 messages as their counterparts on the original
1743 .Ar branch ,
1744 but with different commit IDs.
1745 Once rebasing has completed successfully, the temporary branch becomes
1746 the new version of the specified
1747 .Ar branch
1748 and the work tree is automatically switched to it.
1749 .Pp
1750 Old commits in their pre-rebase state are automatically backed up in the
1751 .Dq refs/got/backup/rebase
1752 reference namespace.
1753 As long as these references are not removed older versions of rebased
1754 commits will remain in the repository and can be viewed with the
1755 .Cm got rebase -l
1756 command.
1757 Removal of these references makes objects which become unreachable via
1758 any reference subject to removal by Git's garbage collector or
1759 .Cm gotadmin cleanup .
1760 .Pp
1761 While rebasing commits, show the status of each affected file,
1762 using the following status codes:
1763 .Bl -column YXZ description
1764 .It G Ta file was merged
1765 .It C Ta file was merged and conflicts occurred during merge
1766 .It ! Ta changes destined for a missing file were not merged
1767 .It D Ta file was deleted
1768 .It d Ta file's deletion was prevented by local modifications
1769 .It A Ta new file was added
1770 .It \(a~ Ta changes destined for a non-regular file were not merged
1771 .It ? Ta changes destined for an unversioned file were not merged
1772 .El
1773 .Pp
1774 If merge conflicts occur the rebase operation is interrupted and may
1775 be continued once conflicts have been resolved.
1776 If any files with destined changes are found to be missing or unversioned,
1777 or if files could not be deleted due to differences in deleted content,
1778 the rebase operation will be interrupted to prevent potentially incomplete
1779 changes from being committed to the repository without user intervention.
1780 The work tree may be modified as desired and the rebase operation can be
1781 continued once the changes present in the work tree are considered complete.
1782 Alternatively, the rebase operation may be aborted which will leave
1783 .Ar branch
1784 unmodified and the work tree switched back to its original branch.
1785 .Pp
1786 If a merge conflict is resolved in a way which renders the merged
1787 change into a no-op change, the corresponding commit will be elided
1788 when the rebase operation continues.
1789 .Pp
1790 .Cm got rebase
1791 will refuse to run if certain preconditions are not met.
1792 If the work tree is not yet fully updated to the tip commit of its
1793 branch then the work tree must first be updated with
1794 .Cm got update .
1795 If changes have been staged with
1796 .Cm got stage ,
1797 these changes must first be committed with
1798 .Cm got commit
1799 or unstaged with
1800 .Cm got unstage .
1801 If the work tree contains local changes, these changes must first be
1802 committed with
1803 .Cm got commit
1804 or reverted with
1805 .Cm got revert .
1806 If the
1807 .Ar branch
1808 contains changes to files outside of the work tree's path prefix,
1809 the work tree cannot be used to rebase this branch.
1810 .Pp
1811 The
1812 .Cm got update
1813 and
1814 .Cm got commit
1815 commands will refuse to run while a rebase operation is in progress.
1816 Other commands which manipulate the work tree may be used for
1817 conflict resolution purposes.
1818 .Pp
1819 The options for
1820 .Cm got rebase
1821 are as follows:
1822 .Bl -tag -width Ds
1823 .It Fl a
1824 Abort an interrupted rebase operation.
1825 If this option is used, no other command-line arguments are allowed.
1826 .It Fl c
1827 Continue an interrupted rebase operation.
1828 If this option is used, no other command-line arguments are allowed.
1829 .It Fl l
1830 Show a list of past rebase operations, represented by references in the
1831 .Dq refs/got/backup/rebase
1832 reference namespace.
1833 .Pp
1834 Display the author, date, and log message of each backed up commit,
1835 the object ID of the corresponding post-rebase commit, and
1836 the object ID of their common ancestor commit.
1837 Given these object IDs,
1838 the
1839 .Cm got log
1840 command with the
1841 .Fl c
1842 and
1843 .Fl x
1844 options can be used to examine the history of either version of the branch,
1845 and the
1846 .Cm got branch
1847 command with the
1848 .Fl c
1849 option can be used to create a new branch from a pre-rebase state if desired.
1850 .Pp
1851 If a
1852 .Ar branch
1853 is specified, only show commits which at some point in time represented this
1854 branch.
1855 Otherwise, list all backed up commits for any branches.
1856 .Pp
1857 If this option is used,
1858 .Cm got rebase
1859 does not require a work tree.
1860 None of the other options can be used together with
1861 .Fl l .
1862 .It Fl X
1863 Delete backups created by past rebase operations, represented by references
1864 in the
1865 .Dq refs/got/backup/rebase
1866 reference namespace.
1867 .Pp
1868 If a
1869 .Ar branch
1870 is specified, only delete backups which at some point in time represented
1871 this branch.
1872 Otherwise, delete all references found within
1873 .Dq refs/got/backup/rebase .
1874 .Pp
1875 Any commit, tree, tag, and blob objects belonging to deleted backups
1876 remain in the repository and may be removed separately with
1877 Git's garbage collector or
1878 .Cm gotadmin cleanup .
1879 .Pp
1880 If this option is used,
1881 .Cm got rebase
1882 does not require a work tree.
1883 None of the other options can be used together with
1884 .Fl X .
1885 .El
1886 .Tg he
1887 .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
1888 .Dl (alias: Cm he )
1889 Edit commit history between the work tree's current base commit and
1890 the tip commit of the work tree's current branch.
1891 .Pp
1892 Before starting a
1893 .Cm histedit
1894 operation the work tree's current branch must be set with
1895 .Cm got update -b
1896 to the branch which should be edited, unless this branch is already the
1897 current branch of the work tree.
1898 The tip of this branch represents the upper bound (inclusive) of commits
1899 touched by the
1900 .Cm histedit
1901 operation.
1902 .Pp
1903 Furthermore, the work tree's base commit
1904 must be set with
1905 .Cm got update -c
1906 to a point in this branch's commit history where editing should begin.
1907 This commit represents the lower bound (non-inclusive) of commits touched
1908 by the
1909 .Cm histedit
1910 operation.
1911 .Pp
1912 Editing of commit history is controlled via a
1913 .Ar histedit script
1914 which can be written in an editor based on a template, passed on the
1915 command line, or generated with the
1916 .Fl f
1918 .Fl m
1919 options.
1920 .Pp
1921 The format of the histedit script is line-based.
1922 Each line in the script begins with a command name, followed by
1923 whitespace and an argument.
1924 For most commands, the expected argument is a commit ID SHA1 hash.
1925 Any remaining text on the line is ignored.
1926 Lines which begin with the
1927 .Sq #
1928 character are ignored entirely.
1929 .Pp
1930 The available commands are as follows:
1931 .Bl -column YXZ pick-commit
1932 .It pick Ar commit Ta Use the specified commit as it is.
1933 .It edit Ar commit Ta Use the specified commit but once changes have been
1934 merged into the work tree interrupt the histedit operation for amending.
1935 .It fold Ar commit Ta Combine the specified commit with the next commit
1936 listed further below that will be used.
1937 .It drop Ar commit Ta Remove this commit from the edited history.
1938 .It mesg Ar log-message Ta Use the specified single-line log message for
1939 the commit on the previous line.
1940 If the log message argument is left empty, open an editor where a new
1941 log message can be written.
1942 .El
1943 .Pp
1944 Every commit in the history being edited must be mentioned in the script.
1945 Lines may be re-ordered to change the order of commits in the edited history.
1946 No commit may be listed more than once.
1947 .Pp
1948 Edited commits are accumulated on a temporary branch which the work tree
1949 will remain switched to throughout the entire histedit operation.
1950 Once history editing has completed successfully, the temporary branch becomes
1951 the new version of the work tree's branch and the work tree is automatically
1952 switched to it.
1953 .Pp
1954 Old commits in their pre-histedit state are automatically backed up in the
1955 .Dq refs/got/backup/histedit
1956 reference namespace.
1957 As long as these references are not removed older versions of edited
1958 commits will remain in the repository and can be viewed with the
1959 .Cm got histedit -l
1960 command.
1961 Removal of these references makes objects which become unreachable via
1962 any reference subject to removal by Git's garbage collector or
1963 .Cm gotadmin cleanup .
1964 .Pp
1965 While merging commits, show the status of each affected file,
1966 using the following status codes:
1967 .Bl -column YXZ description
1968 .It G Ta file was merged
1969 .It C Ta file was merged and conflicts occurred during merge
1970 .It ! Ta changes destined for a missing file were not merged
1971 .It D Ta file was deleted
1972 .It d Ta file's deletion was prevented by local modifications
1973 .It A Ta new file was added
1974 .It \(a~ Ta changes destined for a non-regular file were not merged
1975 .It ? Ta changes destined for an unversioned file were not merged
1976 .El
1977 .Pp
1978 If merge conflicts occur the histedit operation is interrupted and may
1979 be continued once conflicts have been resolved.
1980 If any files with destined changes are found to be missing or unversioned,
1981 or if files could not be deleted due to differences in deleted content,
1982 the histedit operation will be interrupted to prevent potentially incomplete
1983 changes from being committed to the repository without user intervention.
1984 The work tree may be modified as desired and the histedit operation can be
1985 continued once the changes present in the work tree are considered complete.
1986 Alternatively, the histedit operation may be aborted which will leave
1987 the work tree switched back to its original branch.
1988 .Pp
1989 If a merge conflict is resolved in a way which renders the merged
1990 change into a no-op change, the corresponding commit will be elided
1991 when the histedit operation continues.
1992 .Pp
1993 .Cm got histedit
1994 will refuse to run if certain preconditions are not met.
1995 If the work tree's current branch is not in the
1996 .Dq refs/heads/
1997 reference namespace, the history of the branch may not be edited.
1998 If the work tree contains multiple base commits it must first be updated
1999 to a single base commit with
2000 .Cm got update .
2001 If changes have been staged with
2002 .Cm got stage ,
2003 these changes must first be committed with
2004 .Cm got commit
2005 or unstaged with
2006 .Cm got unstage .
2007 If the work tree contains local changes, these changes must first be
2008 committed with
2009 .Cm got commit
2010 or reverted with
2011 .Cm got revert .
2012 If the edited history contains changes to files outside of the work tree's
2013 path prefix, the work tree cannot be used to edit the history of this branch.
2014 .Pp
2015 The
2016 .Cm got update ,
2017 .Cm got rebase ,
2018 and
2019 .Cm got integrate
2020 commands will refuse to run while a histedit operation is in progress.
2021 Other commands which manipulate the work tree may be used, and the
2022 .Cm got commit
2023 command may be used to commit arbitrary changes to the temporary branch
2024 while the histedit operation is interrupted.
2025 .Pp
2026 The options for
2027 .Cm got histedit
2028 are as follows:
2029 .Bl -tag -width Ds
2030 .It Fl a
2031 Abort an interrupted histedit operation.
2032 If this option is used, no other command-line arguments are allowed.
2033 .It Fl c
2034 Continue an interrupted histedit operation.
2035 If this option is used, no other command-line arguments are allowed.
2036 .It Fl e
2037 Interrupt the histedit operation for editing after merging each commit.
2038 This option is a quick equivalent to a histedit script which uses the
2039 .Cm edit
2040 command for all commits.
2041 The
2042 .Fl e
2043 option can only be used when starting a new histedit operation.
2044 If this option is used, no other command-line arguments are allowed.
2045 .It Fl f
2046 Fold all commits into a single commit.
2047 This option is a quick equivalent to a histedit script which folds all
2048 commits, combining them all into one commit.
2049 The
2050 .Fl f
2051 option can only be used when starting a new histedit operation.
2052 If this option is used, no other command-line arguments are allowed.
2053 .It Fl F Ar histedit-script
2054 Use the specified
2055 .Ar histedit-script
2056 instead of opening a temporary file in an editor where a histedit script
2057 can be written.
2058 .It Fl m
2059 Edit log messages only.
2060 This option is a quick equivalent to a histedit script which edits
2061 only log messages but otherwise leaves every picked commit as-is.
2062 The
2063 .Fl m
2064 option can only be used when starting a new histedit operation.
2065 If this option is used, no other command-line arguments are allowed.
2066 .It Fl l
2067 Show a list of past histedit operations, represented by references in the
2068 .Dq refs/got/backup/histedit
2069 reference namespace.
2070 .Pp
2071 Display the author, date, and log message of each backed up commit,
2072 the object ID of the corresponding post-histedit commit, and
2073 the object ID of their common ancestor commit.
2074 Given these object IDs,
2075 the
2076 .Cm got log
2077 command with the
2078 .Fl c
2079 and
2080 .Fl x
2081 options can be used to examine the history of either version of the branch,
2082 and the
2083 .Cm got branch
2084 command with the
2085 .Fl c
2086 option can be used to create a new branch from a pre-histedit state if desired.
2087 .Pp
2088 If a
2089 .Ar branch
2090 is specified, only show commits which at some point in time represented this
2091 branch.
2092 Otherwise, list all backed up commits for any branches.
2093 .Pp
2094 If this option is used,
2095 .Cm got histedit
2096 does not require a work tree.
2097 None of the other options can be used together with
2098 .Fl l .
2099 .It Fl X
2100 Delete backups created by past histedit operations, represented by references
2101 in the
2102 .Dq refs/got/backup/histedit
2103 reference namespace.
2104 .Pp
2105 If a
2106 .Ar branch
2107 is specified, only delete backups which at some point in time represented
2108 this branch.
2109 Otherwise, delete all references found within
2110 .Dq refs/got/backup/histedit .
2111 .Pp
2112 Any commit, tree, tag, and blob objects belonging to deleted backups
2113 remain in the repository and may be removed separately with
2114 Git's garbage collector or
2115 .Cm gotadmin cleanup .
2116 .Pp
2117 If this option is used,
2118 .Cm got histedit
2119 does not require a work tree.
2120 None of the other options can be used together with
2121 .Fl X .
2122 .El
2123 .Tg ig
2124 .It Cm integrate Ar branch
2125 .Dl (alias: Cm ig )
2126 Integrate the specified
2127 .Ar branch
2128 into the work tree's current branch.
2129 Files in the work tree are updated to match the contents on the integrated
2130 .Ar branch ,
2131 and the reference of the work tree's branch is changed to point at the
2132 head commit of the integrated
2133 .Ar branch .
2134 .Pp
2135 Both branches can be considered equivalent after integration since they
2136 will be pointing at the same commit.
2137 Both branches remain available for future work, if desired.
2138 In case the integrated
2139 .Ar branch
2140 is no longer needed it may be deleted with
2141 .Cm got branch -d .
2142 .Pp
2143 Show the status of each affected file, using the following status codes:
2144 .Bl -column YXZ description
2145 .It U Ta file was updated
2146 .It D Ta file was deleted
2147 .It A Ta new file was added
2148 .It \(a~ Ta versioned file is obstructed by a non-regular file
2149 .It ! Ta a missing versioned file was restored
2150 .El
2151 .Pp
2152 .Cm got integrate
2153 will refuse to run if certain preconditions are not met.
2154 Most importantly, the
2155 .Ar branch
2156 must have been rebased onto the work tree's current branch with
2157 .Cm got rebase
2158 before it can be integrated, in order to linearize commit history and
2159 resolve merge conflicts.
2160 If the work tree contains multiple base commits it must first be updated
2161 to a single base commit with
2162 .Cm got update .
2163 If changes have been staged with
2164 .Cm got stage ,
2165 these changes must first be committed with
2166 .Cm got commit
2167 or unstaged with
2168 .Cm got unstage .
2169 If the work tree contains local changes, these changes must first be
2170 committed with
2171 .Cm got commit
2172 or reverted with
2173 .Cm got revert .
2174 .Tg mg
2175 .It Cm merge Oo Fl a Oc Oo Fl c Oc Oo Fl n Oc Op Ar branch
2176 .Dl (alias: Cm mg )
2177 Create a merge commit based on the current branch of the work tree and
2178 the specified
2179 .Ar branch .
2180 If a linear project history is desired, then use of
2181 .Cm got rebase
2182 should be preferred over
2183 .Cm got merge .
2184 However, even strictly linear projects may require merge commits in order
2185 to merge in new versions of third-party code stored on vendor branches
2186 created with
2187 .Cm got import .
2188 .Pp
2189 Merge commits are commits based on multiple parent commits.
2190 The tip commit of the work tree's current branch, which must be set with
2191 .Cm got update -b
2192 before starting the
2193 .Cm merge
2194 operation, will be used as the first parent.
2195 The tip commit of the specified
2196 .Ar branch
2197 will be used as the second parent.
2198 .Pp
2199 No ancestral relationship between the two branches is required.
2200 If the two branches have already been merged previously, only new changes
2201 will be merged.
2202 .Pp
2203 It is not possible to create merge commits with more than two parents.
2204 If more than one branch needs to be merged, then multiple merge commits
2205 with two parents each can be created in sequence.
2206 .Pp
2207 While merging changes found on the
2208 .Ar branch
2209 into the work tree, show the status of each affected file,
2210 using the following status codes:
2211 .Bl -column YXZ description
2212 .It G Ta file was merged
2213 .It C Ta file was merged and conflicts occurred during merge
2214 .It ! Ta changes destined for a missing file were not merged
2215 .It D Ta file was deleted
2216 .It d Ta file's deletion was prevented by local modifications
2217 .It A Ta new file was added
2218 .It \(a~ Ta changes destined for a non-regular file were not merged
2219 .It ? Ta changes destined for an unversioned file were not merged
2220 .El
2221 .Pp
2222 If merge conflicts occur, the merge operation is interrupted and conflicts
2223 must be resolved before the merge operation can continue.
2224 If any files with destined changes are found to be missing or unversioned,
2225 or if files could not be deleted due to differences in deleted content,
2226 the merge operation will be interrupted to prevent potentially incomplete
2227 changes from being committed to the repository without user intervention.
2228 The work tree may be modified as desired and the merge can be continued
2229 once the changes present in the work tree are considered complete.
2230 Alternatively, the merge operation may be aborted which will leave
2231 the work tree's current branch unmodified.
2232 .Pp
2233 If a merge conflict is resolved in a way which renders all merged
2234 changes into no-op changes, the merge operation cannot continue
2235 and must be aborted.
2236 .Pp
2237 .Cm got merge
2238 will refuse to run if certain preconditions are not met.
2239 If history of the
2240 .Ar branch
2241 is based on the work tree's current branch, then no merge commit can
2242 be created and
2243 .Cm got integrate
2244 may be used to integrate the
2245 .Ar branch
2246 instead.
2247 If the work tree is not yet fully updated to the tip commit of its
2248 branch, then the work tree must first be updated with
2249 .Cm got update .
2250 If the work tree contains multiple base commits it must first be updated
2251 to a single base commit with
2252 .Cm got update .
2253 If changes have been staged with
2254 .Cm got stage ,
2255 these changes must first be committed with
2256 .Cm got commit
2257 or unstaged with
2258 .Cm got unstage .
2259 If the work tree contains local changes, these changes must first be
2260 committed with
2261 .Cm got commit
2262 or reverted with
2263 .Cm got revert .
2264 If the
2265 .Ar branch
2266 contains changes to files outside of the work tree's path prefix,
2267 the work tree cannot be used to merge this branch.
2268 .Pp
2269 The
2270 .Cm got update ,
2271 .Cm got commit ,
2272 .Cm got rebase ,
2273 .Cm got histedit ,
2274 .Cm got integrate ,
2275 and
2276 .Cm got stage
2277 commands will refuse to run while a merge operation is in progress.
2278 Other commands which manipulate the work tree may be used for
2279 conflict resolution purposes.
2280 .Pp
2281 The options for
2282 .Cm got merge
2283 are as follows:
2284 .Bl -tag -width Ds
2285 .It Fl a
2286 Abort an interrupted merge operation.
2287 If this option is used, no other command-line arguments are allowed.
2288 .It Fl c
2289 Continue an interrupted merge operation.
2290 If this option is used, no other command-line arguments are allowed.
2291 .It Fl n
2292 Merge changes into the work tree as usual but do not create a merge
2293 commit immediately.
2294 The merge result can be adjusted as desired before a merge commit is
2295 created with
2296 .Cm got merge -c .
2297 Alternatively, the merge may be aborted with
2298 .Cm got merge -a .
2299 .El
2300 .Tg sg
2301 .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 ...
2302 .Dl (alias: Cm sg )
2303 Stage local changes for inclusion in the next commit.
2304 If no
2305 .Ar path
2306 is specified, stage all changes in the work tree.
2307 Otherwise, stage changes at or within the specified paths.
2308 Paths may be staged if they are added, modified, or deleted according to
2309 .Cm got status .
2310 .Pp
2311 Show the status of each affected file, using the following status codes:
2312 .Bl -column YXZ description
2313 .It A Ta file addition has been staged
2314 .It M Ta file modification has been staged
2315 .It D Ta file deletion has been staged
2316 .El
2317 .Pp
2318 Staged file contents are saved in newly created blob objects in the repository.
2319 These blobs will be referred to by tree objects once staged changes have been
2320 committed.
2321 .Pp
2322 Staged changes affect the behaviour of
2323 .Cm got commit ,
2324 .Cm got status ,
2325 and
2326 .Cm got diff .
2327 While paths with staged changes exist, the
2328 .Cm got commit
2329 command will refuse to commit any paths which do not have staged changes.
2330 Local changes created on top of staged changes can only be committed if
2331 the path is staged again, or if the staged changes are committed first.
2332 The
2333 .Cm got status
2334 command will show both local changes and staged changes.
2335 The
2336 .Cm got diff
2337 command is able to display local changes relative to staged changes,
2338 and to display staged changes relative to the repository.
2339 The
2340 .Cm got revert
2341 command cannot revert staged changes but may be used to revert
2342 local changes created on top of staged changes.
2343 .Pp
2344 The options for
2345 .Cm got stage
2346 are as follows:
2347 .Bl -tag -width Ds
2348 .It Fl l
2349 Instead of staging new changes, list paths which are already staged,
2350 along with the IDs of staged blob objects and stage status codes.
2351 If paths were provided in the command line show the staged paths
2352 among the specified paths.
2353 Otherwise, show all staged paths.
2354 .It Fl p
2355 Instead of staging the entire content of a changed file, interactively
2356 select or reject changes for staging based on
2357 .Dq y
2358 (stage change),
2359 .Dq n
2360 (reject change), and
2361 .Dq q
2362 (quit staging this file) responses.
2363 If a file is in modified status, individual patches derived from the
2364 modified file content can be staged.
2365 Files in added or deleted status may only be staged or rejected in
2366 their entirety.
2367 .It Fl F Ar response-script
2368 With the
2369 .Fl p
2370 option, read
2371 .Dq y ,
2372 .Dq n ,
2373 and
2374 .Dq q
2375 responses line-by-line from the specified
2376 .Ar response-script
2377 file instead of prompting interactively.
2378 .It Fl S
2379 Allow staging of symbolic links which point outside of the path space
2380 that is under version control.
2381 By default,
2382 .Cm got stage
2383 will reject such symbolic links due to safety concerns.
2384 As a precaution,
2385 .Nm
2386 may decide to represent such a symbolic link as a regular file which contains
2387 the link's target path, rather than creating an actual symbolic link which
2388 points outside of the work tree.
2389 Use of this option is discouraged because external mechanisms such as
2390 .Dq make obj
2391 are better suited for managing symbolic links to paths not under
2392 version control.
2393 .El
2394 .Pp
2395 .Cm got stage
2396 will refuse to run if certain preconditions are not met.
2397 If a file contains merge conflicts, these conflicts must be resolved first.
2398 If a file is found to be out of date relative to the head commit on the
2399 work tree's current branch, the file must be updated with
2400 .Cm got update
2401 before it can be staged (however, this does not prevent the file from
2402 becoming out-of-date at some point after having been staged).
2403 .Pp
2404 The
2405 .Cm got update ,
2406 .Cm got rebase ,
2407 and
2408 .Cm got histedit
2409 commands will refuse to run while staged changes exist.
2410 If staged changes cannot be committed because a staged path
2411 is out of date, the path must be unstaged with
2412 .Cm got unstage
2413 before it can be updated with
2414 .Cm got update ,
2415 and may then be staged again if necessary.
2416 .Tg ug
2417 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
2418 .Dl (alias: Cm ug )
2419 Merge staged changes back into the work tree and put affected paths
2420 back into non-staged status.
2421 If no
2422 .Ar path
2423 is specified, unstage all staged changes across the entire work tree.
2424 Otherwise, unstage changes at or within the specified paths.
2425 .Pp
2426 Show the status of each affected file, using the following status codes:
2427 .Bl -column YXZ description
2428 .It G Ta file was unstaged
2429 .It C Ta file was unstaged and conflicts occurred during merge
2430 .It ! Ta changes destined for a missing file were not merged
2431 .It D Ta file was staged as deleted and still is deleted
2432 .It d Ta file's deletion was prevented by local modifications
2433 .It \(a~ Ta changes destined for a non-regular file were not merged
2434 .El
2435 .Pp
2436 The options for
2437 .Cm got unstage
2438 are as follows:
2439 .Bl -tag -width Ds
2440 .It Fl p
2441 Instead of unstaging the entire content of a changed file, interactively
2442 select or reject changes for unstaging based on
2443 .Dq y
2444 (unstage change),
2445 .Dq n
2446 (keep change staged), and
2447 .Dq q
2448 (quit unstaging this file) responses.
2449 If a file is staged in modified status, individual patches derived from the
2450 staged file content can be unstaged.
2451 Files staged in added or deleted status may only be unstaged in their entirety.
2452 .It Fl F Ar response-script
2453 With the
2454 .Fl p
2455 option, read
2456 .Dq y ,
2457 .Dq n ,
2458 and
2459 .Dq q
2460 responses line-by-line from the specified
2461 .Ar response-script
2462 file instead of prompting interactively.
2463 .El
2464 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
2465 Parse and print contents of objects to standard output in a line-based
2466 text format.
2467 Content of commit, tree, and tag objects is printed in a way similar
2468 to the actual content stored in such objects.
2469 Blob object contents are printed as they would appear in files on disk.
2470 .Pp
2471 Attempt to interpret each argument as a reference, a tag name, or
2472 an object ID SHA1 hash.
2473 References will be resolved to an object ID.
2474 Tag names will resolved to a tag object.
2475 An abbreviated hash argument will be expanded to a full SHA1 hash
2476 automatically, provided the abbreviation is unique.
2477 .Pp
2478 If none of the above interpretations produce a valid result, or if the
2479 .Fl P
2480 option is used, attempt to interpret the argument as a path which will
2481 be resolved to the ID of an object found at this path in the repository.
2482 .Pp
2483 The options for
2484 .Cm got cat
2485 are as follows:
2486 .Bl -tag -width Ds
2487 .It Fl c Ar commit
2488 Look up paths in the specified
2489 .Ar commit .
2490 If this option is not used, paths are looked up in the commit resolved
2491 via the repository's HEAD reference.
2492 The expected argument is a commit ID SHA1 hash or an existing reference
2493 or tag name which will be resolved to a commit ID.
2494 An abbreviated hash argument will be expanded to a full SHA1 hash
2495 automatically, provided the abbreviation is unique.
2496 .It Fl r Ar repository-path
2497 Use the repository at the specified path.
2498 If not specified, assume the repository is located at or above the current
2499 working directory.
2500 If this directory is a
2501 .Nm
2502 work tree, use the repository path associated with this work tree.
2503 .It Fl P
2504 Interpret all arguments as paths only.
2505 This option can be used to resolve ambiguity in cases where paths
2506 look like tag names, reference names, or object IDs.
2507 .El
2508 .It Cm info Op Ar path ...
2509 Display meta-data stored in a work tree.
2510 See
2511 .Xr got-worktree 5
2512 for details.
2513 .Pp
2514 The work tree to use is resolved implicitly by walking upwards from the
2515 current working directory.
2516 .Pp
2517 If one or more
2518 .Ar path
2519 arguments are specified, show additional per-file information for tracked
2520 files located at or within these paths.
2521 If a
2522 .Ar path
2523 argument corresponds to the work tree's root directory, display information
2524 for all tracked files.
2525 .El
2526 .Sh ENVIRONMENT
2527 .Bl -tag -width GOT_AUTHOR
2528 .It Ev GOT_AUTHOR
2529 The author's name and email address for
2530 .Cm got commit
2531 and
2532 .Cm got import ,
2533 for example:
2534 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
2535 Because
2536 .Xr git 1
2537 may fail to parse commits without an email address in author data,
2538 .Nm
2539 attempts to reject
2540 .Ev GOT_AUTHOR
2541 environment variables with a missing email address.
2542 .Pp
2543 .Ev GOT_AUTHOR will be overridden by configuration settings in
2544 .Xr got.conf 5
2545 or by Git's
2546 .Dv user.name
2547 and
2548 .Dv user.email
2549 configuration settings in the repository's
2550 .Pa .git/config
2551 file.
2552 The
2553 .Dv user.name
2554 and
2555 .Dv user.email
2556 configuration settings contained in Git's global
2557 .Pa ~/.gitconfig
2558 configuration file will only be used if neither
2559 .Xr got.conf 5
2560 nor the
2561 .Ev GOT_AUTHOR
2562 environment variable provide author information.
2563 .It Ev VISUAL , EDITOR
2564 The editor spawned by
2565 .Cm got commit ,
2566 .Cm got histedit ,
2567 .Cm got import ,
2569 .Cm got tag .
2570 If not set, the
2571 .Xr ed 1
2572 text editor will be spawned in order to give
2573 .Xr ed 1
2574 the attention it deserves.
2575 .It Ev GOT_LOG_DEFAULT_LIMIT
2576 The default limit on the number of commits traversed by
2577 .Cm got log .
2578 If set to zero, the limit is unbounded.
2579 This variable will be silently ignored if it is set to a non-numeric value.
2580 .El
2581 .Sh FILES
2582 .Bl -tag -width packed-refs -compact
2583 .It Pa got.conf
2584 Repository-wide configuration settings for
2585 .Nm .
2586 If present, a
2587 .Xr got.conf 5
2588 configuration file located in the root directory of a Git repository
2589 supersedes any relevant settings in Git's
2590 .Pa config
2591 file.
2592 .Pp
2593 .It Pa .got/got.conf
2594 Worktree-specific configuration settings for
2595 .Nm .
2596 If present, a
2597 .Xr got.conf 5
2598 configuration file in the
2599 .Pa .got
2600 meta-data directory of a work tree supersedes any relevant settings in
2601 the repository's
2602 .Xr got.conf 5
2603 configuration file and Git's
2604 .Pa config
2605 file.
2606 .El
2607 .Sh EXIT STATUS
2608 .Ex -std got
2609 .Sh EXAMPLES
2610 Enable tab-completion of
2611 .Nm
2612 command names in
2613 .Xr ksh 1 :
2614 .Pp
2615 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
2616 .Pp
2617 Clone an existing Git repository for use with
2618 .Nm .
2619 .Pp
2620 .Dl $ cd /var/git/
2621 .Dl $ got clone ssh://git@github.com/openbsd/src.git
2622 .Pp
2623 Use of HTTP URLs currently requires
2624 .Xr git 1 :
2625 .Pp
2626 .Dl $ cd /var/git/
2627 .Dl $ git clone --bare https://github.com/openbsd/src.git
2628 .Pp
2629 Alternatively, for quick and dirty local testing of
2630 .Nm
2631 a new Git repository could be created and populated with files,
2632 e.g. from a temporary CVS checkout located at
2633 .Pa /tmp/src :
2634 .Pp
2635 .Dl $ got init /var/git/src.git
2636 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
2637 .Pp
2638 Check out a work tree from the Git repository to /usr/src:
2639 .Pp
2640 .Dl $ got checkout /var/git/src.git /usr/src
2641 .Pp
2642 View local changes in a work tree directory:
2643 .Pp
2644 .Dl $ got diff | less
2645 .Pp
2646 In a work tree, display files in a potentially problematic state:
2647 .Pp
2648 .Dl $ got status -s 'C!~?'
2649 .Pp
2650 Interactively revert selected local changes in a work tree directory:
2651 .Pp
2652 .Dl $ got revert -p -R\ .
2653 .Pp
2654 In a work tree or a git repository directory, list all branch references:
2655 .Pp
2656 .Dl $ got branch -l
2657 .Pp
2658 In a work tree or a git repository directory, create a new branch called
2659 .Dq unified-buffer-cache
2660 which is forked off the
2661 .Dq master
2662 branch:
2663 .Pp
2664 .Dl $ got branch -c master unified-buffer-cache
2665 .Pp
2666 Switch an existing work tree to the branch
2667 .Dq unified-buffer-cache .
2668 Local changes in the work tree will be preserved and merged if necessary:
2669 .Pp
2670 .Dl $ got update -b unified-buffer-cache
2671 .Pp
2672 Create a new commit from local changes in a work tree directory.
2673 This new commit will become the head commit of the work tree's current branch:
2674 .Pp
2675 .Dl $ got commit
2676 .Pp
2677 In a work tree or a git repository directory, view changes committed in
2678 the 3 most recent commits to the work tree's branch, or the branch resolved
2679 via the repository's HEAD reference, respectively:
2680 .Pp
2681 .Dl $ got log -p -l 3
2682 .Pp
2683 As above, but display changes in the order in which
2684 .Xr patch 1
2685 could apply them in sequence:
2686 .Pp
2687 .Dl $ got log -p -l 3 -R
2688 .Pp
2689 In a work tree or a git repository directory, log the history of a subdirectory:
2690 .Pp
2691 .Dl $ got log sys/uvm
2692 .Pp
2693 While operating inside a work tree, paths are specified relative to the current
2694 working directory, so this command will log the subdirectory
2695 .Pa sys/uvm :
2696 .Pp
2697 .Dl $ cd sys/uvm && got log\ .
2698 .Pp
2699 And this command has the same effect:
2700 .Pp
2701 .Dl $ cd sys/dev/usb && got log ../../uvm
2702 .Pp
2703 And this command displays work tree meta-data about all tracked files:
2704 .Pp
2705 .Dl $ cd /usr/src
2706 .Dl $ got info\ . | less
2707 .Pp
2708 Add new files and remove obsolete files in a work tree directory:
2709 .Pp
2710 .Dl $ got add sys/uvm/uvm_ubc.c
2711 .Dl $ got remove sys/uvm/uvm_vnode.c
2712 .Pp
2713 Create a new commit from local changes in a work tree directory
2714 with a pre-defined log message.
2715 .Pp
2716 .Dl $ got commit -m 'unify the buffer cache'
2717 .Pp
2718 Alternatively, create a new commit from local changes in a work tree
2719 directory with a log message that has been prepared in the file
2720 .Pa /tmp/msg :
2721 .Pp
2722 .Dl $ got commit -F /tmp/msg
2723 .Pp
2724 Update any work tree checked out from the
2725 .Dq unified-buffer-cache
2726 branch to the latest commit on this branch:
2727 .Pp
2728 .Dl $ got update
2729 .Pp
2730 Roll file content on the unified-buffer-cache branch back by one commit,
2731 and then fetch the rolled-back change into the work tree as a local change
2732 to be amended and perhaps committed again:
2733 .Pp
2734 .Dl $ got backout unified-buffer-cache
2735 .Dl $ got commit -m 'roll back previous'
2736 .Dl $ # now back out the previous backout :-)
2737 .Dl $ got backout unified-buffer-cache
2738 .Pp
2739 Fetch new changes on the remote repository's
2740 .Dq master
2741 branch, making them visible on the local repository's
2742 .Dq origin/master
2743 branch:
2744 .Pp
2745 .Dl $ cd /usr/src
2746 .Dl $ got fetch
2747 .Pp
2748 In a repository created with a HTTP URL and
2749 .Cm git clone --bare
2750 the
2751 .Xr git-fetch 1
2752 command must be used instead:
2753 .Pp
2754 .Dl $ cd /var/git/src.git
2755 .Dl $ git fetch origin master:refs/remotes/origin/master
2756 .Pp
2757 Rebase the local
2758 .Dq master
2759 branch to merge the new changes that are now visible on the
2760 .Dq origin/master
2761 branch:
2762 .Pp
2763 .Dl $ cd /usr/src
2764 .Dl $ got update -b origin/master
2765 .Dl $ got rebase master
2766 .Pp
2767 Rebase the
2768 .Dq unified-buffer-cache
2769 branch on top of the new head commit of the
2770 .Dq master
2771 branch.
2772 .Pp
2773 .Dl $ got update -b master
2774 .Dl $ got rebase unified-buffer-cache
2775 .Pp
2776 Create a patch from all changes on the unified-buffer-cache branch.
2777 The patch can be mailed out for review and applied to
2778 .Ox Ns 's
2779 CVS tree:
2780 .Pp
2781 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2782 .Pp
2783 Edit the entire commit history of the
2784 .Dq unified-buffer-cache
2785 branch:
2786 .Pp
2787 .Dl $ got update -b unified-buffer-cache
2788 .Dl $ got update -c master
2789 .Dl $ got histedit
2790 .Pp
2791 Before working against existing branches in a repository cloned with
2792 .Cm git clone --bare
2793 instead of
2794 .Cm got clone ,
2795 a Git
2796 .Dq refspec
2797 must be configured to map all references in the remote repository
2798 into the
2799 .Dq refs/remotes
2800 namespace of the local repository.
2801 This can be achieved by setting Git's
2802 .Pa remote.origin.fetch
2803 configuration variable to the value
2804 .Dq +refs/heads/*:refs/remotes/origin/*
2805 with the
2806 .Cm git config
2807 command:
2808 .Pp
2809 .Dl $ cd /var/git/repo
2810 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2811 .Pp
2812 Additionally, the
2813 .Dq mirror
2814 option must be disabled:
2815 .Pp
2816 .Dl $ cd /var/git/repo
2817 .Dl $ git config remote.origin.mirror false
2818 .Pp
2819 Alternatively, the following
2820 .Xr git-fetch 1
2821 configuration item can be added manually to the Git repository's
2822 .Pa config
2823 file:
2824 .Pp
2825 .Dl [remote \&"origin\&"]
2826 .Dl url = ...
2827 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2828 .Dl mirror = false
2829 .Pp
2830 This configuration leaves the local repository's
2831 .Dq refs/heads
2832 namespace free for use by local branches checked out with
2833 .Cm got checkout
2834 and, if needed, created with
2835 .Cm got branch .
2836 Branches in the
2837 .Dq refs/remotes/origin
2838 namespace can now be updated with incoming changes from the remote
2839 repository with
2840 .Cm got fetch
2842 .Xr git-fetch 1
2843 without extra command line arguments.
2844 Newly fetched changes can be examined with
2845 .Cm got log .
2846 .Pp
2847 Display changes on the remote repository's version of the
2848 .Dq master
2849 branch, as of the last time
2850 .Cm got fetch
2851 was run:
2852 .Pp
2853 .Dl $ got log -c origin/master | less
2854 .Pp
2855 As shown here, most commands accept abbreviated reference names such as
2856 .Dq origin/master
2857 instead of
2858 .Dq refs/remotes/origin/master .
2859 The latter is only needed in case of ambiguity.
2860 .Pp
2861 .Cm got rebase
2862 must be used to merge changes which are visible on the
2863 .Dq origin/master
2864 branch into the
2865 .Dq master
2866 branch.
2867 This will also merge local changes, if any, with the incoming changes:
2868 .Pp
2869 .Dl $ got update -b origin/master
2870 .Dl $ got rebase master
2871 .Pp
2872 In order to make changes committed to the
2873 .Dq unified-buffer-cache
2874 visible on the
2875 .Dq master
2876 branch, the
2877 .Dq unified-buffer-cache
2878 branch must first be rebased onto the
2879 .Dq master
2880 branch:
2881 .Pp
2882 .Dl $ got update -b master
2883 .Dl $ got rebase unified-buffer-cache
2884 .Pp
2885 Changes on the
2886 .Dq unified-buffer-cache
2887 branch can now be made visible on the
2888 .Dq master
2889 branch with
2890 .Cm got integrate .
2891 Because the rebase operation switched the work tree to the
2892 .Dq unified-buffer-cache
2893 branch the work tree must be switched back to the
2894 .Dq master
2895 branch first:
2896 .Pp
2897 .Dl $ got update -b master
2898 .Dl $ got integrate unified-buffer-cache
2899 .Pp
2900 On the
2901 .Dq master
2902 branch, log messages for local changes can now be amended with
2903 .Dq OK
2904 by other developers and any other important new information:
2905 .Pp
2906 .Dl $ got update -c origin/master
2907 .Dl $ got histedit -m
2908 .Pp
2909 If the remote repository offers write access local changes on the
2910 .Dq master
2911 branch can be sent to the remote repository with
2912 .Cm got send .
2913 Usually,
2914 .Cm got send
2915 can be run without further arguments.
2916 The arguments shown here match defaults, provided the work tree's
2917 current branch is the
2918 .Dq master
2919 branch:
2920 .Pp
2921 .Dl $ got send -b master origin
2922 .Pp
2923 If the remote repository requires the HTTPS protocol the
2924 .Xr git-push 1
2925 command must be used instead:
2926 .Pp
2927 .Dl $ cd /var/git/src.git
2928 .Dl $ git push origin master
2929 .Sh SEE ALSO
2930 .Xr gotadmin 1 ,
2931 .Xr tog 1 ,
2932 .Xr git-repository 5 ,
2933 .Xr got-worktree 5 ,
2934 .Xr got.conf 5
2935 .Sh AUTHORS
2936 .An Stefan Sperling Aq Mt stsp@openbsd.org
2937 .An Martin Pieuchot Aq Mt mpi@openbsd.org
2938 .An Joshua Stein Aq Mt jcs@openbsd.org
2939 .An Ori Bernstein Aq Mt ori@openbsd.org
2940 .Sh CAVEATS
2941 .Nm
2942 is a work-in-progress and some features remain to be implemented.
2943 .Pp
2944 At present, the user has to fall back on
2945 .Xr git 1
2946 to perform some tasks.
2947 In particular:
2948 .Bl -bullet
2949 .It
2950 Reading from remote repositories over HTTP or HTTPS protocols requires
2951 .Xr git-clone 1
2952 and
2953 .Xr git-fetch 1 .
2954 .It
2955 Writing to remote repositories over HTTP or HTTPS protocols requires
2956 .Xr git-push 1 .
2957 .It
2958 The creation of merge commits with more than two parent commits requires
2959 .Xr git-merge 1 .
2960 .It
2961 In situations where files or directories were moved around
2962 .Cm got
2963 will not automatically merge changes to new locations and
2964 .Xr git 1
2965 will usually produce better results.
2966 .El