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
71 .Op Fl r Ar repository-path
75 Create an initial commit in a repository from the file hierarchy
78 The created commit will not have any parent commits, i.e. it will be a
80 Also create a new reference which provides a branch name for the newly
82 Show the path of each imported file to indicate progress.
88 environment variable to be set,
89 unless an author has been configured in
95 configuration settings can be obtained from the repository's
97 file or from Git's global
108 If this option is not specified, a branch corresponding to the repository's
109 HEAD reference will be used.
110 Use of this option is required if the branch resolved via the repository's
111 HEAD reference already exists.
113 Ignore files or directories with a name which matches the specified
115 This option may be specified multiple times to build a list of ignore patterns.
118 follows the globbing rules documented in
120 Ignore patterns which end with a slash,
122 will only match directories.
124 Use the specified log message when creating the new commit.
129 opens a temporary file in an editor where a log message can be written.
130 Quitting the editor without saving the file will abort the import operation.
131 .It Fl r Ar repository-path
132 Use the repository at the specified path.
133 If not specified, assume the repository is located at or above the current
141 .Op Fl R Ar reference
146 Clone a Git repository at the specified
152 is specified, the directory name will be derived from the name of the
155 will refuse to run if the
161 specifies a protocol scheme, a server hostname, an optional port number
162 separated from the hostname by a colon, and a path to the repository on
164 .Lk scheme://hostname:port/path/to/repository
166 The following protocol schemes are supported:
167 .Bl -tag -width git+ssh
169 The Git protocol as implemented by the
172 Use of this protocol is discouraged since it supports neither authentication
175 The Git protocol wrapped in an authenticated and encrypted
178 With this protocol the hostname may contain an embedded username for
183 Short alias for git+ssh.
186 Objects in the cloned repository are stored in a pack file which is downloaded
188 This pack file will then be indexed to facilitate access to the objects stored
190 If any objects in the pack file are stored in deltified form, all deltas will
191 be fully resolved in order to compute the ID of such objects.
192 This can take some time.
193 More details about the pack file format are documented in
194 .Xr git-repository 5 .
197 creates a remote repository entry in the
201 files of the cloned repository to store the
207 arguments for future use by
217 Fetch all branches from the remote repository's
219 reference namespace and set
220 .Cm fetch_all_branches
221 in the cloned repository's
223 file for future use by
225 If this option is not specified, a branch resolved via the remote
226 repository's HEAD reference will be fetched.
227 Cannot be used together with the
233 from the remote repository's
236 This option may be specified multiple times to build a list of branches
238 If the branch corresponding to the remote repository's HEAD reference is not
239 in this list, the cloned repository's HEAD reference will be set to the first
240 branch which was fetched.
241 If this option is not specified, a branch resolved via the remote
242 repository's HEAD reference will be fetched.
243 Cannot be used together with the
247 List branches and tags available for fetching from the remote repository
248 and exit immediately.
249 Cannot be used together with any of the other options except
254 Create the cloned repository as a mirror of the original repository.
255 This is useful if the cloned repository will not be used to store
256 locally created commits.
262 files will be set up with the
264 option enabled, such that
268 will write incoming changes directly to branches in the
270 reference namespace, rather than to branches in the
273 This avoids the usual requirement of having to run
279 in order to make incoming changes appear on branches in the
282 But maintaining custom changes in the cloned repository becomes difficult
283 since such changes will be at risk of being discarded whenever incoming
286 Suppress progress reporting output.
287 The same option will be passed to
290 .It Fl R Ar reference
291 In addition to the branches and tags that will be fetched, fetch an arbitrary
293 from the remote repository's
296 This option may be specified multiple times to build a list of additional
300 may either be a path to a specific reference, or a reference namespace
301 which will cause all references in this namespace to be fetched.
303 Each reference will be mapped into the cloned repository's
305 namespace, unless the
307 option is used to mirror references directly into the cloned repository's
312 will refuse to fetch references from the remote repository's
321 to print debugging messages to standard error output.
322 This option will be passed to
325 Multiple -v options increase the verbosity.
333 .Op Fl R Ar reference
334 .Op Fl r Ar repository-path
335 .Op Ar remote-repository
338 Fetch new changes from a remote repository.
340 .Ar remote-repository
344 The remote repository's URL is obtained from the corresponding entry in
348 file of the local repository, as created by
351 By default, any branches configured in
354 .Ar remote-repository
358 is invoked in a work tree then this work tree's current branch will be
359 fetched, too, provided it is present on the server.
360 If no branches to fetch can be found in
362 or via a work tree, or said branches are not found on the server, a branch
363 resolved via the remote repository's HEAD reference will be fetched.
364 Likewise, if a HEAD reference for the
365 .Ar remote-repository
366 exists but its target no longer matches the remote HEAD, then
367 the new target branch will be fetched.
368 This default behaviour can be overridden with the
374 New changes will be stored in a separate pack file downloaded from the server.
375 Optionally, separate pack files stored in the repository can be combined with
378 By default, branch references in the
380 reference namespace will be updated to point at the newly fetched commits.
385 command can then be used to make new changes visible on branches in the
387 namespace, merging incoming changes with the changes on those branches
390 If the repository was created as a mirror with
392 then all branches in the
394 namespace will be updated directly to match the corresponding branches in
395 the remote repository.
396 If those branches contained local commits, these commits will no longer be
397 reachable via a reference and will therefore be at risk of being discarded
398 by Git's garbage collector or
399 .Cm gotadmin cleanup .
400 Maintaining custom changes in a mirror repository is therefore discouraged.
402 In any case, references in the
404 namespace will always be fetched and mapped directly to local references
405 in the same namespace.
412 Fetch all branches from the remote repository's
415 This option can be enabled by default for specific repositories in
417 Cannot be used together with the
423 from the remote repository's
426 This option may be specified multiple times to build a list of branches
428 Cannot be used together with the
432 Delete branches and tags from the local repository which are no longer
433 present in the remote repository.
434 Only references are deleted.
435 Any commit, tree, tag, and blob objects belonging to deleted branches or
436 tags remain in the repository and may be removed separately with
437 Git's garbage collector or
438 .Cm gotadmin cleanup .
440 List branches and tags available for fetching from the remote repository
441 and exit immediately.
442 Cannot be used together with any of the other options except
448 Suppress progress reporting output.
449 The same option will be passed to
452 .It Fl R Ar reference
453 In addition to the branches and tags that will be fetched, fetch an arbitrary
455 from the remote repository's
458 This option may be specified multiple times to build a list of additional
462 may either be a path to a specific reference, or a reference namespace
463 which will cause all references in this namespace to be fetched.
465 Each reference will be mapped into the local repository's
467 namespace, unless the local repository was created as a mirror with
469 in which case references will be mapped directly into the local repository's
473 Once a reference has been fetched, a branch based on it can be created with
478 will refuse to fetch references from the remote repository's
483 .It Fl r Ar repository-path
484 Use the repository at the specified path.
485 If not specified, assume the repository is located at or above the current
487 If this directory is a
489 work tree, use the repository path associated with this work tree.
491 Allow existing references in the
493 namespace to be updated if they have changed on the server.
494 If not specified, only new tag references will be created.
499 to print debugging messages to standard error output.
500 The same option will be passed to
503 Multiple -v options increase the verbosity.
506 Delete all references which correspond to a particular
507 .Ar remote-repository
508 instead of fetching new changes.
509 This can be useful when a remote repository is being removed from
515 .Ar remote-repository
516 argument is mandatory and no other options except
523 Only references are deleted.
524 Any commit, tree, tag, and blob objects fetched from a remote repository
525 will generally be stored in pack files and may be removed separately with
527 and Git's garbage collector.
535 .Op Fl p Ar path-prefix
537 .Op Ar work-tree-path
540 Copy files from a repository into a new work tree.
541 Show the status of each affected file, using the following status codes:
542 .Bl -column YXZ description
543 .It A Ta new file was added
544 .It E Ta file already exists in work tree's meta-data
549 is not specified, either use the last component of
550 .Ar repository path ,
553 was specified use the last component of
561 Check out files from a commit on the specified
563 If this option is not specified, a branch resolved via the repository's HEAD
564 reference will be used.
566 Check out files from the specified
568 on the selected branch.
569 If this option is not specified, the most recent commit on the selected
574 argument is a commit ID SHA1 hash, or a reference name or a keyword
575 which will be resolved to a commit ID.
576 An abbreviated hash argument will be expanded to a full SHA1 hash
577 automatically, provided the abbreviation is unique.
582 resolve to the repository's HEAD reference, or, if the
584 option is used, the head of the checked-out
586 Keywords and reference names may be appended with
590 modifiers and an optional integer N to denote the
591 Nth descendant or antecedent by first parent traversal, respectively;
594 denotes the work tree branch head's 2nd generation ancestor, and
596 will denote the 3rd generation ancestor of the commit resolved by the
599 If an integer does not follow the
605 is implicitly appended
614 is not contained in the selected branch, a different branch which contains
615 this commit must be specified with the
618 If no such branch is known, a new branch must be created for this
624 Checking out work trees with an unknown branch is intentionally not supported.
626 Proceed with the checkout operation even if the directory at
629 Existing files will be left intact.
630 .It Fl p Ar path-prefix
631 Restrict the work tree to a subset of the repository's tree hierarchy.
632 Only files beneath the specified
636 Silence progress output.
647 Update an existing work tree to a different
649 Change existing files in the work tree as necessary to match file contents
651 Preserve any local changes in the work tree and merge them with the
654 Files which already contain merge conflicts will not be updated to avoid
655 further complications.
656 Such files will be updated when
658 is run again after merge conflicts have been resolved.
659 If the conflicting changes are no longer needed, affected files can be
666 Show the status of each affected file, using the following status codes:
667 .Bl -column YXZ description
668 .It U Ta file was updated and contained no local changes
669 .It G Ta file was updated and local changes were merged cleanly
670 .It C Ta file was updated and conflicts occurred during merge
671 .It D Ta file was deleted
672 .It d Ta file's deletion was prevented by local modifications
673 .It A Ta new file was added
674 .It \(a~ Ta versioned file is obstructed by a non-regular file
675 .It ! Ta a missing versioned file was restored
676 .It # Ta file was not updated because it contains merge conflicts
677 .It ? Ta changes destined for an unversioned file were not merged
682 is specified, update the entire work tree.
683 Otherwise, restrict the update operation to files at or within the
685 Each path is required to exist in the update operation's target commit.
686 Files in the work tree outside specified paths will remain unchanged and
687 will retain their previously recorded base commit.
690 commands may refuse to run while the work tree contains files from
691 multiple base commits.
692 The base commit of such a work tree can be made consistent by running
694 across the entire work tree.
697 is incompatible with the
702 cannot update paths with staged changes.
703 If changes have been staged with
705 these changes must first be committed with
715 Switch the work tree's branch reference to the specified
717 before updating the work tree.
718 This option requires that all paths in the work tree are updated.
720 As usual, any local changes in the work tree will be preserved.
721 This can be useful when switching to a newly created branch in order
722 to commit existing local changes to this branch.
724 Any local changes must be dealt with separately in order to obtain a
725 work tree with pristine file contents corresponding exactly to the specified
727 Such changes could first be committed to a different branch with
729 or could be discarded with
732 Update the work tree to the specified
734 If this option is not specified, the most recent commit on the work tree's
739 argument is a commit ID SHA1 hash, or a reference name or a keyword
740 which will be resolved to a commit ID.
741 An abbreviated hash argument will be expanded to a full SHA1 hash
742 automatically, provided the abbreviation is unique.
747 resolve to the work tree's base commit and branch head, respectively.
748 Keywords and reference names may be appended with
752 modifiers and an optional integer N to denote the
753 Nth descendant or antecedent, respectively, by first parent traversal;
756 denotes the work tree branch head's 2nd generation ancestor, and
758 denotes the 4th generation descendant of the work tree's base commit.
761 will denote the 3rd generation ancestor of the commit resolved by the
764 If an integer does not follow the
770 is implicitly appended
777 Silence progress output.
783 .Op Fl S Ar status-codes
784 .Op Fl s Ar status-codes
788 Show the current modification status of files in a work tree,
789 using the following status codes:
790 .Bl -column YXZ description
791 .It M Ta modified file
792 .It A Ta file scheduled for addition in next commit
793 .It D Ta file scheduled for deletion in next commit
794 .It C Ta modified or added file which contains merge conflicts
795 .It ! Ta versioned file was expected on disk but is missing
796 .It \(a~ Ta versioned file is obstructed by a non-regular file
797 .It ? Ta unversioned item not tracked by
799 .It m Ta modified file modes (executable bit only)
800 .It N Ta non-existent
802 specified on the command line
807 is specified, show modifications in the entire work tree.
808 Otherwise, show modifications at or within the specified paths.
810 If changes have been staged with
812 staged changes are shown in the second output column, using the following
814 .Bl -column YXZ description
815 .It M Ta file modification is staged
816 .It A Ta file addition is staged
817 .It D Ta file deletion is staged
820 Changes created on top of staged changes are indicated in the first column:
821 .Bl -column YXZ description
822 .It MM Ta file was modified after earlier changes have been staged
823 .It MA Ta file was modified after having been staged for addition
831 Show unversioned files even if they match an ignore pattern.
832 .It Fl S Ar status-codes
833 Suppress the output of files with a modification status matching any of the
834 single-character status codes contained in the
837 Any combination of codes from the above list of possible status codes
839 For staged files, status codes displayed in either column will be matched.
840 Cannot be used together with the
843 .It Fl s Ar status-codes
844 Only show files with a modification status matching any of the
845 single-character status codes contained in the
848 Any combination of codes from the above list of possible status codes
850 For staged files, status codes displayed in either column will be matched.
851 Cannot be used together with the
856 For compatibility with
867 files in each traversed directory and will not display unversioned files
868 which match these patterns.
869 Ignore patterns which end with a slash,
871 will only match directories.
876 supports consecutive asterisks,
878 which will match an arbitrary amount of directories.
882 only supports a single ignore pattern per line.
886 does not support negated ignore patterns prefixed with
888 and gives no special significance to the location of path component separators,
897 .Op Fl r Ar repository-path
898 .Op Fl S Ar search-pattern
902 Display history of a repository.
905 is specified, show only commits which modified this path.
906 If invoked in a work tree, the
908 is interpreted relative to the current working directory,
909 and the work tree's path prefix is implicitly prepended.
910 Otherwise, the path is interpreted relative to the repository root.
917 Display individual commits which were merged into the current branch
921 shows the linear history of the current branch only.
923 Set the number of context lines shown in diffs with
925 By default, 3 lines of context are shown.
927 Start traversing history at the specified
929 If this option is not specified, default to the work tree's current branch
930 if invoked in a work tree, or to the repository's HEAD reference.
934 argument is a commit ID SHA1 hash, or a reference name or a keyword
935 which will be resolved to a commit ID.
936 An abbreviated hash argument will be expanded to a full SHA1 hash
937 automatically, provided the abbreviation is unique.
942 resolve to the work tree's base commit and branch head, respectively.
943 The former is only valid if invoked in a work tree, while the latter will
944 resolve to the tip of the work tree's current branch if invoked in a
945 work tree, otherwise it will resolve to the repository's HEAD reference.
946 Keywords and references may be appended with
950 modifiers and an optional integer N to denote the
951 Nth descendant or antecedent, respectively, by first parent traversal;
954 denotes the HEAD reference's 2nd generation ancestor, and
956 denotes the 4th generation descendant of the work tree's base commit.
959 will denote the 3rd generation descendant of the commit resolved by the
966 modifier without a trailing integer has an implicit
975 Display diffstat of changes introduced in each commit.
976 Cannot be used with the
980 Limit history traversal to a given number of commits.
981 If this option is not specified, a default limit value of zero is used,
982 which is treated as an unbounded limit.
984 .Ev GOT_LOG_DEFAULT_LIMIT
985 environment variable may be set to change this default value.
987 Display the list of file paths changed in each commit, using the following
989 .Bl -column YXZ description
990 .It M Ta modified file
991 .It D Ta file was deleted
992 .It A Ta new file was added
993 .It m Ta modified file modes (executable bit only)
996 Cannot be used with the
1000 Display the patch of modifications made in each commit.
1003 is specified, only show the patch of modifications at or within this path.
1004 Cannot be used with the
1008 Determine a set of commits to display as usual, but display these commits
1010 .It Fl r Ar repository-path
1011 Use the repository at the specified path.
1012 If not specified, assume the repository is located at or above the current
1014 If this directory is a
1016 work tree, use the repository path associated with this work tree.
1017 .It Fl S Ar search-pattern
1018 If specified, show only commits with a log message, author name,
1019 committer name, or ID SHA1 hash matched by the extended regular
1021 .Ar search-pattern .
1022 Lines in committed patches will be matched if
1025 File paths changed by a commit will be matched if
1028 Regular expression syntax is documented in
1031 Display a short one-line summary of each commit, instead of the default
1033 Cannot be used together with the
1039 Stop traversing commit history immediately after the specified
1042 This option has no effect if the specified
1052 .Op Fl r Ar repository-path
1053 .Op Ar object1 Ar object2 | Ar path ...
1056 When invoked within a work tree without any arguments, display all
1057 local changes in the work tree.
1060 arguments are specified, only show changes within the specified paths.
1062 If two arguments are provided, treat each argument as a reference, a tag
1063 name, or an object ID SHA1 hash, and display differences between the
1064 corresponding objects.
1065 Both objects must be of the same type (blobs, trees, or commits).
1066 An abbreviated hash argument will be expanded to a full SHA1 hash
1067 automatically, provided the abbreviation is unique.
1068 If none of these interpretations produce a valid result or if the
1073 is running in a work tree, attempt to interpret the two arguments as paths.
1080 Treat file contents as ASCII text even if binary data is detected.
1082 Set the number of context lines shown in the diff.
1083 By default, 3 lines of context are shown.
1085 Show differences between commits in the repository.
1086 This option may be used up to two times.
1087 When used only once, show differences between the specified
1089 and its first parent commit.
1090 When used twice, show differences between the two specified commits.
1094 option is used, all non-option arguments will be interpreted as paths.
1097 arguments are provided, only show differences for the specified paths.
1101 argument is a commit ID SHA1 hash, or a reference name or a keyword
1102 which will be resolved to a commit ID.
1103 An abbreviated hash argument will be expanded to a full SHA1 hash
1104 automatically, provided the abbreviation is unique.
1109 resolve to the work tree's base commit and branch head, respectively.
1110 The former is only valid if invoked in a work tree, while the latter will
1111 resolve to the tip of the work tree's current branch if invoked in a
1112 work tree, otherwise it will resolve to the repository's HEAD reference.
1113 Keywords and references may be appended with
1117 modifiers and an optional integer N to denote the
1118 Nth descendant or antecedent, respectively, by first parent traversal;
1121 denotes the HEAD reference's 2nd generation ancestor, and
1123 denotes the 4th generation descendant of the work tree's base commit.
1126 will denote the 8th generation descendant of the commit resolved by the
1129 If an integer does not follow the
1135 is implicitly appended
1142 Cannot be used together with the
1146 Display diffstat of changes before the actual diff by annotating each file path
1147 or blob hash being diffed with the total number of lines added and removed.
1148 A summary line will display the total number of changes across all files.
1150 Interpret all arguments as paths only.
1151 This option can be used to resolve ambiguity in cases where paths
1152 look like tag names, reference names, or object IDs.
1153 This option is only valid when
1155 is invoked in a work tree.
1156 .It Fl r Ar repository-path
1157 Use the repository at the specified path.
1158 If not specified, assume the repository is located at or above the current
1160 If this directory is a
1162 work tree, use the repository path associated with this work tree.
1164 Show changes staged with
1166 instead of showing local changes in the work tree.
1167 This option is only valid when
1169 is invoked in a work tree.
1171 Ignore whitespace-only changes.
1177 .Op Fl r Ar repository-path
1181 Display line-by-line history of a file at the specified path.
1188 Start traversing history at the specified
1190 The expected argument is a commit ID SHA1 hash or an existing reference
1191 or tag name which will be resolved to a commit ID.
1192 An abbreviated hash argument will be expanded to a full SHA1 hash
1193 automatically, provided the abbreviation is unique.
1201 can also be used to represent the work tree's base commit
1202 and branch head, respectively.
1203 The former is only valid if invoked in a work tree, while the latter will
1204 resolve to the tip of the work tree's current branch if invoked in a
1205 work tree, otherwise it will resolve to the repository's HEAD reference.
1206 Keywords and references may be appended with
1210 modifiers and an optional integer N to denote the
1211 Nth descendant or antecedent by first parent traversal, respectively;
1214 denotes the work tree branch head's 2nd generation ancestor, and
1216 denotes the 4th generation descendant of the work tree's base commit.
1219 will denote the 5th generation ancestor of the commit resolved by the
1226 modifier without a trailing integer has an implicit
1234 .It Fl r Ar repository-path
1235 Use the repository at the specified path.
1236 If not specified, assume the repository is located at or above the current
1238 If this directory is a
1240 work tree, use the repository path associated with this work tree.
1247 .Op Fl r Ar repository-path
1251 Display a listing of files and directories at the specified
1252 directory path in the repository.
1253 Entries shown in this listing may carry one of the following trailing
1255 .Bl -column YXZ description
1256 .It @ Ta entry is a symbolic link
1257 .It / Ta entry is a directory
1258 .It * Ta entry is an executable file
1259 .It $ Ta entry is a Git submodule
1262 Symbolic link entries are also annotated with the target path of the link.
1266 is specified, list the repository path corresponding to the current
1267 directory of the work tree, or the root directory of the repository
1268 if there is no work tree.
1275 List files and directories as they appear in the specified
1277 The expected argument is a commit ID SHA1 hash or an existing reference
1278 or tag name which will be resolved to a commit ID.
1279 An abbreviated hash argument will be expanded to a full SHA1 hash
1280 automatically, provided the abbreviation is unique.
1288 can also be used to represent the work tree's base commit
1289 and branch head, respectively.
1290 The former is only valid if invoked in a work tree, while the latter will
1291 resolve to the tip of the work tree's current branch if invoked in a
1292 work tree, otherwise it will resolve to the repository's HEAD reference.
1293 Keywords and references may be appended with
1297 modifiers and an optional integer N to denote the
1298 Nth descendant or antecedent by first parent traversal, respectively;
1301 denotes the work tree branch head's 2nd generation ancestor, and
1303 denotes the 4th generation descendant of the work tree's base commit.
1306 will denote the 3rd generation ancestor of the commit resolved by the
1313 modifier without a trailing integer has an implicit
1322 Show object IDs of files (blob objects) and directories (tree objects).
1324 Recurse into sub-directories in the repository.
1325 .It Fl r Ar repository-path
1326 Use the repository at the specified path.
1327 If not specified, assume the repository is located at or above the current
1329 If this directory is a
1331 work tree, use the repository path associated with this work tree.
1337 .Op Fl r Ar repository-path
1338 .Op Fl s Ar reference
1341 Manage references in a repository.
1343 References may be listed, created, deleted, and changed.
1344 When creating, deleting, or changing a reference the specified
1346 must be an absolute reference name, i.e. it must begin with
1354 Create a reference or change an existing reference.
1355 The reference with the specified
1357 will point at the specified
1362 argument is an ID SHA1 hash or an existing reference or tag name
1363 or a keyword which will be resolved to the ID of a corresponding commit,
1364 tree, tag, or blob object.
1365 An abbreviated hash argument will be expanded to a full SHA1 hash
1366 automatically, provided the abbreviation is unique.
1371 resolve to the work tree's base commit and branch head, respectively.
1372 The former is only valid if invoked in a work tree, while the latter will
1373 resolve to the tip of the work tree's current branch if invoked in a
1374 work tree, otherwise it will resolve to the repository's HEAD reference.
1375 Keywords and reference names may be appended with
1379 modifiers and an optional integer N to denote the
1380 Nth descendant or antecedent by first parent traversal, respectively;
1383 denotes the work tree branch head's 2nd generation ancestor, and
1385 will denote the 3rd generation ancestor of the commit resolved by the
1388 If an integer does not follow the
1394 is implicitly appended
1401 Cannot be used together with any other options except
1404 Delete the reference with the specified
1406 from the repository.
1407 Any commit, tree, tag, and blob objects belonging to deleted references
1408 remain in the repository and may be removed separately with
1409 Git's garbage collector or
1410 .Cm gotadmin cleanup .
1411 Cannot be used together with any other options except
1414 List references in the repository.
1417 is specified, list all existing references in the repository.
1420 is a reference namespace, list all references in this namespace.
1421 Otherwise, show only the reference with the given
1423 Cannot be used together with any other options except
1427 .It Fl r Ar repository-path
1428 Use the repository at the specified path.
1429 If not specified, assume the repository is located at or above the current
1431 If this directory is a
1433 work tree, use the repository path associated with this work tree.
1434 .It Fl s Ar reference
1435 Create a symbolic reference, or change an existing symbolic reference.
1436 The symbolic reference with the specified
1438 will point at the specified
1440 which must already exist in the repository.
1441 Care should be taken not to create loops between references when
1442 this option is used.
1443 Cannot be used together with any other options except
1446 Sort listed references by modification time (most recently modified first)
1447 instead of sorting by lexicographical order.
1448 Use of this option requires the
1450 option to be used as well.
1458 .Op Fl r Ar repository-path
1462 Create, list, or delete branches.
1464 Local branches are managed via references which live in the
1466 reference namespace.
1469 command creates references in this namespace only.
1471 When deleting branches, the specified
1475 reference namespace first.
1476 If no corresponding branch is found, the
1478 namespace will be searched next.
1480 If invoked in a work tree without any arguments, print the name of the
1481 work tree's current branch.
1485 argument is passed, attempt to create a branch reference with the given name.
1486 By default the new branch reference will point at the latest commit on the
1487 work tree's current branch if invoked in a work tree, and otherwise to a commit
1488 resolved via the repository's HEAD reference.
1490 If invoked in a work tree, once the branch was created successfully
1491 switch the work tree's head reference to the newly created branch and
1492 update files across the entire work tree, just like
1493 .Cm got update -b Ar name
1495 Show the status of each affected file, using the following status codes:
1496 .Bl -column YXZ description
1497 .It U Ta file was updated and contained no local changes
1498 .It G Ta file was updated and local changes were merged cleanly
1499 .It C Ta file was updated and conflicts occurred during merge
1500 .It D Ta file was deleted
1501 .It A Ta new file was added
1502 .It \(a~ Ta versioned file is obstructed by a non-regular file
1503 .It ! Ta a missing versioned file was restored
1511 Make a newly created branch reference point at the specified
1513 The expected argument is a commit ID SHA1 hash, or a reference name or keyword
1514 which will be resolved to a commit ID.
1515 An abbreviated hash argument will be expanded to a full SHA1 hash
1516 automatically, provided the abbreviation is unique.
1521 resolve to the work tree's base commit and branch head, respectively.
1522 The former is only valid if invoked in a work tree, while the latter will
1523 resolve to the tip of the work tree's current branch if invoked in a
1524 work tree, otherwise it will resolve to the repository's HEAD reference.
1525 Keywords and references may be appended with
1529 modifiers and an optional integer N to denote the
1530 Nth descendant or antecedent by first parent traversal, respectively;
1533 denotes the work tree branch head's 2nd generation ancestor, and
1535 denotes the 4th generation descendant of the work tree's base commit.
1538 will denote the 3rd generation descendant of the commit resolved by the
1545 modifier without a trailing integer has an implicit
1554 Delete the branch with the specified
1560 reference namespace.
1562 Only the branch reference is deleted.
1563 Any commit, tree, and blob objects belonging to the branch
1564 remain in the repository and may be removed separately with
1565 Git's garbage collector or
1566 .Cm gotadmin cleanup .
1568 List all existing branches in the repository, including copies of remote
1569 repositories' branches in the
1571 reference namespace.
1573 If invoked in a work tree, the work tree's current branch is shown
1574 with one of the following annotations:
1575 .Bl -column YXZ description
1576 .It * Ta work tree's base commit matches the branch tip
1577 .It \(a~ Ta work tree's base commit is out-of-date
1580 Do not switch and update the work tree after creating a new branch.
1581 .It Fl r Ar repository-path
1582 Use the repository at the specified path.
1583 If not specified, assume the repository is located at or above the current
1585 If this directory is a
1587 work tree, use the repository path associated with this work tree.
1589 Sort listed branches by modification time (most recently modified first)
1590 instead of sorting by lexicographical order.
1593 reference namespace are listed before branches in
1596 Use of this option requires the
1598 option to be used as well.
1605 .Op Fl r Ar repository-path
1606 .Op Fl s Ar signer-id
1609 Manage tags in a repository.
1611 Tags are managed via references which live in the
1613 reference namespace.
1616 command operates on references in this namespace only.
1617 References in this namespace point at tag objects which contain a pointer
1618 to another object, a tag message, as well as author and timestamp information.
1620 Attempt to create a tag with the given
1622 and make this tag point at the given
1624 If no commit is specified, default to the latest commit on the work tree's
1625 current branch if invoked in a work tree, and to a commit resolved via
1626 the repository's HEAD reference otherwise.
1633 Make the newly created tag reference point at the specified
1637 argument is a commit ID SHA1 hash or an existing reference or tag name which
1638 will be resolved to a commit ID.
1639 An abbreviated hash argument will be expanded to a full SHA1 hash
1640 automatically, provided the abbreviation is unique.
1648 can also be used to represent the work tree's base commit
1649 and branch head, respectively.
1650 The former is only valid if invoked in a work tree, while the latter will
1651 resolve to the tip of the work tree's current branch if invoked in a
1652 work tree, otherwise it will resolve to the repository's HEAD reference.
1653 Keywords and references may be appended with
1657 modifiers and an optional integer N to denote the
1658 Nth descendant or antecedent by first parent traversal, respectively;
1661 denotes the work tree branch head's 2nd generation ancestor, and
1663 denotes the 4th generation descendant of the work tree's base commit.
1666 will denote the 3rd generation ancestor of the commit resolved by the
1673 modifier without a trailing integer has an implicit
1682 List all existing tags in the repository instead of creating a new tag.
1685 argument is passed, show only the tag with the given
1688 Use the specified tag message when creating the new tag.
1693 opens a temporary file in an editor where a tag message can be written.
1694 Quitting the editor without saving the file will abort the tag operation.
1695 .It Fl r Ar repository-path
1696 Use the repository at the specified path.
1697 If not specified, assume the repository is located at or above the current
1699 If this directory is a
1701 work tree, use the repository path associated with this work tree.
1702 .It Fl s Ar signer-id
1703 While creating a new tag, sign this tag with the identity given in
1706 For SSH-based signatures,
1708 is the path to a file which may refer to either a private SSH key,
1709 or a public SSH key with the private half available via
1712 will sign the tag object by invoking
1716 command, using the signature namespace
1718 for compatibility with
1721 Verify tag object signatures.
1724 is specified, show and verify the tag object with the provided name.
1725 Otherwise, list all tag objects and verify signatures where present.
1728 verifies SSH-based signatures by invoking
1731 .Fl Y Cm verify Fl f Ar allowed_signers .
1736 otherwise verification is impossible.
1739 During SSH signature creation and verification this option will be passed to
1741 Multiple -v options increase the verbosity.
1747 command will not delete tags or change existing tags.
1748 If a tag must be deleted, the
1750 command may be used to delete a tag's reference.
1751 This should only be done if the tag has not already been copied to
1758 Schedule unversioned files in a work tree for addition to the
1759 repository in the next commit.
1760 By default, files which match a
1762 ignore pattern will not be added.
1766 mentioned in the command line is not an unversioned file then
1769 To avoid unnecessary errors from paths picked up by file globbing patterns
1770 in the shell, paths in the argument list will be silently ignored if they
1773 at all, or if they are reported with one of the following status codes
1774 and do not have changes staged via
1776 .Bl -column YXZ description
1777 .It M Ta modified file
1778 .It A Ta file scheduled for addition in next commit
1779 .It C Ta modified or added file which contains merge conflicts
1780 .It m Ta modified file modes (executable bit only)
1788 Add files even if they match a
1792 Permit recursion into directories.
1793 If this option is not specified,
1795 will refuse to run if a specified
1803 .Op Fl s Ar status-codes
1807 Remove versioned files from a work tree and schedule them for deletion
1808 from the repository in the next commit.
1815 Perform the operation even if a file contains local modifications,
1816 and do not raise an error if a specified
1818 does not exist on disk.
1820 Keep affected files on disk.
1822 Permit recursion into directories.
1823 If this option is not specified,
1825 will refuse to run if a specified
1828 .It Fl s Ar status-codes
1829 Only delete files with a modification status matching one of the
1830 single-character status codes contained in the
1833 The following status codes may be specified:
1834 .Bl -column YXZ description
1835 .It M Ta modified file (this implies the
1838 .It ! Ta versioned file expected on disk but missing
1846 .Op Fl p Ar strip-count
1852 to files in a work tree.
1853 Files added or removed by a patch will be scheduled for addition or removal in
1856 The patch must be in the unified diff format as produced by
1863 diff when invoked with their
1868 argument is provided, read unified diff data from standard input instead.
1872 contains multiple patches, then attempt to apply each of them in sequence.
1874 Show the status of each affected file, using the following status codes:
1875 .Bl -column XYZ description
1876 .It M Ta file was modified
1877 .It G Ta file was merged using a merge-base found in the repository
1878 .It C Ta file was merged and conflicts occurred during merge
1879 .It D Ta file was deleted
1880 .It A Ta file was added
1881 .It # Ta failed to patch the file
1884 If a change does not match at its exact line number, attempt to
1885 apply it somewhere else in the file if a good spot can be found.
1886 Otherwise, the patch will fail to apply.
1890 will refuse to apply a patch if certain preconditions are not met.
1891 Files to be deleted must already be under version control, and must
1892 not have been scheduled for deletion already.
1893 Files to be added must not yet be under version control and must not
1894 already be present on disk.
1895 Files to be modified must already be under version control and may not
1896 contain conflict markers.
1898 If an error occurs, the
1900 operation will be aborted.
1901 Any changes made to the work tree up to this point will be left behind.
1902 Such changes can be viewed with
1904 and can be reverted with
1913 Attempt to locate files within the specified
1915 for use as a merge-base for 3-way merges.
1919 option is not used then
1921 will attempt to locate merge-bases via object IDs found in
1923 meta-data, such as produced by
1929 option is only recommended in the absence of such meta-data.
1931 Ideally, the specified
1933 should contain versions of files which the changes contained in the
1936 Files will be located by path, relative to the repository root.
1939 option is used then leading path components will be stripped
1940 before paths are looked up in the repository.
1942 In case no merge-base is available for a file, changes will be applied
1943 without doing a 3-way merge.
1944 Changes which do not apply cleanly may then be rejected entirely, rather
1945 than producing merge conflicts in the patched target file.
1949 argument is a commit ID SHA1 hash, or a reference name or a keyword
1950 which will be resolved to a commit ID.
1951 An abbreviated hash argument will be expanded to a full SHA1 hash
1952 automatically, provided the abbreviation is unique.
1957 resolve to the work tree's base commit and branch head, respectively.
1958 Keywords and references may be appended with
1962 modifiers and an optional integer N to denote the
1963 Nth descendant or antecedent by first parent traversal, respectively;
1966 denotes the work tree branch head's 2nd generation ancestor, and
1968 denotes the 4th generation descendant of the work tree's base commit.
1971 will denote the 3rd generation descendant of the commit resolved by the
1978 modifier without a trailing integer has an implicit
1987 Do not make any modifications to the work tree.
1988 This can be used to check whether a patch would apply without issues.
1991 contains diffs that affect the same file multiple times, the results
1992 displayed may be incorrect.
1993 .It Fl p Ar strip-count
1994 Specify the number of leading path components to strip from paths
2003 path prefixes generated by
2005 will be recognized and stripped automatically.
2007 Reverse the patch before applying it.
2013 .Op Fl F Ar response-script
2017 Revert any local changes in files at the specified paths in a work tree.
2018 File contents will be overwritten with those contained in the
2019 work tree's base commit.
2020 There is no way to bring discarded changes back after
2023 If a file was added with
2025 it will become an unversioned file again.
2026 If a file was deleted with
2028 it will be restored.
2034 .It Fl F Ar response-script
2042 responses line-by-line from the specified
2044 file instead of prompting interactively.
2046 Instead of reverting all changes in files, interactively select or reject
2047 changes to revert based on
2053 (quit reverting this file) responses.
2054 If a file is in modified status, individual patches derived from the
2055 modified file content can be reverted.
2056 Files in added or deleted status may only be reverted in their entirety.
2058 Permit recursion into directories.
2059 If this option is not specified,
2061 will refuse to run if a specified
2075 Create a new commit in the repository from changes in a work tree
2076 and use this commit as the new base commit for the work tree.
2079 is specified, commit all changes in the work tree.
2080 Otherwise, commit changes at or within the specified paths.
2082 If changes have been explicitly staged for commit with
2084 only commit staged changes and reject any specified paths which
2085 have not been staged.
2088 opens a temporary file in an editor where a log message can be written
2096 options are used together.
2097 Quitting the editor without saving the file will abort the commit operation.
2099 Show the status of each affected file, using the following status codes:
2100 .Bl -column YXZ description
2101 .It M Ta modified file
2102 .It D Ta file was deleted
2103 .It A Ta new file was added
2104 .It m Ta modified file modes (executable bit only)
2107 Files which are not part of the new commit will retain their previously
2108 recorded base commit.
2111 commands may refuse to run while the work tree contains files from
2112 multiple base commits.
2113 The base commit of such a work tree can be made consistent by running
2115 across the entire work tree.
2119 command requires the
2121 environment variable to be set,
2122 unless an author has been configured in
2128 configuration settings can be
2129 obtained from the repository's
2131 file or from Git's global
2140 Set author information in the newly created commit to
2142 This is useful when committing changes on behalf of someone else.
2145 argument must use the same format as the
2147 environment variable.
2149 In addition to storing author information, the newly created commit
2152 information which is obtained, as usual, from the
2154 environment variable, or
2156 or Git configuration settings.
2158 Allow committing files in conflicted status.
2160 Committing files with conflict markers should generally be avoided.
2161 Cases where conflict markers must be stored in the repository for
2162 some legitimate reason should be very rare.
2163 There are usually ways to avoid storing conflict markers verbatim by
2164 applying appropriate programming tricks.
2166 Use the prepared log message stored in the file found at
2168 when creating the new commit.
2170 opens a temporary file in an editor where the prepared log message can be
2171 reviewed and edited further if needed.
2172 Cannot be used together with the
2176 Use the specified log message when creating the new commit.
2177 Cannot be used together with the
2181 This option prevents
2183 from opening the commit message in an editor.
2184 It has no effect unless it is used together with the
2186 option and is intended for non-interactive use such as scripting.
2188 This option prevents
2190 from generating a diff of the to-be-committed changes in a temporary file
2191 which can be viewed while editing a commit message.
2193 Allow the addition of symbolic links which point outside of the path space
2194 that is under version control.
2197 will reject such symbolic links due to safety concerns.
2200 may decide to represent such a symbolic link as a regular file which contains
2201 the link's target path, rather than creating an actual symbolic link which
2202 points outside of the work tree.
2203 Use of this option is discouraged because external mechanisms such as
2205 are better suited for managing symbolic links to paths not under
2210 will refuse to run if certain preconditions are not met.
2211 If the work tree's current branch is not in the
2213 reference namespace, new commits may not be created on this branch.
2214 Local changes may only be committed if they are based on file content
2215 found in the most recent commit on the work tree's branch.
2216 If a path is found to be out of date,
2218 must be used first in order to merge local changes with changes made
2226 .Op Fl r Ar repository-path
2228 .Op Ar remote-repository
2231 Send new changes to a remote repository.
2233 .Ar remote-repository
2237 The remote repository's URL is obtained from the corresponding entry in
2241 file of the local repository, as created by
2244 All objects corresponding to new changes will be written to a temporary
2245 pack file which is then uploaded to the server.
2246 Upon success, references in the
2248 reference namespace of the local repository will be updated to point at
2249 the commits which have been sent.
2251 By default, changes will only be sent if they are based on up-to-date
2252 copies of relevant branches in the remote repository.
2253 If any changes to be sent are based on out-of-date copies or would
2254 otherwise break linear history of existing branches, new changes must
2255 be fetched from the server with
2257 and local branches must be rebased with
2264 option can be used to make exceptions to these requirements.
2271 Send all branches from the local repository's
2273 reference namespace.
2276 option is equivalent to listing all branches with multiple
2279 Cannot be used together with the
2285 from the local repository's
2287 reference namespace.
2288 This option may be specified multiple times to build a list of branches
2290 If this option is not specified, default to the work tree's current branch
2291 if invoked in a work tree, or to the repository's HEAD reference.
2292 Cannot be used together with the
2296 Delete the specified
2298 from the remote repository's
2300 reference namespace.
2301 This option may be specified multiple times to build a list of branches
2304 Only references are deleted.
2305 Any commit, tree, tag, and blob objects belonging to deleted branches
2306 may become subject to deletion by Git's garbage collector running on
2309 Requesting deletion of branches results in an error if the server
2310 does not support this feature or disallows the deletion of branches
2311 based on its configuration.
2313 Attempt to force the server to overwrite existing branches or tags
2314 in the remote repository, even when
2320 would usually be required before changes can be sent.
2321 The server may reject forced requests regardless, depending on its
2324 Any commit, tree, tag, and blob objects belonging to overwritten branches
2325 or tags may become subject to deletion by Git's garbage collector running
2330 reference namespace is globally shared between all repositories.
2333 option to overwrite tags is discouraged because it can lead to
2334 inconsistencies between the tags present in different repositories.
2335 In general, creating a new tag with a different name is recommended
2336 instead of overwriting an existing tag.
2340 option is particularly discouraged if changes being sent are based
2341 on an out-of-date copy of a branch in the remote repository.
2342 Instead of using the
2344 option, new changes should
2347 and local branches should be rebased with
2351 followed by another attempt to send the changes.
2355 option should only be needed in situations where the remote repository's
2356 copy of a branch or tag is known to be out-of-date and is considered
2358 The risks of creating inconsistencies between different repositories
2359 should also be taken into account.
2361 Suppress progress reporting output.
2362 The same option will be passed to
2365 .It Fl r Ar repository-path
2366 Use the repository at the specified path.
2367 If not specified, assume the repository is located at or above the current
2369 If this directory is a
2371 work tree, use the repository path associated with this work tree.
2373 Attempt to send all tags from the local repository's
2375 reference namespace.
2378 option is equivalent to listing all tags with multiple
2381 Cannot be used together with the
2387 from the local repository's
2389 reference namespace, in addition to any branches that are being sent.
2392 option may be specified multiple times to build a list of tags to send.
2393 No tags will be sent if the
2397 Raise an error if the specified
2399 already exists in the remote repository, unless the
2401 option is used to overwrite the server's copy of the tag.
2402 In general, creating a new tag with a different name is recommended
2403 instead of overwriting an existing tag.
2405 Cannot be used together with the
2412 to print debugging messages to standard error output.
2413 The same option will be passed to
2416 Multiple -v options increase the verbosity.
2426 Merge changes from a single
2431 should be on a different branch than the work tree's base commit.
2433 The expected argument is a commit ID SHA1 hash, or a reference name or
2434 keyword which will be resolved to a commit ID.
2435 An abbreviated hash argument will be expanded to a full SHA1 hash
2436 automatically, provided the abbreviation is unique.
2441 resolve to the work tree's base commit and branch head, respectively.
2442 Keywords and references may be appended with
2446 modifiers and an optional integer N to denote the
2447 Nth descendant or antecedent by first parent traversal, respectively;
2450 denotes the work tree branch head's 2nd generation ancestor, and
2452 denotes the 4th generation descendant of the work tree's base commit.
2455 will denote the 3rd generation descendant of the commit resolved by the
2462 modifier without a trailing integer has an implicit
2471 Show the status of each affected file, using the following status codes:
2472 .Bl -column YXZ description
2473 .It G Ta file was merged
2474 .It C Ta file was merged and conflicts occurred during merge
2475 .It ! Ta changes destined for a missing file were not merged
2476 .It D Ta file was deleted
2477 .It d Ta file's deletion was prevented by local modifications
2478 .It A Ta new file was added
2479 .It \(a~ Ta changes destined for a non-regular file were not merged
2480 .It ? Ta changes destined for an unversioned file were not merged
2483 The merged changes will appear as local changes in the work tree, which
2486 amended manually or with further
2492 If invoked in a work tree where no
2497 operation is taking place,
2499 creates a record of commits which have been merged into the work tree.
2500 When a file changed by
2504 the log messages of relevant merged commits will then appear in the editor,
2505 where the messages should be further adjusted to convey the reasons for
2506 cherrypicking the changes.
2507 Upon exiting the editor, if the time stamp of the log message file
2508 is unchanged or the log message is empty,
2510 will fail with an unmodified or empty log message error.
2512 If all the changes in all files touched by a given commit are discarded,
2515 this commit's log message record will also disappear.
2518 will refuse to run if certain preconditions are not met.
2519 If the work tree contains multiple base commits, it must first be updated
2520 to a single base commit with
2522 If any relevant files already contain merge conflicts, these
2523 conflicts must be resolved first.
2531 Display a list of commit log messages recorded by cherrypick operations,
2532 represented by references in the
2533 .Dq refs/got/worktree
2534 reference namespace.
2537 is specified, only show the log message of the specified commit.
2539 If invoked in a work tree, only log messages recorded by cherrypick operations
2540 in the current work tree will be displayed.
2541 Otherwise, all commit log messages will be displayed irrespective of the
2542 work tree in which they were created.
2543 This option cannot be used with
2546 Delete log messages created by previous cherrypick operations, represented by
2548 .Dq refs/got/worktree
2549 reference namespace.
2552 is specified, only delete the log message of the specified commit.
2554 If invoked in a work tree, only log messages recorded by cherrypick operations
2555 in the current work tree will be deleted.
2556 Otherwise, all commit log messages will be deleted irrespective of the
2557 work tree in which they were created.
2558 This option cannot be used with
2569 Reverse-merge changes from a single
2574 should be on the same branch as the work tree's base commit.
2576 The expected argument is a commit ID SHA1 hash, or a reference name
2577 or keyword which will be resolved to a commit ID.
2578 An abbreviated hash argument will be expanded to a full SHA1 hash
2579 automatically, provided the abbreviation is unique.
2584 resolve to the work tree's base commit and branch head, respectively.
2585 Keywords and references may be appended with
2589 modifiers and an optional integer N to denote the
2590 Nth descendant or antecedent by first parent traversal, respectively;
2593 denotes the work tree branch head's 2nd generation ancestor, and
2595 denotes the 4th generation descendant of the work tree's base commit.
2598 will denote the 5th generation descendant of the commit resolved by the
2605 modifier without a trailing integer has an implicit
2614 Show the status of each affected file, using the following status codes:
2615 .Bl -column YXZ description
2616 .It G Ta file was merged
2617 .It C Ta file was merged and conflicts occurred during merge
2618 .It ! Ta changes destined for a missing file were not merged
2619 .It D Ta file was deleted
2620 .It d Ta file's deletion was prevented by local modifications
2621 .It A Ta new file was added
2622 .It \(a~ Ta changes destined for a non-regular file were not merged
2623 .It ? Ta changes destined for an unversioned file were not merged
2626 The reverse-merged changes will appear as local changes in the work tree,
2627 which may be viewed with
2629 amended manually or with further
2635 If invoked in a work tree where no
2640 operation is taking place,
2642 creates a record of commits which have been reverse-merged into the work tree.
2643 When a file changed by
2647 the log messages of relevant reverse-merged commits will then appear in
2648 the editor, where the messages should be further adjusted to convey the
2649 reasons for backing out the changes.
2650 Upon exiting the editor, if the time stamp of the log message file
2651 is unchanged or the log message is empty,
2653 will fail with an unmodified or empty log message error.
2655 If all the changes in all files touched by a given commit are discarded,
2658 this commit's log message record will also disappear.
2661 will refuse to run if certain preconditions are not met.
2662 If the work tree contains multiple base commits, it must first be updated
2663 to a single base commit with
2665 If any relevant files already contain merge conflicts, these
2666 conflicts must be resolved first.
2674 Display a list of commit log messages recorded by backout operations,
2675 represented by references in the
2676 .Dq refs/got/worktree
2677 reference namespace.
2680 is specified, only show the log message of the specified commit.
2682 If invoked in a work tree, only log messages recorded by backout operations
2683 in the current work tree will be displayed.
2684 Otherwise, all commit log messages will be displayed irrespective of the
2685 work tree in which they were created.
2686 This option cannot be used with
2689 Delete log messages created by previous backout operations, represented by
2691 .Dq refs/got/worktree
2692 reference namespace.
2695 is specified, only delete the log message of the specified commit.
2697 If invoked in a work tree, only log messages recorded by backout operations
2698 in the current work tree will be deleted.
2699 Otherwise, all commit log messages will be deleted irrespective of the
2700 work tree in which they were created.
2701 This option cannot be used with
2712 Rebase commits on the specified
2714 onto the tip of the current branch of the work tree.
2717 must share common ancestry with the work tree's current branch.
2718 Rebasing begins with the first descendant commit of the youngest
2719 common ancestor commit shared by the specified
2721 and the work tree's current branch, and stops once the tip commit
2728 is used as intended, the specified
2730 represents a local commit history and may already contain changes
2731 that are not yet visible in any other repositories.
2732 The work tree's current branch, which must be set with
2736 operation, represents a branch from a remote repository which shares
2737 a common history with the specified
2739 but has progressed, and perhaps diverged, due to commits added to the
2742 Rebased commits are accumulated on a temporary branch which the work tree
2743 will remain switched to throughout the entire rebase operation.
2744 Commits on this branch represent the same changes with the same log
2745 messages as their counterparts on the original
2747 but with different commit IDs.
2748 Once rebasing has completed successfully, the temporary branch becomes
2749 the new version of the specified
2751 and the work tree is automatically switched to it.
2752 If author information is available via the
2754 environment variable,
2760 configuration settings, this author information will be used to identify
2765 Old commits in their pre-rebase state are automatically backed up in the
2766 .Dq refs/got/backup/rebase
2767 reference namespace.
2768 As long as these references are not removed older versions of rebased
2769 commits will remain in the repository and can be viewed with the
2772 Removal of these references makes objects which become unreachable via
2773 any reference subject to removal by Git's garbage collector or
2774 .Cm gotadmin cleanup .
2776 While rebasing commits, show the status of each affected file,
2777 using the following status codes:
2778 .Bl -column YXZ description
2779 .It G Ta file was merged
2780 .It C Ta file was merged and conflicts occurred during merge
2781 .It ! Ta changes destined for a missing file were not merged
2782 .It D Ta file was deleted
2783 .It d Ta file's deletion was prevented by local modifications
2784 .It A Ta new file was added
2785 .It \(a~ Ta changes destined for a non-regular file were not merged
2786 .It ? Ta changes destined for an unversioned file were not merged
2789 If merge conflicts occur, the rebase operation is interrupted and may
2790 be continued once conflicts have been resolved.
2791 If any files with destined changes are found to be missing or unversioned,
2792 or if files could not be deleted due to differences in deleted content,
2793 the rebase operation will be interrupted to prevent potentially incomplete
2794 changes from being committed to the repository without user intervention.
2795 The work tree may be modified as desired and the rebase operation can be
2796 continued once the changes present in the work tree are considered complete.
2797 Alternatively, the rebase operation may be aborted which will leave
2799 unmodified and the work tree switched back to its original branch.
2801 If a merge conflict is resolved in a way which renders the merged
2802 change into a no-op change, the corresponding commit will be elided
2803 when the rebase operation continues.
2806 will refuse to run if certain preconditions are not met.
2811 reference namespace, the branch may not be rebased.
2812 If the work tree is not yet fully updated to the tip commit of its
2813 branch, then the work tree must first be updated with
2815 If changes have been staged with
2817 these changes must first be committed with
2821 If the work tree contains local changes, these changes must first be
2828 contains changes to files outside of the work tree's path prefix,
2829 the work tree cannot be used to rebase this branch.
2838 commands will refuse to run while a rebase operation is in progress.
2839 Other commands which manipulate the work tree may be used for
2840 conflict resolution purposes.
2844 is already based on the work tree's current branch, then no commits
2845 need to be rebased and
2847 will simply switch the work tree to the specified
2849 and update files in the work tree accordingly.
2856 Abort an interrupted rebase operation.
2857 If this option is used, no other command-line arguments are allowed.
2859 Allow a rebase operation to continue with files in conflicted status.
2860 This option should generally be avoided, and can only be used with the
2864 Continue an interrupted rebase operation.
2865 If this option is used, no other command-line arguments are allowed except
2868 Show a list of past rebase operations, represented by references in the
2869 .Dq refs/got/backup/rebase
2870 reference namespace.
2872 Display the author, date, and log message of each backed up commit,
2873 the object ID of the corresponding post-rebase commit, and
2874 the object ID of their common ancestor commit.
2875 Given these object IDs,
2882 options can be used to examine the history of either version of the branch,
2887 option can be used to create a new branch from a pre-rebase state if desired.
2891 is specified, only show commits which at some point in time represented this
2893 Otherwise, list all backed up commits for any branches.
2895 If this option is used,
2897 does not require a work tree.
2898 None of the other options can be used together with
2901 Delete backups created by past rebase operations, represented by references
2903 .Dq refs/got/backup/rebase
2904 reference namespace.
2908 is specified, only delete backups which at some point in time represented
2910 Otherwise, delete all references found within
2911 .Dq refs/got/backup/rebase .
2913 Any commit, tree, tag, and blob objects belonging to deleted backups
2914 remain in the repository and may be removed separately with
2915 Git's garbage collector or
2916 .Cm gotadmin cleanup .
2918 If this option is used,
2920 does not require a work tree.
2921 None of the other options can be used together with
2928 .Op Fl F Ar histedit-script
2932 Edit commit history between the work tree's current base commit and
2933 the tip commit of the work tree's current branch.
2937 command requires the
2939 environment variable to be set,
2940 unless an author has been configured in
2946 configuration settings can be obtained from the repository's
2948 file or from Git's global
2954 operation, the work tree's current branch must be set with
2956 to the branch which should be edited, unless this branch is already the
2957 current branch of the work tree.
2958 The tip of this branch represents the upper bound (inclusive) of commits
2963 Furthermore, the work tree's base commit
2966 to a point in this branch's commit history where editing should begin.
2967 This commit represents the lower bound (non-inclusive) of commits touched
2972 Editing of commit history is controlled via a
2974 which can be written in an editor based on a template, passed on the
2975 command line, or generated with the
2982 Quitting the editor without saving the file will abort the histedit operation.
2984 The format of the histedit script is line-based.
2985 Each line in the script begins with a command name, followed by
2986 whitespace and an argument.
2987 For most commands, the expected argument is a commit ID SHA1 hash.
2988 Any remaining text on the line is ignored.
2989 Lines which begin with the
2991 character are ignored entirely.
2993 The available histedit script commands are as follows:
2994 .Bl -column YXZ pick-commit
2995 .It Cm pick Ar commit Ta Use the specified commit as it is.
2996 .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
2997 then interrupt the histedit operation for amending, without creating a commit.
2998 While the histedit operation is interrupted arbitrary files may be edited,
2999 and commands which manipulate the work tree can be used freely.
3004 commands can be used to add new files or remove existing ones.
3007 command can be used to eliminate arbitrary changes from files in the work tree.
3010 command may be used to prepare a subset of changes for inclusion in the
3014 command can be used to insert arbitrary commits into the edited history.
3015 Regular editing of history must eventually be resumed by running
3016 .Cm got histedit -c .
3017 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
3018 listed further below that will be used.
3019 .It Cm drop Ar commit Ta Remove this commit from the edited history.
3020 .It Cm mesg Oo Ar log-message Oc Ta Create a new log message for the commit of
3025 command on the previous line of the histedit script.
3028 argument provides a new single-line log message to use.
3031 argument is omitted, open an editor where a new log message can be written.
3034 Every commit in the history being edited must be mentioned in the script.
3035 Lines may be re-ordered to change the order of commits in the edited history.
3036 No commit may be listed more than once.
3038 Edited commits are accumulated on a temporary branch which the work tree
3039 will remain switched to throughout the entire histedit operation.
3040 Once history editing has completed successfully, the temporary branch becomes
3041 the new version of the work tree's branch and the work tree is automatically
3044 Old commits in their pre-histedit state are automatically backed up in the
3045 .Dq refs/got/backup/histedit
3046 reference namespace.
3047 As long as these references are not removed older versions of edited
3048 commits will remain in the repository and can be viewed with the
3051 Removal of these references makes objects which become unreachable via
3052 any reference subject to removal by Git's garbage collector or
3053 .Cm gotadmin cleanup .
3055 While merging commits, show the status of each affected file,
3056 using the following status codes:
3057 .Bl -column YXZ description
3058 .It G Ta file was merged
3059 .It C Ta file was merged and conflicts occurred during merge
3060 .It ! Ta changes destined for a missing file were not merged
3061 .It D Ta file was deleted
3062 .It d Ta file's deletion was prevented by local modifications
3063 .It A Ta new file was added
3064 .It \(a~ Ta changes destined for a non-regular file were not merged
3065 .It ? Ta changes destined for an unversioned file were not merged
3068 If merge conflicts occur, the histedit operation is interrupted and may
3069 be continued once conflicts have been resolved.
3070 If any files with destined changes are found to be missing or unversioned,
3071 or if files could not be deleted due to differences in deleted content,
3072 the histedit operation will be interrupted to prevent potentially incomplete
3073 changes from being committed to the repository without user intervention.
3074 The work tree may be modified as desired and the histedit operation can be
3075 continued once the changes present in the work tree are considered complete.
3076 Alternatively, the histedit operation may be aborted which will leave
3077 the work tree switched back to its original branch.
3079 If a merge conflict is resolved in a way which renders the merged
3080 change into a no-op change, the corresponding commit will be elided
3081 when the histedit operation continues.
3084 will refuse to run if certain preconditions are not met.
3085 If the work tree's current branch is not in the
3087 reference namespace, the history of the branch may not be edited.
3088 If the work tree contains multiple base commits, it must first be updated
3089 to a single base commit with
3091 If changes have been staged with
3093 these changes must first be committed with
3097 If the work tree contains local changes, these changes must first be
3102 If the edited history contains changes to files outside of the work tree's
3103 path prefix, the work tree cannot be used to edit the history of this branch.
3111 commands will refuse to run while a histedit operation is in progress.
3112 Other commands which manipulate the work tree may be used, and the
3114 command may be used to commit arbitrary changes to the temporary branch
3115 while the histedit operation is interrupted.
3122 Abort an interrupted histedit operation.
3123 If this option is used, no other command-line arguments are allowed.
3125 Allow a histedit operation to continue with files in conflicted status.
3126 This option should generally be avoided, and can only be used with the
3130 Continue an interrupted histedit operation.
3131 If this option is used, no other command-line arguments are allowed except
3135 This option is a quick equivalent to a histedit script which drops all
3139 option can only be used when starting a new histedit operation.
3140 If this option is used, no other command-line arguments are allowed.
3142 Interrupt the histedit operation for editing after merging each commit.
3143 This option is a quick equivalent to a histedit script which uses the
3145 command for all commits.
3148 option can only be used when starting a new histedit operation.
3149 If this option is used, no other command-line arguments are allowed.
3150 .It Fl F Ar histedit-script
3153 instead of opening a temporary file in an editor where a histedit script
3156 Fold all commits into a single commit.
3157 This option is a quick equivalent to a histedit script which folds all
3158 commits, combining them all into one commit.
3161 option can only be used when starting a new histedit operation.
3162 If this option is used, no other command-line arguments are allowed.
3164 Show a list of past histedit operations, represented by references in the
3165 .Dq refs/got/backup/histedit
3166 reference namespace.
3168 Display the author, date, and log message of each backed up commit,
3169 the object ID of the corresponding post-histedit commit, and
3170 the object ID of their common ancestor commit.
3171 Given these object IDs,
3178 options can be used to examine the history of either version of the branch,
3183 option can be used to create a new branch from a pre-histedit state if desired.
3187 is specified, only show commits which at some point in time represented this
3189 Otherwise, list all backed up commits for any branches.
3191 If this option is used,
3193 does not require a work tree.
3194 None of the other options can be used together with
3197 Edit log messages only.
3198 This option is a quick equivalent to a histedit script which edits
3199 only log messages but otherwise leaves every picked commit as-is.
3202 option can only be used when starting a new histedit operation.
3203 If this option is used, no other command-line arguments are allowed.
3205 Delete backups created by past histedit operations, represented by references
3207 .Dq refs/got/backup/histedit
3208 reference namespace.
3212 is specified, only delete backups which at some point in time represented
3214 Otherwise, delete all references found within
3215 .Dq refs/got/backup/histedit .
3217 Any commit, tree, tag, and blob objects belonging to deleted backups
3218 remain in the repository and may be removed separately with
3219 Git's garbage collector or
3220 .Cm gotadmin cleanup .
3222 If this option is used,
3224 does not require a work tree.
3225 None of the other options can be used together with
3229 .It Cm integrate Ar branch
3231 Integrate the specified
3233 into the work tree's current branch.
3234 Files in the work tree are updated to match the contents on the integrated
3236 and the reference of the work tree's branch is changed to point at the
3237 head commit of the integrated
3240 Both branches can be considered equivalent after integration since they
3241 will be pointing at the same commit.
3242 Both branches remain available for future work, if desired.
3243 In case the integrated
3245 is no longer needed it may be deleted with
3248 Show the status of each affected file, using the following status codes:
3249 .Bl -column YXZ description
3250 .It U Ta file was updated
3251 .It D Ta file was deleted
3252 .It A Ta new file was added
3253 .It \(a~ Ta versioned file is obstructed by a non-regular file
3254 .It ! Ta a missing versioned file was restored
3258 will refuse to run if certain preconditions are not met.
3259 Most importantly, the
3261 must have been rebased onto the work tree's current branch with
3263 before it can be integrated, in order to linearize commit history and
3264 resolve merge conflicts.
3265 If the work tree contains multiple base commits, it must first be updated
3266 to a single base commit with
3268 If changes have been staged with
3270 these changes must first be committed with
3274 If the work tree contains local changes, these changes must first be
3288 into the current branch of the work tree.
3289 If the branches have diverged, creates a merge commit.
3292 already includes all commits from the work tree's branch, updates the work
3293 tree's branch to be the same as
3295 without creating a commit, and updates the work tree to the most recent commit
3298 If a linear project history is desired, then use of
3300 should be preferred over
3302 However, even strictly linear projects may require merge commits in order
3303 to merge in new versions of third-party code stored on vendor branches
3307 Merge commits are commits based on multiple parent commits.
3308 The tip commit of the work tree's current branch, which must be in the
3310 reference namespace and must be set with
3314 operation, will be used as the first parent.
3315 The tip commit of the specified
3317 will be used as the second parent.
3319 No ancestral relationship between the two branches is required.
3320 If the two branches have already been merged previously, only new changes
3323 It is not possible to create merge commits with more than two parents.
3324 If more than one branch needs to be merged, then multiple merge commits
3325 with two parents each can be created in sequence.
3327 While merging changes found on the
3329 into the work tree, show the status of each affected file,
3330 using the following status codes:
3331 .Bl -column YXZ description
3332 .It G Ta file was merged
3333 .It C Ta file was merged and conflicts occurred during merge
3334 .It ! Ta changes destined for a missing file were not merged
3335 .It D Ta file was deleted
3336 .It d Ta file's deletion was prevented by local modifications
3337 .It A Ta new file was added
3338 .It \(a~ Ta changes destined for a non-regular file were not merged
3339 .It ? Ta changes destined for an unversioned file were not merged
3342 If merge conflicts occur, the merge operation is interrupted and conflicts
3343 must be resolved before the merge operation can continue.
3344 If any files with destined changes are found to be missing or unversioned,
3345 or if files could not be deleted due to differences in deleted content,
3346 the merge operation will be interrupted to prevent potentially incomplete
3347 changes from being committed to the repository without user intervention.
3348 The work tree may be modified as desired and the merge can be continued
3349 once the changes present in the work tree are considered complete.
3350 Alternatively, the merge operation may be aborted which will leave
3351 the work tree's current branch unmodified.
3354 will refuse to run if certain preconditions are not met.
3355 If the work tree's current branch is not in the
3357 reference namespace then the work tree must first be switched to a
3362 If the work tree is not yet fully updated to the tip commit of its
3363 branch, then the work tree must first be updated with
3365 If the work tree contains multiple base commits, it must first be updated
3366 to a single base commit with
3368 If changes have been staged with
3370 these changes must first be committed with
3374 If the work tree contains local changes, these changes must first be
3381 contains changes to files outside of the work tree's path prefix,
3382 the work tree cannot be used to merge this branch.
3392 commands will refuse to run while a merge operation is in progress.
3393 Other commands which manipulate the work tree may be used for
3394 conflict resolution purposes.
3401 Abort an interrupted merge operation.
3402 If this option is used, no other command-line arguments are allowed.
3404 Allow a merge operation to continue with files in conflicted status.
3405 This option should generally be avoided, and can only be used with the
3409 Continue an interrupted merge operation.
3410 If this option is used, no other command-line arguments are allowed except
3413 Create a merge commit even if the branches have not diverged.
3415 Merge changes into the work tree as usual but do not create a merge
3417 The merge result can be adjusted as desired before a merge commit is
3420 Alternatively, the merge may be aborted with
3427 .Op Fl F Ar response-script
3431 Stage local changes for inclusion in the next commit.
3434 is specified, stage all changes in the work tree.
3435 Otherwise, stage changes at or within the specified paths.
3436 Paths may be staged if they are added, modified, or deleted according to
3439 Show the status of each affected file, using the following status codes:
3440 .Bl -column YXZ description
3441 .It A Ta file addition has been staged
3442 .It M Ta file modification has been staged
3443 .It D Ta file deletion has been staged
3446 Staged file contents are saved in newly created blob objects in the repository.
3447 These blobs will be referred to by tree objects once staged changes have been
3450 Staged changes affect the behaviour of
3455 While paths with staged changes exist, the
3457 command will refuse to commit any paths which do not have staged changes.
3458 Local changes created on top of staged changes can only be committed if
3459 the path is staged again, or if the staged changes are committed first.
3462 command will show both local changes and staged changes.
3465 command is able to display local changes relative to staged changes,
3466 and to display staged changes relative to the repository.
3469 command cannot revert staged changes but may be used to revert
3470 local changes created on top of staged changes.
3476 .It Fl F Ar response-script
3484 responses line-by-line from the specified
3486 file instead of prompting interactively.
3488 Instead of staging new changes, list paths which are already staged,
3489 along with the IDs of staged blob objects and stage status codes.
3490 If paths were provided on the command line, show the staged paths
3491 among the specified paths.
3492 Otherwise, show all staged paths.
3494 Instead of staging the entire content of a changed file, interactively
3495 select or reject changes for staging based on
3499 (reject change), and
3501 (quit staging this file) responses.
3502 If a file is in modified status, individual patches derived from the
3503 modified file content can be staged.
3504 Files in added or deleted status may only be staged or rejected in
3507 Allow staging of symbolic links which point outside of the path space
3508 that is under version control.
3511 will reject such symbolic links due to safety concerns.
3514 may decide to represent such a symbolic link as a regular file which contains
3515 the link's target path, rather than creating an actual symbolic link which
3516 points outside of the work tree.
3517 Use of this option is discouraged because external mechanisms such as
3519 are better suited for managing symbolic links to paths not under
3524 will refuse to run if certain preconditions are not met.
3525 If a file contains merge conflicts, these conflicts must be resolved first.
3526 If a file is found to be out of date relative to the head commit on the
3527 work tree's current branch, the file must be updated with
3529 before it can be staged (however, this does not prevent the file from
3530 becoming out-of-date at some point after having been staged).
3538 commands will refuse to run while staged changes exist.
3539 If staged changes cannot be committed because a staged path
3540 is out of date, the path must be unstaged with
3542 before it can be updated with
3544 and may then be staged again if necessary.
3549 .Op Fl F Ar response-script
3553 Merge staged changes back into the work tree and put affected paths
3554 back into non-staged status.
3557 is specified, unstage all staged changes across the entire work tree.
3558 Otherwise, unstage changes at or within the specified paths.
3560 Show the status of each affected file, using the following status codes:
3561 .Bl -column YXZ description
3562 .It G Ta file was unstaged
3563 .It C Ta file was unstaged and conflicts occurred during merge
3564 .It ! Ta changes destined for a missing file were not merged
3565 .It D Ta file was staged as deleted and still is deleted
3566 .It d Ta file's deletion was prevented by local modifications
3567 .It \(a~ Ta changes destined for a non-regular file were not merged
3574 .It Fl F Ar response-script
3582 responses line-by-line from the specified
3584 file instead of prompting interactively.
3586 Instead of unstaging the entire content of a changed file, interactively
3587 select or reject changes for unstaging based on
3591 (keep change staged), and
3593 (quit unstaging this file) responses.
3594 If a file is staged in modified status, individual patches derived from the
3595 staged file content can be unstaged.
3596 Files staged in added or deleted status may only be unstaged in their entirety.
3602 .Op Fl r Ar repository-path
3605 Parse and print contents of objects to standard output in a line-based
3607 Content of commit, tree, and tag objects is printed in a way similar
3608 to the actual content stored in such objects.
3609 Blob object contents are printed as they would appear in files on disk.
3611 Attempt to interpret each argument as a reference, a tag name, or
3612 an object ID SHA1 hash.
3613 References will be resolved to an object ID.
3614 Tag names will resolved to a tag object.
3615 An abbreviated hash argument will be expanded to a full SHA1 hash
3616 automatically, provided the abbreviation is unique.
3618 If none of the above interpretations produce a valid result, or if the
3620 option is used, attempt to interpret the argument as a path which will
3621 be resolved to the ID of an object found at this path in the repository.
3628 Look up paths in the specified
3630 If this option is not used, paths are looked up in the commit resolved
3631 via the repository's HEAD reference.
3632 The expected argument is a commit ID SHA1 hash or an existing reference
3633 or tag name which will be resolved to a commit ID.
3634 An abbreviated hash argument will be expanded to a full SHA1 hash
3635 automatically, provided the abbreviation is unique.
3643 can also be used to represent the work tree's base commit
3644 and branch head, respectively.
3645 The former is only valid if invoked in a work tree, while the latter will
3646 resolve to the tip of the work tree's current branch if invoked in a
3647 work tree, otherwise it will resolve to the repository's HEAD reference.
3648 Keywords and references may be appended with
3652 modifiers and an optional integer N to denote the
3653 Nth descendant or antecedent by first parent traversal, respectively;
3656 denotes the work tree branch head's 2nd generation ancestor, and
3658 denotes the 4th generation descendant of the work tree's base commit.
3661 will denote the 8th generation ancestor of the commit resolved by the
3668 modifier without a trailing integer has an implicit
3677 Interpret all arguments as paths only.
3678 This option can be used to resolve ambiguity in cases where paths
3679 look like tag names, reference names, or object IDs.
3680 .It Fl r Ar repository-path
3681 Use the repository at the specified path.
3682 If not specified, assume the repository is located at or above the current
3684 If this directory is a
3686 work tree, use the repository path associated with this work tree.
3688 .It Cm info Op Ar path ...
3689 Display meta-data stored in a work tree.
3694 The work tree to use is resolved implicitly by walking upwards from the
3695 current working directory.
3699 arguments are specified, show additional per-file information for tracked
3700 files located at or within these paths.
3703 argument corresponds to the work tree's root directory, display information
3704 for all tracked files.
3707 .Bl -tag -width GOT_IGNORE_GITCONFIG
3709 The author's name and email address, such as
3710 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3721 may fail to parse commits without an email address in author data,
3725 environment variables with a missing email address.
3727 .Ev GOT_AUTHOR will be overridden by configuration settings in
3733 configuration settings in the repository's
3740 configuration settings contained in Git's global
3742 configuration file will only be used if neither
3746 environment variable provide author information.
3747 .It Ev GOT_IGNORE_GITCONFIG
3748 If this variable is set then any remote repository definitions or author
3749 information found in Git configuration files will be ignored.
3750 .It Ev GOT_LOG_DEFAULT_LIMIT
3751 The default limit on the number of commits traversed by
3753 If set to zero, the limit is unbounded.
3754 This variable will be silently ignored if it is set to a non-numeric value.
3755 .It Ev VISUAL , EDITOR
3756 The editor spawned by
3764 text editor will be spawned.
3767 .Bl -tag -width packed-refs -compact
3769 Repository-wide configuration settings for
3773 configuration file located in the root directory of a Git repository
3774 supersedes any relevant settings in Git's
3778 .It Pa .got/got.conf
3779 Worktree-specific configuration settings for
3783 configuration file in the
3785 meta-data directory of a work tree supersedes any relevant settings in
3788 configuration file and Git's
3795 Enable tab-completion of
3800 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3802 Clone an existing Git repository for use with
3806 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3808 Unfortunately, many of the popular Git hosting sites do not offer anonymous
3810 Such sites will require an account to be created, and a public SSH key to be
3811 uploaded to this account, before repository access via ssh:// URLs will work.
3813 Use of HTTP URLs currently requires
3817 .Dl $ git clone --bare https://github.com/openbsd/src.git
3819 Alternatively, for quick and dirty local testing of
3821 a new Git repository could be created and populated with files,
3822 e.g. from a temporary CVS checkout located at
3825 .Dl $ gotadmin init /var/git/src.git
3826 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3828 Check out a work tree from the Git repository to /usr/src:
3830 .Dl $ got checkout /var/git/src.git /usr/src
3832 View local changes in a work tree directory:
3834 .Dl $ got diff | less
3836 In a work tree, display files in a potentially problematic state:
3838 .Dl $ got status -s 'C!~?'
3840 Interactively revert selected local changes in a work tree directory:
3842 .Dl $ got revert -p -R\ .
3844 In a work tree or a git repository directory, list all branch references:
3848 As above, but list the most recently modified branches only:
3850 .Dl $ got branch -lt | head
3852 In a work tree or a git repository directory, create a new branch called
3853 .Dq unified-buffer-cache
3854 which is forked off the
3858 .Dl $ got branch -c master unified-buffer-cache
3860 Switch an existing work tree to the branch
3861 .Dq unified-buffer-cache .
3862 Local changes in the work tree will be preserved and merged if necessary:
3864 .Dl $ got update -b unified-buffer-cache
3866 Create a new commit from local changes in a work tree directory.
3867 This new commit will become the head commit of the work tree's current branch:
3871 In a work tree or a git repository directory, view changes committed in
3872 the 3 most recent commits to the work tree's branch, or the branch resolved
3873 via the repository's HEAD reference, respectively:
3875 .Dl $ got log -p -l 3
3877 As above, but display changes in the order in which
3879 could apply them in sequence:
3881 .Dl $ got log -p -l 3 -R
3883 In a work tree or a git repository directory, log the history of a subdirectory:
3885 .Dl $ got log sys/uvm
3887 While operating inside a work tree, paths are specified relative to the current
3888 working directory, so this command will log the subdirectory
3891 .Dl $ cd sys/uvm && got log\ .
3893 And this command has the same effect:
3895 .Dl $ cd sys/dev/usb && got log ../../uvm
3897 And this command displays work tree meta-data about all tracked files:
3900 .Dl $ got info\ . | less
3902 Add new files and remove obsolete files in a work tree directory:
3904 .Dl $ got add sys/uvm/uvm_ubc.c
3905 .Dl $ got remove sys/uvm/uvm_vnode.c
3907 Create a new commit from local changes in a work tree directory
3908 with a pre-defined log message.
3910 .Dl $ got commit -m 'unify the buffer cache'
3912 Alternatively, create a new commit from local changes in a work tree
3913 directory with a log message that has been prepared in the file
3916 .Dl $ got commit -F /tmp/msg
3918 Update any work tree checked out from the
3919 .Dq unified-buffer-cache
3920 branch to the latest commit on this branch:
3924 Roll file content on the unified-buffer-cache branch back by one commit,
3925 and then fetch the rolled-back change into the work tree as a local change
3926 to be amended and perhaps committed again:
3928 .Dl $ got backout unified-buffer-cache
3929 .Dl $ got commit -m 'roll back previous'
3930 .Dl $ # now back out the previous backout :-)
3931 .Dl $ got backout unified-buffer-cache
3933 Fetch new changes on the remote repository's
3935 branch, making them visible on the local repository's
3942 In a repository created with a HTTP URL and
3943 .Cm git clone --bare
3946 command must be used instead:
3948 .Dl $ cd /var/git/src.git
3949 .Dl $ git fetch origin master:refs/remotes/origin/master
3953 branch to merge the new changes that are now visible on the
3958 .Dl $ got update -b origin/master
3959 .Dl $ got rebase master
3962 .Dq unified-buffer-cache
3963 branch on top of the new head commit of the
3967 .Dl $ got update -b master
3968 .Dl $ got rebase unified-buffer-cache
3970 Create a patch from all changes on the unified-buffer-cache branch.
3971 The patch can be mailed out for review and applied to
3975 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
3977 Edit the entire commit history of the
3978 .Dq unified-buffer-cache
3981 .Dl $ got update -b unified-buffer-cache
3982 .Dl $ got update -c master
3985 Before working against existing branches in a repository cloned with
3986 .Cm git clone --bare
3991 must be configured to map all references in the remote repository
3994 namespace of the local repository.
3995 This can be achieved by setting Git's
3996 .Pa remote.origin.fetch
3997 configuration variable to the value
3998 .Dq +refs/heads/*:refs/remotes/origin/*
4003 .Dl $ cd /var/git/repo
4004 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
4008 option must be disabled:
4010 .Dl $ cd /var/git/repo
4011 .Dl $ git config remote.origin.mirror false
4013 Alternatively, the following
4015 configuration item can be added manually to the Git repository's
4019 .Dl [remote \&"origin\&"]
4021 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
4024 This configuration leaves the local repository's
4026 namespace free for use by local branches checked out with
4028 and, if needed, created with
4031 .Dq refs/remotes/origin
4032 namespace can now be updated with incoming changes from the remote
4037 without extra command line arguments.
4038 Newly fetched changes can be examined with
4041 Display changes on the remote repository's version of the
4043 branch, as of the last time
4047 .Dl $ got log -c origin/master | less
4049 As shown here, most commands accept abbreviated reference names such as
4052 .Dq refs/remotes/origin/master .
4053 The latter is only needed in case of ambiguity.
4056 can be used to merge changes which are visible on the
4061 This will also merge local changes, if any, with the incoming changes:
4063 .Dl $ got update -b origin/master
4064 .Dl $ got rebase master
4066 In order to make changes committed to the
4067 .Dq unified-buffer-cache
4071 .Dq unified-buffer-cache
4072 branch can be rebased onto the
4076 .Dl $ got update -b master
4077 .Dl $ got rebase unified-buffer-cache
4080 .Dq unified-buffer-cache
4081 branch can now be made visible on the
4085 Because the rebase operation switched the work tree to the
4086 .Dq unified-buffer-cache
4087 branch, the work tree must be switched back to the
4091 .Dl $ got update -b master
4092 .Dl $ got integrate unified-buffer-cache
4096 branch, log messages for local changes can now be amended with
4098 by other developers and any other important new information:
4100 .Dl $ got update -c origin/master
4101 .Dl $ got histedit -m
4103 If the remote repository offers write access, local changes on the
4105 branch can be sent to the remote repository with
4109 can be run without further arguments.
4110 The arguments shown here match defaults, provided the work tree's
4111 current branch is the
4115 .Dl $ got send -b master origin
4117 If the remote repository requires the HTTPS protocol, the
4119 command must be used instead:
4121 .Dl $ cd /var/git/src.git
4122 .Dl $ git push origin master
4124 When making contributions to projects which use the
4126 workflow, SSH protocol repository access needs to be set up first.
4127 Once an account has been created on a Git hosting site it should
4128 be possible to upload a public SSH key for repository access
4133 workflow will usually involve two remote repositories.
4134 In the real-life example below, the
4136 repository was forked from the
4138 repository by using the Git hosting site's web interface.
4141 file in the local repository describes both remote repositories:
4142 .Bd -literal -offset indent
4143 # Jelmers's repository, which accepts pull requests
4145 server git@github.com
4147 repository "/jelmer/dulwich"
4151 # Stefan's fork, used as the default remote repository
4153 server git@github.com
4155 repository "/stspdotname/dulwich"
4160 With this configuration, Stefan can create commits on
4161 .Dq refs/heads/master
4162 and send them to the
4164 repository by running:
4166 .Dl $ got send -b master origin
4168 The changes can now be proposed to Jelmer by opening a pull request
4169 via the Git hosting site's web interface.
4170 If Jelmer requests further changes to be made, additional commits
4171 can be created on the
4173 branch and be added to the pull request by running
4177 If Jelmer prefers additional commits to be
4179 then the following commands can be used to achieve this:
4181 .Dl $ got update -b master
4182 .Dl $ got update -c origin/master
4183 .Dl $ got histedit -f
4184 .Dl $ got send -f -b master origin
4186 In addition to reviewing the pull request in the web user interface,
4187 Jelmer can fetch the pull request's branch into his local repository
4188 and create a local branch which contains the proposed changes:
4190 .Dl $ got fetch -R refs/pull/1046/head origin
4191 .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
4193 Once Jelmer has accepted the pull request, Stefan can fetch the
4194 merged changes, and possibly several other new changes, by running:
4196 .Dl $ got fetch upstream
4198 The merged changes will now be visible under the reference
4199 .Dq refs/remotes/upstream/master .
4202 branch can now be rebased on top of the latest changes
4205 .Dl $ got update -b upstream/master
4206 .Dl $ got rebase master
4208 As an alternative to
4210 branches can be merged with
4213 .Dl $ got update -b master
4214 .Dl $ got merge upstream/master
4216 The question of whether to rebase or merge branches is philosophical.
4217 When in doubt, refer to the software project's policies set by project
4220 As a final step, the forked repository's copy of the master branch needs
4221 to be kept in sync by sending the new changes there:
4223 .Dl $ got send -f -b master origin
4225 If multiple pull requests need to be managed in parallel, a separate branch
4226 must be created for each pull request with
4228 Each such branch can then be used as above, in place of
4229 .Dq refs/heads/master .
4230 Changes for any accepted pull requests will still appear under
4231 .Dq refs/remotes/upstream/master,
4232 regardless of which branch was used in the forked repository to
4233 create a pull request.
4237 .Xr git-repository 5 ,
4238 .Xr got-worktree 5 ,
4242 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
4243 .An Christian Weisgerber Aq Mt naddy@openbsd.org
4244 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
4245 .An Josh Rickmar Aq Mt jrick@zettaport.com
4246 .An Joshua Stein Aq Mt jcs@openbsd.org
4247 .An Klemens Nanni Aq Mt kn@openbsd.org
4248 .An Martin Pieuchot Aq Mt mpi@openbsd.org
4249 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
4250 .An Omar Polo Aq Mt op@openbsd.org
4251 .An Ori Bernstein Aq Mt ori@openbsd.org
4252 .An Sebastien Marie Aq Mt semarie@openbsd.org
4253 .An Stefan Sperling Aq Mt stsp@openbsd.org
4254 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
4255 .An Theo Buehler Aq Mt tb@openbsd.org
4256 .An Thomas Adam Aq Mt thomas@xteddy.org
4257 .An Tracey Emery Aq Mt tracey@traceyemery.net
4258 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
4265 were derived from code under copyright by:
4267 .An Caldera International
4268 .An Daniel Hartmeier
4273 .An Jean-Francois Brousseau
4279 .An Niklas Hallqvist
4284 .An Xavier Santolaria
4287 contains code contributed to the public domain by
4288 .An Austin Appleby .
4291 is a work-in-progress and some features remain to be implemented.
4293 At present, the user has to fall back on
4295 to perform some tasks.
4299 Reading from remote repositories over HTTP or HTTPS protocols requires
4304 Writing to remote repositories over HTTP or HTTPS protocols requires
4307 The creation of merge commits with more than two parent commits requires
4310 In situations where files or directories were moved around
4312 will not automatically merge changes to new locations and
4314 will usually produce better results.