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