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.
188 Not compatible with servers using the
194 Git HTTP protocol is supported by
200 Sending from a repository cloned over HTTP will require use of the
206 protocol will be used by
209 Use of this protocol is discouraged since it supports neither authentication
214 Git HTTP protocol wrapped in SSL/TLS.
217 Objects in the cloned repository are stored in a pack file which is downloaded
219 This pack file will then be indexed to facilitate access to the objects stored
221 If any objects in the pack file are stored in deltified form, all deltas will
222 be fully resolved in order to compute the ID of such objects.
223 This can take some time.
224 More details about the pack file format are documented in
225 .Xr git-repository 5 .
228 creates a remote repository entry in the
232 files of the cloned repository to store the
238 arguments for future use by
248 Fetch all branches from the remote repository's
250 reference namespace and set
251 .Cm fetch_all_branches
252 in the cloned repository's
254 file for future use by
256 If this option is not specified, a branch resolved via the remote
257 repository's HEAD reference will be fetched.
258 Cannot be used together with the
264 from the remote repository's
267 This option may be specified multiple times to build a list of branches
269 If the branch corresponding to the remote repository's HEAD reference is not
270 in this list, the cloned repository's HEAD reference will be set to the first
271 branch which was fetched.
272 If this option is not specified, a branch resolved via the remote
273 repository's HEAD reference will be fetched.
274 Cannot be used together with the
278 List branches and tags available for fetching from the remote repository
279 and exit immediately.
280 Cannot be used together with any of the other options except
285 Create the cloned repository as a mirror of the original repository.
286 This is useful if the cloned repository will not be used to store
287 locally created commits.
293 files will be set up with the
295 option enabled, such that
299 will write incoming changes directly to branches in the
301 reference namespace, rather than to branches in the
304 This avoids the usual requirement of having to run
310 in order to make incoming changes appear on branches in the
313 But maintaining custom changes in the cloned repository becomes difficult
314 since such changes will be at risk of being discarded whenever incoming
317 Suppress progress reporting output.
318 The same option will be passed to
321 .It Fl R Ar reference
322 In addition to the branches and tags that will be fetched, fetch an arbitrary
324 from the remote repository's
327 This option may be specified multiple times to build a list of additional
331 may either be a path to a specific reference, or a reference namespace
332 which will cause all references in this namespace to be fetched.
334 Each reference will be mapped into the cloned repository's
336 namespace, unless the
338 option is used to mirror references directly into the cloned repository's
343 will refuse to fetch references from the remote repository's
352 to print debugging messages to standard error output.
353 This option will be passed to
356 Multiple -v options increase the verbosity.
364 .Op Fl R Ar reference
365 .Op Fl r Ar repository-path
366 .Op Ar remote-repository
369 Fetch new changes from a remote repository.
371 .Ar remote-repository
375 The remote repository's URL is obtained from the corresponding entry in
379 file of the local repository, as created by
382 By default, any branches configured in
385 .Ar remote-repository
389 is invoked in a work tree then this work tree's current branch will be
390 fetched, too, provided it is present on the server.
391 If no branches to fetch can be found in
393 or via a work tree, or said branches are not found on the server, a branch
394 resolved via the remote repository's HEAD reference will be fetched.
395 Likewise, if a HEAD reference for the
396 .Ar remote-repository
397 exists but its target no longer matches the remote HEAD, then
398 the new target branch will be fetched.
399 This default behaviour can be overridden with the
405 New changes will be stored in a separate pack file downloaded from the server.
406 Optionally, separate pack files stored in the repository can be combined with
409 By default, branch references in the
411 reference namespace will be updated to point at the newly fetched commits.
416 command can then be used to make new changes visible on branches in the
418 namespace, merging incoming changes with the changes on those branches
421 If the repository was created as a mirror with
423 then all branches in the
425 namespace will be updated directly to match the corresponding branches in
426 the remote repository.
427 If those branches contained local commits, these commits will no longer be
428 reachable via a reference and will therefore be at risk of being discarded
429 by Git's garbage collector or
430 .Cm gotadmin cleanup .
431 Maintaining custom changes in a mirror repository is therefore discouraged.
433 In any case, references in the
435 namespace will always be fetched and mapped directly to local references
436 in the same namespace.
443 Fetch all branches from the remote repository's
446 This option can be enabled by default for specific repositories in
448 Cannot be used together with the
454 from the remote repository's
457 This option may be specified multiple times to build a list of branches
459 Cannot be used together with the
463 Delete branches and tags from the local repository which are no longer
464 present in the remote repository.
465 Only references are deleted.
466 Any commit, tree, tag, and blob objects belonging to deleted branches or
467 tags remain in the repository and may be removed separately with
468 Git's garbage collector or
469 .Cm gotadmin cleanup .
471 List branches and tags available for fetching from the remote repository
472 and exit immediately.
473 Cannot be used together with any of the other options except
479 Suppress progress reporting output.
480 The same option will be passed to
483 .It Fl R Ar reference
484 In addition to the branches and tags that will be fetched, fetch an arbitrary
486 from the remote repository's
489 This option may be specified multiple times to build a list of additional
493 may either be a path to a specific reference, or a reference namespace
494 which will cause all references in this namespace to be fetched.
496 Each reference will be mapped into the local repository's
498 namespace, unless the local repository was created as a mirror with
500 in which case references will be mapped directly into the local repository's
504 Once a reference has been fetched, a branch based on it can be created with
509 will refuse to fetch references from the remote repository's
514 .It Fl r Ar repository-path
515 Use the repository at the specified path.
516 If not specified, assume the repository is located at or above the current
518 If this directory is a
520 work tree, use the repository path associated with this work tree.
522 Allow existing references in the
524 namespace to be updated if they have changed on the server.
525 If not specified, only new tag references will be created.
530 to print debugging messages to standard error output.
531 The same option will be passed to
534 Multiple -v options increase the verbosity.
537 Delete all references which correspond to a particular
538 .Ar remote-repository
539 instead of fetching new changes.
540 This can be useful when a remote repository is being removed from
546 .Ar remote-repository
547 argument is mandatory and no other options except
554 Only references are deleted.
555 Any commit, tree, tag, and blob objects fetched from a remote repository
556 will generally be stored in pack files and may be removed separately with
558 and Git's garbage collector.
566 .Op Fl p Ar path-prefix
568 .Op Ar work-tree-path
571 Copy files from a repository into a new work tree.
572 Show the status of each affected file, using the following status codes:
573 .Bl -column YXZ description
574 .It A Ta new file was added
575 .It E Ta file already exists in work tree's meta-data
580 is not specified, either use the last component of
581 .Ar repository path ,
584 was specified use the last component of
592 Check out files from a commit on the specified
594 If this option is not specified, a branch resolved via the repository's HEAD
595 reference will be used.
597 Check out files from the specified
599 on the selected branch.
600 If this option is not specified, the most recent commit on the selected
605 argument is a commit ID SHA1 hash, or a reference name or a keyword
606 which will be resolved to a commit ID.
607 An abbreviated hash argument will be expanded to a full SHA1 hash
608 automatically, provided the abbreviation is unique.
613 resolve to the repository's HEAD reference, or, if the
615 option is used, the head of the checked-out
617 Keywords and reference names may be appended with
621 modifiers and an optional integer N to denote the
622 Nth descendant or antecedent by first parent traversal, respectively;
625 denotes the work tree branch head's 2nd generation ancestor, and
627 will denote the 3rd generation ancestor of the commit resolved by the
630 If an integer does not follow the
636 is implicitly appended
645 is not contained in the selected branch, a different branch which contains
646 this commit must be specified with the
649 If no such branch is known, a new branch must be created for this
655 Checking out work trees with an unknown branch is intentionally not supported.
657 Proceed with the checkout operation even if the directory at
660 Existing files will be left intact.
661 .It Fl p Ar path-prefix
662 Restrict the work tree to a subset of the repository's tree hierarchy.
663 Only files beneath the specified
667 Silence progress output.
678 Update an existing work tree to a different
680 Change existing files in the work tree as necessary to match file contents
682 Preserve any local changes in the work tree and merge them with the
685 Files which already contain merge conflicts will not be updated to avoid
686 further complications.
687 Such files will be updated when
689 is run again after merge conflicts have been resolved.
690 If the conflicting changes are no longer needed, affected files can be
697 Show the status of each affected file, using the following status codes:
698 .Bl -column YXZ description
699 .It U Ta file was updated and contained no local changes
700 .It G Ta file was updated and local changes were merged cleanly
701 .It C Ta file was updated and conflicts occurred during merge
702 .It D Ta file was deleted
703 .It d Ta file's deletion was prevented by local modifications
704 .It A Ta new file was added
705 .It \(a~ Ta versioned file is obstructed by a non-regular file
706 .It ! Ta a missing versioned file was restored
707 .It # Ta file was not updated because it contains merge conflicts
708 .It ? Ta changes destined for an unversioned file were not merged
713 is specified, update the entire work tree.
714 Otherwise, restrict the update operation to files at or within the
716 Each path is required to exist in the update operation's target commit.
717 Files in the work tree outside specified paths will remain unchanged and
718 will retain their previously recorded base commit.
721 commands may refuse to run while the work tree contains files from
722 multiple base commits.
723 The base commit of such a work tree can be made consistent by running
725 across the entire work tree.
728 is incompatible with the
733 cannot update paths with staged changes.
734 If changes have been staged with
736 these changes must first be committed with
746 Switch the work tree's branch reference to the specified
748 before updating the work tree.
749 This option requires that all paths in the work tree are updated.
751 As usual, any local changes in the work tree will be preserved.
752 This can be useful when switching to a newly created branch in order
753 to commit existing local changes to this branch.
755 Any local changes must be dealt with separately in order to obtain a
756 work tree with pristine file contents corresponding exactly to the specified
758 Such changes could first be committed to a different branch with
760 or could be discarded with
763 Update the work tree to the specified
765 If this option is not specified, the most recent commit on the work tree's
770 argument is a commit ID SHA1 hash, or a reference name or a keyword
771 which will be resolved to a commit ID.
772 An abbreviated hash argument will be expanded to a full SHA1 hash
773 automatically, provided the abbreviation is unique.
778 resolve to the work tree's base commit and branch head, respectively.
779 Keywords and reference names may be appended with
783 modifiers and an optional integer N to denote the
784 Nth descendant or antecedent, respectively, by first parent traversal;
787 denotes the work tree branch head's 2nd generation ancestor, and
789 denotes the 4th generation descendant of the work tree's base commit.
792 will denote the 3rd generation ancestor of the commit resolved by the
795 If an integer does not follow the
801 is implicitly appended
808 Silence progress output.
814 .Op Fl S Ar status-codes
815 .Op Fl s Ar status-codes
819 Show the current modification status of files in a work tree,
820 using the following status codes:
821 .Bl -column YXZ description
822 .It M Ta modified file
823 .It A Ta file scheduled for addition in next commit
824 .It D Ta file scheduled for deletion in next commit
825 .It C Ta modified or added file which contains merge conflicts
826 .It ! Ta versioned file was expected on disk but is missing
827 .It \(a~ Ta versioned file is obstructed by a non-regular file
828 .It ? Ta unversioned item not tracked by
830 .It m Ta modified file modes (executable bit only)
831 .It N Ta non-existent
833 specified on the command line
838 is specified, show modifications in the entire work tree.
839 Otherwise, show modifications at or within the specified paths.
841 If changes have been staged with
843 staged changes are shown in the second output column, using the following
845 .Bl -column YXZ description
846 .It M Ta file modification is staged
847 .It A Ta file addition is staged
848 .It D Ta file deletion is staged
851 Changes created on top of staged changes are indicated in the first column:
852 .Bl -column YXZ description
853 .It MM Ta file was modified after earlier changes have been staged
854 .It MA Ta file was modified after having been staged for addition
857 If the work tree contains the results of an interrupted
862 operation then display a message which shows the branches involved.
869 Show unversioned files even if they match an ignore pattern.
870 .It Fl S Ar status-codes
871 Suppress the output of files with a modification status matching any of the
872 single-character status codes contained in the
875 Any combination of codes from the above list of possible status codes
877 For staged files, status codes displayed in either column will be matched.
878 Cannot be used together with the
881 .It Fl s Ar status-codes
882 Only show files with a modification status matching any of the
883 single-character status codes contained in the
886 Any combination of codes from the above list of possible status codes
888 For staged files, status codes displayed in either column will be matched.
889 Cannot be used together with the
894 For compatibility with
905 files in each traversed directory and will not display unversioned files
906 which match these patterns.
907 Ignore patterns which end with a slash,
909 will only match directories.
914 supports consecutive asterisks,
916 which will match an arbitrary amount of directories.
920 only supports a single ignore pattern per line.
924 does not support negated ignore patterns prefixed with
926 and gives no special significance to the location of path component separators,
935 .Op Fl r Ar repository-path
936 .Op Fl S Ar search-pattern
940 Display history of a repository.
943 is specified, show only commits which modified this path.
944 If invoked in a work tree, the
946 is interpreted relative to the current working directory,
947 and the work tree's path prefix is implicitly prepended.
948 Otherwise, the path is interpreted relative to the repository root.
955 Display individual commits which were merged into the current branch
959 shows the linear history of the current branch only.
961 Set the number of context lines shown in diffs with
963 By default, 3 lines of context are shown.
965 Start traversing history at the specified
967 If this option is not specified, default to the work tree's current branch
968 if invoked in a work tree, or to the repository's HEAD reference.
972 argument is a commit ID SHA1 hash, or a reference name or a keyword
973 which will be resolved to a commit ID.
974 An abbreviated hash argument will be expanded to a full SHA1 hash
975 automatically, provided the abbreviation is unique.
980 resolve to the work tree's base commit and branch head, respectively.
981 The former is only valid if invoked in a work tree, while the latter will
982 resolve to the tip of the work tree's current branch if invoked in a
983 work tree, otherwise it will resolve to the repository's HEAD reference.
984 Keywords and references may be appended with
988 modifiers and an optional integer N to denote the
989 Nth descendant or antecedent, respectively, by first parent traversal;
992 denotes the HEAD reference's 2nd generation ancestor, and
994 denotes the 4th generation descendant of the work tree's base commit.
997 will denote the 3rd generation descendant of the commit resolved by the
1004 modifier without a trailing integer has an implicit
1013 Display diffstat of changes introduced in each commit.
1014 Cannot be used with the
1019 option (diffstat displays a list of changed paths).
1021 Limit history traversal to a given number of commits.
1022 If this option is not specified, a default limit value of zero is used,
1023 which is treated as an unbounded limit.
1025 .Ev GOT_LOG_DEFAULT_LIMIT
1026 environment variable may be set to change this default value.
1028 Display the list of file paths changed in each commit, using the following
1030 .Bl -column YXZ description
1031 .It M Ta modified file
1032 .It D Ta file was deleted
1033 .It A Ta new file was added
1034 .It m Ta modified file modes (executable bit only)
1037 Cannot be used with the
1041 Display the patch of modifications made in each commit.
1044 is specified, only show the patch of modifications at or within this path.
1045 Cannot be used with the
1049 Determine a set of commits to display as usual, but display these commits
1051 .It Fl r Ar repository-path
1052 Use the repository at the specified path.
1053 If not specified, assume the repository is located at or above the current
1055 If this directory is a
1057 work tree, use the repository path associated with this work tree.
1058 .It Fl S Ar search-pattern
1059 If specified, show only commits with a log message, author name,
1060 committer name, or ID SHA1 hash matched by the extended regular
1062 .Ar search-pattern .
1063 Lines in committed patches will be matched if
1066 File paths changed by a commit will be matched if
1069 Regular expression syntax is documented in
1072 Display a short one-line summary of each commit, instead of the default
1074 Cannot be used together with the
1080 Display commits in topological order.
1081 This option has no effect without the
1083 option because a linear history is sorted in topological order by definition.
1084 Topological sorting is disabled by default because the present implementation
1085 requires that commit history is fully traversed before any output can be shown.
1087 Stop traversing commit history immediately after the specified
1094 argument is a commit ID SHA1 hash, or a reference name or a keyword
1095 which will be resolved to a commit ID.
1096 This option has no effect if the specified
1106 .Op Fl r Ar repository-path
1107 .Op Ar object1 Ar object2 | Ar path ...
1110 When invoked within a work tree without any arguments, display all
1111 local changes in the work tree.
1114 arguments are specified, only show changes within the specified paths.
1116 If two arguments are provided, treat each argument as a reference, a tag
1117 name, or an object ID SHA1 hash, and display differences between the
1118 corresponding objects.
1119 Both objects must be of the same type (blobs, trees, or commits).
1120 An abbreviated hash argument will be expanded to a full SHA1 hash
1121 automatically, provided the abbreviation is unique.
1122 If none of these interpretations produce a valid result or if the
1127 is running in a work tree, attempt to interpret the two arguments as paths.
1134 Treat file contents as ASCII text even if binary data is detected.
1136 Set the number of context lines shown in the diff.
1137 By default, 3 lines of context are shown.
1139 Show differences between commits in the repository.
1140 This option may be used up to two times.
1141 When used only once, show differences between the specified
1143 and its first parent commit.
1144 When used twice, show differences between the two specified commits.
1148 option is used, all non-option arguments will be interpreted as paths.
1151 arguments are provided, only show differences for the specified paths.
1155 argument is a commit ID SHA1 hash, or a reference name or a keyword
1156 which will be resolved to a commit ID.
1157 An abbreviated hash argument will be expanded to a full SHA1 hash
1158 automatically, provided the abbreviation is unique.
1163 resolve to the work tree's base commit and branch head, respectively.
1164 The former is only valid if invoked in a work tree, while the latter will
1165 resolve to the tip of the work tree's current branch if invoked in a
1166 work tree, otherwise it will resolve to the repository's HEAD reference.
1167 Keywords and references may be appended with
1171 modifiers and an optional integer N to denote the
1172 Nth descendant or antecedent, respectively, by first parent traversal;
1175 denotes the HEAD reference's 2nd generation ancestor, and
1177 denotes the 4th generation descendant of the work tree's base commit.
1180 will denote the 8th generation descendant of the commit resolved by the
1183 If an integer does not follow the
1189 is implicitly appended
1196 Cannot be used together with the
1200 Display diffstat of changes before the actual diff by annotating each file path
1201 or blob hash being diffed with the total number of lines added and removed.
1202 A summary line will display the total number of changes across all files.
1204 Interpret all arguments as paths only.
1205 This option can be used to resolve ambiguity in cases where paths
1206 look like tag names, reference names, or object IDs.
1207 This option is only valid when
1209 is invoked in a work tree.
1210 .It Fl r Ar repository-path
1211 Use the repository at the specified path.
1212 If not specified, assume the repository is located at or above the current
1214 If this directory is a
1216 work tree, use the repository path associated with this work tree.
1218 Show changes staged with
1220 instead of showing local changes in the work tree.
1221 This option is only valid when
1223 is invoked in a work tree.
1225 Ignore whitespace-only changes.
1231 .Op Fl r Ar repository-path
1235 Display line-by-line history of a file at the specified path.
1242 Start traversing history at the specified
1244 The expected argument is a commit ID SHA1 hash, or a reference name
1245 or a keyword which will be resolved to a commit ID.
1246 An abbreviated hash argument will be expanded to a full SHA1 hash
1247 automatically, provided the abbreviation is unique.
1252 resolve to the work tree's base commit and branch head, respectively.
1253 The former is only valid if invoked in a work tree, while the latter will
1254 resolve to the tip of the work tree's current branch if invoked in a
1255 work tree, otherwise it will resolve to the repository's HEAD reference.
1256 Keywords and references may be appended with
1260 modifiers and an optional integer N to denote the
1261 Nth descendant or antecedent by first parent traversal, respectively;
1264 denotes the work tree branch head's 2nd generation ancestor, and
1266 denotes the 4th generation descendant of the work tree's base commit.
1269 will denote the 5th generation ancestor of the commit resolved by the
1276 modifier without a trailing integer has an implicit
1284 .It Fl r Ar repository-path
1285 Use the repository at the specified path.
1286 If not specified, assume the repository is located at or above the current
1288 If this directory is a
1290 work tree, use the repository path associated with this work tree.
1297 .Op Fl r Ar repository-path
1301 Display a listing of files and directories at the specified
1302 directory path in the repository.
1303 Entries shown in this listing may carry one of the following trailing
1305 .Bl -column YXZ description
1306 .It @ Ta entry is a symbolic link
1307 .It / Ta entry is a directory
1308 .It * Ta entry is an executable file
1309 .It $ Ta entry is a Git submodule
1312 Symbolic link entries are also annotated with the target path of the link.
1316 is specified, list the repository path corresponding to the current
1317 directory of the work tree, or the root directory of the repository
1318 if there is no work tree.
1325 List files and directories as they appear in the specified
1328 The expected argument is a commit ID SHA1 hash, or a reference name
1329 or a keyword which will be resolved to a commit ID.
1330 An abbreviated hash argument will be expanded to a full SHA1 hash
1331 automatically, provided the abbreviation is unique.
1336 resolve to the work tree's base commit and branch head, respectively.
1337 The former is only valid if invoked in a work tree, while the latter will
1338 resolve to the tip of the work tree's current branch if invoked in a
1339 work tree, otherwise it will resolve to the repository's HEAD reference.
1340 Keywords and references may be appended with
1344 modifiers and an optional integer N to denote the
1345 Nth descendant or antecedent by first parent traversal, respectively;
1348 denotes the work tree branch head's 2nd generation ancestor, and
1350 denotes the 4th generation descendant of the work tree's base commit.
1353 will denote the 3rd generation ancestor of the commit resolved by the
1360 modifier without a trailing integer has an implicit
1369 Show object IDs of files (blob objects) and directories (tree objects).
1371 Recurse into sub-directories in the repository.
1372 .It Fl r Ar repository-path
1373 Use the repository at the specified path.
1374 If not specified, assume the repository is located at or above the current
1376 If this directory is a
1378 work tree, use the repository path associated with this work tree.
1384 .Op Fl r Ar repository-path
1385 .Op Fl s Ar reference
1388 Manage references in a repository.
1390 References may be listed, created, deleted, and changed.
1391 When creating, deleting, or changing a reference the specified
1393 must be an absolute reference name, i.e. it must begin with
1401 Create a reference or change an existing reference.
1402 The reference with the specified
1404 will point at the specified
1409 argument is an ID SHA1 hash or an existing reference or tag name
1410 or a keyword which will be resolved to the ID of a corresponding commit,
1411 tree, tag, or blob object.
1412 An abbreviated hash argument will be expanded to a full SHA1 hash
1413 automatically, provided the abbreviation is unique.
1418 resolve to the work tree's base commit and branch head, respectively.
1419 The former is only valid if invoked in a work tree, while the latter will
1420 resolve to the tip of the work tree's current branch if invoked in a
1421 work tree, otherwise it will resolve to the repository's HEAD reference.
1422 Keywords and reference names may be appended with
1426 modifiers and an optional integer N to denote the
1427 Nth descendant or antecedent by first parent traversal, respectively;
1430 denotes the work tree branch head's 2nd generation ancestor, and
1432 will denote the 3rd generation ancestor of the commit resolved by the
1435 If an integer does not follow the
1441 is implicitly appended
1448 Cannot be used together with any other options except
1451 Delete the reference with the specified
1453 from the repository.
1454 Any commit, tree, tag, and blob objects belonging to deleted references
1455 remain in the repository and may be removed separately with
1456 Git's garbage collector or
1457 .Cm gotadmin cleanup .
1458 Cannot be used together with any other options except
1461 List references in the repository.
1464 is specified, list all existing references in the repository.
1467 is a reference namespace, list all references in this namespace.
1468 Otherwise, show only the reference with the given
1470 Cannot be used together with any other options except
1474 .It Fl r Ar repository-path
1475 Use the repository at the specified path.
1476 If not specified, assume the repository is located at or above the current
1478 If this directory is a
1480 work tree, use the repository path associated with this work tree.
1481 .It Fl s Ar reference
1482 Create a symbolic reference, or change an existing symbolic reference.
1483 The symbolic reference with the specified
1485 will point at the specified
1487 which must already exist in the repository.
1488 Care should be taken not to create loops between references when
1489 this option is used.
1490 Cannot be used together with any other options except
1493 Sort listed references by modification time (most recently modified first)
1494 instead of sorting by lexicographical order.
1495 Use of this option requires the
1497 option to be used as well.
1505 .Op Fl r Ar repository-path
1509 Create, list, or delete branches.
1511 Local branches are managed via references which live in the
1513 reference namespace.
1516 command creates references in this namespace only.
1518 When deleting branches, the specified
1522 reference namespace first.
1523 If no corresponding branch is found, the
1525 namespace will be searched next.
1527 If invoked in a work tree without any arguments, print the name of the
1528 work tree's current branch.
1532 argument is passed, attempt to create a branch reference with the given name.
1533 By default the new branch reference will point at the latest commit on the
1534 work tree's current branch if invoked in a work tree, and otherwise to a commit
1535 resolved via the repository's HEAD reference.
1537 If invoked in a work tree, once the branch was created successfully
1538 switch the work tree's head reference to the newly created branch and
1539 update files across the entire work tree, just like
1540 .Cm got update -b Ar name
1542 Show the status of each affected file, using the following status codes:
1543 .Bl -column YXZ description
1544 .It U Ta file was updated and contained no local changes
1545 .It G Ta file was updated and local changes were merged cleanly
1546 .It C Ta file was updated and conflicts occurred during merge
1547 .It D Ta file was deleted
1548 .It A Ta new file was added
1549 .It \(a~ Ta versioned file is obstructed by a non-regular file
1550 .It ! Ta a missing versioned file was restored
1558 Make a newly created branch reference point at the specified
1560 The expected argument is a commit ID SHA1 hash, or a reference name or keyword
1561 which will be resolved to a commit ID.
1562 An abbreviated hash argument will be expanded to a full SHA1 hash
1563 automatically, provided the abbreviation is unique.
1568 resolve to the work tree's base commit and branch head, respectively.
1569 The former is only valid if invoked in a work tree, while the latter will
1570 resolve to the tip of the work tree's current branch if invoked in a
1571 work tree, otherwise it will resolve to the repository's HEAD reference.
1572 Keywords and references may be appended with
1576 modifiers and an optional integer N to denote the
1577 Nth descendant or antecedent by first parent traversal, respectively;
1580 denotes the work tree branch head's 2nd generation ancestor, and
1582 denotes the 4th generation descendant of the work tree's base commit.
1585 will denote the 3rd generation descendant of the commit resolved by the
1592 modifier without a trailing integer has an implicit
1601 Delete the branch with the specified
1607 reference namespace.
1609 Only the branch reference is deleted.
1610 Any commit, tree, and blob objects belonging to the branch
1611 remain in the repository and may be removed separately with
1612 Git's garbage collector or
1613 .Cm gotadmin cleanup .
1615 List all existing branches in the repository, including copies of remote
1616 repositories' branches in the
1618 reference namespace.
1620 If invoked in a work tree, the work tree's current branch is shown
1621 with one of the following annotations:
1622 .Bl -column YXZ description
1623 .It * Ta work tree's base commit and the base commit of all tracked files
1624 matches the branch tip
1625 .It \(a~ Ta work tree comprises mixed commits or its base commit is out-of-date
1628 Do not switch and update the work tree after creating a new branch.
1629 .It Fl r Ar repository-path
1630 Use the repository at the specified path.
1631 If not specified, assume the repository is located at or above the current
1633 If this directory is a
1635 work tree, use the repository path associated with this work tree.
1637 Sort listed branches by modification time (most recently modified first)
1638 instead of sorting by lexicographical order.
1641 reference namespace are listed before branches in
1644 Use of this option requires the
1646 option to be used as well.
1653 .Op Fl r Ar repository-path
1654 .Op Fl s Ar signer-id
1657 Manage tags in a repository.
1659 Tags are managed via references which live in the
1661 reference namespace.
1664 command operates on references in this namespace only.
1665 References in this namespace point at tag objects which contain a pointer
1666 to another object, a tag message, as well as author and timestamp information.
1668 Attempt to create a tag with the given
1670 and make this tag point at the given
1672 If no commit is specified, default to the latest commit on the work tree's
1673 current branch if invoked in a work tree, and to a commit resolved via
1674 the repository's HEAD reference otherwise.
1681 Make the newly created tag reference point at the specified
1685 argument is a commit ID SHA1 hash, or a reference or keyword
1686 which will be resolved to a commit ID.
1687 An abbreviated hash argument will be expanded to a full SHA1 hash
1688 automatically, provided the abbreviation is unique.
1693 resolve to the work tree's base commit and branch head, respectively.
1694 The former is only valid if invoked in a work tree, while the latter will
1695 resolve to the tip of the work tree's current branch if invoked in a
1696 work tree, otherwise it will resolve to the repository's HEAD reference.
1697 Keywords and references may be appended with
1701 modifiers and an optional integer N to denote the
1702 Nth descendant or antecedent by first parent traversal, respectively;
1705 denotes the work tree branch head's 2nd generation ancestor, and
1707 denotes the 4th generation descendant of the work tree's base commit.
1710 will denote the 3rd generation ancestor of the commit resolved by the
1717 modifier without a trailing integer has an implicit
1726 List all existing tags in the repository instead of creating a new tag.
1729 argument is passed, show only the tag with the given
1732 Use the specified tag message when creating the new tag.
1737 opens a temporary file in an editor where a tag message can be written.
1738 Quitting the editor without saving the file will abort the tag operation.
1739 .It Fl r Ar repository-path
1740 Use the repository at the specified path.
1741 If not specified, assume the repository is located at or above the current
1743 If this directory is a
1745 work tree, use the repository path associated with this work tree.
1746 .It Fl s Ar signer-id
1747 While creating a new tag, sign this tag with the identity given in
1750 For SSH-based signatures,
1752 is the path to a file which may refer to either a private SSH key,
1753 or a public SSH key with the private half available via
1756 will sign the tag object by invoking
1760 command, using the signature namespace
1762 for compatibility with
1765 Verify tag object signatures.
1768 is specified, show and verify the tag object with the provided name.
1769 Otherwise, list all tag objects and verify signatures where present.
1772 verifies SSH-based signatures by invoking
1775 .Fl Y Cm verify Fl f Ar allowed_signers .
1780 otherwise verification is impossible.
1783 During SSH signature creation and verification this option will be passed to
1785 Multiple -v options increase the verbosity.
1791 command will not delete tags or change existing tags.
1792 If a tag must be deleted, the
1794 command may be used to delete a tag's reference.
1795 This should only be done if the tag has not already been copied to
1802 Schedule unversioned files in a work tree for addition to the
1803 repository in the next commit.
1804 By default, files which match a
1806 ignore pattern will not be added.
1810 mentioned in the command line is not an unversioned file then
1813 To avoid unnecessary errors from paths picked up by file globbing patterns
1814 in the shell, paths in the argument list will be silently ignored if they
1817 at all, or if they are reported with one of the following status codes
1818 and do not have changes staged via
1820 .Bl -column YXZ description
1821 .It M Ta modified file
1822 .It A Ta file scheduled for addition in next commit
1823 .It C Ta modified or added file which contains merge conflicts
1824 .It m Ta modified file modes (executable bit only)
1832 Add files even if they match a
1836 Permit recursion into directories.
1837 If this option is not specified,
1839 will refuse to run if a specified
1847 .Op Fl s Ar status-codes
1851 Remove versioned files from a work tree and schedule them for deletion
1852 from the repository in the next commit.
1859 Perform the operation even if a file contains local modifications,
1860 and do not raise an error if a specified
1862 does not exist on disk.
1864 Keep affected files on disk.
1866 Permit recursion into directories.
1867 If this option is not specified,
1869 will refuse to run if a specified
1872 .It Fl s Ar status-codes
1873 Only delete files with a modification status matching one of the
1874 single-character status codes contained in the
1877 The following status codes may be specified:
1878 .Bl -column YXZ description
1879 .It M Ta modified file (this implies the
1882 .It ! Ta versioned file expected on disk but missing
1890 .Op Fl p Ar strip-count
1896 to files in a work tree.
1897 Files added or removed by a patch will be scheduled for addition or removal in
1900 The patch must be in the unified diff format as produced by
1907 diff when invoked with their
1912 argument is provided, read unified diff data from standard input instead.
1916 contains multiple patches, then attempt to apply each of them in sequence.
1918 Show the status of each affected file, using the following status codes:
1919 .Bl -column XYZ description
1920 .It M Ta file was modified
1921 .It G Ta file was merged using a merge-base found in the repository
1922 .It C Ta file was merged and conflicts occurred during merge
1923 .It D Ta file was deleted
1924 .It A Ta file was added
1925 .It # Ta failed to patch the file
1928 If a change does not match at its exact line number, attempt to
1929 apply it somewhere else in the file if a good spot can be found.
1930 Otherwise, the patch will fail to apply.
1934 will refuse to apply a patch if certain preconditions are not met.
1935 Files to be deleted must already be under version control, and must
1936 not have been scheduled for deletion already.
1937 Files to be added must not yet be under version control and must not
1938 already be present on disk.
1939 Files to be modified must already be under version control and may not
1940 contain conflict markers.
1942 If an error occurs, the
1944 operation will be aborted.
1945 Any changes made to the work tree up to this point will be left behind.
1946 Such changes can be viewed with
1948 and can be reverted with
1957 Attempt to locate files within the specified
1959 for use as a merge-base for 3-way merges.
1963 option is not used then
1965 will attempt to locate merge-bases via object IDs found in
1967 meta-data, such as produced by
1973 option is only recommended in the absence of such meta-data.
1975 Ideally, the specified
1977 should contain versions of files which the changes contained in the
1980 Files will be located by path, relative to the repository root.
1983 option is used then leading path components will be stripped
1984 before paths are looked up in the repository.
1986 In case no merge-base is available for a file, changes will be applied
1987 without doing a 3-way merge.
1988 Changes which do not apply cleanly may then be rejected entirely, rather
1989 than producing merge conflicts in the patched target file.
1993 argument is a commit ID SHA1 hash, or a reference name or a keyword
1994 which will be resolved to a commit ID.
1995 An abbreviated hash argument will be expanded to a full SHA1 hash
1996 automatically, provided the abbreviation is unique.
2001 resolve to the work tree's base commit and branch head, respectively.
2002 Keywords and references may be appended with
2006 modifiers and an optional integer N to denote the
2007 Nth descendant or antecedent by first parent traversal, respectively;
2010 denotes the work tree branch head's 2nd generation ancestor, and
2012 denotes the 4th generation descendant of the work tree's base commit.
2015 will denote the 3rd generation descendant of the commit resolved by the
2022 modifier without a trailing integer has an implicit
2031 Do not make any modifications to the work tree.
2032 This can be used to check whether a patch would apply without issues.
2035 contains diffs that affect the same file multiple times, the results
2036 displayed may be incorrect.
2037 .It Fl p Ar strip-count
2038 Specify the number of leading path components to strip from paths
2047 path prefixes generated by
2049 will be recognized and stripped automatically.
2051 Reverse the patch before applying it.
2057 .Op Fl F Ar response-script
2061 Revert any local changes in files at the specified paths in a work tree.
2062 File contents will be overwritten with those contained in the
2063 work tree's base commit.
2064 There is no way to bring discarded changes back after
2067 If a file was added with
2069 it will become an unversioned file again.
2070 If a file was deleted with
2072 it will be restored.
2078 .It Fl F Ar response-script
2086 responses line-by-line from the specified
2088 file instead of prompting interactively.
2090 Instead of reverting all changes in files, interactively select or reject
2091 changes to revert based on
2097 (quit reverting this file) responses.
2098 If a file is in modified status, individual patches derived from the
2099 modified file content can be reverted.
2100 Files in added or deleted status may only be reverted in their entirety.
2102 Permit recursion into directories.
2103 If this option is not specified,
2105 will refuse to run if a specified
2119 Create a new commit in the repository from changes in a work tree
2120 and use this commit as the new base commit for the work tree.
2123 is specified, commit all changes in the work tree.
2124 Otherwise, commit changes at or within the specified paths.
2126 If changes have been explicitly staged for commit with
2128 only commit staged changes and reject any specified paths which
2129 have not been staged.
2132 opens a temporary file in an editor where a log message can be written
2140 options are used together.
2141 Quitting the editor without saving the file will abort the commit operation.
2143 Show the status of each affected file, using the following status codes:
2144 .Bl -column YXZ description
2145 .It M Ta modified file
2146 .It D Ta file was deleted
2147 .It A Ta new file was added
2148 .It m Ta modified file modes (executable bit only)
2151 Files which are not part of the new commit will retain their previously
2152 recorded base commit.
2155 commands may refuse to run while the work tree contains files from
2156 multiple base commits.
2157 The base commit of such a work tree can be made consistent by running
2159 across the entire work tree.
2163 command requires the
2165 environment variable to be set,
2166 unless an author has been configured in
2172 configuration settings can be
2173 obtained from the repository's
2175 file or from Git's global
2184 Set author information in the newly created commit to
2186 This is useful when committing changes on behalf of someone else.
2189 argument must use the same format as the
2191 environment variable.
2193 In addition to storing author information, the newly created commit
2196 information which is obtained, as usual, from the
2198 environment variable, or
2200 or Git configuration settings.
2202 Allow committing files in conflicted status.
2204 Committing files with conflict markers should generally be avoided.
2205 Cases where conflict markers must be stored in the repository for
2206 some legitimate reason should be very rare.
2207 There are usually ways to avoid storing conflict markers verbatim by
2208 applying appropriate programming tricks.
2210 Use the prepared log message stored in the file found at
2212 when creating the new commit.
2214 opens a temporary file in an editor where the prepared log message can be
2215 reviewed and edited further if needed.
2216 Cannot be used together with the
2220 Use the specified log message when creating the new commit.
2221 Cannot be used together with the
2225 This option prevents
2227 from opening the commit message in an editor.
2228 It has no effect unless it is used together with the
2230 option and is intended for non-interactive use such as scripting.
2232 This option prevents
2234 from generating a diff of the to-be-committed changes in a temporary file
2235 which can be viewed while editing a commit message.
2237 Allow the addition of symbolic links which point outside of the path space
2238 that is under version control.
2241 will reject such symbolic links due to safety concerns.
2244 may decide to represent such a symbolic link as a regular file which contains
2245 the link's target path, rather than creating an actual symbolic link which
2246 points outside of the work tree.
2247 Use of this option is discouraged because external mechanisms such as
2249 are better suited for managing symbolic links to paths not under
2254 will refuse to run if certain preconditions are not met.
2255 If the work tree's current branch is not in the
2257 reference namespace, new commits may not be created on this branch.
2258 Local changes may only be committed if they are based on file content
2259 found in the most recent commit on the work tree's branch.
2260 If a path is found to be out of date,
2262 must be used first in order to merge local changes with changes made
2270 .Op Fl r Ar repository-path
2272 .Op Ar remote-repository
2275 Send new changes to a remote repository.
2277 .Ar remote-repository
2281 The remote repository's URL is obtained from the corresponding entry in
2285 file of the local repository, as created by
2288 All objects corresponding to new changes will be written to a temporary
2289 pack file which is then uploaded to the server.
2290 Upon success, references in the
2292 reference namespace of the local repository will be updated to point at
2293 the commits which have been sent.
2295 By default, changes will only be sent if they are based on up-to-date
2296 copies of relevant branches in the remote repository.
2297 If any changes to be sent are based on out-of-date copies or would
2298 otherwise break linear history of existing branches, new changes must
2299 be fetched from the server with
2301 and local branches must be rebased with
2308 option can be used to make exceptions to these requirements.
2315 Send all branches from the local repository's
2317 reference namespace.
2320 option is equivalent to listing all branches with multiple
2323 Cannot be used together with the
2329 from the local repository's
2331 reference namespace.
2332 This option may be specified multiple times to build a list of branches
2334 If this option is not specified, default to the work tree's current branch
2335 if invoked in a work tree, or to the repository's HEAD reference.
2336 Cannot be used together with the
2340 Delete the specified
2342 from the remote repository's
2344 reference namespace.
2345 This option may be specified multiple times to build a list of branches
2348 Only references are deleted.
2349 Any commit, tree, tag, and blob objects belonging to deleted branches
2350 may become subject to deletion by Git's garbage collector running on
2353 Requesting deletion of branches results in an error if the server
2354 does not support this feature or disallows the deletion of branches
2355 based on its configuration.
2357 Attempt to force the server to overwrite existing branches or tags
2358 in the remote repository, even when
2364 would usually be required before changes can be sent.
2365 The server may reject forced requests regardless, depending on its
2368 Any commit, tree, tag, and blob objects belonging to overwritten branches
2369 or tags may become subject to deletion by Git's garbage collector running
2374 reference namespace is globally shared between all repositories.
2377 option to overwrite tags is discouraged because it can lead to
2378 inconsistencies between the tags present in different repositories.
2379 In general, creating a new tag with a different name is recommended
2380 instead of overwriting an existing tag.
2384 option is particularly discouraged if changes being sent are based
2385 on an out-of-date copy of a branch in the remote repository.
2386 Instead of using the
2388 option, new changes should
2391 and local branches should be rebased with
2395 followed by another attempt to send the changes.
2399 option should only be needed in situations where the remote repository's
2400 copy of a branch or tag is known to be out-of-date and is considered
2402 The risks of creating inconsistencies between different repositories
2403 should also be taken into account.
2405 Suppress progress reporting output.
2406 The same option will be passed to
2409 .It Fl r Ar repository-path
2410 Use the repository at the specified path.
2411 If not specified, assume the repository is located at or above the current
2413 If this directory is a
2415 work tree, use the repository path associated with this work tree.
2417 Attempt to send all tags from the local repository's
2419 reference namespace.
2422 option is equivalent to listing all tags with multiple
2425 Cannot be used together with the
2431 from the local repository's
2433 reference namespace, in addition to any branches that are being sent.
2436 option may be specified multiple times to build a list of tags to send.
2437 No tags will be sent if the
2441 Raise an error if the specified
2443 already exists in the remote repository, unless the
2445 option is used to overwrite the server's copy of the tag.
2446 In general, creating a new tag with a different name is recommended
2447 instead of overwriting an existing tag.
2449 Cannot be used together with the
2456 to print debugging messages to standard error output.
2457 The same option will be passed to
2460 Multiple -v options increase the verbosity.
2470 Merge changes from a single
2475 should be on a different branch than the work tree's base commit.
2477 The expected argument is a commit ID SHA1 hash, or a reference name or
2478 keyword which will be resolved to a commit ID.
2479 An abbreviated hash argument will be expanded to a full SHA1 hash
2480 automatically, provided the abbreviation is unique.
2485 resolve to the work tree's base commit and branch head, respectively.
2486 Keywords and references may be appended with
2490 modifiers and an optional integer N to denote the
2491 Nth descendant or antecedent by first parent traversal, respectively;
2494 denotes the work tree branch head's 2nd generation ancestor, and
2496 denotes the 4th generation descendant of the work tree's base commit.
2499 will denote the 3rd generation descendant of the commit resolved by the
2506 modifier without a trailing integer has an implicit
2515 Show the status of each affected file, using the following status codes:
2516 .Bl -column YXZ description
2517 .It G Ta file was merged
2518 .It C Ta file was merged and conflicts occurred during merge
2519 .It ! Ta changes destined for a missing file were not merged
2520 .It D Ta file was deleted
2521 .It d Ta file's deletion was prevented by local modifications
2522 .It A Ta new file was added
2523 .It \(a~ Ta changes destined for a non-regular file were not merged
2524 .It ? Ta changes destined for an unversioned file were not merged
2527 The merged changes will appear as local changes in the work tree, which
2530 amended manually or with further
2536 If invoked in a work tree where no
2541 operation is taking place,
2543 creates a record of commits which have been merged into the work tree.
2544 When a file changed by
2548 the log messages of relevant merged commits will then appear in the editor,
2549 where the messages should be further adjusted to convey the reasons for
2550 cherrypicking the changes.
2551 Upon exiting the editor, if the time stamp of the log message file
2552 is unchanged or the log message is empty,
2554 will fail with an unmodified or empty log message error.
2556 If all the changes in all files touched by a given commit are discarded,
2559 this commit's log message record will also disappear.
2562 will refuse to run if certain preconditions are not met.
2563 If the work tree contains multiple base commits, it must first be updated
2564 to a single base commit with
2566 If any relevant files already contain merge conflicts, these
2567 conflicts must be resolved first.
2575 Display a list of commit log messages recorded by cherrypick operations,
2576 represented by references in the
2577 .Dq refs/got/worktree
2578 reference namespace.
2581 is specified, only show the log message of the specified commit.
2583 If invoked in a work tree, only log messages recorded by cherrypick operations
2584 in the current work tree will be displayed.
2585 Otherwise, all commit log messages will be displayed irrespective of the
2586 work tree in which they were created.
2587 This option cannot be used with
2590 Delete log messages created by previous cherrypick operations, represented by
2592 .Dq refs/got/worktree
2593 reference namespace.
2596 is specified, only delete the log message of the specified commit.
2598 If invoked in a work tree, only log messages recorded by cherrypick operations
2599 in the current work tree will be deleted.
2600 Otherwise, all commit log messages will be deleted irrespective of the
2601 work tree in which they were created.
2602 This option cannot be used with
2613 Reverse-merge changes from a single
2618 should be on the same branch as the work tree's base commit.
2620 The expected argument is a commit ID SHA1 hash, or a reference name
2621 or keyword which will be resolved to a commit ID.
2622 An abbreviated hash argument will be expanded to a full SHA1 hash
2623 automatically, provided the abbreviation is unique.
2628 resolve to the work tree's base commit and branch head, respectively.
2629 Keywords and references may be appended with
2633 modifiers and an optional integer N to denote the
2634 Nth descendant or antecedent by first parent traversal, respectively;
2637 denotes the work tree branch head's 2nd generation ancestor, and
2639 denotes the 4th generation descendant of the work tree's base commit.
2642 will denote the 5th generation descendant of the commit resolved by the
2649 modifier without a trailing integer has an implicit
2658 Show the status of each affected file, using the following status codes:
2659 .Bl -column YXZ description
2660 .It G Ta file was merged
2661 .It C Ta file was merged and conflicts occurred during merge
2662 .It ! Ta changes destined for a missing file were not merged
2663 .It D Ta file was deleted
2664 .It d Ta file's deletion was prevented by local modifications
2665 .It A Ta new file was added
2666 .It \(a~ Ta changes destined for a non-regular file were not merged
2667 .It ? Ta changes destined for an unversioned file were not merged
2670 The reverse-merged changes will appear as local changes in the work tree,
2671 which may be viewed with
2673 amended manually or with further
2679 If invoked in a work tree where no
2684 operation is taking place,
2686 creates a record of commits which have been reverse-merged into the work tree.
2687 When a file changed by
2691 the log messages of relevant reverse-merged commits will then appear in
2692 the editor, where the messages should be further adjusted to convey the
2693 reasons for backing out the changes.
2694 Upon exiting the editor, if the time stamp of the log message file
2695 is unchanged or the log message is empty,
2697 will fail with an unmodified or empty log message error.
2699 If all the changes in all files touched by a given commit are discarded,
2702 this commit's log message record will also disappear.
2705 will refuse to run if certain preconditions are not met.
2706 If the work tree contains multiple base commits, it must first be updated
2707 to a single base commit with
2709 If any relevant files already contain merge conflicts, these
2710 conflicts must be resolved first.
2718 Display a list of commit log messages recorded by backout operations,
2719 represented by references in the
2720 .Dq refs/got/worktree
2721 reference namespace.
2724 is specified, only show the log message of the specified commit.
2726 If invoked in a work tree, only log messages recorded by backout operations
2727 in the current work tree will be displayed.
2728 Otherwise, all commit log messages will be displayed irrespective of the
2729 work tree in which they were created.
2730 This option cannot be used with
2733 Delete log messages created by previous backout operations, represented by
2735 .Dq refs/got/worktree
2736 reference namespace.
2739 is specified, only delete the log message of the specified commit.
2741 If invoked in a work tree, only log messages recorded by backout operations
2742 in the current work tree will be deleted.
2743 Otherwise, all commit log messages will be deleted irrespective of the
2744 work tree in which they were created.
2745 This option cannot be used with
2756 Rebase commits on the specified
2758 onto the tip of the current branch of the work tree.
2761 must share common ancestry with the work tree's current branch.
2762 Rebasing begins with the first descendant commit of the youngest
2763 common ancestor commit shared by the specified
2765 and the work tree's current branch, and stops once the tip commit
2772 is used as intended, the specified
2774 represents a local commit history and may already contain changes
2775 that are not yet visible in any other repositories.
2776 The work tree's current branch, which must be set with
2780 operation, represents a branch from a remote repository which shares
2781 a common history with the specified
2783 but has progressed, and perhaps diverged, due to commits added to the
2786 Rebased commits are accumulated on a temporary branch which the work tree
2787 will remain switched to throughout the entire rebase operation.
2788 Commits on this branch represent the same changes with the same log
2789 messages as their counterparts on the original
2791 but with different commit IDs.
2792 Once rebasing has completed successfully, the temporary branch becomes
2793 the new version of the specified
2795 and the work tree is automatically switched to it.
2796 If author information is available via the
2798 environment variable,
2804 configuration settings, this author information will be used to identify
2809 Old commits in their pre-rebase state are automatically backed up in the
2810 .Dq refs/got/backup/rebase
2811 reference namespace.
2812 As long as these references are not removed older versions of rebased
2813 commits will remain in the repository and can be viewed with the
2816 Removal of these references makes objects which become unreachable via
2817 any reference subject to removal by Git's garbage collector or
2818 .Cm gotadmin cleanup .
2820 While rebasing commits, show the status of each affected file,
2821 using the following status codes:
2822 .Bl -column YXZ description
2823 .It G Ta file was merged
2824 .It C Ta file was merged and conflicts occurred during merge
2825 .It ! Ta changes destined for a missing file were not merged
2826 .It D Ta file was deleted
2827 .It d Ta file's deletion was prevented by local modifications
2828 .It A Ta new file was added
2829 .It \(a~ Ta changes destined for a non-regular file were not merged
2830 .It ? Ta changes destined for an unversioned file were not merged
2833 If merge conflicts occur, the rebase operation is interrupted and may
2834 be continued once conflicts have been resolved.
2835 If any files with destined changes are found to be missing or unversioned,
2836 or if files could not be deleted due to differences in deleted content,
2837 the rebase operation will be interrupted to prevent potentially incomplete
2838 changes from being committed to the repository without user intervention.
2839 The work tree may be modified as desired and the rebase operation can be
2840 continued once the changes present in the work tree are considered complete.
2841 Alternatively, the rebase operation may be aborted which will leave
2843 unmodified and the work tree switched back to its original branch.
2845 If a merge conflict is resolved in a way which renders the merged
2846 change into a no-op change, the corresponding commit will be elided
2847 when the rebase operation continues.
2850 will refuse to run if certain preconditions are not met.
2855 reference namespace, the branch may not be rebased.
2856 If the work tree is not yet fully updated to the tip commit of its
2857 branch, then the work tree must first be updated with
2859 If changes have been staged with
2861 these changes must first be committed with
2865 If the work tree contains local changes, these changes must first be
2872 contains changes to files outside of the work tree's path prefix,
2873 the work tree cannot be used to rebase this branch.
2882 commands will refuse to run while a rebase operation is in progress.
2883 Other commands which manipulate the work tree may be used for
2884 conflict resolution purposes.
2888 is already based on the work tree's current branch, then no commits
2889 need to be rebased and
2891 will simply switch the work tree to the specified
2893 and update files in the work tree accordingly.
2900 Abort an interrupted rebase operation.
2901 If this option is used, no other command-line arguments are allowed.
2903 Allow a rebase operation to continue with files in conflicted status.
2904 This option should generally be avoided, and can only be used with the
2908 Continue an interrupted rebase operation.
2909 If this option is used, no other command-line arguments are allowed except
2912 Show a list of past rebase operations, represented by references in the
2913 .Dq refs/got/backup/rebase
2914 reference namespace.
2916 Display the author, date, and log message of each backed up commit,
2917 the object ID of the corresponding post-rebase commit, and
2918 the object ID of their common ancestor commit.
2919 Given these object IDs,
2926 options can be used to examine the history of either version of the branch,
2931 option can be used to create a new branch from a pre-rebase state if desired.
2935 is specified, only show commits which at some point in time represented this
2937 Otherwise, list all backed up commits for any branches.
2939 If this option is used,
2941 does not require a work tree.
2942 None of the other options can be used together with
2945 Delete backups created by past rebase operations, represented by references
2947 .Dq refs/got/backup/rebase
2948 reference namespace.
2952 is specified, only delete backups which at some point in time represented
2954 Otherwise, delete all references found within
2955 .Dq refs/got/backup/rebase .
2957 Any commit, tree, tag, and blob objects belonging to deleted backups
2958 remain in the repository and may be removed separately with
2959 Git's garbage collector or
2960 .Cm gotadmin cleanup .
2962 If this option is used,
2964 does not require a work tree.
2965 None of the other options can be used together with
2972 .Op Fl F Ar histedit-script
2976 Edit commit history between the work tree's current base commit and
2977 the tip commit of the work tree's current branch.
2981 command requires the
2983 environment variable to be set,
2984 unless an author has been configured in
2990 configuration settings can be obtained from the repository's
2992 file or from Git's global
2998 operation, the work tree's current branch must be set with
3000 to the branch which should be edited, unless this branch is already the
3001 current branch of the work tree.
3002 The tip of this branch represents the upper bound (inclusive) of commits
3007 Furthermore, the work tree's base commit
3010 to a point in this branch's commit history where editing should begin.
3011 This commit represents the lower bound (non-inclusive) of commits touched
3016 Editing of commit history is controlled via a
3018 which can be written in an editor based on a template, passed on the
3019 command line, or generated with the
3026 Quitting the editor without saving the file will abort the histedit operation.
3028 The format of the histedit script is line-based.
3029 Each line in the script begins with a command name, followed by
3030 whitespace and an argument.
3031 For most commands, the expected argument is a commit ID SHA1 hash.
3032 Any remaining text on the line is ignored.
3033 Lines which begin with the
3035 character are ignored entirely.
3037 The available histedit script commands are as follows:
3038 .Bl -column YXZ pick-commit
3039 .It Cm pick Ar commit Ta Use the specified commit as it is.
3040 .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
3041 then interrupt the histedit operation for amending, without creating a commit.
3042 While the histedit operation is interrupted arbitrary files may be edited,
3043 and commands which manipulate the work tree can be used freely.
3048 commands can be used to add new files or remove existing ones.
3051 command can be used to eliminate arbitrary changes from files in the work tree.
3054 command may be used to prepare a subset of changes for inclusion in the
3058 command can be used to insert arbitrary commits into the edited history.
3059 Regular editing of history must eventually be resumed by running
3060 .Cm got histedit -c .
3061 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
3062 listed further below that will be used.
3063 .It Cm drop Ar commit Ta Remove this commit from the edited history.
3064 .It Cm mesg Ar commit Ta Open an editor to create a new log message for this
3068 Every commit in the history being edited must be mentioned in the script.
3069 Lines may be re-ordered to change the order of commits in the edited history.
3070 No commit may be listed more than once.
3072 Edited commits are accumulated on a temporary branch which the work tree
3073 will remain switched to throughout the entire histedit operation.
3074 Once history editing has completed successfully, the temporary branch becomes
3075 the new version of the work tree's branch and the work tree is automatically
3078 Old commits in their pre-histedit state are automatically backed up in the
3079 .Dq refs/got/backup/histedit
3080 reference namespace.
3081 As long as these references are not removed older versions of edited
3082 commits will remain in the repository and can be viewed with the
3085 Removal of these references makes objects which become unreachable via
3086 any reference subject to removal by Git's garbage collector or
3087 .Cm gotadmin cleanup .
3089 While merging commits, show the status of each affected file,
3090 using the following status codes:
3091 .Bl -column YXZ description
3092 .It G Ta file was merged
3093 .It C Ta file was merged and conflicts occurred during merge
3094 .It ! Ta changes destined for a missing file were not merged
3095 .It D Ta file was deleted
3096 .It d Ta file's deletion was prevented by local modifications
3097 .It A Ta new file was added
3098 .It \(a~ Ta changes destined for a non-regular file were not merged
3099 .It ? Ta changes destined for an unversioned file were not merged
3102 If merge conflicts occur, the histedit operation is interrupted and may
3103 be continued once conflicts have been resolved.
3104 If any files with destined changes are found to be missing or unversioned,
3105 or if files could not be deleted due to differences in deleted content,
3106 the histedit operation will be interrupted to prevent potentially incomplete
3107 changes from being committed to the repository without user intervention.
3108 The work tree may be modified as desired and the histedit operation can be
3109 continued once the changes present in the work tree are considered complete.
3110 Alternatively, the histedit operation may be aborted which will leave
3111 the work tree switched back to its original branch.
3113 If a merge conflict is resolved in a way which renders the merged
3114 change into a no-op change, the corresponding commit will be elided
3115 when the histedit operation continues.
3118 will refuse to run if certain preconditions are not met.
3119 If the work tree's current branch is not in the
3121 reference namespace, the history of the branch may not be edited.
3122 If the work tree contains multiple base commits, it must first be updated
3123 to a single base commit with
3125 If changes have been staged with
3127 these changes must first be committed with
3131 If the work tree contains local changes, these changes must first be
3136 If the edited history contains changes to files outside of the work tree's
3137 path prefix, the work tree cannot be used to edit the history of this branch.
3145 commands will refuse to run while a histedit operation is in progress.
3146 Other commands which manipulate the work tree may be used, and the
3148 command may be used to commit arbitrary changes to the temporary branch
3149 while the histedit operation is interrupted.
3156 Abort an interrupted histedit operation.
3157 If this option is used, no other command-line arguments are allowed.
3159 Allow a histedit operation to continue with files in conflicted status.
3160 This option should generally be avoided, and can only be used with the
3164 Continue an interrupted histedit operation.
3165 If this option is used, no other command-line arguments are allowed except
3169 This option is a quick equivalent to a histedit script which drops all
3173 option can only be used when starting a new histedit operation.
3174 If this option is used, no other command-line arguments are allowed.
3176 Interrupt the histedit operation for editing after merging each commit.
3177 This option is a quick equivalent to a histedit script which uses the
3179 command for all commits.
3182 option can only be used when starting a new histedit operation.
3183 If this option is used, no other command-line arguments are allowed.
3184 .It Fl F Ar histedit-script
3187 instead of opening a temporary file in an editor where a histedit script
3190 Fold all commits into a single commit.
3191 This option is a quick equivalent to a histedit script which folds all
3192 commits, combining them all into one commit.
3195 option can only be used when starting a new histedit operation.
3196 If this option is used, no other command-line arguments are allowed.
3198 Show a list of past histedit operations, represented by references in the
3199 .Dq refs/got/backup/histedit
3200 reference namespace.
3202 Display the author, date, and log message of each backed up commit,
3203 the object ID of the corresponding post-histedit commit, and
3204 the object ID of their common ancestor commit.
3205 Given these object IDs,
3212 options can be used to examine the history of either version of the branch,
3217 option can be used to create a new branch from a pre-histedit state if desired.
3221 is specified, only show commits which at some point in time represented this
3223 Otherwise, list all backed up commits for any branches.
3225 If this option is used,
3227 does not require a work tree.
3228 None of the other options can be used together with
3231 Edit log messages only.
3232 This option is a quick equivalent to a histedit script which edits
3233 only log messages but otherwise leaves every picked commit as-is.
3236 option can only be used when starting a new histedit operation.
3237 If this option is used, no other command-line arguments are allowed.
3239 Delete backups created by past histedit operations, represented by references
3241 .Dq refs/got/backup/histedit
3242 reference namespace.
3246 is specified, only delete backups which at some point in time represented
3248 Otherwise, delete all references found within
3249 .Dq refs/got/backup/histedit .
3251 Any commit, tree, tag, and blob objects belonging to deleted backups
3252 remain in the repository and may be removed separately with
3253 Git's garbage collector or
3254 .Cm gotadmin cleanup .
3256 If this option is used,
3258 does not require a work tree.
3259 None of the other options can be used together with
3263 .It Cm integrate Ar branch
3265 Integrate the specified
3267 into the work tree's current branch.
3268 Files in the work tree are updated to match the contents on the integrated
3270 and the reference of the work tree's branch is changed to point at the
3271 head commit of the integrated
3274 Both branches can be considered equivalent after integration since they
3275 will be pointing at the same commit.
3276 Both branches remain available for future work, if desired.
3277 In case the integrated
3279 is no longer needed it may be deleted with
3282 Show the status of each affected file, using the following status codes:
3283 .Bl -column YXZ description
3284 .It U Ta file was updated
3285 .It D Ta file was deleted
3286 .It A Ta new file was added
3287 .It \(a~ Ta versioned file is obstructed by a non-regular file
3288 .It ! Ta a missing versioned file was restored
3292 will refuse to run if certain preconditions are not met.
3293 Most importantly, the
3295 must have been rebased onto the work tree's current branch with
3297 before it can be integrated, in order to linearize commit history and
3298 resolve merge conflicts.
3299 If the work tree contains multiple base commits, it must first be updated
3300 to a single base commit with
3302 If changes have been staged with
3304 these changes must first be committed with
3308 If the work tree contains local changes, these changes must first be
3322 into the current branch of the work tree.
3323 If the branches have diverged, merge changes into the work tree
3324 and create a merge commit.
3325 Otherwise, if the specified
3327 is already based on the work tree's current branch, make the work tree's
3328 current branch equivalent to the specified
3330 and update files in the work tree accordingly.
3332 Merge commits are commits based on multiple parent commits.
3333 The tip commit of the work tree's current branch will be used as the
3335 The tip commit of the specified
3337 will be used as the second parent.
3338 The work tree's current branch
3341 reference namespace and can be set with
3347 No ancestral relationship between the two branches is required.
3348 If the two branches have already been merged previously, only new changes
3351 It is not possible to create merge commits with more than two parents.
3352 If more than one branch needs to be merged, then multiple merge commits
3353 with two parents each can be created in sequence.
3355 If a linear project history is desired, then use of
3357 should generally be preferred over
3359 However, even strictly linear projects may require occasional merge commits,
3360 for example in order to merge in new versions of third-party code stored
3363 branches created with
3366 While merging changes found on the
3368 into the work tree, show the status of each affected file,
3369 using the following status codes:
3370 .Bl -column YXZ description
3371 .It G Ta file was merged
3372 .It C Ta file was merged and conflicts occurred during merge
3373 .It ! Ta changes destined for a missing file were not merged
3374 .It D Ta file was deleted
3375 .It d Ta file's deletion was prevented by local modifications
3376 .It A Ta new file was added
3377 .It \(a~ Ta changes destined for a non-regular file were not merged
3378 .It ? Ta changes destined for an unversioned file were not merged
3381 If merge conflicts occur, the merge operation is interrupted and conflicts
3382 must be resolved before the merge operation can continue.
3383 If any files with destined changes are found to be missing or unversioned,
3384 or if files could not be deleted due to differences in deleted content,
3385 the merge operation will be interrupted to prevent potentially incomplete
3386 changes from being committed to the repository without user intervention.
3387 The work tree may be modified as desired and the merge can be continued
3388 once the changes present in the work tree are considered complete.
3389 Alternatively, the merge operation may be aborted which will leave
3390 the work tree's current branch unmodified.
3393 will refuse to run if certain preconditions are not met.
3394 If the work tree's current branch is not in the
3396 reference namespace then the work tree must first be switched to a
3401 If the work tree is not yet fully updated to the tip commit of its
3402 branch, then the work tree must first be updated with
3404 If the work tree contains multiple base commits, it must first be updated
3405 to a single base commit with
3407 If changes have been staged with
3409 these changes must first be committed with
3413 If the work tree contains local changes, these changes must first be
3420 contains changes to files outside of the work tree's path prefix,
3421 the work tree cannot be used to merge this branch.
3431 commands will refuse to run while a merge operation is in progress.
3432 Other commands which manipulate the work tree may be used for
3433 conflict resolution purposes.
3440 Abort an interrupted merge operation.
3441 If this option is used, no other command-line arguments are allowed.
3443 Allow a merge operation to continue with files in conflicted status.
3444 This option should generally be avoided, and can only be used with the
3448 Continue an interrupted merge operation.
3449 If this option is used, no other command-line arguments are allowed except
3452 Create a merge commit even if the branches have not diverged.
3454 Merge changes into the work tree as usual but do not create a merge
3456 The merge result can be adjusted as desired before a merge commit is
3459 Alternatively, the merge may be aborted with
3466 .Op Fl F Ar response-script
3470 Stage local changes for inclusion in the next commit.
3473 is specified, stage all changes in the work tree.
3474 Otherwise, stage changes at or within the specified paths.
3475 Paths may be staged if they are added, modified, or deleted according to
3478 Show the status of each affected file, using the following status codes:
3479 .Bl -column YXZ description
3480 .It A Ta file addition has been staged
3481 .It M Ta file modification has been staged
3482 .It D Ta file deletion has been staged
3485 Staged file contents are saved in newly created blob objects in the repository.
3486 These blobs will be referred to by tree objects once staged changes have been
3489 Staged changes affect the behaviour of
3494 While paths with staged changes exist, the
3496 command will refuse to commit any paths which do not have staged changes.
3497 Local changes created on top of staged changes can only be committed if
3498 the path is staged again, or if the staged changes are committed first.
3501 command will show both local changes and staged changes.
3504 command is able to display local changes relative to staged changes,
3505 and to display staged changes relative to the repository.
3508 command cannot revert staged changes but may be used to revert
3509 local changes created on top of staged changes.
3515 .It Fl F Ar response-script
3523 responses line-by-line from the specified
3525 file instead of prompting interactively.
3527 Instead of staging new changes, list paths which are already staged,
3528 along with the IDs of staged blob objects and stage status codes.
3529 If paths were provided on the command line, show the staged paths
3530 among the specified paths.
3531 Otherwise, show all staged paths.
3533 Instead of staging the entire content of a changed file, interactively
3534 select or reject changes for staging based on
3538 (reject change), and
3540 (quit staging this file) responses.
3541 If a file is in modified status, individual patches derived from the
3542 modified file content can be staged.
3543 Files in added or deleted status may only be staged or rejected in
3546 Allow staging of symbolic links which point outside of the path space
3547 that is under version control.
3550 will reject such symbolic links due to safety concerns.
3553 may decide to represent such a symbolic link as a regular file which contains
3554 the link's target path, rather than creating an actual symbolic link which
3555 points outside of the work tree.
3556 Use of this option is discouraged because external mechanisms such as
3558 are better suited for managing symbolic links to paths not under
3563 will refuse to run if certain preconditions are not met.
3564 If a file contains merge conflicts, these conflicts must be resolved first.
3565 If a file is found to be out of date relative to the head commit on the
3566 work tree's current branch, the file must be updated with
3568 before it can be staged (however, this does not prevent the file from
3569 becoming out-of-date at some point after having been staged).
3577 commands will refuse to run while staged changes exist.
3578 If staged changes cannot be committed because a staged path
3579 is out of date, the path must be unstaged with
3581 before it can be updated with
3583 and may then be staged again if necessary.
3588 .Op Fl F Ar response-script
3592 Merge staged changes back into the work tree and put affected paths
3593 back into non-staged status.
3596 is specified, unstage all staged changes across the entire work tree.
3597 Otherwise, unstage changes at or within the specified paths.
3599 Show the status of each affected file, using the following status codes:
3600 .Bl -column YXZ description
3601 .It G Ta file was unstaged
3602 .It C Ta file was unstaged and conflicts occurred during merge
3603 .It ! Ta changes destined for a missing file were not merged
3604 .It D Ta file was staged as deleted and still is deleted
3605 .It d Ta file's deletion was prevented by local modifications
3606 .It \(a~ Ta changes destined for a non-regular file were not merged
3613 .It Fl F Ar response-script
3621 responses line-by-line from the specified
3623 file instead of prompting interactively.
3625 Instead of unstaging the entire content of a changed file, interactively
3626 select or reject changes for unstaging based on
3630 (keep change staged), and
3632 (quit unstaging this file) responses.
3633 If a file is staged in modified status, individual patches derived from the
3634 staged file content can be unstaged.
3635 Files staged in added or deleted status may only be unstaged in their entirety.
3641 .Op Fl r Ar repository-path
3644 Parse and print contents of objects to standard output in a line-based
3646 Content of commit, tree, and tag objects is printed in a way similar
3647 to the actual content stored in such objects.
3648 Blob object contents are printed as they would appear in files on disk.
3650 Attempt to interpret each argument as a reference, a tag name, or
3651 an object ID SHA1 hash.
3652 References will be resolved to an object ID.
3653 Tag names will resolved to a tag object.
3654 An abbreviated hash argument will be expanded to a full SHA1 hash
3655 automatically, provided the abbreviation is unique.
3657 If none of the above interpretations produce a valid result, or if the
3659 option is used, attempt to interpret the argument as a path which will
3660 be resolved to the ID of an object found at this path in the repository.
3667 Look up paths in the specified
3669 If this option is not used, paths are looked up in the commit resolved
3670 via the repository's HEAD reference.
3672 The expected argument is a commit ID SHA1 hash, or a reference name
3673 or keyword which will be resolved to a commit ID.
3674 An abbreviated hash argument will be expanded to a full SHA1 hash
3675 automatically, provided the abbreviation is unique.
3680 resolve to the work tree's base commit and branch head, respectively.
3681 The former is only valid if invoked in a work tree, while the latter will
3682 resolve to the tip of the work tree's current branch if invoked in a
3683 work tree, otherwise it will resolve to the repository's HEAD reference.
3684 Keywords and references may be appended with
3688 modifiers and an optional integer N to denote the
3689 Nth descendant or antecedent by first parent traversal, respectively;
3692 denotes the work tree branch head's 2nd generation ancestor, and
3694 denotes the 4th generation descendant of the work tree's base commit.
3697 will denote the 8th generation ancestor of the commit resolved by the
3704 modifier without a trailing integer has an implicit
3713 Interpret all arguments as paths only.
3714 This option can be used to resolve ambiguity in cases where paths
3715 look like tag names, reference names, or object IDs.
3716 .It Fl r Ar repository-path
3717 Use the repository at the specified path.
3718 If not specified, assume the repository is located at or above the current
3720 If this directory is a
3722 work tree, use the repository path associated with this work tree.
3724 .It Cm info Op Ar path ...
3725 Display meta-data stored in a work tree.
3730 The work tree to use is resolved implicitly by walking upwards from the
3731 current working directory.
3735 arguments are specified, show additional per-file information for tracked
3736 files located at or within these paths.
3739 argument corresponds to the work tree's root directory, display information
3740 for all tracked files.
3743 .Bl -tag -width GOT_IGNORE_GITCONFIG
3745 The author's name and email address, such as
3746 .Qq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3757 may fail to parse commits without an email address in author data,
3761 environment variables with a missing email address.
3763 .Ev GOT_AUTHOR will be overridden by configuration settings in
3769 configuration settings in the repository's
3776 configuration settings contained in Git's global
3778 configuration file will only be used if neither
3782 environment variable provide author information.
3783 .It Ev GOT_IGNORE_GITCONFIG
3784 If this variable is set then any remote repository definitions or author
3785 information found in Git configuration files will be ignored.
3786 .It Ev GOT_LOG_DEFAULT_LIMIT
3787 The default limit on the number of commits traversed by
3789 If set to zero, the limit is unbounded.
3790 This variable will be silently ignored if it is set to a non-numeric value.
3791 .It Ev VISUAL , EDITOR
3792 The editor spawned by
3800 text editor will be spawned.
3803 .Bl -tag -width packed-refs -compact
3805 Repository-wide configuration settings for
3809 configuration file located in the root directory of a Git repository
3810 supersedes any relevant settings in Git's
3814 .It Pa .got/got.conf
3815 Worktree-specific configuration settings for
3819 configuration file in the
3821 meta-data directory of a work tree supersedes any relevant settings in
3824 configuration file and Git's
3831 Enable tab-completion of
3836 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3838 Clone an existing Git repository for use with
3842 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3844 Unfortunately, many of the popular Git hosting sites do not offer anonymous
3846 Such sites will require an account to be created, and a public SSH key to be
3847 uploaded to this account, before repository access via ssh:// URLs will work.
3849 Most sites offer anonymous repository access via HTTPS:
3852 .Dl $ got clone https://github.com/openbsd/src.git
3854 Alternatively, for quick and dirty local testing of
3856 a new Git repository could be created and populated with files,
3857 e.g. from a temporary CVS checkout located at
3860 .Dl $ gotadmin init /var/git/src.git
3861 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3863 Check out a work tree from the Git repository to /usr/src:
3865 .Dl $ got checkout /var/git/src.git /usr/src
3867 View local changes in a work tree directory:
3869 .Dl $ got diff | less
3871 In a work tree, display files in a potentially problematic state:
3873 .Dl $ got status -s 'C!~?'
3875 Interactively revert selected local changes in a work tree directory:
3877 .Dl $ got revert -p -R\ .
3879 In a work tree or a git repository directory, list all branch references:
3883 As above, but list the most recently modified branches only:
3885 .Dl $ got branch -lt | head
3887 In a work tree or a git repository directory, create a new branch called
3888 .Dq unified-buffer-cache
3889 which is forked off the
3893 .Dl $ got branch -c master unified-buffer-cache
3895 Switch an existing work tree to the branch
3896 .Dq unified-buffer-cache .
3897 Local changes in the work tree will be preserved and merged if necessary:
3899 .Dl $ got update -b unified-buffer-cache
3901 Create a new commit from local changes in a work tree directory.
3902 This new commit will become the head commit of the work tree's current branch:
3906 In a work tree or a git repository directory, view changes committed in
3907 the 3 most recent commits to the work tree's branch, or the branch resolved
3908 via the repository's HEAD reference, respectively:
3910 .Dl $ got log -p -l 3
3912 As above, but display changes in the order in which
3914 could apply them in sequence:
3916 .Dl $ got log -p -l 3 -R
3918 In a work tree or a git repository directory, log the history of a subdirectory:
3920 .Dl $ got log sys/uvm
3922 While operating inside a work tree, paths are specified relative to the current
3923 working directory, so this command will log the subdirectory
3926 .Dl $ cd sys/uvm && got log\ .
3928 And this command has the same effect:
3930 .Dl $ cd sys/dev/usb && got log ../../uvm
3932 And this command displays work tree meta-data about all tracked files:
3935 .Dl $ got info\ . | less
3937 Add new files and remove obsolete files in a work tree directory:
3939 .Dl $ got add sys/uvm/uvm_ubc.c
3940 .Dl $ got remove sys/uvm/uvm_vnode.c
3942 Create a new commit from local changes in a work tree directory
3943 with a pre-defined log message.
3945 .Dl $ got commit -m 'unify the buffer cache'
3947 Alternatively, create a new commit from local changes in a work tree
3948 directory with a log message that has been prepared in the file
3951 .Dl $ got commit -F /tmp/msg
3953 Update any work tree checked out from the
3954 .Dq unified-buffer-cache
3955 branch to the latest commit on this branch:
3959 Roll file content on the unified-buffer-cache branch back by one commit,
3960 and then fetch the rolled-back change into the work tree as a local change
3961 to be amended and perhaps committed again:
3963 .Dl $ got backout unified-buffer-cache
3964 .Dl $ got commit -m 'roll back previous'
3965 .Dl $ # now back out the previous backout :-)
3966 .Dl $ got backout unified-buffer-cache
3968 Fetch new changes on the remote repository's
3970 branch, making them visible on the local repository's
3979 branch to merge the new changes that are now visible on the
3984 .Dl $ got update -b origin/master
3985 .Dl $ got rebase master
3988 .Dq unified-buffer-cache
3989 branch on top of the new head commit of the
3993 .Dl $ got update -b master
3994 .Dl $ got rebase unified-buffer-cache
3996 Create a patch from all changes on the unified-buffer-cache branch.
3997 The patch can be mailed out for review and applied to
4001 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
4003 Edit the entire commit history of the
4004 .Dq unified-buffer-cache
4007 .Dl $ got update -b unified-buffer-cache
4008 .Dl $ got update -c master
4011 Before working against existing branches in a repository cloned with
4012 .Cm git clone --bare
4017 must be configured to map all references in the remote repository
4020 namespace of the local repository.
4021 This can be achieved by setting Git's
4022 .Pa remote.origin.fetch
4023 configuration variable to the value
4024 .Dq +refs/heads/*:refs/remotes/origin/*
4029 .Dl $ cd /var/git/repo
4030 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
4034 option must be disabled:
4036 .Dl $ cd /var/git/repo
4037 .Dl $ git config remote.origin.mirror false
4039 Alternatively, the following
4041 configuration item can be added manually to the Git repository's
4045 .Dl [remote \&"origin\&"]
4047 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
4050 This configuration leaves the local repository's
4052 namespace free for use by local branches checked out with
4054 and, if needed, created with
4057 .Dq refs/remotes/origin
4058 namespace can now be updated with incoming changes from the remote
4063 without extra command line arguments.
4064 Newly fetched changes can be examined with
4067 Display changes on the remote repository's version of the
4069 branch, as of the last time
4073 .Dl $ got log -c origin/master | less
4075 As shown here, most commands accept abbreviated reference names such as
4078 .Dq refs/remotes/origin/master .
4079 The latter is only needed in case of ambiguity.
4082 can be used to merge changes which are visible on the
4087 This will also merge local changes, if any, with the incoming changes:
4089 .Dl $ got update -b origin/master
4090 .Dl $ got rebase master
4092 In order to make changes committed to the
4093 .Dq unified-buffer-cache
4097 .Dq unified-buffer-cache
4098 branch can be rebased onto the
4102 .Dl $ got update -b master
4103 .Dl $ got rebase unified-buffer-cache
4106 .Dq unified-buffer-cache
4107 branch can now be made visible on the
4111 Because the rebase operation switched the work tree to the
4112 .Dq unified-buffer-cache
4113 branch, the work tree must be switched back to the
4117 .Dl $ got update -b master
4118 .Dl $ got integrate unified-buffer-cache
4122 branch, log messages for local changes can now be amended with
4124 by other developers and any other important new information:
4126 .Dl $ got update -c origin/master
4127 .Dl $ got histedit -m
4129 If the remote repository offers write access, local changes on the
4131 branch can be sent to the remote repository with
4135 can be run without further arguments.
4136 The arguments shown here match defaults, provided the work tree's
4137 current branch is the
4141 .Dl $ got send -b master origin
4143 If the remote repository requires the HTTPS protocol, the
4145 command must be used instead:
4147 .Dl $ cd /var/git/src.git
4148 .Dl $ git push origin master
4150 When making contributions to projects which use the
4152 workflow, SSH protocol repository access needs to be set up first.
4153 Once an account has been created on a Git hosting site it should
4154 be possible to upload a public SSH key for repository access
4159 workflow will usually involve two remote repositories.
4160 In the real-life example below, the
4162 repository was forked from the
4164 repository by using the Git hosting site's web interface.
4167 file in the local repository describes both remote repositories:
4168 .Bd -literal -offset indent
4169 # Jelmers's repository, which accepts pull requests
4171 server git@github.com
4173 repository "/jelmer/dulwich"
4177 # Stefan's fork, used as the default remote repository
4179 server git@github.com
4181 repository "/stspdotname/dulwich"
4186 With this configuration, Stefan can create commits on
4187 .Dq refs/heads/master
4188 and send them to the
4190 repository by running:
4192 .Dl $ got send -b master origin
4194 The changes can now be proposed to Jelmer by opening a pull request
4195 via the Git hosting site's web interface.
4196 If Jelmer requests further changes to be made, additional commits
4197 can be created on the
4199 branch and be added to the pull request by running
4203 If Jelmer prefers additional commits to be
4205 then the following commands can be used to achieve this:
4207 .Dl $ got update -b master
4208 .Dl $ got update -c origin/master
4209 .Dl $ got histedit -f
4210 .Dl $ got send -f -b master origin
4212 In addition to reviewing the pull request in the web user interface,
4213 Jelmer can fetch the pull request's branch into his local repository
4214 and create a local branch which contains the proposed changes:
4216 .Dl $ got fetch -R refs/pull/1046/head origin
4217 .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
4219 Once Jelmer has accepted the pull request, Stefan can fetch the
4220 merged changes, and possibly several other new changes, by running:
4222 .Dl $ got fetch upstream
4224 The merged changes will now be visible under the reference
4225 .Dq refs/remotes/upstream/master .
4228 branch can now be rebased on top of the latest changes
4231 .Dl $ got update -b upstream/master
4232 .Dl $ got rebase master
4234 As an alternative to
4236 branches can be merged with
4239 .Dl $ got update -b master
4240 .Dl $ got merge upstream/master
4242 The question of whether to rebase or merge branches is philosophical.
4243 When in doubt, refer to the software project's policies set by project
4246 As a final step, the forked repository's copy of the master branch needs
4247 to be kept in sync by sending the new changes there:
4249 .Dl $ got send -f -b master origin
4251 If multiple pull requests need to be managed in parallel, a separate branch
4252 must be created for each pull request with
4254 Each such branch can then be used as above, in place of
4255 .Dq refs/heads/master .
4256 Changes for any accepted pull requests will still appear under
4257 .Dq refs/remotes/upstream/master,
4258 regardless of which branch was used in the forked repository to
4259 create a pull request.
4263 .Xr git-repository 5 ,
4264 .Xr got-worktree 5 ,
4268 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
4269 .An Christian Weisgerber Aq Mt naddy@openbsd.org
4270 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
4271 .An Josh Rickmar Aq Mt jrick@zettaport.com
4272 .An Joshua Stein Aq Mt jcs@openbsd.org
4273 .An Klemens Nanni Aq Mt kn@openbsd.org
4274 .An Martin Pieuchot Aq Mt mpi@openbsd.org
4275 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
4276 .An Omar Polo Aq Mt op@openbsd.org
4277 .An Ori Bernstein Aq Mt ori@openbsd.org
4278 .An Sebastien Marie Aq Mt semarie@openbsd.org
4279 .An Stefan Sperling Aq Mt stsp@openbsd.org
4280 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
4281 .An Theo Buehler Aq Mt tb@openbsd.org
4282 .An Thomas Adam Aq Mt thomas@xteddy.org
4283 .An Tracey Emery Aq Mt tracey@traceyemery.net
4284 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
4291 were derived from code under copyright by:
4293 .An Caldera International
4294 .An Daniel Hartmeier
4299 .An Jean-Francois Brousseau
4305 .An Niklas Hallqvist
4310 .An Xavier Santolaria
4313 contains code contributed to the public domain by
4314 .An Austin Appleby .
4317 is a work-in-progress and some features remain to be implemented.
4319 At present, the user has to fall back on
4321 to perform some tasks.
4325 Writing to remote repositories over HTTP or HTTPS protocols requires
4328 The creation of merge commits with more than two parent commits requires
4331 In situations where files or directories were moved around
4333 will not automatically merge changes to new locations and
4335 will usually produce better results.