Blob


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