2 .\" Copyright (c) 2017 Martin Pieuchot
3 .\" Copyright (c) 2018, 2019, 2020 Stefan Sperling
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.
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.
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 .
38 version control system because every copy of a repository is writeable.
39 Modifications made to files can be synchronized between repositories
44 must be checked out from the repository for modification.
45 Checked out files are stored in a
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
52 provides global and command-specific options.
53 Global options must precede the command name, and are as follows:
54 .Bl -tag -width tenletters
56 Display usage information and exit immediately.
58 Display program version and exit immediately.
64 .Bl -tag -width checkout
65 .It Cm init Ar repository-path
66 Create a new empty repository at the specified
73 command must be used to populate the empty repository before
77 .It Cm import Oo Fl b Ar branch Oc Oo Fl m Ar message Oc Oo Fl r Ar repository-path Oc Oo Fl I Ar pattern Oc Ar directory
79 Create an initial commit in a repository from the file hierarchy
82 The created commit will not have any parent commits, i.e. it will be a
84 Also create a new reference which provides a branch name for the newly
86 Show the path of each imported file to indicate progress.
92 environment variable to be set,
93 unless an author has been configured in
99 configuration settings can be obtained from the repository's
101 file or from Git's global
112 instead of creating the default branch
114 Use of this option is required if the
116 branch already exists.
118 Use the specified log message when creating the new commit.
123 opens a temporary file in an editor where a log message can be written.
124 .It Fl r Ar repository-path
125 Use the repository at the specified path.
126 If not specified, assume the repository is located at or above the current
129 Ignore files or directories with a name which matches the specified
131 This option may be specified multiple times to build a list of ignore patterns.
134 follows the globbing rules documented in
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
140 Clone a Git repository at the specified
146 is specified, the directory name will be derived from the name of the
149 will refuse to run if the
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
158 .Lk scheme://hostname:port/path/to/repository
160 The following protocol schemes are supported:
161 .Bl -tag -width git+ssh
163 The Git protocol as implemented by the
166 Use of this protocol is discouraged since it supports neither authentication
169 The Git protocol wrapped in an authenticated and encrypted
172 With this protocol the hostname may contain an embedded username for
177 Short alias for git+ssh.
180 Objects in the cloned repository are stored in a pack file which is downloaded
182 This pack file will then be indexed to facilitate access to the objects stored
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 .
191 creates a remote repository entry in the
195 files of the cloned repository to store the
201 arguments for future use by
211 Fetch all branches from the remote repository's
213 reference namespace and set
214 .Cm fetch_all_branches
215 in the cloned repository's
217 file for future use by
219 If this option is not specified, a branch resolved via the remote
220 repository's HEAD reference will be fetched.
221 Cannot be used together with the
227 from the remote repository's
230 This option may be specified multiple times to build a list of branches
232 If the branch corresponding to the remote repository's HEAD reference is not
233 in this list, the cloned repository's HEAD reference will be set to the first
234 branch which was fetched.
235 If this option is not specified, a branch resolved via the remote
236 repository's HEAD reference will be fetched.
237 Cannot be used together with the
241 List branches and tags available for fetching from the remote repository
242 and exit immediately.
243 Cannot be used together with any of the other options except
248 Create the cloned repository as a mirror of the original repository.
249 This is useful if the cloned repository will not be used to store
250 locally created commits.
256 files will be set up with the
258 option enabled, such that
262 will write incoming changes directly to branches in the
264 reference namespace, rather than to branches in the
267 This avoids the usual requirement of having to run
271 in order to make incoming changes appear on branches in the
274 But maintaining custom changes in the cloned repository becomes difficult
275 since such changes will be at risk of being discarded whenever incoming
278 Suppress progress reporting output.
279 The same option will be passed to
286 to print debugging messages to standard error output.
287 This option will be passed to
290 Multiple -v options increase the verbosity.
292 .It Fl R Ar reference
293 In addition to the branches and tags that will be fetched, fetch an arbitrary
295 from the remote repository's
298 This option may be specified multiple times to build a list of additional
302 may either be a path to a specific reference, or a reference namespace
303 which will cause all references in this namespace to be fetched.
305 Each reference will be mapped into the cloned repository's
307 namespace, unless the
309 option is used to mirror references directly into the cloned repository's
314 will refuse to fetch references from the remote repository's
321 .It Cm fetch Oo Fl a Oc Oo Fl b Ar branch Oc Oo Fl d Oc Oo Fl l Oc Oo Fl r Ar repository-path Oc Oo Fl t Oc Oo Fl q Oc Oo Fl v Oc Oo Fl R Ar reference Oc Oo Fl X Oc Op Ar remote-repository
323 Fetch new changes from a remote repository.
325 .Ar remote-repository
329 The remote repository's URL is obtained from the corresponding entry in
333 file of the local repository, as created by
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
340 By default, branch references in the
342 reference namespace will be updated to point at the newly fetched commits.
345 command can then be used to make new changes visible on branches in the
347 namespace, merging incoming changes with the changes on those branches
350 If the repository was created as a mirror with
352 then all branches in the
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.
362 In any case, references in the
364 namespace will always be fetched and mapped directly to local references
365 in the same namespace.
372 Fetch all branches from the remote repository's
375 This option can be enabled by default for specific repositories in
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
385 from the remote repository's
388 This option may be specified multiple times to build a list of branches
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
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 .
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
412 Allow existing references in the
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
420 If this directory is a
422 work tree, use the repository path associated with this work tree.
424 Suppress progress reporting output.
425 The same option will be passed to
432 to print debugging messages to standard error output.
433 The same option will be passed to
436 Multiple -v options increase the verbosity.
438 .It Fl R Ar reference
439 In addition to the branches and tags that will be fetched, fetch an arbitrary
441 from the remote repository's
444 This option may be specified multiple times to build a list of additional
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.
451 Each reference will be mapped into the local repository's
453 namespace, unless the local repository was created as a mirror with
455 in which case references will be mapped directly into the local repository's
459 Once a reference has been fetched, a branch based on it can be created with
464 will refuse to fetch references from the remote repository's
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
479 .Ar remote-repository
480 argument is mandatory and no other options except
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
491 and Git's garbage collector.
494 .It Cm checkout Oo Fl E Oc Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl p Ar path-prefix Oc Oo Fl q Oc Ar repository-path Op Ar work-tree-path
496 Copy files from a repository into a new work tree.
497 Show the status of each affected file, using the following status codes:
498 .Bl -column YXZ description
499 .It A Ta new file was added
500 .It E Ta file already exists in work tree's meta-data
505 is not specified, either use the last component of
506 .Ar repository path ,
509 was specified use the last component of
517 Proceed with the checkout operation even if the directory at
520 Existing files will be left intact.
522 Check out files from a commit on the specified
524 If this option is not specified, a branch resolved via the repository's HEAD
525 reference will be used.
527 Check out files from the specified
529 on the selected branch.
530 The expected argument is a commit ID SHA1 hash or an existing reference
531 or tag name which will be resolved to a commit ID.
532 An abbreviated hash argument will be expanded to a full SHA1 hash
533 automatically, provided the abbreviation is unique.
534 If this option is not specified, the most recent commit on the selected
539 is not contained in the selected branch, a different branch which contains
540 this commit must be specified with the
543 If no such branch is known, a new branch must be created for this
549 Checking out work trees with an unknown branch is intentionally not supported.
550 .It Fl p Ar path-prefix
551 Restrict the work tree to a subset of the repository's tree hierarchy.
552 Only files beneath the specified
556 Silence progress output.
559 .It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl q Oc Op Ar path ...
561 Update an existing work tree to a different
563 Change existing files in the work tree as necessary to match file contents
565 Preserve any local changes in the work tree and merge them with the
568 Files which already contain merge conflicts will not be updated to avoid
569 further complications.
570 Such files will be updated when
572 is run again after merge conflicts have been resolved.
573 If the conflicting changes are no longer needed, affected files can be
580 Show the status of each affected file, using the following status codes:
581 .Bl -column YXZ description
582 .It U Ta file was updated and contained no local changes
583 .It G Ta file was updated and local changes were merged cleanly
584 .It C Ta file was updated and conflicts occurred during merge
585 .It D Ta file was deleted
586 .It A Ta new file was added
587 .It \(a~ Ta versioned file is obstructed by a non-regular file
588 .It ! Ta a missing versioned file was restored
589 .It # Ta file was not updated because it contains merge conflicts
590 .It ? Ta changes destined for an unversioned file were not merged
595 is specified, update the entire work tree.
596 Otherwise, restrict the update operation to files at or within the
598 Each path is required to exist in the update operation's target commit.
599 Files in the work tree outside specified paths will remain unchanged and
600 will retain their previously recorded base commit.
603 commands may refuse to run while the work tree contains files from
604 multiple base commits.
605 The base commit of such a work tree can be made consistent by running
607 across the entire work tree.
610 is incompatible with the
615 cannot update paths with staged changes.
616 If changes have been staged with
618 these changes must first be committed with
628 Switch the work tree's branch reference to the specified
630 before updating the work tree.
631 This option requires that all paths in the work tree are updated.
633 As usual, any local changes in the work tree will be preserved.
634 This can be useful when switching to a newly created branch in order
635 to commit existing local changes to this branch.
637 Any local changes must be dealt with separately in order to obtain a
638 work tree with pristine file contents corresponding exactly to the specified
640 Such changes could first be committed to a different branch with
642 or could be discarded with
645 Update the work tree to the specified
647 The expected argument is a commit ID SHA1 hash or an existing reference
648 or tag name which will be resolved to a commit ID.
649 An abbreviated hash argument will be expanded to a full SHA1 hash
650 automatically, provided the abbreviation is unique.
651 If this option is not specified, the most recent commit on the work tree's
654 Silence progress output.
657 .It Cm status Oo Fl I Oc Oo Fl s Ar status-codes Oc Oo Fl S Ar status-codes Oc Op Ar path ...
659 Show the current modification status of files in a work tree,
660 using the following status codes:
661 .Bl -column YXZ description
662 .It M Ta modified file
663 .It A Ta file scheduled for addition in next commit
664 .It D Ta file scheduled for deletion in next commit
665 .It C Ta modified or added file which contains merge conflicts
666 .It ! Ta versioned file was expected on disk but is missing
667 .It \(a~ Ta versioned file is obstructed by a non-regular file
668 .It ? Ta unversioned item not tracked by
670 .It m Ta modified file modes (executable bit only)
671 .It N Ta non-existent
673 specified on the command line
678 is specified, show modifications in the entire work tree.
679 Otherwise, show modifications at or within the specified paths.
681 If changes have been staged with
683 staged changes are shown in the second output column, using the following
685 .Bl -column YXZ description
686 .It M Ta file modification is staged
687 .It A Ta file addition is staged
688 .It D Ta file deletion is staged
691 Changes created on top of staged changes are indicated in the first column:
692 .Bl -column YXZ description
693 .It MM Ta file was modified after earlier changes have been staged
694 .It MA Ta file was modified after having been staged for addition
702 Show unversioned files even if they match an ignore pattern.
703 .It Fl s Ar status-codes
704 Only show files with a modification status matching any of the
705 single-character status codes contained in the
708 Any combination of codes from the above list of possible status codes
710 For staged files, status codes displayed in either column will be matched.
711 Cannot be used together with the
714 .It Fl S Ar status-codes
715 Suppress the output of files with a modification status matching any of the
716 single-character status codes contained in the
719 Any combination of codes from the above list of possible status codes
721 For staged files, status codes displayed in either column will be matched.
722 Cannot be used together with the
727 For compatibility with
738 files in each traversed directory and will not display unversioned files
739 which match these patterns.
744 supports consecutive asterisks,
746 which will match an arbitrary amount of directories.
750 only supports a single ignore pattern per line.
754 does not support negated ignore patterns prefixed with
756 and gives no special significance to the location of path component separators,
759 .It Cm log Oo Fl b Oc Oo Fl c Ar commit Oc Oo Fl C Ar number Oc Oo Fl l Ar N Oc Oo Fl p Oc Oo Fl P Oc Oo Fl s Oc Oo Fl S Ar search-pattern Oc Oo Fl r Ar repository-path Oc Oo Fl R Oc Oo Fl x Ar commit Oc Op Ar path
760 Display history of a repository.
763 is specified, show only commits which modified this path.
764 If invoked in a work tree, the
766 is interpreted relative to the current working directory,
767 and the work tree's path prefix is implicitly prepended.
768 Otherwise, the path is interpreted relative to the repository root.
775 Display individual commits which were merged into the current branch
779 shows the linear history of the current branch only.
781 Start traversing history at the specified
783 The expected argument is a commit ID SHA1 hash or an existing reference
784 or tag name which will be resolved to a commit ID.
785 An abbreviated hash argument will be expanded to a full SHA1 hash
786 automatically, provided the abbreviation is unique.
787 If this option is not specified, default to the work tree's current branch
788 if invoked in a work tree, or to the repository's HEAD reference.
790 Set the number of context lines shown in diffs with
792 By default, 3 lines of context are shown.
794 Limit history traversal to a given number of commits.
795 If this option is not specified, a default limit value of zero is used,
796 which is treated as an unbounded limit.
798 .Ev GOT_LOG_DEFAULT_LIMIT
799 environment variable may be set to change this default value.
801 Display the patch of modifications made in each commit.
804 is specified, only show the patch of modifications at or within this path.
805 Cannot be used with the
809 Display the list of file paths changed in each commit, using the following
811 .Bl -column YXZ description
812 .It M Ta modified file
813 .It D Ta file was deleted
814 .It A Ta new file was added
815 .It m Ta modified file modes (executable bit only)
818 Cannot be used with the
822 Display a short one-line summary of each commit, instead of the default
824 Cannot be used together with the
829 .It Fl S Ar search-pattern
830 If specified, show only commits with a log message, author name,
831 committer name, or ID SHA1 hash matched by the extended regular
834 Lines in committed patches will be matched if
837 File paths changed by a commit will be matched if
840 Regular expression syntax is documented in
842 .It Fl r Ar repository-path
843 Use the repository at the specified path.
844 If not specified, assume the repository is located at or above the current
846 If this directory is a
848 work tree, use the repository path associated with this work tree.
850 Determine a set of commits to display as usual, but display these commits
853 Stop traversing commit history immediately after the specified
856 This option has no effect if the specified
861 .It Cm diff Oo Fl a Oc Oo Fl c Ar commit Oc Oo Fl C Ar number Oc Oo Fl r Ar repository-path Oc Oo Fl s Oc Oo Fl P Oc Oo Fl w Oc Op Ar object1 Ar object2 | Ar path ...
863 When invoked within a work tree without any arguments, display all
864 local changes in the work tree.
867 arguments are specified, only show changes within the specified paths.
869 If two arguments are provided, treat each argument as a reference, a tag
870 name, or an object ID SHA1 hash, and display differences between the
871 corresponding objects.
872 Both objects must be of the same type (blobs, trees, or commits).
873 An abbreviated hash argument will be expanded to a full SHA1 hash
874 automatically, provided the abbreviation is unique.
875 If none of these interpretations produce a valid result or if the
880 is running in a work tree, attempt to interpret the two arguments as paths.
887 Treat file contents as ASCII text even if binary data is detected.
889 Show differences between commits in the repository.
890 This options may be used up to two times.
891 When used only once, show differences between the specified
893 and its first parent commit.
894 When used twice, show differences between the two specified commits.
896 The expected argument is a commit ID SHA1 hash or an existing reference
897 or tag name which will be resolved to a commit ID.
898 An abbreviated hash argument will be expanded to a full SHA1 hash
899 automatically, provided the abbreviation is unique.
903 option is used, all non-option arguments will be interpreted as paths.
906 arguments are provided, only show differences for the specified paths.
908 Cannot be used together with the
912 Set the number of context lines shown in the diff.
913 By default, 3 lines of context are shown.
914 .It Fl r Ar repository-path
915 Use the repository at the specified path.
916 If not specified, assume the repository is located at or above the current
918 If this directory is a
920 work tree, use the repository path associated with this work tree.
922 Show changes staged with
924 instead of showing local changes in the work tree.
925 This option is only valid when
927 is invoked in a work tree.
929 Interpret all arguments as paths only.
930 This option can be used to resolve ambiguity in cases where paths
931 look like tag names, reference names, or object IDs.
932 This option is only valid when
934 is invoked in a work tree.
936 Ignore whitespace-only changes.
939 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
941 Display line-by-line history of a file at the specified path.
948 Start traversing history at the specified
950 The expected argument is a commit ID SHA1 hash or an existing reference
951 or tag name which will be resolved to a commit ID.
952 An abbreviated hash argument will be expanded to a full SHA1 hash
953 automatically, provided the abbreviation is unique.
954 .It Fl r Ar repository-path
955 Use the repository at the specified path.
956 If not specified, assume the repository is located at or above the current
958 If this directory is a
960 work tree, use the repository path associated with this work tree.
963 .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
965 Display a listing of files and directories at the specified
966 directory path in the repository.
967 Entries shown in this listing may carry one of the following trailing
969 .Bl -column YXZ description
970 .It @ Ta entry is a symbolic link
971 .It / Ta entry is a directory
972 .It * Ta entry is an executable file
973 .It $ Ta entry is a Git submodule
976 Symbolic link entries are also annotated with the target path of the link.
980 is specified, list the repository path corresponding to the current
981 directory of the work tree, or the root directory of the repository
982 if there is no work tree.
989 List files and directories as they appear in the specified
991 The expected argument is a commit ID SHA1 hash or an existing reference
992 or tag name which will be resolved to a commit ID.
993 An abbreviated hash argument will be expanded to a full SHA1 hash
994 automatically, provided the abbreviation is unique.
995 .It Fl r Ar repository-path
996 Use the repository at the specified path.
997 If not specified, assume the repository is located at or above the current
999 If this directory is a
1001 work tree, use the repository path associated with this work tree.
1003 Show object IDs of files (blob objects) and directories (tree objects).
1005 Recurse into sub-directories in the repository.
1007 .It Cm ref Oo Fl r Ar repository-path Oc Oo Fl l Oc Oo Fl t Oc Oo Fl c Ar object Oc Oo Fl s Ar reference Oc Oo Fl d Oc Op Ar name
1008 Manage references in a repository.
1010 References may be listed, created, deleted, and changed.
1011 When creating, deleting, or changing a reference the specified
1013 must be an absolute reference name, i.e. it must begin with
1020 .It Fl r Ar repository-path
1021 Use the repository at the specified path.
1022 If not specified, assume the repository is located at or above the current
1024 If this directory is a
1026 work tree, use the repository path associated with this work tree.
1028 List references in the repository.
1031 is specified, list all existing references in the repository.
1034 is a reference namespace, list all references in this namespace.
1035 Otherwise, show only the reference with the given
1037 Cannot be used together with any other options except
1042 Sort listed references by modification time (most recently modified first)
1043 instead of sorting by lexicographical order.
1044 Use of this option requires the
1046 option to be used as well.
1048 Create a reference or change an existing reference.
1049 The reference with the specified
1051 will point at the specified
1055 argument is a ID SHA1 hash or an existing reference or tag name which will
1056 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
1057 Cannot be used together with any other options except
1059 .It Fl s Ar reference
1060 Create a symbolic reference, or change an existing symbolic reference.
1061 The symbolic reference with the specified
1063 will point at the specified
1065 which must already exist in the repository.
1066 Care should be taken not to create loops between references when
1067 this option is used.
1068 Cannot be used together with any other options except
1071 Delete the reference with the specified
1073 from the repository.
1074 Any commit, tree, tag, and blob objects belonging to deleted references
1075 remain in the repository and may be removed separately with
1076 Git's garbage collector or
1077 .Cm gotadmin cleanup .
1078 Cannot be used together with any other options except
1082 .It Cm branch Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl l Oc Oo Fl t Oc Oo Fl d Ar name Oc Oo Fl n Oc Op Ar name
1084 Create, list, or delete branches.
1086 Local branches are managed via references which live in the
1088 reference namespace.
1091 command creates references in this namespace only.
1093 When deleting branches, the specified
1097 reference namespace first.
1098 If no corresponding branch is found, the
1100 namespace will be searched next.
1102 If invoked in a work tree without any arguments, print the name of the
1103 work tree's current branch.
1107 argument is passed, attempt to create a branch reference with the given name.
1108 By default the new branch reference will point at the latest commit on the
1109 work tree's current branch if invoked in a work tree, and otherwise to a commit
1110 resolved via the repository's HEAD reference.
1112 If invoked in a work tree, once the branch was created successfully
1113 switch the work tree's head reference to the newly created branch and
1114 update files across the entire work tree, just like
1115 .Cm got update -b Ar name
1117 Show the status of each affected file, using the following status codes:
1118 .Bl -column YXZ description
1119 .It U Ta file was updated and contained no local changes
1120 .It G Ta file was updated and local changes were merged cleanly
1121 .It C Ta file was updated and conflicts occurred during merge
1122 .It D Ta file was deleted
1123 .It A Ta new file was added
1124 .It \(a~ Ta versioned file is obstructed by a non-regular file
1125 .It ! Ta a missing versioned file was restored
1133 Make a newly created branch reference point at the specified
1137 argument is a commit ID SHA1 hash or an existing reference
1138 or tag name which will be resolved to a commit ID.
1139 .It Fl r Ar repository-path
1140 Use the repository at the specified path.
1141 If not specified, assume the repository is located at or above the current
1143 If this directory is a
1145 work tree, use the repository path associated with this work tree.
1147 List all existing branches in the repository, including copies of remote
1148 repositories' branches in the
1150 reference namespace.
1152 If invoked in a work tree, the work tree's current branch is shown
1153 with one the following annotations:
1154 .Bl -column YXZ description
1155 .It * Ta work tree's base commit matches the branch tip
1156 .It \(a~ Ta work tree's base commit is out-of-date
1159 Sort listed branches by modification time (most recently modified first)
1160 instead of sorting by lexicographical order.
1163 reference namespace are listed before branches in
1166 Use of this option requires the
1168 option to be used as well.
1170 Delete the branch with the specified
1176 reference namespace.
1178 Only the branch reference is deleted.
1179 Any commit, tree, and blob objects belonging to the branch
1180 remain in the repository and may be removed separately with
1181 Git's garbage collector or
1182 .Cm gotadmin cleanup .
1184 Do not switch and update the work tree after creating a new branch.
1186 .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 Oo Fl s Ar signer-id Oc Oo Fl v Oc Oo Fl V Oc Ar name
1187 Manage tags in a repository.
1189 Tags are managed via references which live in the
1191 reference namespace.
1194 command operates on references in this namespace only.
1195 References in this namespace point at tag objects which contain a pointer
1196 to another object, a tag message, as well as author and timestamp information.
1198 Attempt to create a tag with the given
1200 and make this tag point at the given
1202 If no commit is specified, default to the latest commit on the work tree's
1203 current branch if invoked in a work tree, and to a commit resolved via
1204 the repository's HEAD reference otherwise.
1211 Make the newly created tag reference point at the specified
1215 argument is a commit ID SHA1 hash or an existing reference or tag name which
1216 will be resolved to a commit ID.
1217 An abbreviated hash argument will be expanded to a full SHA1 hash
1218 automatically, provided the abbreviation is unique.
1220 Use the specified tag message when creating the new tag.
1225 opens a temporary file in an editor where a tag message can be written.
1226 .It Fl r Ar repository-path
1227 Use the repository at the specified path.
1228 If not specified, assume the repository is located at or above the current
1230 If this directory is a
1232 work tree, use the repository path associated with this work tree.
1234 List all existing tags in the repository instead of creating a new tag.
1237 argument is passed, show only the tag with the given
1239 .It Fl s Ar signer-id
1240 While creating a new tag, sign this tag with the identity given in
1243 For SSH-based signatures,
1245 is the path to a file which may refer to either a private SSH key,
1246 or a public SSH key with the private half available via
1249 will sign the tag object by invoking
1253 command, using the signature namespace
1255 for compatibility with
1259 During SSH signature creation and verification this option will be passed to
1261 Multiple -v options increase the verbosity.
1264 Verify tag object signatures.
1267 is specified, show and verify the tag object with the provided name.
1268 Otherwise, list all tag objects and verify signatures where present.
1271 verifies SSH-based signatures by invoking
1274 .Fl Y Ar verify Fl f Ar allowed_signers .
1279 otherwise verification is impossible.
1284 command will not delete tags or change existing tags.
1285 If a tag must be deleted, the
1287 command may be used to delete a tag's reference.
1288 This should only be done if the tag has not already been copied to
1290 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1291 Schedule unversioned files in a work tree for addition to the
1292 repository in the next commit.
1293 By default, files which match a
1295 ignore pattern will not be added.
1302 Permit recursion into directories.
1303 If this option is not specified,
1305 will refuse to run if a specified
1309 Add files even if they match a
1314 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
1316 Remove versioned files from a work tree and schedule them for deletion
1317 from the repository in the next commit.
1324 Perform the operation even if a file contains local modifications,
1325 and do not raise an error if a specified
1327 does not exist on disk.
1329 Keep affected files on disk.
1331 Permit recursion into directories.
1332 If this option is not specified,
1334 will refuse to run if a specified
1337 .It Fl s Ar status-codes
1338 Only delete files with a modification status matching one of the
1339 single-character status codes contained in the
1342 The following status codes may be specified:
1343 .Bl -column YXZ description
1344 .It M Ta modified file (this implies the
1347 .It ! Ta versioned file expected on disk but missing
1351 .It Cm patch Oo Fl n Oc Oo Fl p Ar strip-count Oc Oo Fl R Oc Op Ar patchfile
1355 to files in a work tree.
1356 Files added or removed by a patch will be scheduled for addition or removal in
1359 The patch must be in the unified diff format as produced by
1366 diff when invoked with their
1371 argument is provided, read unified diff data from standard input instead.
1375 contains multiple patches, then attempt to apply each of them in sequence.
1377 Show the status of each affected file, using the following status codes:
1378 .Bl -column XYZ description
1379 .It M Ta file was modified
1380 .It G Ta file was merged using a merge-base found in the repository
1381 .It C Ta file was merged and conflicts occurred during merge
1382 .It D Ta file was deleted
1383 .It A Ta file was added
1384 .It # Ta failed to patch the file
1387 If a change does not match at its exact line number, attempt to
1388 apply it somewhere else in the file if a good spot can be found.
1389 Otherwise, the patch will fail to apply.
1393 will refuse to apply a patch if certain preconditions are not met.
1394 Files to be deleted must already be under version control, and must
1395 not have been scheduled for deletion already.
1396 Files to be added must not yet be under version control and must not
1397 already be present on disk.
1398 Files to be modified must already be under version control and may not
1399 contain conflict markers.
1401 If an error occurs, the
1403 operation will be aborted.
1404 Any changes made to the work tree up to this point will be left behind.
1405 Such changes can be viewed with
1407 and can be reverted with
1416 Do not make any modifications to the work tree.
1417 This can be used to check whether a patch would apply without issues.
1420 contains diffs that affect the same file multiple times, the results
1421 displayed may be incorrect.
1422 .It Fl p Ar strip-count
1423 Specify the number of leading path components to strip from paths
1432 path prefixes generated by
1434 will be recognized and stripped automatically.
1436 Reverse the patch before applying it.
1439 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1441 Revert any local changes in files at the specified paths in a work tree.
1442 File contents will be overwritten with those contained in the
1443 work tree's base commit.
1444 There is no way to bring discarded changes back after
1447 If a file was added with
1449 it will become an unversioned file again.
1450 If a file was deleted with
1452 it will be restored.
1459 Instead of reverting all changes in files, interactively select or reject
1460 changes to revert based on
1466 (quit reverting this file) responses.
1467 If a file is in modified status, individual patches derived from the
1468 modified file content can be reverted.
1469 Files in added or deleted status may only be reverted in their entirety.
1470 .It Fl F Ar response-script
1478 responses line-by-line from the specified
1480 file instead of prompting interactively.
1482 Permit recursion into directories.
1483 If this option is not specified,
1485 will refuse to run if a specified
1490 .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 ...
1492 Create a new commit in the repository from changes in a work tree
1493 and use this commit as the new base commit for the work tree.
1496 is specified, commit all changes in the work tree.
1497 Otherwise, commit changes at or within the specified paths.
1499 If changes have been explicitly staged for commit with
1501 only commit staged changes and reject any specified paths which
1502 have not been staged.
1505 opens a temporary file in an editor where a log message can be written
1513 options are used together.
1515 Show the status of each affected file, using the following status codes:
1516 .Bl -column YXZ description
1517 .It M Ta modified file
1518 .It D Ta file was deleted
1519 .It A Ta new file was added
1520 .It m Ta modified file modes (executable bit only)
1523 Files which are not part of the new commit will retain their previously
1524 recorded base commit.
1527 commands may refuse to run while the work tree contains files from
1528 multiple base commits.
1529 The base commit of such a work tree can be made consistent by running
1531 across the entire work tree.
1535 command requires the
1537 environment variable to be set,
1538 unless an author has been configured in
1544 configuration settings can be
1545 obtained from the repository's
1547 file or from Git's global
1556 Use the prepared log message stored in the file found at
1558 when creating the new commit.
1560 opens a temporary file in an editor where the prepared log message can be
1561 reviewed and edited further if needed.
1562 Cannot be used together with the
1566 Use the specified log message when creating the new commit.
1567 Cannot be used together with the
1571 This option prevents
1573 from opening the commit message in an editor.
1574 It has no effect unless it is used together with the
1576 option and is intended for non-interactive use such as scripting.
1578 Allow the addition of symbolic links which point outside of the path space
1579 that is under version control.
1582 will reject such symbolic links due to safety concerns.
1585 may decide to represent such a symbolic link as a regular file which contains
1586 the link's target path, rather than creating an actual symbolic link which
1587 points outside of the work tree.
1588 Use of this option is discouraged because external mechanisms such as
1590 are better suited for managing symbolic links to paths not under
1595 will refuse to run if certain preconditions are not met.
1596 If the work tree's current branch is not in the
1598 reference namespace, new commits may not be created on this branch.
1599 Local changes may only be committed if they are based on file content
1600 found in the most recent commit on the work tree's branch.
1601 If a path is found to be out of date,
1603 must be used first in order to merge local changes with changes made
1606 .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
1608 Send new changes to a remote repository.
1610 .Ar remote-repository
1614 The remote repository's URL is obtained from the corresponding entry in
1618 file of the local repository, as created by
1621 All objects corresponding to new changes will be written to a temporary
1622 pack file which is then uploaded to the server.
1623 Upon success, references in the
1625 reference namespace of the local repository will be updated to point at
1626 the commits which have been sent.
1628 By default, changes will only be sent if they are based on up-to-date
1629 copies of relevant branches in the remote repository.
1630 If any changes to be sent are based on out-of-date copies or would
1631 otherwise break linear history of existing branches, new changes must
1632 be fetched from the server with
1634 and local branches must be rebased with
1641 option can be used to make exceptions to these requirements.
1648 Send all branches from the local repository's
1650 reference namespace.
1653 option is equivalent to listing all branches with multiple
1656 Cannot be used together with the
1662 from the local repository's
1664 reference namespace.
1665 This option may be specified multiple times to build a list of branches
1667 If this option is not specified, default to the work tree's current branch
1668 if invoked in a work tree, or to the repository's HEAD reference.
1669 Cannot be used together with the
1673 Delete the specified
1675 from the remote repository's
1677 reference namespace.
1678 This option may be specified multiple times to build a list of branches
1681 Only references are deleted.
1682 Any commit, tree, tag, and blob objects belonging to deleted branches
1683 may become subject to deletion by Git's garbage collector running on
1686 Requesting deletion of branches results in an error if the server
1687 does not support this feature or disallows the deletion of branches
1688 based on its configuration.
1690 Attempt to force the server to overwrite existing branches or tags
1691 in the remote repository, even when
1695 would usually be required before changes can be sent.
1696 The server may reject forced requests regardless, depending on its
1699 Any commit, tree, tag, and blob objects belonging to overwritten branches
1700 or tags may become subject to deletion by Git's garbage collector running
1705 reference namespace is globally shared between all repositories.
1708 option to overwrite tags is discouraged because it can lead to
1709 inconsistencies between the tags present in different repositories.
1710 In general, creating a new tag with a different name is recommended
1711 instead of overwriting an existing tag.
1715 option is particularly discouraged if changes being sent are based
1716 on an out-of-date copy of a branch in the remote repository.
1717 Instead of using the
1719 option, new changes should
1722 and local branches should be rebased with
1724 followed by another attempt to send the changes.
1728 option should only be needed in situations where the remote repository's
1729 copy of a branch or tag is known to be out-of-date and is considered
1731 The risks of creating inconsistencies between different repositories
1732 should also be taken into account.
1733 .It Fl r Ar repository-path
1734 Use the repository at the specified path.
1735 If not specified, assume the repository is located at or above the current
1737 If this directory is a
1739 work tree, use the repository path associated with this work tree.
1743 from the local repository's
1745 reference namespace, in addition to any branches that are being sent.
1748 option may be specified multiple times to build a list of tags to send.
1749 No tags will be sent if the
1753 Raise an error if the specified
1755 already exists in the remote repository, unless the
1757 option is used to overwrite the server's copy of the tag.
1758 In general, creating a new tag with a different name is recommended
1759 instead of overwriting an existing tag.
1761 Cannot be used together with the
1765 Attempt to send all tags from the local repository's
1767 reference namespace.
1770 option is equivalent to listing all tags with multiple
1773 Cannot be used together with the
1777 Suppress progress reporting output.
1778 The same option will be passed to
1785 to print debugging messages to standard error output.
1786 The same option will be passed to
1789 Multiple -v options increase the verbosity.
1793 .It Cm cherrypick Ar commit
1795 Merge changes from a single
1800 should be on a different branch than the work tree's base commit.
1801 The expected argument is a reference or a commit ID SHA1 hash.
1802 An abbreviated hash argument will be expanded to a full SHA1 hash
1803 automatically, provided the abbreviation is unique.
1805 Show the status of each affected file, using the following status codes:
1806 .Bl -column YXZ description
1807 .It G Ta file was merged
1808 .It C Ta file was merged and conflicts occurred during merge
1809 .It ! Ta changes destined for a missing file were not merged
1810 .It D Ta file was deleted
1811 .It d Ta file's deletion was prevented by local modifications
1812 .It A Ta new file was added
1813 .It \(a~ Ta changes destined for a non-regular file were not merged
1814 .It ? Ta changes destined for an unversioned file were not merged
1817 The merged changes will appear as local changes in the work tree, which
1820 amended manually or with further
1825 or discarded again with
1829 will refuse to run if certain preconditions are not met.
1830 If the work tree contains multiple base commits, it must first be updated
1831 to a single base commit with
1833 If any relevant files already contain merge conflicts, these
1834 conflicts must be resolved first.
1836 .It Cm backout Ar commit
1838 Reverse-merge changes from a single
1843 should be on the same branch as the work tree's base commit.
1844 The expected argument is a reference or a commit ID SHA1 hash.
1845 An abbreviated hash argument will be expanded to a full SHA1 hash
1846 automatically, provided the abbreviation is unique.
1848 Show the status of each affected file, using the following status codes:
1849 .Bl -column YXZ description
1850 .It G Ta file was merged
1851 .It C Ta file was merged and conflicts occurred during merge
1852 .It ! Ta changes destined for a missing file were not merged
1853 .It D Ta file was deleted
1854 .It d Ta file's deletion was prevented by local modifications
1855 .It A Ta new file was added
1856 .It \(a~ Ta changes destined for a non-regular file were not merged
1857 .It ? Ta changes destined for an unversioned file were not merged
1860 The reverse-merged changes will appear as local changes in the work tree,
1861 which may be viewed with
1863 amended manually or with further
1868 or discarded again with
1872 will refuse to run if certain preconditions are not met.
1873 If the work tree contains multiple base commits, it must first be updated
1874 to a single base commit with
1876 If any relevant files already contain merge conflicts, these
1877 conflicts must be resolved first.
1879 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Oo Fl l Oc Oo Fl X Oc Op Ar branch
1881 Rebase commits on the specified
1883 onto the tip of the current branch of the work tree.
1886 must share common ancestry with the work tree's current branch.
1887 Rebasing begins with the first descendant commit of the youngest
1888 common ancestor commit shared by the specified
1890 and the work tree's current branch, and stops once the tip commit
1897 is used as intended, the specified
1899 represents a local commit history and may already contain changes
1900 that are not yet visible in any other repositories.
1901 The work tree's current branch, which must be set with
1905 operation, represents a branch from a remote repository which shares
1906 a common history with the specified
1908 but has progressed, and perhaps diverged, due to commits added to the
1911 Rebased commits are accumulated on a temporary branch which the work tree
1912 will remain switched to throughout the entire rebase operation.
1913 Commits on this branch represent the same changes with the same log
1914 messages as their counterparts on the original
1916 but with different commit IDs.
1917 Once rebasing has completed successfully, the temporary branch becomes
1918 the new version of the specified
1920 and the work tree is automatically switched to it.
1922 Old commits in their pre-rebase state are automatically backed up in the
1923 .Dq refs/got/backup/rebase
1924 reference namespace.
1925 As long as these references are not removed older versions of rebased
1926 commits will remain in the repository and can be viewed with the
1929 Removal of these references makes objects which become unreachable via
1930 any reference subject to removal by Git's garbage collector or
1931 .Cm gotadmin cleanup .
1933 While rebasing commits, show the status of each affected file,
1934 using the following status codes:
1935 .Bl -column YXZ description
1936 .It G Ta file was merged
1937 .It C Ta file was merged and conflicts occurred during merge
1938 .It ! Ta changes destined for a missing file were not merged
1939 .It D Ta file was deleted
1940 .It d Ta file's deletion was prevented by local modifications
1941 .It A Ta new file was added
1942 .It \(a~ Ta changes destined for a non-regular file were not merged
1943 .It ? Ta changes destined for an unversioned file were not merged
1946 If merge conflicts occur, the rebase operation is interrupted and may
1947 be continued once conflicts have been resolved.
1948 If any files with destined changes are found to be missing or unversioned,
1949 or if files could not be deleted due to differences in deleted content,
1950 the rebase operation will be interrupted to prevent potentially incomplete
1951 changes from being committed to the repository without user intervention.
1952 The work tree may be modified as desired and the rebase operation can be
1953 continued once the changes present in the work tree are considered complete.
1954 Alternatively, the rebase operation may be aborted which will leave
1956 unmodified and the work tree switched back to its original branch.
1958 If a merge conflict is resolved in a way which renders the merged
1959 change into a no-op change, the corresponding commit will be elided
1960 when the rebase operation continues.
1963 will refuse to run if certain preconditions are not met.
1964 If the work tree is not yet fully updated to the tip commit of its
1965 branch, then the work tree must first be updated with
1967 If changes have been staged with
1969 these changes must first be committed with
1973 If the work tree contains local changes, these changes must first be
1980 contains changes to files outside of the work tree's path prefix,
1981 the work tree cannot be used to rebase this branch.
1987 commands will refuse to run while a rebase operation is in progress.
1988 Other commands which manipulate the work tree may be used for
1989 conflict resolution purposes.
1993 is already based on the work tree's current branch, then no commits
1994 need to be rebased and
1996 will simply switch the work tree to the specified
1998 and update files in the work tree accordingly.
2005 Abort an interrupted rebase operation.
2006 If this option is used, no other command-line arguments are allowed.
2008 Continue an interrupted rebase operation.
2009 If this option is used, no other command-line arguments are allowed.
2011 Show a list of past rebase operations, represented by references in the
2012 .Dq refs/got/backup/rebase
2013 reference namespace.
2015 Display the author, date, and log message of each backed up commit,
2016 the object ID of the corresponding post-rebase commit, and
2017 the object ID of their common ancestor commit.
2018 Given these object IDs,
2025 options can be used to examine the history of either version of the branch,
2030 option can be used to create a new branch from a pre-rebase state if desired.
2034 is specified, only show commits which at some point in time represented this
2036 Otherwise, list all backed up commits for any branches.
2038 If this option is used,
2040 does not require a work tree.
2041 None of the other options can be used together with
2044 Delete backups created by past rebase operations, represented by references
2046 .Dq refs/got/backup/rebase
2047 reference namespace.
2051 is specified, only delete backups which at some point in time represented
2053 Otherwise, delete all references found within
2054 .Dq refs/got/backup/rebase .
2056 Any commit, tree, tag, and blob objects belonging to deleted backups
2057 remain in the repository and may be removed separately with
2058 Git's garbage collector or
2059 .Cm gotadmin cleanup .
2061 If this option is used,
2063 does not require a work tree.
2064 None of the other options can be used together with
2068 .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
2070 Edit commit history between the work tree's current base commit and
2071 the tip commit of the work tree's current branch.
2075 operation, the work tree's current branch must be set with
2077 to the branch which should be edited, unless this branch is already the
2078 current branch of the work tree.
2079 The tip of this branch represents the upper bound (inclusive) of commits
2084 Furthermore, the work tree's base commit
2087 to a point in this branch's commit history where editing should begin.
2088 This commit represents the lower bound (non-inclusive) of commits touched
2093 Editing of commit history is controlled via a
2095 which can be written in an editor based on a template, passed on the
2096 command line, or generated with the
2102 The format of the histedit script is line-based.
2103 Each line in the script begins with a command name, followed by
2104 whitespace and an argument.
2105 For most commands, the expected argument is a commit ID SHA1 hash.
2106 Any remaining text on the line is ignored.
2107 Lines which begin with the
2109 character are ignored entirely.
2111 The available commands are as follows:
2112 .Bl -column YXZ pick-commit
2113 .It pick Ar commit Ta Use the specified commit as it is.
2114 .It edit Ar commit Ta Use the specified commit but once changes have been
2115 merged into the work tree interrupt the histedit operation for amending.
2116 .It fold Ar commit Ta Combine the specified commit with the next commit
2117 listed further below that will be used.
2118 .It drop Ar commit Ta Remove this commit from the edited history.
2119 .It mesg Ar log-message Ta Use the specified single-line log message for
2120 the commit on the previous line.
2121 If the log message argument is left empty, open an editor where a new
2122 log message can be written.
2125 Every commit in the history being edited must be mentioned in the script.
2126 Lines may be re-ordered to change the order of commits in the edited history.
2127 No commit may be listed more than once.
2129 Edited commits are accumulated on a temporary branch which the work tree
2130 will remain switched to throughout the entire histedit operation.
2131 Once history editing has completed successfully, the temporary branch becomes
2132 the new version of the work tree's branch and the work tree is automatically
2135 Old commits in their pre-histedit state are automatically backed up in the
2136 .Dq refs/got/backup/histedit
2137 reference namespace.
2138 As long as these references are not removed older versions of edited
2139 commits will remain in the repository and can be viewed with the
2142 Removal of these references makes objects which become unreachable via
2143 any reference subject to removal by Git's garbage collector or
2144 .Cm gotadmin cleanup .
2146 While merging commits, show the status of each affected file,
2147 using the following status codes:
2148 .Bl -column YXZ description
2149 .It G Ta file was merged
2150 .It C Ta file was merged and conflicts occurred during merge
2151 .It ! Ta changes destined for a missing file were not merged
2152 .It D Ta file was deleted
2153 .It d Ta file's deletion was prevented by local modifications
2154 .It A Ta new file was added
2155 .It \(a~ Ta changes destined for a non-regular file were not merged
2156 .It ? Ta changes destined for an unversioned file were not merged
2159 If merge conflicts occur, the histedit operation is interrupted and may
2160 be continued once conflicts have been resolved.
2161 If any files with destined changes are found to be missing or unversioned,
2162 or if files could not be deleted due to differences in deleted content,
2163 the histedit operation will be interrupted to prevent potentially incomplete
2164 changes from being committed to the repository without user intervention.
2165 The work tree may be modified as desired and the histedit operation can be
2166 continued once the changes present in the work tree are considered complete.
2167 Alternatively, the histedit operation may be aborted which will leave
2168 the work tree switched back to its original branch.
2170 If a merge conflict is resolved in a way which renders the merged
2171 change into a no-op change, the corresponding commit will be elided
2172 when the histedit operation continues.
2175 will refuse to run if certain preconditions are not met.
2176 If the work tree's current branch is not in the
2178 reference namespace, the history of the branch may not be edited.
2179 If the work tree contains multiple base commits, it must first be updated
2180 to a single base commit with
2182 If changes have been staged with
2184 these changes must first be committed with
2188 If the work tree contains local changes, these changes must first be
2193 If the edited history contains changes to files outside of the work tree's
2194 path prefix, the work tree cannot be used to edit the history of this branch.
2201 commands will refuse to run while a histedit operation is in progress.
2202 Other commands which manipulate the work tree may be used, and the
2204 command may be used to commit arbitrary changes to the temporary branch
2205 while the histedit operation is interrupted.
2212 Abort an interrupted histedit operation.
2213 If this option is used, no other command-line arguments are allowed.
2215 Continue an interrupted histedit operation.
2216 If this option is used, no other command-line arguments are allowed.
2218 Interrupt the histedit operation for editing after merging each commit.
2219 This option is a quick equivalent to a histedit script which uses the
2221 command for all commits.
2224 option can only be used when starting a new histedit operation.
2225 If this option is used, no other command-line arguments are allowed.
2227 Fold all commits into a single commit.
2228 This option is a quick equivalent to a histedit script which folds all
2229 commits, combining them all into one commit.
2232 option can only be used when starting a new histedit operation.
2233 If this option is used, no other command-line arguments are allowed.
2234 .It Fl F Ar histedit-script
2237 instead of opening a temporary file in an editor where a histedit script
2240 Edit log messages only.
2241 This option is a quick equivalent to a histedit script which edits
2242 only log messages but otherwise leaves every picked commit as-is.
2245 option can only be used when starting a new histedit operation.
2246 If this option is used, no other command-line arguments are allowed.
2248 Show a list of past histedit operations, represented by references in the
2249 .Dq refs/got/backup/histedit
2250 reference namespace.
2252 Display the author, date, and log message of each backed up commit,
2253 the object ID of the corresponding post-histedit commit, and
2254 the object ID of their common ancestor commit.
2255 Given these object IDs,
2262 options can be used to examine the history of either version of the branch,
2267 option can be used to create a new branch from a pre-histedit state if desired.
2271 is specified, only show commits which at some point in time represented this
2273 Otherwise, list all backed up commits for any branches.
2275 If this option is used,
2277 does not require a work tree.
2278 None of the other options can be used together with
2281 Delete backups created by past histedit operations, represented by references
2283 .Dq refs/got/backup/histedit
2284 reference namespace.
2288 is specified, only delete backups which at some point in time represented
2290 Otherwise, delete all references found within
2291 .Dq refs/got/backup/histedit .
2293 Any commit, tree, tag, and blob objects belonging to deleted backups
2294 remain in the repository and may be removed separately with
2295 Git's garbage collector or
2296 .Cm gotadmin cleanup .
2298 If this option is used,
2300 does not require a work tree.
2301 None of the other options can be used together with
2305 .It Cm integrate Ar branch
2307 Integrate the specified
2309 into the work tree's current branch.
2310 Files in the work tree are updated to match the contents on the integrated
2312 and the reference of the work tree's branch is changed to point at the
2313 head commit of the integrated
2316 Both branches can be considered equivalent after integration since they
2317 will be pointing at the same commit.
2318 Both branches remain available for future work, if desired.
2319 In case the integrated
2321 is no longer needed it may be deleted with
2324 Show the status of each affected file, using the following status codes:
2325 .Bl -column YXZ description
2326 .It U Ta file was updated
2327 .It D Ta file was deleted
2328 .It A Ta new file was added
2329 .It \(a~ Ta versioned file is obstructed by a non-regular file
2330 .It ! Ta a missing versioned file was restored
2334 will refuse to run if certain preconditions are not met.
2335 Most importantly, the
2337 must have been rebased onto the work tree's current branch with
2339 before it can be integrated, in order to linearize commit history and
2340 resolve merge conflicts.
2341 If the work tree contains multiple base commits, it must first be updated
2342 to a single base commit with
2344 If changes have been staged with
2346 these changes must first be committed with
2350 If the work tree contains local changes, these changes must first be
2356 .It Cm merge Oo Fl a Oc Oo Fl c Oc Oo Fl n Oc Op Ar branch
2358 Create a merge commit based on the current branch of the work tree and
2361 If a linear project history is desired, then use of
2363 should be preferred over
2365 However, even strictly linear projects may require merge commits in order
2366 to merge in new versions of third-party code stored on vendor branches
2370 Merge commits are commits based on multiple parent commits.
2371 The tip commit of the work tree's current branch, which must be set with
2375 operation, will be used as the first parent.
2376 The tip commit of the specified
2378 will be used as the second parent.
2380 No ancestral relationship between the two branches is required.
2381 If the two branches have already been merged previously, only new changes
2384 It is not possible to create merge commits with more than two parents.
2385 If more than one branch needs to be merged, then multiple merge commits
2386 with two parents each can be created in sequence.
2388 While merging changes found on the
2390 into the work tree, show the status of each affected file,
2391 using the following status codes:
2392 .Bl -column YXZ description
2393 .It G Ta file was merged
2394 .It C Ta file was merged and conflicts occurred during merge
2395 .It ! Ta changes destined for a missing file were not merged
2396 .It D Ta file was deleted
2397 .It d Ta file's deletion was prevented by local modifications
2398 .It A Ta new file was added
2399 .It \(a~ Ta changes destined for a non-regular file were not merged
2400 .It ? Ta changes destined for an unversioned file were not merged
2403 If merge conflicts occur, the merge operation is interrupted and conflicts
2404 must be resolved before the merge operation can continue.
2405 If any files with destined changes are found to be missing or unversioned,
2406 or if files could not be deleted due to differences in deleted content,
2407 the merge operation will be interrupted to prevent potentially incomplete
2408 changes from being committed to the repository without user intervention.
2409 The work tree may be modified as desired and the merge can be continued
2410 once the changes present in the work tree are considered complete.
2411 Alternatively, the merge operation may be aborted which will leave
2412 the work tree's current branch unmodified.
2414 If a merge conflict is resolved in a way which renders all merged
2415 changes into no-op changes, the merge operation cannot continue
2416 and must be aborted.
2419 will refuse to run if certain preconditions are not met.
2422 is based on the work tree's current branch, then no merge commit can
2425 may be used to integrate the
2428 If the work tree is not yet fully updated to the tip commit of its
2429 branch, then the work tree must first be updated with
2431 If the work tree contains multiple base commits, it must first be updated
2432 to a single base commit with
2434 If changes have been staged with
2436 these changes must first be committed with
2440 If the work tree contains local changes, these changes must first be
2447 contains changes to files outside of the work tree's path prefix,
2448 the work tree cannot be used to merge this branch.
2458 commands will refuse to run while a merge operation is in progress.
2459 Other commands which manipulate the work tree may be used for
2460 conflict resolution purposes.
2467 Abort an interrupted merge operation.
2468 If this option is used, no other command-line arguments are allowed.
2470 Continue an interrupted merge operation.
2471 If this option is used, no other command-line arguments are allowed.
2473 Merge changes into the work tree as usual but do not create a merge
2475 The merge result can be adjusted as desired before a merge commit is
2478 Alternatively, the merge may be aborted with
2482 .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 ...
2484 Stage local changes for inclusion in the next commit.
2487 is specified, stage all changes in the work tree.
2488 Otherwise, stage changes at or within the specified paths.
2489 Paths may be staged if they are added, modified, or deleted according to
2492 Show the status of each affected file, using the following status codes:
2493 .Bl -column YXZ description
2494 .It A Ta file addition has been staged
2495 .It M Ta file modification has been staged
2496 .It D Ta file deletion has been staged
2499 Staged file contents are saved in newly created blob objects in the repository.
2500 These blobs will be referred to by tree objects once staged changes have been
2503 Staged changes affect the behaviour of
2508 While paths with staged changes exist, the
2510 command will refuse to commit any paths which do not have staged changes.
2511 Local changes created on top of staged changes can only be committed if
2512 the path is staged again, or if the staged changes are committed first.
2515 command will show both local changes and staged changes.
2518 command is able to display local changes relative to staged changes,
2519 and to display staged changes relative to the repository.
2522 command cannot revert staged changes but may be used to revert
2523 local changes created on top of staged changes.
2530 Instead of staging new changes, list paths which are already staged,
2531 along with the IDs of staged blob objects and stage status codes.
2532 If paths were provided on the command line, show the staged paths
2533 among the specified paths.
2534 Otherwise, show all staged paths.
2536 Instead of staging the entire content of a changed file, interactively
2537 select or reject changes for staging based on
2541 (reject change), and
2543 (quit staging this file) responses.
2544 If a file is in modified status, individual patches derived from the
2545 modified file content can be staged.
2546 Files in added or deleted status may only be staged or rejected in
2548 .It Fl F Ar response-script
2556 responses line-by-line from the specified
2558 file instead of prompting interactively.
2560 Allow staging of symbolic links which point outside of the path space
2561 that is under version control.
2564 will reject such symbolic links due to safety concerns.
2567 may decide to represent such a symbolic link as a regular file which contains
2568 the link's target path, rather than creating an actual symbolic link which
2569 points outside of the work tree.
2570 Use of this option is discouraged because external mechanisms such as
2572 are better suited for managing symbolic links to paths not under
2577 will refuse to run if certain preconditions are not met.
2578 If a file contains merge conflicts, these conflicts must be resolved first.
2579 If a file is found to be out of date relative to the head commit on the
2580 work tree's current branch, the file must be updated with
2582 before it can be staged (however, this does not prevent the file from
2583 becoming out-of-date at some point after having been staged).
2590 commands will refuse to run while staged changes exist.
2591 If staged changes cannot be committed because a staged path
2592 is out of date, the path must be unstaged with
2594 before it can be updated with
2596 and may then be staged again if necessary.
2598 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
2600 Merge staged changes back into the work tree and put affected paths
2601 back into non-staged status.
2604 is specified, unstage all staged changes across the entire work tree.
2605 Otherwise, unstage changes at or within the specified paths.
2607 Show the status of each affected file, using the following status codes:
2608 .Bl -column YXZ description
2609 .It G Ta file was unstaged
2610 .It C Ta file was unstaged and conflicts occurred during merge
2611 .It ! Ta changes destined for a missing file were not merged
2612 .It D Ta file was staged as deleted and still is deleted
2613 .It d Ta file's deletion was prevented by local modifications
2614 .It \(a~ Ta changes destined for a non-regular file were not merged
2622 Instead of unstaging the entire content of a changed file, interactively
2623 select or reject changes for unstaging based on
2627 (keep change staged), and
2629 (quit unstaging this file) responses.
2630 If a file is staged in modified status, individual patches derived from the
2631 staged file content can be unstaged.
2632 Files staged in added or deleted status may only be unstaged in their entirety.
2633 .It Fl F Ar response-script
2641 responses line-by-line from the specified
2643 file instead of prompting interactively.
2645 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
2646 Parse and print contents of objects to standard output in a line-based
2648 Content of commit, tree, and tag objects is printed in a way similar
2649 to the actual content stored in such objects.
2650 Blob object contents are printed as they would appear in files on disk.
2652 Attempt to interpret each argument as a reference, a tag name, or
2653 an object ID SHA1 hash.
2654 References will be resolved to an object ID.
2655 Tag names will resolved to a tag object.
2656 An abbreviated hash argument will be expanded to a full SHA1 hash
2657 automatically, provided the abbreviation is unique.
2659 If none of the above interpretations produce a valid result, or if the
2661 option is used, attempt to interpret the argument as a path which will
2662 be resolved to the ID of an object found at this path in the repository.
2669 Look up paths in the specified
2671 If this option is not used, paths are looked up in the commit resolved
2672 via the repository's HEAD reference.
2673 The expected argument is a commit ID SHA1 hash or an existing reference
2674 or tag name which will be resolved to a commit ID.
2675 An abbreviated hash argument will be expanded to a full SHA1 hash
2676 automatically, provided the abbreviation is unique.
2677 .It Fl r Ar repository-path
2678 Use the repository at the specified path.
2679 If not specified, assume the repository is located at or above the current
2681 If this directory is a
2683 work tree, use the repository path associated with this work tree.
2685 Interpret all arguments as paths only.
2686 This option can be used to resolve ambiguity in cases where paths
2687 look like tag names, reference names, or object IDs.
2689 .It Cm info Op Ar path ...
2690 Display meta-data stored in a work tree.
2695 The work tree to use is resolved implicitly by walking upwards from the
2696 current working directory.
2700 arguments are specified, show additional per-file information for tracked
2701 files located at or within these paths.
2704 argument corresponds to the work tree's root directory, display information
2705 for all tracked files.
2708 .Bl -tag -width GOT_AUTHOR
2710 The author's name and email address for
2715 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
2718 may fail to parse commits without an email address in author data,
2722 environment variables with a missing email address.
2724 .Ev GOT_AUTHOR will be overridden by configuration settings in
2730 configuration settings in the repository's
2737 configuration settings contained in Git's global
2739 configuration file will only be used if neither
2743 environment variable provide author information.
2744 .It Ev VISUAL , EDITOR
2745 The editor spawned by
2753 text editor will be spawned in order to give
2755 the attention it deserves.
2756 .It Ev GOT_LOG_DEFAULT_LIMIT
2757 The default limit on the number of commits traversed by
2759 If set to zero, the limit is unbounded.
2760 This variable will be silently ignored if it is set to a non-numeric value.
2763 .Bl -tag -width packed-refs -compact
2765 Repository-wide configuration settings for
2769 configuration file located in the root directory of a Git repository
2770 supersedes any relevant settings in Git's
2774 .It Pa .got/got.conf
2775 Worktree-specific configuration settings for
2779 configuration file in the
2781 meta-data directory of a work tree supersedes any relevant settings in
2784 configuration file and Git's
2791 Enable tab-completion of
2796 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
2798 Clone an existing Git repository for use with
2802 .Dl $ got clone ssh://git@github.com/openbsd/src.git
2804 Use of HTTP URLs currently requires
2808 .Dl $ git clone --bare https://github.com/openbsd/src.git
2810 Alternatively, for quick and dirty local testing of
2812 a new Git repository could be created and populated with files,
2813 e.g. from a temporary CVS checkout located at
2816 .Dl $ got init /var/git/src.git
2817 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
2819 Check out a work tree from the Git repository to /usr/src:
2821 .Dl $ got checkout /var/git/src.git /usr/src
2823 View local changes in a work tree directory:
2825 .Dl $ got diff | less
2827 In a work tree, display files in a potentially problematic state:
2829 .Dl $ got status -s 'C!~?'
2831 Interactively revert selected local changes in a work tree directory:
2833 .Dl $ got revert -p -R\ .
2835 In a work tree or a git repository directory, list all branch references:
2839 In a work tree or a git repository directory, create a new branch called
2840 .Dq unified-buffer-cache
2841 which is forked off the
2845 .Dl $ got branch -c master unified-buffer-cache
2847 Switch an existing work tree to the branch
2848 .Dq unified-buffer-cache .
2849 Local changes in the work tree will be preserved and merged if necessary:
2851 .Dl $ got update -b unified-buffer-cache
2853 Create a new commit from local changes in a work tree directory.
2854 This new commit will become the head commit of the work tree's current branch:
2858 In a work tree or a git repository directory, view changes committed in
2859 the 3 most recent commits to the work tree's branch, or the branch resolved
2860 via the repository's HEAD reference, respectively:
2862 .Dl $ got log -p -l 3
2864 As above, but display changes in the order in which
2866 could apply them in sequence:
2868 .Dl $ got log -p -l 3 -R
2870 In a work tree or a git repository directory, log the history of a subdirectory:
2872 .Dl $ got log sys/uvm
2874 While operating inside a work tree, paths are specified relative to the current
2875 working directory, so this command will log the subdirectory
2878 .Dl $ cd sys/uvm && got log\ .
2880 And this command has the same effect:
2882 .Dl $ cd sys/dev/usb && got log ../../uvm
2884 And this command displays work tree meta-data about all tracked files:
2887 .Dl $ got info\ . | less
2889 Add new files and remove obsolete files in a work tree directory:
2891 .Dl $ got add sys/uvm/uvm_ubc.c
2892 .Dl $ got remove sys/uvm/uvm_vnode.c
2894 Create a new commit from local changes in a work tree directory
2895 with a pre-defined log message.
2897 .Dl $ got commit -m 'unify the buffer cache'
2899 Alternatively, create a new commit from local changes in a work tree
2900 directory with a log message that has been prepared in the file
2903 .Dl $ got commit -F /tmp/msg
2905 Update any work tree checked out from the
2906 .Dq unified-buffer-cache
2907 branch to the latest commit on this branch:
2911 Roll file content on the unified-buffer-cache branch back by one commit,
2912 and then fetch the rolled-back change into the work tree as a local change
2913 to be amended and perhaps committed again:
2915 .Dl $ got backout unified-buffer-cache
2916 .Dl $ got commit -m 'roll back previous'
2917 .Dl $ # now back out the previous backout :-)
2918 .Dl $ got backout unified-buffer-cache
2920 Fetch new changes on the remote repository's
2922 branch, making them visible on the local repository's
2929 In a repository created with a HTTP URL and
2930 .Cm git clone --bare
2933 command must be used instead:
2935 .Dl $ cd /var/git/src.git
2936 .Dl $ git fetch origin master:refs/remotes/origin/master
2940 branch to merge the new changes that are now visible on the
2945 .Dl $ got update -b origin/master
2946 .Dl $ got rebase master
2949 .Dq unified-buffer-cache
2950 branch on top of the new head commit of the
2954 .Dl $ got update -b master
2955 .Dl $ got rebase unified-buffer-cache
2957 Create a patch from all changes on the unified-buffer-cache branch.
2958 The patch can be mailed out for review and applied to
2962 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2964 Edit the entire commit history of the
2965 .Dq unified-buffer-cache
2968 .Dl $ got update -b unified-buffer-cache
2969 .Dl $ got update -c master
2972 Before working against existing branches in a repository cloned with
2973 .Cm git clone --bare
2978 must be configured to map all references in the remote repository
2981 namespace of the local repository.
2982 This can be achieved by setting Git's
2983 .Pa remote.origin.fetch
2984 configuration variable to the value
2985 .Dq +refs/heads/*:refs/remotes/origin/*
2990 .Dl $ cd /var/git/repo
2991 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2995 option must be disabled:
2997 .Dl $ cd /var/git/repo
2998 .Dl $ git config remote.origin.mirror false
3000 Alternatively, the following
3002 configuration item can be added manually to the Git repository's
3006 .Dl [remote \&"origin\&"]
3008 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
3011 This configuration leaves the local repository's
3013 namespace free for use by local branches checked out with
3015 and, if needed, created with
3018 .Dq refs/remotes/origin
3019 namespace can now be updated with incoming changes from the remote
3024 without extra command line arguments.
3025 Newly fetched changes can be examined with
3028 Display changes on the remote repository's version of the
3030 branch, as of the last time
3034 .Dl $ got log -c origin/master | less
3036 As shown here, most commands accept abbreviated reference names such as
3039 .Dq refs/remotes/origin/master .
3040 The latter is only needed in case of ambiguity.
3043 must be used to merge changes which are visible on the
3048 This will also merge local changes, if any, with the incoming changes:
3050 .Dl $ got update -b origin/master
3051 .Dl $ got rebase master
3053 In order to make changes committed to the
3054 .Dq unified-buffer-cache
3058 .Dq unified-buffer-cache
3059 branch must first be rebased onto the
3063 .Dl $ got update -b master
3064 .Dl $ got rebase unified-buffer-cache
3067 .Dq unified-buffer-cache
3068 branch can now be made visible on the
3072 Because the rebase operation switched the work tree to the
3073 .Dq unified-buffer-cache
3074 branch, the work tree must be switched back to the
3078 .Dl $ got update -b master
3079 .Dl $ got integrate unified-buffer-cache
3083 branch, log messages for local changes can now be amended with
3085 by other developers and any other important new information:
3087 .Dl $ got update -c origin/master
3088 .Dl $ got histedit -m
3090 If the remote repository offers write access, local changes on the
3092 branch can be sent to the remote repository with
3096 can be run without further arguments.
3097 The arguments shown here match defaults, provided the work tree's
3098 current branch is the
3102 .Dl $ got send -b master origin
3104 If the remote repository requires the HTTPS protocol, the
3106 command must be used instead:
3108 .Dl $ cd /var/git/src.git
3109 .Dl $ git push origin master
3113 .Xr git-repository 5 ,
3114 .Xr got-worktree 5 ,
3117 .An Stefan Sperling Aq Mt stsp@openbsd.org
3118 .An Martin Pieuchot Aq Mt mpi@openbsd.org
3119 .An Joshua Stein Aq Mt jcs@openbsd.org
3120 .An Ori Bernstein Aq Mt ori@openbsd.org
3123 is a work-in-progress and some features remain to be implemented.
3125 At present, the user has to fall back on
3127 to perform some tasks.
3131 Reading from remote repositories over HTTP or HTTPS protocols requires
3136 Writing to remote repositories over HTTP or HTTPS protocols requires
3139 The creation of merge commits with more than two parent commits requires
3142 In situations where files or directories were moved around
3144 will not automatically merge changes to new locations and
3146 will usually produce better results.