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 in
77 Short alias for
78 .Cm init .
79 .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
80 Create an initial commit in a repository from the file hierarchy
81 within the specified
82 .Ar directory .
83 The created commit will not have any parent commits, i.e. it will be a
84 root commit.
85 Also create a new reference which provides a branch name for the newly
86 created commit.
87 Show the path of each imported file to indicate progress.
88 .Pp
89 The
90 .Cm got import
91 command requires the
92 .Ev GOT_AUTHOR
93 environment variable to be set,
94 unless Git's
95 .Dv user.name
96 and
97 .Dv user.email
98 configuration settings can be obtained from the repository's
99 .Pa .git/config
100 file or from Git's global
101 .Pa ~/.gitconfig
102 configuration file.
103 .Pp
104 The options for
105 .Cm got import
106 are as follows:
107 .Bl -tag -width Ds
108 .It Fl b Ar branch
109 Create the specified
110 .Ar branch
111 instead of creating the default branch
112 .Dq main .
113 Use of this option is required if the
114 .Dq main
115 branch already exists.
116 .It Fl m Ar message
117 Use the specified log message when creating the new commit.
118 Without the
119 .Fl m
120 option,
121 .Cm got import
122 opens a temporary file in an editor where a log message can be written.
123 .It Fl r Ar repository-path
124 Use the repository at the specified path.
125 If not specified, assume the repository is located at or above the current
126 working directory.
127 .It Fl I Ar pattern
128 Ignore files or directories with a name which matches the specified
129 .Ar pattern .
130 This option may be specified multiple times to build a list of ignore patterns.
131 The
132 .Ar pattern
133 follows the globbing rules documented in
134 .Xr glob 7 .
135 .El
136 .It Cm im
137 Short alias for
138 .Cm import .
139 .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
140 Clone a Git repository at the specified
141 .Ar repository-URL
142 into the specified
143 .Ar directory .
144 If no
145 .Ar directory
146 is specified the directory name will be derived from the name of the
147 cloned repository.
148 .Cm got clone
149 will refuse to run if the
150 .Ar directory
151 already exists.
152 .Pp
153 The
154 .Ar repository-URL
155 specifies a protocol scheme, a server hostname, an optional port number
156 separated from the hostname by a colon, and a path to the repository on
157 the server:
158 .Lk scheme://hostname:port/path/to/repository
159 .Pp
160 The following protocol schemes are supported:
161 .Bl -tag -width git+ssh
162 .It git
163 The Git protocol as implemented by the
164 .Xr git-daemon 1
165 server.
166 Use of this protocol is discouraged since it supports neither authentication
167 nor encryption.
168 .It git+ssh
169 The Git protocol wrapped in an authenticated and encrypted
170 .Xr ssh 1
171 tunnel.
172 With this protocol the hostname may contain an embedded username for
173 .Xr ssh 1
174 to use:
175 .Mt user@hostname
176 .It ssh
177 Short alias for git+ssh.
178 .El
179 .Pp
180 Objects in the cloned repository are stored in a pack file which is downloaded
181 from the server.
182 This pack file will then be indexed to facilitate access to the objects stored
183 within.
184 If any objects in the pack file are stored in deltified form, all deltas will
185 be fully resolved in order to compute the ID of such objects.
186 This can take some time.
187 More details about the pack file format are documented in
188 .Xr git-repository 5 .
189 .Pp
190 .Cm got clone
191 creates a remote repository entry in the
192 .Pa config
193 file of the cloned repository to store the
194 .Ar repository-url
195 for future use by
196 .Cm got fetch
197 or
198 .Xr git-fetch 1 .
199 .Pp
200 The options for
201 .Cm got clone
202 are as follows:
203 .Bl -tag -width Ds
204 .It Fl a
205 Fetch all branches from the remote repository's
206 .Dq refs/heads/
207 reference namespace.
208 If this option is not specified, a branch resolved via the remote
209 repository's HEAD reference will be fetched.
210 Cannot be used together with the
211 .Fl b
212 option.
213 .It Fl b Ar branch
214 Fetch the specified
215 .Ar branch
216 from the remote repository's
217 .Dq refs/heads/
218 reference namespace.
219 This option may be specified multiple times to build a list of branches
220 to fetch.
221 If the branch corresponding to the remote repository's HEAD reference is not
222 in this list, the cloned repository's HEAD reference will be set to the first
223 branch which was fetched.
224 If this option is not specified, a branch resolved via the remote
225 repository's HEAD reference will be fetched.
226 Cannot be used together with the
227 .Fl a
228 option.
229 .It Fl l
230 List branches and tags available for fetching from the remote repository
231 and exit immediately.
232 Cannot be used together with any of the other options except
233 .Fl v .
234 .It Fl m
235 Create the cloned repository as a mirror of the original repository.
236 This is useful if the cloned repository will not be used to store
237 locally created commits.
238 .Pp
239 The repository's
240 .Pa config
241 file will be set up with the
242 .Dq mirror
243 option enabled, such that
244 .Cm got fetch
245 or
246 .Xr git-fetch 1
247 will write incoming changes directly to branches in the
248 .Dq refs/heads/
249 reference namespace, rather than to branches in the
250 .Dq refs/remotes/
251 namespace.
252 This avoids the usual requirement of having to run
253 .Cm got rebase
254 after
255 .Cm got fetch
256 in order to make incoming changes appear on branches in the
257 .Dq refs/heads/
258 namespace.
259 But maintaining custom changes in the cloned repository becomes difficult
260 since such changes will be at risk of being discarded whenever incoming
261 changes are fetched.
262 .It Fl q
263 Suppress progress reporting output.
264 The same option will be passed to
265 .Xr ssh 1
266 if applicable.
267 .It Fl v
268 Verbose mode.
269 Causes
270 .Cm got clone
271 to print debugging messages to standard error output.
272 This option will be passed to
273 .Xr ssh 1
274 if applicable.
275 Multiple -v options increase the verbosity.
276 The maximum is 3.
277 .It Fl R Ar reference
278 In addition to the branches and tags that will be fetched, fetch an arbitrary
279 .Ar reference
280 from the remote repository's
281 .Dq refs/
282 namespace.
283 This option may be specified multiple times to build a list of additional
284 references to fetch.
285 The specified
286 .Ar reference
287 may either be a path to a specific reference, or a reference namespace
288 which will cause all references in this namespace to be fetched.
289 .Pp
290 Each reference will be mapped into the cloned repository's
291 .Dq refs/remotes/
292 namespace, unless the
293 .Fl m
294 option is used to mirror references directly into the cloned repository's
295 .Dq refs/
296 namespace.
297 .Pp
298 .Cm got clone
299 will refuse to fetch references from the remote repository's
300 .Dq refs/remotes/
301 or
302 .Dq refs/got/
303 namespace.
304 .El
305 .It Cm cl
306 Short alias for
307 .Cm clone .
308 .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 Op Ar remote-repository
309 Fetch new changes from a remote repository.
310 If no
311 .Ar remote-repository
312 is specified,
313 .Dq origin
314 will be used.
315 The remote repository's URL is obtained from the corresponding entry in the
316 .Pa config
317 file of the local repository, as created by
318 .Cm got clone .
319 .Pp
320 New changes will be stored in a separate pack file downloaded from the server.
321 Optionally, separate pack files stored in the repository can be combined with
322 .Xr git-repack 1 .
323 .Pp
324 By default, branch references in the
325 .Dq refs/remotes/
326 reference namespace will be updated to point at the newly fetched commits.
327 The
328 .Cm got rebase
329 command can then be used to make new changes visible on branches in the
330 .Dq refs/heads/
331 namespace, merging incoming changes with the changes on those branches
332 as necessary.
333 .Pp
334 If the repository was created as a mirror with
335 .Cm got clone -m
336 then all branches in the
337 .Dq refs/heads/
338 namespace will be updated directly to match the corresponding branches in
339 the remote repository.
340 If those branches contained local commits, these commits will no longer be
341 reachable via a reference and will therefore be at risk of being discarded
342 by Git's garbage collector.
343 Maintaining custom changes in a mirror repository is therefore discouraged.
344 .Pp
345 In any case, references in the
346 .Dq refs/tags/
347 namespace will always be fetched and mapped directly to local references
348 in the same namespace.
349 .Pp
350 The options for
351 .Cm got fetch
352 are as follows:
353 .Bl -tag -width Ds
354 .It Fl a
355 Fetch all branches from the remote repository's
356 .Dq refs/heads/
357 reference namespace.
358 If this option is not specified, a branch resolved via the remote
359 repository's HEAD reference will be fetched.
360 Cannot be used together with the
361 .Fl b
362 option.
363 .It Fl b Ar branch
364 Fetch the specified
365 .Ar branch
366 from the remote repository's
367 .Dq refs/heads/
368 reference namespace.
369 This option may be specified multiple times to build a list of branches
370 to fetch.
371 If this option is not specified, a branch resolved via the remote
372 repository's HEAD reference will be fetched.
373 Cannot be used together with the
374 .Fl a
375 option.
376 .It Fl d
377 Delete branches and tags from the local repository which are no longer
378 present in the remote repository.
379 Only references are deleted.
380 Any commit, tree, tag, and blob objects belonging to deleted branches or
381 tags remain in the repository and may be removed separately with
382 Git's garbage collector.
383 .It Fl l
384 List branches and tags available for fetching from the remote repository
385 and exit immediately.
386 Cannot be used together with any of the other options except
387 .Fl v
388 and
389 .Fl r .
390 .It Fl t
391 Allow existing references in the
392 .Dq refs/tags
393 namespace to be updated if they have changed on the server.
394 If not specified, only new tag references will be created.
395 .It Fl r Ar repository-path
396 Use the repository at the specified path.
397 If not specified, assume the repository is located at or above the current
398 working directory.
399 If this directory is a
400 .Nm
401 work tree, use the repository path associated with this work tree.
402 .It Fl q
403 Suppress progress reporting output.
404 The same option will be passed to
405 .Xr ssh 1
406 if applicable.
407 .It Fl v
408 Verbose mode.
409 Causes
410 .Cm got fetch
411 to print debugging messages to standard error output.
412 The same option will be passed to
413 .Xr ssh 1
414 if applicable.
415 Multiple -v options increase the verbosity.
416 The maximum is 3.
417 .It Fl R Ar reference
418 In addition to the branches and tags that will be fetched, fetch an arbitrary
419 .Ar reference
420 from the remote repository's
421 .Dq refs/
422 namespace.
423 This option may be specified multiple times to build a list of additional
424 references to fetch.
425 The specified
426 .Ar reference
427 may either be a path to a specific reference, or a reference namespace
428 which will cause all references in this namespace to be fetched.
429 .Pp
430 Each reference will be mapped into the local repository's
431 .Dq refs/remotes/
432 namespace, unless the local repository was created as a mirror with
433 .Cm got clone -m
434 in which case references will be mapped directly into the local repository's
435 .Dq refs/
436 namespace.
437 .Pp
438 Once a reference has been fetched, a branch based on it can be created with
439 .Cm got branch
440 if needed.
441 .Pp
442 .Cm got fetch
443 will refuse to fetch references from the remote repository's
444 .Dq refs/remotes/
445 or
446 .Dq refs/got/
447 namespace.
448 .El
449 .It Cm fe
450 Short alias for
451 .Cm fetch .
452 .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 Ar repository-path Op Ar work-tree-path
453 Copy files from a repository into a new work tree.
454 Show the status of each affected file, using the following status codes:
455 .Bl -column YXZ description
456 .It A Ta new file was added
457 .It E Ta file already exists in work tree's meta-data
458 .El
459 .Pp
460 If the
461 .Ar work tree path
462 is not specified, either use the last component of
463 .Ar repository path ,
464 or if a
465 .Ar path prefix
466 was specified use the last component of
467 .Ar path prefix .
468 .Pp
469 The options for
470 .Cm got checkout
471 are as follows:
472 .Bl -tag -width Ds
473 .It Fl E
474 Proceed with the checkout operation even if the directory at
475 .Ar work-tree-path
476 is not empty.
477 Existing files will be left intact.
478 .It Fl b Ar branch
479 Check out files from a commit on the specified
480 .Ar branch .
481 If this option is not specified, a branch resolved via the repository's HEAD
482 reference will be used.
483 .It Fl c Ar commit
484 Check out files from the specified
485 .Ar commit
486 on the selected branch.
487 The expected argument is a commit ID SHA1 hash or an existing reference
488 or tag name which will be resolved to a commit ID.
489 An abbreviated hash argument will be expanded to a full SHA1 hash
490 automatically, provided the abbreviation is unique.
491 If this option is not specified, the most recent commit on the selected
492 branch will be used.
493 .Pp
494 If the specified
495 .Ar commit
496 is not contained in the selected branch, a different branch which contains
497 this commit must be specified with the
498 .Fl b
499 option.
500 If no such branch is known a new branch must be created for this
501 commit with
502 .Cm got branch
503 before
504 .Cm got checkout
505 can be used.
506 Checking out work trees with an unknown branch is intentionally not supported.
507 .It Fl p Ar path-prefix
508 Restrict the work tree to a subset of the repository's tree hierarchy.
509 Only files beneath the specified
510 .Ar path-prefix
511 will be checked out.
512 .El
513 .It Cm co
514 Short alias for
515 .Cm checkout .
516 .It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Op Ar path ...
517 Update an existing work tree to a different
518 .Ar commit .
519 Change existing files in the work tree as necessary to match file contents
520 of this commit.
521 Preserve any local changes in the work tree and merge them with the
522 incoming changes.
523 .Pp
524 Files which already contain merge conflicts will not be updated to avoid
525 further complications.
526 Such files will be updated when
527 .Cm got update
528 is run again after merge conflicts have been resolved.
529 If the conflicting changes are no longer needed affected files can be
530 reverted with
531 .Cm got revert
532 before running
533 .Cm got update
534 again.
535 .Pp
536 Show the status of each affected file, using the following status codes:
537 .Bl -column YXZ description
538 .It U Ta file was updated and contained no local changes
539 .It G Ta file was updated and local changes were merged cleanly
540 .It C Ta file was updated and conflicts occurred during merge
541 .It D Ta file was deleted
542 .It A Ta new file was added
543 .It \(a~ Ta versioned file is obstructed by a non-regular file
544 .It ! Ta a missing versioned file was restored
545 .It # Ta file was not updated because it contains merge conflicts
546 .El
547 .Pp
548 If no
549 .Ar path
550 is specified, update the entire work tree.
551 Otherwise, restrict the update operation to files at or within the
552 specified paths.
553 Each path is required to exist in the update operation's target commit.
554 Files in the work tree outside specified paths will remain unchanged and
555 will retain their previously recorded base commit.
556 Some
557 .Nm
558 commands may refuse to run while the work tree contains files from
559 multiple base commits.
560 The base commit of such a work tree can be made consistent by running
561 .Cm got update
562 across the entire work tree.
563 Specifying a
564 .Ar path
565 is incompatible with the
566 .Fl b
567 option.
568 .Pp
569 .Cm got update
570 cannot update paths with staged changes.
571 If changes have been staged with
572 .Cm got stage ,
573 these changes must first be committed with
574 .Cm got commit
575 or unstaged with
576 .Cm got unstage .
577 .Pp
578 The options for
579 .Cm got update
580 are as follows:
581 .Bl -tag -width Ds
582 .It Fl b Ar branch
583 Switch the work tree's branch reference to the specified
584 .Ar branch
585 before updating the work tree.
586 This option requires that all paths in the work tree are updated.
587 .Pp
588 As usual, any local changes in the work tree will be preserved.
589 This can be useful when switching to a newly created branch in order
590 to commit existing local changes to this branch.
591 .Pp
592 Any local changes must be dealt with separately in order to obtain a
593 work tree with pristine file contents corresponding exactly to the specified
594 .Ar branch .
595 Such changes could first be committed to a different branch with
596 .Cm got commit ,
597 or could be discarded with
598 .Cm got revert .
599 .It Fl c Ar commit
600 Update the work tree to the specified
601 .Ar commit .
602 The expected argument is a commit ID SHA1 hash or an existing reference
603 or tag name which will be resolved to a commit ID.
604 An abbreviated hash argument will be expanded to a full SHA1 hash
605 automatically, provided the abbreviation is unique.
606 If this option is not specified, the most recent commit on the work tree's
607 branch will be used.
608 .El
609 .It Cm up
610 Short alias for
611 .Cm update .
612 .It Cm status Op Ar path ...
613 Show the current modification status of files in a work tree,
614 using the following status codes:
615 .Bl -column YXZ description
616 .It M Ta modified file
617 .It A Ta file scheduled for addition in next commit
618 .It D Ta file scheduled for deletion in next commit
619 .It C Ta modified or added file which contains merge conflicts
620 .It ! Ta versioned file was expected on disk but is missing
621 .It \(a~ Ta versioned file is obstructed by a non-regular file
622 .It ? Ta unversioned item not tracked by
623 .Nm
624 .It m Ta modified file modes (executable bit only)
625 .It N Ta non-existent
626 .Ar path
627 specified on the command line
628 .El
629 .Pp
630 If no
631 .Ar path
632 is specified, show modifications in the entire work tree.
633 Otherwise, show modifications at or within the specified paths.
634 .Pp
635 If changes have been staged with
636 .Cm got stage ,
637 staged changes are shown in the second output column, using the following
638 status codes:
639 .Bl -column YXZ description
640 .It M Ta file modification is staged
641 .It A Ta file addition is staged
642 .It D Ta file deletion is staged
643 .El
644 .Pp
645 Changes created on top of staged changes are indicated in the first column:
646 .Bl -column YXZ description
647 .It MM Ta file was modified after earlier changes have been staged
648 .It MA Ta file was modified after having been staged for addition
649 .El
650 .Pp
651 For compatibility with
652 .Xr cvs 1
653 and
654 .Xr git 1 ,
655 .Cm got status
656 reads
657 .Xr glob 7
658 patterns from
659 .Pa .cvsignore
660 and
661 .Pa .gitignore
662 files in each traversed directory and will not display unversioned files
663 which match these patterns.
664 As an extension to
665 .Xr glob 7
666 matching rules,
667 .Cm got status
668 supports consecutive asterisks,
669 .Dq ** ,
670 which will match an arbitrary amount of directories.
671 Unlike
672 .Xr cvs 1 ,
673 .Cm got status
674 only supports a single ignore pattern per line.
675 Unlike
676 .Xr git 1 ,
677 .Cm got status
678 does not support negated ignore patterns prefixed with
679 .Dq \&! ,
680 and gives no special significance to the location of path component separators,
681 .Dq / ,
682 in a pattern.
683 .It Cm st
684 Short alias for
685 .Cm status .
686 .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
687 Display history of a repository.
688 If a
689 .Ar path
690 is specified, show only commits which modified this path.
691 If invoked in a work tree, the
692 .Ar path
693 is interpreted relative to the current working directory,
694 and the work tree's path prefix is implicitly prepended.
695 Otherwise, the path is interpreted relative to the repository root.
696 .Pp
697 The options for
698 .Cm got log
699 are as follows:
700 .Bl -tag -width Ds
701 .It Fl b
702 Display individual commits which were merged into the current branch
703 from other branches.
704 By default,
705 .Cm got log
706 shows the linear history of the current branch only.
707 .It Fl c Ar commit
708 Start traversing history at the specified
709 .Ar commit .
710 The expected argument is a commit ID SHA1 hash or an existing reference
711 or tag name which will be resolved to a commit ID.
712 An abbreviated hash argument will be expanded to a full SHA1 hash
713 automatically, provided the abbreviation is unique.
714 If this option is not specified, default to the work tree's current branch
715 if invoked in a work tree, or to the repository's HEAD reference.
716 .It Fl C Ar number
717 Set the number of context lines shown in diffs with
718 .Fl p .
719 By default, 3 lines of context are shown.
720 .It Fl l Ar N
721 Limit history traversal to a given number of commits.
722 If this option is not specified, a default limit value of zero is used,
723 which is treated as an unbounded limit.
724 The
725 .Ev GOT_LOG_DEFAULT_LIMIT
726 environment variable may be set to change this default value.
727 .It Fl p
728 Display the patch of modifications made in each commit.
729 If a
730 .Ar path
731 is specified, only show the patch of modifications at or within this path.
732 .It Fl P
733 Display the list of file paths changed in each commit, using the following
734 status codes:
735 .Bl -column YXZ description
736 .It M Ta modified file
737 .It D Ta file was deleted
738 .It A Ta new file was added
739 .It m Ta modified file modes (executable bit only)
740 .El
741 .It Fl s Ar search-pattern
742 If specified, show only commits with a log message matched by the extended
743 regular expression
744 .Ar search-pattern .
745 When used together with
746 .Fl P
747 then the file paths changed by a commit can be matched as well.
748 Regular expression syntax is documented in
749 .Xr re_format 7 .
750 .It Fl r Ar repository-path
751 Use the repository at the specified path.
752 If not specified, assume the repository is located at or above the current
753 working directory.
754 If this directory is a
755 .Nm
756 work tree, use the repository path associated with this work tree.
757 .It Fl R
758 Determine a set of commits to display as usual, but display these commits
759 in reverse order.
760 .It Fl x Ar commit
761 Stop traversing commit history as soon as the specified
762 .Ar commit
763 has been traversed.
764 This option has no effect if the specified
765 .Ar commit
766 is never traversed.
767 .El
768 .It Cm diff 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
769 When invoked within a work tree with less than two arguments, display
770 local changes in the work tree.
771 If a
772 .Ar path
773 is specified, only show changes within this path.
774 .Pp
775 If two arguments are provided, treat each argument as a reference, a tag
776 name, or an object ID SHA1 hash, and display differences between the
777 corresponding objects.
778 Both objects must be of the same type (blobs, trees, or commits).
779 An abbreviated hash argument will be expanded to a full SHA1 hash
780 automatically, provided the abbreviation is unique.
781 .Pp
782 The options for
783 .Cm got diff
784 are as follows:
785 .Bl -tag -width Ds
786 .It Fl C Ar number
787 Set the number of context lines shown in the diff.
788 By default, 3 lines of context are shown.
789 .It Fl r Ar repository-path
790 Use the repository at the specified path.
791 If not specified, assume the repository is located at or above the current
792 working directory.
793 If this directory is a
794 .Nm
795 work tree, use the repository path associated with this work tree.
796 .It Fl s
797 Show changes staged with
798 .Cm got stage
799 instead of showing local changes in the work tree.
800 This option is only valid when
801 .Cm got diff
802 is invoked in a work tree.
803 .It Fl w
804 Ignore whitespace-only changes.
805 .El
806 .It Cm di
807 Short alias for
808 .Cm diff .
809 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
810 Display line-by-line history of a file at the specified path.
811 .Pp
812 The options for
813 .Cm got blame
814 are as follows:
815 .Bl -tag -width Ds
816 .It Fl c Ar commit
817 Start traversing history at the specified
818 .Ar commit .
819 The expected argument is a commit ID SHA1 hash or an existing reference
820 or tag name which will be resolved to a commit ID.
821 An abbreviated hash argument will be expanded to a full SHA1 hash
822 automatically, provided the abbreviation is unique.
823 .It Fl r Ar repository-path
824 Use the repository at the specified path.
825 If not specified, assume the repository is located at or above the current
826 working directory.
827 If this directory is a
828 .Nm
829 work tree, use the repository path associated with this work tree.
830 .El
831 .It Cm bl
832 Short alias for
833 .Cm blame .
834 .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
835 Display a listing of files and directories at the specified
836 directory path in the repository.
837 Entries shown in this listing may carry one of the following trailing
838 annotations:
839 .Bl -column YXZ description
840 .It @ Ta entry is a symbolic link
841 .It / Ta entry is a directory
842 .It * Ta entry is an executable file
843 .It $ Ta entry is a Git submodule
844 .El
845 .Pp
846 Symbolic link entries are also annotated with the target path of the link.
847 .Pp
848 If no
849 .Ar path
850 is specified, list the repository path corresponding to the current
851 directory of the work tree, or the root directory of the repository
852 if there is no work tree.
853 .Pp
854 The options for
855 .Cm got tree
856 are as follows:
857 .Bl -tag -width Ds
858 .It Fl c Ar commit
859 List files and directories as they appear in the specified
860 .Ar commit .
861 The expected argument is a commit ID SHA1 hash or an existing reference
862 or tag name which will be resolved to a commit ID.
863 An abbreviated hash argument will be expanded to a full SHA1 hash
864 automatically, provided the abbreviation is unique.
865 .It Fl r Ar repository-path
866 Use the repository at the specified path.
867 If not specified, assume the repository is located at or above the current
868 working directory.
869 If this directory is a
870 .Nm
871 work tree, use the repository path associated with this work tree.
872 .It Fl i
873 Show object IDs of files (blob objects) and directories (tree objects).
874 .It Fl R
875 Recurse into sub-directories in the repository.
876 .El
877 .It Cm tr
878 Short alias for
879 .Cm tree .
880 .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
881 Manage references in a repository.
882 .Pp
883 References may be listed, created, deleted, and changed.
884 When creating, deleting, or changing a reference the specified
885 .Ar name
886 must be an absolute reference name, i.e. it must begin with
887 .Dq refs/ .
888 .Pp
889 The options for
890 .Cm got ref
891 are as follows:
892 .Bl -tag -width Ds
893 .It Fl r Ar repository-path
894 Use the repository at the specified path.
895 If not specified, assume the repository is located at or above the current
896 working directory.
897 If this directory is a
898 .Nm
899 work tree, use the repository path associated with this work tree.
900 .It Fl l
901 List references in the repository.
902 If no
903 .Ar name
904 is specified, list all existing references in the repository.
905 If
906 .Ar name
907 is a reference namespace, list all references in this namespace.
908 Otherwise, show only the reference with the given
909 .Ar name .
910 Cannot be used together with any other options except
911 .Fl r .
912 .It Fl c Ar object
913 Create a reference or change an existing reference.
914 The reference with the specified
915 .Ar name
916 will point at the specified
917 .Ar object.
918 The expected
919 .Ar object
920 argument is a ID SHA1 hash or an existing reference or tag name which will
921 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
922 Cannot be used together with any other options except
923 .Fl r .
924 .It Fl s Ar reference
925 Create a symbolic reference, or change an existing symbolic reference.
926 The symbolic reference with the specified
927 .Ar name
928 will point at the specified
929 .Ar reference
930 which must already exist in the repository.
931 Care should be taken not to create loops between references when
932 this option is used.
933 Cannot be used together with any other options except
934 .Fl r .
935 .It Fl d
936 Delete the reference with the specified
937 .Ar name
938 from the repository.
939 Cannot be used together with any other options except
940 .Fl r .
941 .El
942 .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
943 Create, list, or delete branches.
944 .Pp
945 Branches are managed via references which live in the
946 .Dq refs/heads/
947 reference namespace.
948 The
949 .Cm got branch
950 command operates on references in this namespace only.
951 .Pp
952 If invoked in a work tree without any arguments, print the name of the
953 work tree's current branch.
954 .Pp
955 If a
956 .Ar name
957 argument is passed, attempt to create a branch reference with the given name.
958 By default the new branch reference will point at the latest commit on the
959 work tree's current branch if invoked in a work tree, and otherwise to a commit
960 resolved via the repository's HEAD reference.
961 .Pp
962 If invoked in a work tree, once the branch was created successfully
963 switch the work tree's head reference to the newly created branch and
964 update files across the entire work tree, just like
965 .Cm got update -b Ar name
966 would do.
967 Show the status of each affected file, using the following status codes:
968 .Bl -column YXZ description
969 .It U Ta file was updated and contained no local changes
970 .It G Ta file was updated and local changes were merged cleanly
971 .It C Ta file was updated and conflicts occurred during merge
972 .It D Ta file was deleted
973 .It A Ta new file was added
974 .It \(a~ Ta versioned file is obstructed by a non-regular file
975 .It ! Ta a missing versioned file was restored
976 .El
977 .Pp
978 The options for
979 .Cm got branch
980 are as follows:
981 .Bl -tag -width Ds
982 .It Fl c Ar commit
983 Make a newly created branch reference point at the specified
984 .Ar commit .
985 The expected
986 .Ar commit
987 argument is a commit ID SHA1 hash or an existing reference
988 or tag name which will be resolved to a commit ID.
989 .It Fl r Ar repository-path
990 Use the repository at the specified path.
991 If not specified, assume the repository is located at or above the current
992 working directory.
993 If this directory is a
994 .Nm
995 work tree, use the repository path associated with this work tree.
996 .It Fl l
997 List all existing branches in the repository.
998 If invoked in a work tree, the work tree's current branch is shown
999 with one the following annotations:
1000 .Bl -column YXZ description
1001 .It * Ta work tree's base commit matches the branch tip
1002 .It \(a~ Ta work tree's base commit is out-of-date
1003 .El
1004 .It Fl d Ar name
1005 Delete the branch with the specified name from the repository.
1006 Only the branch reference is deleted.
1007 Any commit, tree, and blob objects belonging to the branch
1008 remain in the repository and may be removed separately with
1009 Git's garbage collector.
1010 .It Fl n
1011 Do not switch and update the work tree after creating a new branch.
1012 .El
1013 .It Cm br
1014 Short alias for
1015 .Cm branch .
1016 .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
1017 Manage tags in a repository.
1018 .Pp
1019 Tags are managed via references which live in the
1020 .Dq refs/tags/
1021 reference namespace.
1022 The
1023 .Cm got tag
1024 command operates on references in this namespace only.
1025 References in this namespace point at tag objects which contain a pointer
1026 to another object, a tag message, as well as author and timestamp information.
1027 .Pp
1028 Attempt to create a tag with the given
1029 .Ar name ,
1030 and make this tag point at the given
1031 .Ar commit .
1032 If no commit is specified, default to the latest commit on the work tree's
1033 current branch if invoked in a work tree, and to a commit resolved via
1034 the repository's HEAD reference otherwise.
1035 .Pp
1036 The options for
1037 .Cm got tag
1038 are as follows:
1039 .Bl -tag -width Ds
1040 .It Fl c Ar commit
1041 Make the newly created tag reference point at the specified
1042 .Ar commit .
1043 The expected
1044 .Ar commit
1045 argument is a commit ID SHA1 hash or an existing reference or tag name which
1046 will be resolved to a commit ID.
1047 An abbreviated hash argument will be expanded to a full SHA1 hash
1048 automatically, provided the abbreviation is unique.
1049 .It Fl m Ar message
1050 Use the specified tag message when creating the new tag.
1051 Without the
1052 .Fl m
1053 option,
1054 .Cm got tag
1055 opens a temporary file in an editor where a tag message can be written.
1056 .It Fl r Ar repository-path
1057 Use the repository at the specified path.
1058 If not specified, assume the repository is located at or above the current
1059 working directory.
1060 If this directory is a
1061 .Nm
1062 work tree, use the repository path associated with this work tree.
1063 .It Fl l
1064 List all existing tags in the repository instead of creating a new tag.
1065 If this option is used, no other command-line arguments are allowed.
1066 .El
1067 .Pp
1068 By design, the
1069 .Cm got tag
1070 command will not delete tags or change existing tags.
1071 If a tag must be deleted, the
1072 .Cm got ref
1073 command may be used to delete a tag's reference.
1074 This should only be done if the tag has not already been copied to
1075 another repository.
1076 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1077 Schedule unversioned files in a work tree for addition to the
1078 repository in the next commit.
1079 .Pp
1080 The options for
1081 .Cm got add
1082 are as follows:
1083 .Bl -tag -width Ds
1084 .It Fl R
1085 Permit recursion into directories.
1086 If this option is not specified,
1087 .Cm got add
1088 will refuse to run if a specified
1089 .Ar path
1090 is a directory.
1091 .It Fl I
1092 With -R, add files even if they match a
1093 .Cm got status
1094 ignore pattern.
1095 .El
1096 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Ar path ...
1097 Remove versioned files from a work tree and schedule them for deletion
1098 from the repository in the next commit.
1099 .Pp
1100 The options for
1101 .Cm got remove
1102 are as follows:
1103 .Bl -tag -width Ds
1104 .It Fl f
1105 Perform the operation even if a file contains local modifications.
1106 .It Fl k
1107 Keep affected files on disk.
1108 .It Fl R
1109 Permit recursion into directories.
1110 If this option is not specified,
1111 .Cm got remove
1112 will refuse to run if a specified
1113 .Ar path
1114 is a directory.
1115 .El
1116 .It Cm rm
1117 Short alias for
1118 .Cm remove .
1119 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1120 Revert any local changes in files at the specified paths in a work tree.
1121 File contents will be overwritten with those contained in the
1122 work tree's base commit.
1123 There is no way to bring discarded changes back after
1124 .Cm got revert !
1125 .Pp
1126 If a file was added with
1127 .Cm got add
1128 it will become an unversioned file again.
1129 If a file was deleted with
1130 .Cm got remove
1131 it will be restored.
1132 .Pp
1133 The options for
1134 .Cm got revert
1135 are as follows:
1136 .Bl -tag -width Ds
1137 .It Fl p
1138 Instead of reverting all changes in files, interactively select or reject
1139 changes to revert based on
1140 .Dq y
1141 (revert change),
1142 .Dq n
1143 (keep change), and
1144 .Dq q
1145 (quit reverting this file) responses.
1146 If a file is in modified status, individual patches derived from the
1147 modified file content can be reverted.
1148 Files in added or deleted status may only be reverted in their entirety.
1149 .It Fl F Ar response-script
1150 With the
1151 .Fl p
1152 option, read
1153 .Dq y ,
1154 .Dq n ,
1155 and
1156 .Dq q
1157 responses line-by-line from the specified
1158 .Ar response-script
1159 file instead of prompting interactively.
1160 .It Fl R
1161 Permit recursion into directories.
1162 If this option is not specified,
1163 .Cm got revert
1164 will refuse to run if a specified
1165 .Ar path
1166 is a directory.
1167 .El
1168 .It Cm rv
1169 Short alias for
1170 .Cm revert .
1171 .It Cm commit Oo Fl m Ar message Oc Op Ar path ...
1172 Create a new commit in the repository from changes in a work tree
1173 and use this commit as the new base commit for the work tree.
1174 If no
1175 .Ar path
1176 is specified, commit all changes in the work tree.
1177 Otherwise, commit changes at or within the specified paths.
1178 .Pp
1179 If changes have been explicitly staged for commit with
1180 .Cm got stage ,
1181 only commit staged changes and reject any specified paths which
1182 have not been staged.
1183 .Pp
1184 Show the status of each affected file, using the following status codes:
1185 .Bl -column YXZ description
1186 .It M Ta modified file
1187 .It D Ta file was deleted
1188 .It A Ta new file was added
1189 .It m Ta modified file modes (executable bit only)
1190 .El
1191 .Pp
1192 Files which are not part of the new commit will retain their previously
1193 recorded base commit.
1194 Some
1195 .Nm
1196 commands may refuse to run while the work tree contains files from
1197 multiple base commits.
1198 The base commit of such a work tree can be made consistent by running
1199 .Cm got update
1200 across the entire work tree.
1201 .Pp
1202 The
1203 .Cm got commit
1204 command requires the
1205 .Ev GOT_AUTHOR
1206 environment variable to be set,
1207 unless Git's
1208 .Dv user.name
1209 and
1210 .Dv user.email
1211 configuration settings can be
1212 obtained from the repository's
1213 .Pa .git/config
1214 file or from Git's global
1215 .Pa ~/.gitconfig
1216 configuration file.
1217 .Pp
1218 The options for
1219 .Cm got commit
1220 are as follows:
1221 .Bl -tag -width Ds
1222 .It Fl m Ar message
1223 Use the specified log message when creating the new commit.
1224 Without the
1225 .Fl m
1226 option,
1227 .Cm got commit
1228 opens a temporary file in an editor where a log message can be written.
1229 .El
1230 .Pp
1231 .Cm got commit
1232 will refuse to run if certain preconditions are not met.
1233 If the work tree's current branch is not in the
1234 .Dq refs/heads/
1235 reference namespace, new commits may not be created on this branch.
1236 Local changes may only be committed if they are based on file content
1237 found in the most recent commit on the work tree's branch.
1238 If a path is found to be out of date,
1239 .Cm got update
1240 must be used first in order to merge local changes with changes made
1241 in the repository.
1242 .It Cm ci
1243 Short alias for
1244 .Cm commit .
1245 .It Cm cherrypick Ar commit
1246 Merge changes from a single
1247 .Ar commit
1248 into the work tree.
1249 The specified
1250 .Ar commit
1251 must be on a different branch than the work tree's base commit.
1252 The expected argument is a reference or a commit ID SHA1 hash.
1253 An abbreviated hash argument will be expanded to a full SHA1 hash
1254 automatically, provided the abbreviation is unique.
1255 .Pp
1256 Show the status of each affected file, using the following status codes:
1257 .Bl -column YXZ description
1258 .It G Ta file was merged
1259 .It C Ta file was merged and conflicts occurred during merge
1260 .It ! Ta changes destined for a missing file were not merged
1261 .It D Ta file was deleted
1262 .It d Ta file's deletion was obstructed by local modifications
1263 .It A Ta new file was added
1264 .It \(a~ Ta changes destined for a non-regular file were not merged
1265 .El
1266 .Pp
1267 The merged changes will appear as local changes in the work tree, which
1268 may be viewed with
1269 .Cm got diff ,
1270 amended manually or with further
1271 .Cm got cherrypick
1272 commands,
1273 committed with
1274 .Cm got commit ,
1275 or discarded again with
1276 .Cm got revert .
1277 .Pp
1278 .Cm got cherrypick
1279 will refuse to run if certain preconditions are not met.
1280 If the work tree contains multiple base commits it must first be updated
1281 to a single base commit with
1282 .Cm got update .
1283 If the work tree already contains files with merge conflicts, these
1284 conflicts must be resolved first.
1285 .It Cm cy
1286 Short alias for
1287 .Cm cherrypick .
1288 .It Cm backout Ar commit
1289 Reverse-merge changes from a single
1290 .Ar commit
1291 into the work tree.
1292 The specified
1293 .Ar commit
1294 must be on the same branch as the work tree's base commit.
1295 The expected argument is a reference or a commit ID SHA1 hash.
1296 An abbreviated hash argument will be expanded to a full SHA1 hash
1297 automatically, provided the abbreviation is unique.
1298 .Pp
1299 Show the status of each affected file, using the following status codes:
1300 .Bl -column YXZ description
1301 .It G Ta file was merged
1302 .It C Ta file was merged and conflicts occurred during merge
1303 .It ! Ta changes destined for a missing file were not merged
1304 .It D Ta file was deleted
1305 .It d Ta file's deletion was obstructed by local modifications
1306 .It A Ta new file was added
1307 .It \(a~ Ta changes destined for a non-regular file were not merged
1308 .El
1309 .Pp
1310 The reverse-merged changes will appear as local changes in the work tree,
1311 which may be viewed with
1312 .Cm got diff ,
1313 amended manually or with further
1314 .Cm got backout
1315 commands,
1316 committed with
1317 .Cm got commit ,
1318 or discarded again with
1319 .Cm got revert .
1320 .Pp
1321 .Cm got backout
1322 will refuse to run if certain preconditions are not met.
1323 If the work tree contains multiple base commits it must first be updated
1324 to a single base commit with
1325 .Cm got update .
1326 If the work tree already contains files with merge conflicts, these
1327 conflicts must be resolved first.
1328 .It Cm bo
1329 Short alias for
1330 .Cm backout .
1331 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Op Ar branch
1332 Rebase commits on the specified
1333 .Ar branch
1334 onto the tip of the current branch of the work tree.
1335 The
1336 .Ar branch
1337 must share common ancestry with the work tree's current branch.
1338 Rebasing begins with the first descendant commit of the youngest
1339 common ancestor commit shared by the specified
1340 .Ar branch
1341 and the work tree's current branch, and stops once the tip commit
1342 of the specified
1343 .Ar branch
1344 has been rebased.
1345 .Pp
1346 When
1347 .Cm got rebase
1348 is used as intended, the specified
1349 .Ar branch
1350 represents a local commit history and may already contain changes
1351 that are not yet visible in any other repositories.
1352 The work tree's current branch, which must be set with
1353 .Cm got update -b
1354 before starting the
1355 .Cm rebase
1356 operation, represents a branch from a remote repository which shares
1357 a common history with the specified
1358 .Ar branch
1359 but has progressed, and perhaps diverged, due to commits added to the
1360 remote repository.
1361 .Pp
1362 Rebased commits are accumulated on a temporary branch which the work tree
1363 will remain switched to throughout the entire rebase operation.
1364 Commits on this branch represent the same changes with the same log
1365 messages as their counterparts on the original
1366 .Ar branch ,
1367 but with different commit IDs.
1368 Once rebasing has completed successfully, the temporary branch becomes
1369 the new version of the specified
1370 .Ar branch
1371 and the work tree is automatically switched to it.
1372 .Pp
1373 While rebasing commits, show the status of each affected file,
1374 using the following status codes:
1375 .Bl -column YXZ description
1376 .It G Ta file was merged
1377 .It C Ta file was merged and conflicts occurred during merge
1378 .It ! Ta changes destined for a missing file were not merged
1379 .It D Ta file was deleted
1380 .It d Ta file's deletion was obstructed by local modifications
1381 .It A Ta new file was added
1382 .It \(a~ Ta changes destined for a non-regular file were not merged
1383 .El
1384 .Pp
1385 If merge conflicts occur the rebase operation is interrupted and may
1386 be continued once conflicts have been resolved.
1387 Alternatively, the rebase operation may be aborted which will leave
1388 .Ar branch
1389 unmodified and the work tree switched back to its original branch.
1390 .Pp
1391 If a merge conflict is resolved in a way which renders the merged
1392 change into a no-op change, the corresponding commit will be elided
1393 when the rebase operation continues.
1394 .Pp
1395 .Cm got rebase
1396 will refuse to run if certain preconditions are not met.
1397 If the work tree is not yet fully updated to the tip commit of its
1398 branch then the work tree must first be updated with
1399 .Cm got update .
1400 If changes have been staged with
1401 .Cm got stage ,
1402 these changes must first be committed with
1403 .Cm got commit
1404 or unstaged with
1405 .Cm got unstage .
1406 If the work tree contains local changes, these changes must first be
1407 committed with
1408 .Cm got commit
1409 or reverted with
1410 .Cm got revert .
1411 If the
1412 .Ar branch
1413 contains changes to files outside of the work tree's path prefix,
1414 the work tree cannot be used to rebase this branch.
1415 .Pp
1416 The
1417 .Cm got update
1418 and
1419 .Cm got commit
1420 commands will refuse to run while a rebase operation is in progress.
1421 Other commands which manipulate the work tree may be used for
1422 conflict resolution purposes.
1423 .Pp
1424 The options for
1425 .Cm got rebase
1426 are as follows:
1427 .Bl -tag -width Ds
1428 .It Fl a
1429 Abort an interrupted rebase operation.
1430 If this option is used, no other command-line arguments are allowed.
1431 .It Fl c
1432 Continue an interrupted rebase operation.
1433 If this option is used, no other command-line arguments are allowed.
1434 .El
1435 .It Cm rb
1436 Short alias for
1437 .Cm rebase .
1438 .It Cm histedit Oo Fl a Oc Oo Fl c Oc Oo Fl F Ar histedit-script Oc Oo Fl m Oc
1439 Edit commit history between the work tree's current base commit and
1440 the tip commit of the work tree's current branch.
1441 .Pp
1442 Before starting a
1443 .Cm histedit
1444 operation the work tree's current branch must be set with
1445 .Cm got update -b
1446 to the branch which should be edited, unless this branch is already the
1447 current branch of the work tree.
1448 The tip of this branch represents the upper bound (inclusive) of commits
1449 touched by the
1450 .Cm histedit
1451 operation.
1452 .Pp
1453 Furthermore, the work tree's base commit
1454 must be set with
1455 .Cm got update -c
1456 to a point in this branch's commit history where editing should begin.
1457 This commit represents the lower bound (non-inclusive) of commits touched
1458 by the
1459 .Cm histedit
1460 operation.
1461 .Pp
1462 Editing of commit history is controlled via a
1463 .Ar histedit script
1464 which can be written in an editor based on a template, passed on the
1465 command line, or generated with the
1466 .Fl m
1467 option if only log messages need to be edited.
1468 .Pp
1469 The format of the histedit script is line-based.
1470 Each line in the script begins with a command name, followed by
1471 whitespace and an argument.
1472 For most commands, the expected argument is a commit ID SHA1 hash.
1473 Any remaining text on the line is ignored.
1474 Lines which begin with the
1475 .Sq #
1476 character are ignored entirely.
1477 .Pp
1478 The available commands are as follows:
1479 .Bl -column YXZ pick-commit
1480 .It pick Ar commit Ta Use the specified commit as it is.
1481 .It edit Ar commit Ta Use the specified commit but once changes have been
1482 merged into the work tree interrupt the histedit operation for amending.
1483 .It fold Ar commit Ta Combine the specified commit with the next commit
1484 listed further below that will be used.
1485 .It drop Ar commit Ta Remove this commit from the edited history.
1486 .It mesg Ar log-message Ta Use the specified single-line log message for
1487 the commit on the previous line.
1488 If the log message argument is left empty, open an editor where a new
1489 log message can be written.
1490 .El
1491 .Pp
1492 Every commit in the history being edited must be mentioned in the script.
1493 Lines may be re-ordered to change the order of commits in the edited history.
1494 No commit may be listed more than once.
1495 .Pp
1496 Edited commits are accumulated on a temporary branch which the work tree
1497 will remain switched to throughout the entire histedit operation.
1498 Once history editing has completed successfully, the temporary branch becomes
1499 the new version of the work tree's branch and the work tree is automatically
1500 switched to it.
1501 .Pp
1502 While merging commits, show the status of each affected file,
1503 using the following status codes:
1504 .Bl -column YXZ description
1505 .It G Ta file was merged
1506 .It C Ta file was merged and conflicts occurred during merge
1507 .It ! Ta changes destined for a missing file were not merged
1508 .It D Ta file was deleted
1509 .It d Ta file's deletion was obstructed by local modifications
1510 .It A Ta new file was added
1511 .It \(a~ Ta changes destined for a non-regular file were not merged
1512 .El
1513 .Pp
1514 If merge conflicts occur the histedit operation is interrupted and may
1515 be continued once conflicts have been resolved.
1516 Alternatively, the histedit operation may be aborted which will leave
1517 the work tree switched back to its original branch.
1518 .Pp
1519 If a merge conflict is resolved in a way which renders the merged
1520 change into a no-op change, the corresponding commit will be elided
1521 when the histedit operation continues.
1522 .Pp
1523 .Cm got histedit
1524 will refuse to run if certain preconditions are not met.
1525 If the work tree's current branch is not in the
1526 .Dq refs/heads/
1527 reference namespace, the history of the branch may not be edited.
1528 If the work tree contains multiple base commits it must first be updated
1529 to a single base commit with
1530 .Cm got update .
1531 If changes have been staged with
1532 .Cm got stage ,
1533 these changes must first be committed with
1534 .Cm got commit
1535 or unstaged with
1536 .Cm got unstage .
1537 If the work tree contains local changes, these changes must first be
1538 committed with
1539 .Cm got commit
1540 or reverted with
1541 .Cm got revert .
1542 If the edited history contains changes to files outside of the work tree's
1543 path prefix, the work tree cannot be used to edit the history of this branch.
1544 .Pp
1545 The
1546 .Cm got update ,
1547 .Cm got rebase ,
1548 and
1549 .Cm got integrate
1550 commands will refuse to run while a histedit operation is in progress.
1551 Other commands which manipulate the work tree may be used, and the
1552 .Cm got commit
1553 command may be used to commit arbitrary changes to the temporary branch
1554 while the histedit operation is interrupted.
1555 .Pp
1556 The options for
1557 .Cm got histedit
1558 are as follows:
1559 .Bl -tag -width Ds
1560 .It Fl a
1561 Abort an interrupted histedit operation.
1562 If this option is used, no other command-line arguments are allowed.
1563 .It Fl c
1564 Continue an interrupted histedit operation.
1565 If this option is used, no other command-line arguments are allowed.
1566 .It Fl F Ar histedit-script
1567 Use the specified
1568 .Ar histedit-script
1569 instead of opening a temporary file in an editor where a histedit script
1570 can be written.
1571 .It Fl m
1572 Edit log messages only.
1573 This option is a quick equivalent to a histedit script which edits
1574 only log messages but otherwise leaves every picked commit as-is.
1575 The
1576 .Fl m
1577 option can only be used when starting a new histedit operation.
1578 If this option is used, no other command-line arguments are allowed.
1579 .El
1580 .It Cm he
1581 Short alias for
1582 .Cm histedit .
1583 .It Cm integrate Ar branch
1584 Integrate the specified
1585 .Ar branch
1586 into the work tree's current branch.
1587 Files in the work tree are updated to match the contents on the integrated
1588 .Ar branch ,
1589 and the reference of the work tree's branch is changed to point at the
1590 head commit of the integrated
1591 .Ar branch .
1592 .Pp
1593 Both branches can be considered equivalent after integration since they
1594 will be pointing at the same commit.
1595 Both branches remain available for future work, if desired.
1596 In case the integrated
1597 .Ar branch
1598 is no longer needed it may be deleted with
1599 .Cm got branch -d .
1600 .Pp
1601 Show the status of each affected file, using the following status codes:
1602 .Bl -column YXZ description
1603 .It U Ta file was updated
1604 .It D Ta file was deleted
1605 .It A Ta new file was added
1606 .It \(a~ Ta versioned file is obstructed by a non-regular file
1607 .It ! Ta a missing versioned file was restored
1608 .El
1609 .Pp
1610 .Cm got integrate
1611 will refuse to run if certain preconditions are not met.
1612 Most importantly, the
1613 .Ar branch
1614 must have been rebased onto the work tree's current branch with
1615 .Cm got rebase
1616 before it can be integrated, in order to linearize commit history and
1617 resolve merge conflicts.
1618 If the work tree contains multiple base commits it must first be updated
1619 to a single base commit with
1620 .Cm got update .
1621 If changes have been staged with
1622 .Cm got stage ,
1623 these changes must first be committed with
1624 .Cm got commit
1625 or unstaged with
1626 .Cm got unstage .
1627 If the work tree contains local changes, these changes must first be
1628 committed with
1629 .Cm got commit
1630 or reverted with
1631 .Cm got revert .
1632 .It Cm ig
1633 Short alias for
1634 .Cm integrate .
1635 .It Cm stage Oo Fl l Oc Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
1636 Stage local changes for inclusion in the next commit.
1637 If no
1638 .Ar path
1639 is specified, stage all changes in the work tree.
1640 Otherwise, stage changes at or within the specified paths.
1641 Paths may be staged if they are added, modified, or deleted according to
1642 .Cm got status .
1643 .Pp
1644 Show the status of each affected file, using the following status codes:
1645 .Bl -column YXZ description
1646 .It A Ta file addition has been staged
1647 .It M Ta file modification has been staged
1648 .It D Ta file deletion has been staged
1649 .El
1650 .Pp
1651 Staged file contents are saved in newly created blob objects in the repository.
1652 These blobs will be referred to by tree objects once staged changes have been
1653 committed.
1654 .Pp
1655 Staged changes affect the behaviour of
1656 .Cm got commit ,
1657 .Cm got status ,
1658 and
1659 .Cm got diff .
1660 While paths with staged changes exist, the
1661 .Cm got commit
1662 command will refuse to commit any paths which do not have staged changes.
1663 Local changes created on top of staged changes can only be committed if
1664 the path is staged again, or if the staged changes are committed first.
1665 The
1666 .Cm got status
1667 command will show both local changes and staged changes.
1668 The
1669 .Cm got diff
1670 command is able to display local changes relative to staged changes,
1671 and to display staged changes relative to the repository.
1672 The
1673 .Cm got revert
1674 command cannot revert staged changes but may be used to revert
1675 local changes created on top of staged changes.
1676 .Pp
1677 The options for
1678 .Cm got stage
1679 are as follows:
1680 .Bl -tag -width Ds
1681 .It Fl l
1682 Instead of staging new changes, list paths which are already staged,
1683 along with the IDs of staged blob objects and stage status codes.
1684 If paths were provided in the command line show the staged paths
1685 among the specified paths.
1686 Otherwise, show all staged paths.
1687 .It Fl p
1688 Instead of staging the entire content of a changed file, interactively
1689 select or reject changes for staging based on
1690 .Dq y
1691 (stage change),
1692 .Dq n
1693 (reject change), and
1694 .Dq q
1695 (quit staging this file) responses.
1696 If a file is in modified status, individual patches derived from the
1697 modified file content can be staged.
1698 Files in added or deleted status may only be staged or rejected in
1699 their entirety.
1700 .It Fl F Ar response-script
1701 With the
1702 .Fl p
1703 option, read
1704 .Dq y ,
1705 .Dq n ,
1706 and
1707 .Dq q
1708 responses line-by-line from the specified
1709 .Ar response-script
1710 file instead of prompting interactively.
1711 .El
1712 .Pp
1713 .Cm got stage
1714 will refuse to run if certain preconditions are not met.
1715 If a file contains merge conflicts, these conflicts must be resolved first.
1716 If a file is found to be out of date relative to the head commit on the
1717 work tree's current branch, the file must be updated with
1718 .Cm got update
1719 before it can be staged (however, this does not prevent the file from
1720 becoming out-of-date at some point after having been staged).
1721 .Pp
1722 The
1723 .Cm got update ,
1724 .Cm got rebase ,
1725 and
1726 .Cm got histedit
1727 commands will refuse to run while staged changes exist.
1728 If staged changes cannot be committed because a staged path
1729 is out of date, the path must be unstaged with
1730 .Cm got unstage
1731 before it can be updated with
1732 .Cm got update ,
1733 and may then be staged again if necessary.
1734 .It Cm sg
1735 Short alias for
1736 .Cm stage .
1737 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
1738 Merge staged changes back into the work tree and put affected paths
1739 back into non-staged status.
1740 If no
1741 .Ar path
1742 is specified, unstage all staged changes across the entire work tree.
1743 Otherwise, unstage changes at or within the specified paths.
1744 .Pp
1745 Show the status of each affected file, using the following status codes:
1746 .Bl -column YXZ description
1747 .It G Ta file was unstaged
1748 .It C Ta file was unstaged and conflicts occurred during merge
1749 .It ! Ta changes destined for a missing file were not merged
1750 .It D Ta file was staged as deleted and still is deleted
1751 .It d Ta file's deletion was obstructed by local modifications
1752 .It \(a~ Ta changes destined for a non-regular file were not merged
1753 .El
1754 .Pp
1755 The options for
1756 .Cm got unstage
1757 are as follows:
1758 .Bl -tag -width Ds
1759 .It Fl p
1760 Instead of unstaging the entire content of a changed file, interactively
1761 select or reject changes for unstaging based on
1762 .Dq y
1763 (unstage change),
1764 .Dq n
1765 (keep change staged), and
1766 .Dq q
1767 (quit unstaging this file) responses.
1768 If a file is staged in modified status, individual patches derived from the
1769 staged file content can be unstaged.
1770 Files staged in added or deleted status may only be unstaged in their entirety.
1771 .It Fl F Ar response-script
1772 With the
1773 .Fl p
1774 option, read
1775 .Dq y ,
1776 .Dq n ,
1777 and
1778 .Dq q
1779 responses line-by-line from the specified
1780 .Ar response-script
1781 file instead of prompting interactively.
1782 .El
1783 .It Cm ug
1784 Short alias for
1785 .Cm unstage .
1786 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
1787 Parse and print contents of objects to standard output in a line-based
1788 text format.
1789 Content of commit, tree, and tag objects is printed in a way similar
1790 to the actual content stored in such objects.
1791 Blob object contents are printed as they would appear in files on disk.
1792 .Pp
1793 Attempt to interpret each argument as a reference, a tag name, or
1794 an object ID SHA1 hash.
1795 References will be resolved to an object ID.
1796 Tag names will resolved to a tag object.
1797 An abbreviated hash argument will be expanded to a full SHA1 hash
1798 automatically, provided the abbreviation is unique.
1799 .Pp
1800 If none of the above interpretations produce a valid result, or if the
1801 .Fl P
1802 option is used, attempt to interpret the argument as a path which will
1803 be resolved to the ID of an object found at this path in the repository.
1804 .Pp
1805 The options for
1806 .Cm got cat
1807 are as follows:
1808 .Bl -tag -width Ds
1809 .It Fl c Ar commit
1810 Look up paths in the specified
1811 .Ar commit .
1812 If this option is not used, paths are looked up in the commit resolved
1813 via the repository's HEAD reference.
1814 The expected argument is a commit ID SHA1 hash or an existing reference
1815 or tag name which will be resolved to a commit ID.
1816 An abbreviated hash argument will be expanded to a full SHA1 hash
1817 automatically, provided the abbreviation is unique.
1818 .It Fl r Ar repository-path
1819 Use the repository at the specified path.
1820 If not specified, assume the repository is located at or above the current
1821 working directory.
1822 If this directory is a
1823 .Nm
1824 work tree, use the repository path associated with this work tree.
1825 .It Fl P
1826 Interpret all arguments as paths only.
1827 This option can be used to resolve ambiguity in cases where paths
1828 look like tag names, reference names, or object IDs.
1829 .El
1830 .El
1831 .Sh ENVIRONMENT
1832 .Bl -tag -width GOT_AUTHOR
1833 .It Ev GOT_AUTHOR
1834 The author's name and email address for
1835 .Cm got commit
1836 and
1837 .Cm got import ,
1838 for example:
1839 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
1840 Because
1841 .Xr git 1
1842 may fail to parse commits without an email address in author data,
1843 .Nm
1844 attempts to reject
1845 .Ev GOT_AUTHOR
1846 environment variables with a missing email address.
1847 .Pp
1848 If present, Git's
1849 .Dv user.name
1850 and
1851 .Dv user.email
1852 configuration settings in the repository's
1853 .Pa .git/config
1854 file will override the value of
1855 .Ev GOT_AUTHOR .
1856 However, the
1857 .Dv user.name
1858 and
1859 .Dv user.email
1860 configuration settings contained in Git's global
1861 .Pa ~/.gitconfig
1862 configuration file will be used only if the
1863 .Ev GOT_AUTHOR
1864 environment variable is
1865 .Em not
1866 set.
1867 .It Ev VISUAL , EDITOR
1868 The editor spawned by
1869 .Cm got commit ,
1870 .Cm got import ,
1872 .Cm got tag .
1873 .It Ev GOT_LOG_DEFAULT_LIMIT
1874 The default limit on the number of commits traversed by
1875 .Cm got log .
1876 If set to zero, the limit is unbounded.
1877 This variable will be silently ignored if it is set to a non-numeric value.
1878 .El
1879 .Sh EXIT STATUS
1880 .Ex -std got
1881 .Sh EXAMPLES
1882 Clone an existing Git repository for use with
1883 .Nm .
1884 .Pp
1885 .Dl $ cd /var/git/
1886 .Dl $ got clone ssh://git@github.com/openbsd/src.git
1887 .Pp
1888 Use of HTTP URLs currently requires
1889 .Xr git 1 :
1890 .Pp
1891 .Dl $ cd /var/git/
1892 .Dl $ git clone --bare https://github.com/openbsd/src.git
1893 .Pp
1894 Alternatively, for quick and dirty local testing of
1895 .Nm
1896 a new Git repository could be created and populated with files,
1897 e.g. from a temporary CVS checkout located at
1898 .Pa /tmp/src :
1899 .Pp
1900 .Dl $ got init /var/git/src.git
1901 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
1902 .Pp
1903 Check out a work tree from the Git repository to /usr/src:
1904 .Pp
1905 .Dl $ got checkout /var/git/src.git /usr/src
1906 .Pp
1907 View local changes in a work tree directory:
1908 .Pp
1909 .Dl $ got status
1910 .Dl $ got diff | less
1911 .Pp
1912 Interactively revert selected local changes in a work tree directory:
1913 .Pp
1914 .Dl $ got revert -p -R\ .
1915 .Pp
1916 In a work tree or a git repository directory, list all branch references:
1917 .Pp
1918 .Dl $ got branch -l
1919 .Pp
1920 In a work tree or a git repository directory, create a new branch called
1921 .Dq unified-buffer-cache
1922 which is forked off the
1923 .Dq master
1924 branch:
1925 .Pp
1926 .Dl $ got branch unified-buffer-cache master
1927 .Pp
1928 Switch an existing work tree to the branch
1929 .Dq unified-buffer-cache .
1930 Local changes in the work tree will be preserved and merged if necessary:
1931 .Pp
1932 .Dl $ got update -b unified-buffer-cache
1933 .Pp
1934 Create a new commit from local changes in a work tree directory.
1935 This new commit will become the head commit of the work tree's current branch:
1936 .Pp
1937 .Dl $ got commit
1938 .Pp
1939 In a work tree or a git repository directory, view changes committed in
1940 the 3 most recent commits to the work tree's branch, or the branch resolved
1941 via the repository's HEAD reference, respectively:
1942 .Pp
1943 .Dl $ got log -p -l 3
1944 .Pp
1945 As above, but display changes in the order in which
1946 .Xr patch 1
1947 could apply them in sequence:
1948 .Pp
1949 .Dl $ got log -p -l 3 -R
1950 .Pp
1951 In a work tree or a git repository directory, log the history of a subdirectory:
1952 .Pp
1953 .Dl $ got log sys/uvm
1954 .Pp
1955 While operating inside a work tree, paths are specified relative to the current
1956 working directory, so this command will log the subdirectory
1957 .Pa sys/uvm :
1958 .Pp
1959 .Dl $ cd sys/uvm && got log '.'
1960 .Pp
1961 And this command has the same effect:
1962 .Pp
1963 .Dl $ cd sys/dev/usb && got log ../../uvm
1964 .Pp
1965 Add new files and remove obsolete files in a work tree directory:
1966 .Pp
1967 .Dl $ got add sys/uvm/uvm_ubc.c
1968 .Dl $ got remove sys/uvm/uvm_vnode.c
1969 .Pp
1970 Create a new commit from local changes in a work tree directory
1971 with a pre-defined log message.
1972 .Pp
1973 .Dl $ got commit -m 'unify the buffer cache'
1974 .Pp
1975 Alternatively, create a new commit from local changes in a work tree
1976 directory with a log message that has been prepared in the file
1977 .Pa /tmp/msg .
1979 .Xr vi 1
1980 is set as the
1981 .Ev EDITOR ,
1982 .Pa /tmp/msg
1983 can be read into the buffer for review:
1984 .Pp
1985 .Dl $ got commit
1986 .Dl :r /tmp/msg
1987 .Pp
1988 Update any work tree checked out from the
1989 .Dq unified-buffer-cache
1990 branch to the latest commit on this branch:
1991 .Pp
1992 .Dl $ got update
1993 .Pp
1994 Roll file content on the unified-buffer-cache branch back by one commit,
1995 and then fetch the rolled-back change into the work tree as a local change
1996 to be amended and perhaps committed again:
1997 .Pp
1998 .Dl $ got backout unified-buffer-cache
1999 .Dl $ got commit -m 'roll back previous'
2000 .Dl $ # now back out the previous backout :-)
2001 .Dl $ got backout unified-buffer-cache
2002 .Pp
2003 Fetch new upstream commits into the local repository's
2004 .Dq origin/master
2005 branch:
2006 .Pp
2007 .Dl $ cd /usr/src
2008 .Dl $ got fetch
2009 .Pp
2010 In a repository created with a HTTP URL and
2011 .Cm git clone --bare
2012 the
2013 .Xr git-fetch 1
2014 command must be used instead:
2015 .Pp
2016 .Dl $ cd /var/git/src.git
2017 .Dl $ git fetch origin master:refs/remotes/origin/master
2018 .Pp
2019 Rebase the local
2020 .Dq master
2021 branch to merge the new changes that are now visible on the
2022 .Dq origin/master
2023 branch:
2024 .Pp
2025 .Dl $ cd /usr/src
2026 .Dl $ got update -b origin/master
2027 .Dl $ got rebase master
2028 .Pp
2029 Rebase the
2030 .Dq unified-buffer-cache
2031 branch on top of the new head commit of the
2032 .Dq master
2033 branch.
2034 .Pp
2035 .Dl $ got update -b master
2036 .Dl $ got rebase unified-buffer-cache
2037 .Pp
2038 Create a patch from all changes on the unified-buffer-cache branch.
2039 The patch can be mailed out for review and applied to
2040 .Ox Ns 's
2041 CVS tree:
2042 .Pp
2043 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2044 .Pp
2045 Edit the entire commit history of the
2046 .Dq unified-buffer-cache
2047 branch:
2048 .Pp
2049 .Dl $ got update -b unified-buffer-cache
2050 .Dl $ got update -c master
2051 .Dl $ got histedit
2052 .Pp
2053 In order to merge changes committed to the
2054 .Dq unified-buffer-cache
2055 branch back into the
2056 .Dq master
2057 branch, the
2058 .Dq unified-buffer-cache
2059 branch must first be rebased onto the
2060 .Dq master
2061 branch:
2062 .Pp
2063 .Dl $ got update -b master
2064 .Dl $ got rebase unified-buffer-cache
2065 .Pp
2066 Changes on the
2067 .Dq unified-buffer-cache
2068 branch can now be made visible on the
2069 .Dq master
2070 branch with
2071 .Cm got integrate .
2072 Because the rebase operation switched the work tree to the
2073 .Dq unified-buffer-cache
2074 branch, the work tree must be switched back to the
2075 .Dq master
2076 branch before the
2077 .Dq unified-buffer-cache
2078 branch can be integrated into
2079 .Dq master :
2080 .Pp
2081 .Dl $ got update -b master
2082 .Dl $ got integrate unified-buffer-cache
2083 .Pp
2084 Additional steps may be necessary if local changes need to be pushed back
2085 to the remote repository, which currently requires
2086 .Cm git push .
2087 Before working against existing branches in a repository cloned with
2088 .Cm git clone --bare
2089 instead of
2090 .Cm got clone ,
2091 a Git
2092 .Dq refspec
2093 must be configured to map all references in the remote repository
2094 into the
2095 .Dq refs/remotes
2096 namespace of the local repository.
2097 This can achieved by setting Git's
2098 .Pa remote.origin.fetch
2099 configuration variable to the value
2100 .Dq +refs/heads/*:refs/remotes/origin/*
2101 with the
2102 .Cm git config
2103 command:
2104 .Pp
2105 .Dl $ cd /var/git/repo
2106 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2107 .Pp
2108 Additionally, the
2109 .Dq mirror
2110 option must be disabled:
2111 .Pp
2112 .Dl $ cd /var/git/repo
2113 .Dl $ git config remote.origin.mirror false
2114 .Pp
2115 Alternatively, the following
2116 .Xr git-fetch 1
2117 configuration item can be added manually to the Git repository's
2118 .Pa config
2119 file:
2120 .Pp
2121 .Dl [remote "origin"]
2122 .Dl url = ...
2123 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2124 .Dl mirror = false
2125 .Pp
2126 This configuration leaves the local repository's
2127 .Dq refs/heads
2128 namespace free for use by local branches checked out with
2129 .Cm got checkout
2130 and, if needed, created with
2131 .Cm got branch .
2132 .Pp
2133 Branches in the
2134 .Dq remotes/origin
2135 namespace can now be updated with incoming changes from the remote
2136 repository with
2137 .Cm got fetch
2139 .Xr git-fetch 1
2140 without extra command line arguments:
2141 .Pp
2142 .Dl $ cd /var/git/repo
2143 .Dl $ git fetch
2144 .Pp
2145 To make changes fetched from the remote repository appear on the
2146 .Dq master
2147 branch, the
2148 .Dq master
2149 branch must be rebased onto the
2150 .Dq origin/master
2151 branch.
2152 This will also merge local changes, if any, with the incoming changes:
2153 .Pp
2154 .Dl $ got update -b origin/master
2155 .Dl $ got rebase master
2156 .Pp
2157 On the
2158 .Dq master
2159 branch, log messages for local changes can now be amended with
2160 .Dq OK
2161 by other developers and any other important new information:
2162 .Pp
2163 .Dl $ got update -c origin/master
2164 .Dl $ got histedit -m
2165 .Pp
2166 Local changes on the
2167 .Dq master
2168 branch can then be pushed to the remote
2169 repository with
2170 .Cm git push :
2171 .Pp
2172 .Dl $ cd /var/git/repo
2173 .Dl $ git push origin master
2174 .Sh SEE ALSO
2175 .Xr tog 1 ,
2176 .Xr git-repository 5 ,
2177 .Xr got-worktree 5
2178 .Sh AUTHORS
2179 .An Stefan Sperling Aq Mt stsp@openbsd.org
2180 .An Martin Pieuchot Aq Mt mpi@openbsd.org
2181 .An Joshua Stein Aq Mt jcs@openbsd.org
2182 .An Ori Bernstein Aq Mt ori@openbsd.org
2183 .Sh CAVEATS
2184 .Nm
2185 is a work-in-progress and many commands remain to be implemented.
2186 At present, the user has to fall back on
2187 .Xr git 1
2188 to perform many tasks, in particular tasks related to repository
2189 administration and tasks which require a network connection.