2 .\" Copyright (c) 2017 Martin Pieuchot
3 .\" Copyright (c) 2018, 2019, 2020 Stefan Sperling
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
30 is a version control system which stores the history of tracked files
31 in a Git repository, as used by the Git version control system.
32 This repository format is described in
33 .Xr git-repository 5 .
38 version control system because every copy of a repository is writeable.
39 Modifications made to files can be synchronized between repositories
44 must be checked out from the repository for modification.
45 Checked out files are stored in a
47 which can be placed at an arbitrary directory in the filesystem hierarchy.
48 The on-disk format of this work tree is described in
52 provides global and command-specific options.
53 Global options must precede the command name, and are as follows:
54 .Bl -tag -width tenletters
56 Display usage information and exit immediately.
58 Display program version and exit immediately.
64 .Bl -tag -width checkout
71 .Op Fl r Ar repository-path
75 Create an initial commit in a repository from the file hierarchy
78 The created commit will not have any parent commits, i.e. it will be a
80 Also create a new reference which provides a branch name for the newly
82 Show the path of each imported file to indicate progress.
88 environment variable to be set,
89 unless an author has been configured in
95 configuration settings can be obtained from the repository's
97 file or from Git's global
108 If this option is not specified, a branch corresponding to the repository's
109 HEAD reference will be used.
110 Use of this option is required if the branch resolved via the repository's
111 HEAD reference already exists.
113 Ignore files or directories with a name which matches the specified
115 This option may be specified multiple times to build a list of ignore patterns.
118 follows the globbing rules documented in
120 Ignore patterns which end with a slash,
122 will only match directories.
124 Use the specified log message when creating the new commit.
129 opens a temporary file in an editor where a log message can be written.
130 Quitting the editor without saving the file will abort the import operation.
131 .It Fl r Ar repository-path
132 Use the repository at the specified path.
133 If not specified, assume the repository is located at or above the current
141 .Op Fl R Ar reference
146 Clone a Git repository at the specified
152 is specified, the directory name will be derived from the name of the
155 will refuse to run if the
161 specifies a protocol scheme, a server hostname, an optional port number
162 separated from the hostname by a colon, and a path to the repository on
164 .Lk scheme://hostname:port/path/to/repository
166 The following protocol schemes are supported:
167 .Bl -tag -width git+ssh
169 The Git protocol as implemented by the
172 Use of this protocol is discouraged since it supports neither authentication
175 The Git protocol wrapped in an authenticated and encrypted
178 With this protocol the hostname may contain an embedded username for
183 Short alias for git+ssh.
186 Objects in the cloned repository are stored in a pack file which is downloaded
188 This pack file will then be indexed to facilitate access to the objects stored
190 If any objects in the pack file are stored in deltified form, all deltas will
191 be fully resolved in order to compute the ID of such objects.
192 This can take some time.
193 More details about the pack file format are documented in
194 .Xr git-repository 5 .
197 creates a remote repository entry in the
201 files of the cloned repository to store the
207 arguments for future use by
217 Fetch all branches from the remote repository's
219 reference namespace and set
220 .Cm fetch_all_branches
221 in the cloned repository's
223 file for future use by
225 If this option is not specified, a branch resolved via the remote
226 repository's HEAD reference will be fetched.
227 Cannot be used together with the
233 from the remote repository's
236 This option may be specified multiple times to build a list of branches
238 If the branch corresponding to the remote repository's HEAD reference is not
239 in this list, the cloned repository's HEAD reference will be set to the first
240 branch which was fetched.
241 If this option is not specified, a branch resolved via the remote
242 repository's HEAD reference will be fetched.
243 Cannot be used together with the
247 List branches and tags available for fetching from the remote repository
248 and exit immediately.
249 Cannot be used together with any of the other options except
254 Create the cloned repository as a mirror of the original repository.
255 This is useful if the cloned repository will not be used to store
256 locally created commits.
262 files will be set up with the
264 option enabled, such that
268 will write incoming changes directly to branches in the
270 reference namespace, rather than to branches in the
273 This avoids the usual requirement of having to run
279 in order to make incoming changes appear on branches in the
282 But maintaining custom changes in the cloned repository becomes difficult
283 since such changes will be at risk of being discarded whenever incoming
286 Suppress progress reporting output.
287 The same option will be passed to
290 .It Fl R Ar reference
291 In addition to the branches and tags that will be fetched, fetch an arbitrary
293 from the remote repository's
296 This option may be specified multiple times to build a list of additional
300 may either be a path to a specific reference, or a reference namespace
301 which will cause all references in this namespace to be fetched.
303 Each reference will be mapped into the cloned repository's
305 namespace, unless the
307 option is used to mirror references directly into the cloned repository's
312 will refuse to fetch references from the remote repository's
321 to print debugging messages to standard error output.
322 This option will be passed to
325 Multiple -v options increase the verbosity.
333 .Op Fl R Ar reference
334 .Op Fl r Ar repository-path
335 .Op Ar remote-repository
338 Fetch new changes from a remote repository.
340 .Ar remote-repository
344 The remote repository's URL is obtained from the corresponding entry in
348 file of the local repository, as created by
351 By default, any branches configured in
354 .Ar remote-repository
358 is invoked in a work tree then this work tree's current branch will be
359 fetched, too, provided it is present on the server.
360 If no branches to fetch can be found in
362 or via a work tree, or said branches are not found on the server, a branch
363 resolved via the remote repository's HEAD reference will be fetched.
364 Likewise, if a HEAD reference for the
365 .Ar remote-repository
366 exists but its target no longer matches the remote HEAD, then
367 the new target branch will be fetched.
368 This default behaviour can be overridden with the
374 New changes will be stored in a separate pack file downloaded from the server.
375 Optionally, separate pack files stored in the repository can be combined with
378 By default, branch references in the
380 reference namespace will be updated to point at the newly fetched commits.
385 command can then be used to make new changes visible on branches in the
387 namespace, merging incoming changes with the changes on those branches
390 If the repository was created as a mirror with
392 then all branches in the
394 namespace will be updated directly to match the corresponding branches in
395 the remote repository.
396 If those branches contained local commits, these commits will no longer be
397 reachable via a reference and will therefore be at risk of being discarded
398 by Git's garbage collector or
399 .Cm gotadmin cleanup .
400 Maintaining custom changes in a mirror repository is therefore discouraged.
402 In any case, references in the
404 namespace will always be fetched and mapped directly to local references
405 in the same namespace.
412 Fetch all branches from the remote repository's
415 This option can be enabled by default for specific repositories in
417 Cannot be used together with the
423 from the remote repository's
426 This option may be specified multiple times to build a list of branches
428 Cannot be used together with the
432 Delete branches and tags from the local repository which are no longer
433 present in the remote repository.
434 Only references are deleted.
435 Any commit, tree, tag, and blob objects belonging to deleted branches or
436 tags remain in the repository and may be removed separately with
437 Git's garbage collector or
438 .Cm gotadmin cleanup .
440 List branches and tags available for fetching from the remote repository
441 and exit immediately.
442 Cannot be used together with any of the other options except
448 Suppress progress reporting output.
449 The same option will be passed to
452 .It Fl R Ar reference
453 In addition to the branches and tags that will be fetched, fetch an arbitrary
455 from the remote repository's
458 This option may be specified multiple times to build a list of additional
462 may either be a path to a specific reference, or a reference namespace
463 which will cause all references in this namespace to be fetched.
465 Each reference will be mapped into the local repository's
467 namespace, unless the local repository was created as a mirror with
469 in which case references will be mapped directly into the local repository's
473 Once a reference has been fetched, a branch based on it can be created with
478 will refuse to fetch references from the remote repository's
483 .It Fl r Ar repository-path
484 Use the repository at the specified path.
485 If not specified, assume the repository is located at or above the current
487 If this directory is a
489 work tree, use the repository path associated with this work tree.
491 Allow existing references in the
493 namespace to be updated if they have changed on the server.
494 If not specified, only new tag references will be created.
499 to print debugging messages to standard error output.
500 The same option will be passed to
503 Multiple -v options increase the verbosity.
506 Delete all references which correspond to a particular
507 .Ar remote-repository
508 instead of fetching new changes.
509 This can be useful when a remote repository is being removed from
515 .Ar remote-repository
516 argument is mandatory and no other options except
523 Only references are deleted.
524 Any commit, tree, tag, and blob objects fetched from a remote repository
525 will generally be stored in pack files and may be removed separately with
527 and Git's garbage collector.
535 .Op Fl p Ar path-prefix
537 .Op Ar work-tree-path
540 Copy files from a repository into a new work tree.
541 Show the status of each affected file, using the following status codes:
542 .Bl -column YXZ description
543 .It A Ta new file was added
544 .It E Ta file already exists in work tree's meta-data
549 is not specified, either use the last component of
550 .Ar repository path ,
553 was specified use the last component of
561 Check out files from a commit on the specified
563 If this option is not specified, a branch resolved via the repository's HEAD
564 reference will be used.
566 Check out files from the specified
568 on the selected branch.
569 If this option is not specified, the most recent commit on the selected
574 argument is a commit ID SHA1 hash, or a reference name or a keyword
575 which will be resolved to a commit ID.
576 An abbreviated hash argument will be expanded to a full SHA1 hash
577 automatically, provided the abbreviation is unique.
582 resolve to the repository's HEAD reference, or, if the
584 option is used, the head of the checked-out
586 Keywords and reference names may be appended with
590 modifiers and an optional integer N to denote the
591 Nth descendant or antecedent by first parent traversal, respectively;
594 denotes the work tree branch head's 2nd generation ancestor, and
596 will denote the 3rd generation ancestor of the commit resolved by the
599 If an integer does not follow the
605 is implicitly appended
614 is not contained in the selected branch, a different branch which contains
615 this commit must be specified with the
618 If no such branch is known, a new branch must be created for this
624 Checking out work trees with an unknown branch is intentionally not supported.
626 Proceed with the checkout operation even if the directory at
629 Existing files will be left intact.
630 .It Fl p Ar path-prefix
631 Restrict the work tree to a subset of the repository's tree hierarchy.
632 Only files beneath the specified
636 Silence progress output.
647 Update an existing work tree to a different
649 Change existing files in the work tree as necessary to match file contents
651 Preserve any local changes in the work tree and merge them with the
654 Files which already contain merge conflicts will not be updated to avoid
655 further complications.
656 Such files will be updated when
658 is run again after merge conflicts have been resolved.
659 If the conflicting changes are no longer needed, affected files can be
666 Show the status of each affected file, using the following status codes:
667 .Bl -column YXZ description
668 .It U Ta file was updated and contained no local changes
669 .It G Ta file was updated and local changes were merged cleanly
670 .It C Ta file was updated and conflicts occurred during merge
671 .It D Ta file was deleted
672 .It d Ta file's deletion was prevented by local modifications
673 .It A Ta new file was added
674 .It \(a~ Ta versioned file is obstructed by a non-regular file
675 .It ! Ta a missing versioned file was restored
676 .It # Ta file was not updated because it contains merge conflicts
677 .It ? Ta changes destined for an unversioned file were not merged
682 is specified, update the entire work tree.
683 Otherwise, restrict the update operation to files at or within the
685 Each path is required to exist in the update operation's target commit.
686 Files in the work tree outside specified paths will remain unchanged and
687 will retain their previously recorded base commit.
690 commands may refuse to run while the work tree contains files from
691 multiple base commits.
692 The base commit of such a work tree can be made consistent by running
694 across the entire work tree.
697 is incompatible with the
702 cannot update paths with staged changes.
703 If changes have been staged with
705 these changes must first be committed with
715 Switch the work tree's branch reference to the specified
717 before updating the work tree.
718 This option requires that all paths in the work tree are updated.
720 As usual, any local changes in the work tree will be preserved.
721 This can be useful when switching to a newly created branch in order
722 to commit existing local changes to this branch.
724 Any local changes must be dealt with separately in order to obtain a
725 work tree with pristine file contents corresponding exactly to the specified
727 Such changes could first be committed to a different branch with
729 or could be discarded with
732 Update the work tree to the specified
734 If this option is not specified, the most recent commit on the work tree's
739 argument is a commit ID SHA1 hash, or a reference name or a keyword
740 which will be resolved to a commit ID.
741 An abbreviated hash argument will be expanded to a full SHA1 hash
742 automatically, provided the abbreviation is unique.
747 resolve to the work tree's base commit and branch head, respectively.
748 Keywords and reference names may be appended with
752 modifiers and an optional integer N to denote the
753 Nth descendant or antecedent, respectively, by first parent traversal;
756 denotes the work tree branch head's 2nd generation ancestor, and
758 denotes the 4th generation descendant of the work tree's base commit.
761 will denote the 3rd generation ancestor of the commit resolved by the
764 If an integer does not follow the
770 is implicitly appended
777 Silence progress output.
783 .Op Fl S Ar status-codes
784 .Op Fl s Ar status-codes
788 Show the current modification status of files in a work tree,
789 using the following status codes:
790 .Bl -column YXZ description
791 .It M Ta modified file
792 .It A Ta file scheduled for addition in next commit
793 .It D Ta file scheduled for deletion in next commit
794 .It C Ta modified or added file which contains merge conflicts
795 .It ! Ta versioned file was expected on disk but is missing
796 .It \(a~ Ta versioned file is obstructed by a non-regular file
797 .It ? Ta unversioned item not tracked by
799 .It m Ta modified file modes (executable bit only)
800 .It N Ta non-existent
802 specified on the command line
807 is specified, show modifications in the entire work tree.
808 Otherwise, show modifications at or within the specified paths.
810 If changes have been staged with
812 staged changes are shown in the second output column, using the following
814 .Bl -column YXZ description
815 .It M Ta file modification is staged
816 .It A Ta file addition is staged
817 .It D Ta file deletion is staged
820 Changes created on top of staged changes are indicated in the first column:
821 .Bl -column YXZ description
822 .It MM Ta file was modified after earlier changes have been staged
823 .It MA Ta file was modified after having been staged for addition
826 If the work tree contains the results of an interrupted
831 operation then display a message which shows the branches involved.
838 Show unversioned files even if they match an ignore pattern.
839 .It Fl S Ar status-codes
840 Suppress the output of files with a modification status matching any of the
841 single-character status codes contained in the
844 Any combination of codes from the above list of possible status codes
846 For staged files, status codes displayed in either column will be matched.
847 Cannot be used together with the
850 .It Fl s Ar status-codes
851 Only show files with a modification status matching any of the
852 single-character status codes contained in the
855 Any combination of codes from the above list of possible status codes
857 For staged files, status codes displayed in either column will be matched.
858 Cannot be used together with the
863 For compatibility with
874 files in each traversed directory and will not display unversioned files
875 which match these patterns.
876 Ignore patterns which end with a slash,
878 will only match directories.
883 supports consecutive asterisks,
885 which will match an arbitrary amount of directories.
889 only supports a single ignore pattern per line.
893 does not support negated ignore patterns prefixed with
895 and gives no special significance to the location of path component separators,
904 .Op Fl r Ar repository-path
905 .Op Fl S Ar search-pattern
909 Display history of a repository.
912 is specified, show only commits which modified this path.
913 If invoked in a work tree, the
915 is interpreted relative to the current working directory,
916 and the work tree's path prefix is implicitly prepended.
917 Otherwise, the path is interpreted relative to the repository root.
924 Display individual commits which were merged into the current branch
928 shows the linear history of the current branch only.
930 Set the number of context lines shown in diffs with
932 By default, 3 lines of context are shown.
934 Start traversing history at the specified
936 If this option is not specified, default to the work tree's current branch
937 if invoked in a work tree, or to the repository's HEAD reference.
941 argument is a commit ID SHA1 hash, or a reference name or a keyword
942 which will be resolved to a commit ID.
943 An abbreviated hash argument will be expanded to a full SHA1 hash
944 automatically, provided the abbreviation is unique.
949 resolve to the work tree's base commit and branch head, respectively.
950 The former is only valid if invoked in a work tree, while the latter will
951 resolve to the tip of the work tree's current branch if invoked in a
952 work tree, otherwise it will resolve to the repository's HEAD reference.
953 Keywords and references may be appended with
957 modifiers and an optional integer N to denote the
958 Nth descendant or antecedent, respectively, by first parent traversal;
961 denotes the HEAD reference's 2nd generation ancestor, and
963 denotes the 4th generation descendant of the work tree's base commit.
966 will denote the 3rd generation descendant of the commit resolved by the
973 modifier without a trailing integer has an implicit
982 Display diffstat of changes introduced in each commit.
983 Cannot be used with the
988 option (diffstat displays a list of changed paths).
990 Limit history traversal to a given number of commits.
991 If this option is not specified, a default limit value of zero is used,
992 which is treated as an unbounded limit.
994 .Ev GOT_LOG_DEFAULT_LIMIT
995 environment variable may be set to change this default value.
997 Display the list of file paths changed in each commit, using the following
999 .Bl -column YXZ description
1000 .It M Ta modified file
1001 .It D Ta file was deleted
1002 .It A Ta new file was added
1003 .It m Ta modified file modes (executable bit only)
1006 Cannot be used with the
1010 Display the patch of modifications made in each commit.
1013 is specified, only show the patch of modifications at or within this path.
1014 Cannot be used with the
1018 Determine a set of commits to display as usual, but display these commits
1020 .It Fl r Ar repository-path
1021 Use the repository at the specified path.
1022 If not specified, assume the repository is located at or above the current
1024 If this directory is a
1026 work tree, use the repository path associated with this work tree.
1027 .It Fl S Ar search-pattern
1028 If specified, show only commits with a log message, author name,
1029 committer name, or ID SHA1 hash matched by the extended regular
1031 .Ar search-pattern .
1032 Lines in committed patches will be matched if
1035 File paths changed by a commit will be matched if
1038 Regular expression syntax is documented in
1041 Display a short one-line summary of each commit, instead of the default
1043 Cannot be used together with the
1049 Display commits in topological order.
1050 This option has no effect without the
1052 option because a linear history is sorted in topological order by definition.
1053 Topological sorting is disabled by default because the present implementation
1054 requires that commit history is fully traversed before any output can be shown.
1056 Stop traversing commit history immediately after the specified
1063 argument is a commit ID SHA1 hash, or a reference name or a keyword
1064 which will be resolved to a commit ID.
1065 This option has no effect if the specified
1075 .Op Fl r Ar repository-path
1076 .Op Ar object1 Ar object2 | Ar path ...
1079 When invoked within a work tree without any arguments, display all
1080 local changes in the work tree.
1083 arguments are specified, only show changes within the specified paths.
1085 If two arguments are provided, treat each argument as a reference, a tag
1086 name, or an object ID SHA1 hash, and display differences between the
1087 corresponding objects.
1088 Both objects must be of the same type (blobs, trees, or commits).
1089 An abbreviated hash argument will be expanded to a full SHA1 hash
1090 automatically, provided the abbreviation is unique.
1091 If none of these interpretations produce a valid result or if the
1096 is running in a work tree, attempt to interpret the two arguments as paths.
1103 Treat file contents as ASCII text even if binary data is detected.
1105 Set the number of context lines shown in the diff.
1106 By default, 3 lines of context are shown.
1108 Show differences between commits in the repository.
1109 This option may be used up to two times.
1110 When used only once, show differences between the specified
1112 and its first parent commit.
1113 When used twice, show differences between the two specified commits.
1117 option is used, all non-option arguments will be interpreted as paths.
1120 arguments are provided, only show differences for the specified paths.
1124 argument is a commit ID SHA1 hash, or a reference name or a keyword
1125 which will be resolved to a commit ID.
1126 An abbreviated hash argument will be expanded to a full SHA1 hash
1127 automatically, provided the abbreviation is unique.
1132 resolve to the work tree's base commit and branch head, respectively.
1133 The former is only valid if invoked in a work tree, while the latter will
1134 resolve to the tip of the work tree's current branch if invoked in a
1135 work tree, otherwise it will resolve to the repository's HEAD reference.
1136 Keywords and references may be appended with
1140 modifiers and an optional integer N to denote the
1141 Nth descendant or antecedent, respectively, by first parent traversal;
1144 denotes the HEAD reference's 2nd generation ancestor, and
1146 denotes the 4th generation descendant of the work tree's base commit.
1149 will denote the 8th generation descendant of the commit resolved by the
1152 If an integer does not follow the
1158 is implicitly appended
1165 Cannot be used together with the
1169 Display diffstat of changes before the actual diff by annotating each file path
1170 or blob hash being diffed with the total number of lines added and removed.
1171 A summary line will display the total number of changes across all files.
1173 Interpret all arguments as paths only.
1174 This option can be used to resolve ambiguity in cases where paths
1175 look like tag names, reference names, or object IDs.
1176 This option is only valid when
1178 is invoked in a work tree.
1179 .It Fl r Ar repository-path
1180 Use the repository at the specified path.
1181 If not specified, assume the repository is located at or above the current
1183 If this directory is a
1185 work tree, use the repository path associated with this work tree.
1187 Show changes staged with
1189 instead of showing local changes in the work tree.
1190 This option is only valid when
1192 is invoked in a work tree.
1194 Ignore whitespace-only changes.
1200 .Op Fl r Ar repository-path
1204 Display line-by-line history of a file at the specified path.
1211 Start traversing history at the specified
1213 The expected argument is a commit ID SHA1 hash, or a reference name
1214 or a keyword which will be resolved to a commit ID.
1215 An abbreviated hash argument will be expanded to a full SHA1 hash
1216 automatically, provided the abbreviation is unique.
1221 resolve to the work tree's base commit and branch head, respectively.
1222 The former is only valid if invoked in a work tree, while the latter will
1223 resolve to the tip of the work tree's current branch if invoked in a
1224 work tree, otherwise it will resolve to the repository's HEAD reference.
1225 Keywords and references may be appended with
1229 modifiers and an optional integer N to denote the
1230 Nth descendant or antecedent by first parent traversal, respectively;
1233 denotes the work tree branch head's 2nd generation ancestor, and
1235 denotes the 4th generation descendant of the work tree's base commit.
1238 will denote the 5th generation ancestor of the commit resolved by the
1245 modifier without a trailing integer has an implicit
1253 .It Fl r Ar repository-path
1254 Use the repository at the specified path.
1255 If not specified, assume the repository is located at or above the current
1257 If this directory is a
1259 work tree, use the repository path associated with this work tree.
1266 .Op Fl r Ar repository-path
1270 Display a listing of files and directories at the specified
1271 directory path in the repository.
1272 Entries shown in this listing may carry one of the following trailing
1274 .Bl -column YXZ description
1275 .It @ Ta entry is a symbolic link
1276 .It / Ta entry is a directory
1277 .It * Ta entry is an executable file
1278 .It $ Ta entry is a Git submodule
1281 Symbolic link entries are also annotated with the target path of the link.
1285 is specified, list the repository path corresponding to the current
1286 directory of the work tree, or the root directory of the repository
1287 if there is no work tree.
1294 List files and directories as they appear in the specified
1297 The expected argument is a commit ID SHA1 hash, or a reference name
1298 or a keyword which will be resolved to a commit ID.
1299 An abbreviated hash argument will be expanded to a full SHA1 hash
1300 automatically, provided the abbreviation is unique.
1305 resolve to the work tree's base commit and branch head, respectively.
1306 The former is only valid if invoked in a work tree, while the latter will
1307 resolve to the tip of the work tree's current branch if invoked in a
1308 work tree, otherwise it will resolve to the repository's HEAD reference.
1309 Keywords and references may be appended with
1313 modifiers and an optional integer N to denote the
1314 Nth descendant or antecedent by first parent traversal, respectively;
1317 denotes the work tree branch head's 2nd generation ancestor, and
1319 denotes the 4th generation descendant of the work tree's base commit.
1322 will denote the 3rd generation ancestor of the commit resolved by the
1329 modifier without a trailing integer has an implicit
1338 Show object IDs of files (blob objects) and directories (tree objects).
1340 Recurse into sub-directories in the repository.
1341 .It Fl r Ar repository-path
1342 Use the repository at the specified path.
1343 If not specified, assume the repository is located at or above the current
1345 If this directory is a
1347 work tree, use the repository path associated with this work tree.
1353 .Op Fl r Ar repository-path
1354 .Op Fl s Ar reference
1357 Manage references in a repository.
1359 References may be listed, created, deleted, and changed.
1360 When creating, deleting, or changing a reference the specified
1362 must be an absolute reference name, i.e. it must begin with
1370 Create a reference or change an existing reference.
1371 The reference with the specified
1373 will point at the specified
1378 argument is an ID SHA1 hash or an existing reference or tag name
1379 or a keyword which will be resolved to the ID of a corresponding commit,
1380 tree, tag, or blob object.
1381 An abbreviated hash argument will be expanded to a full SHA1 hash
1382 automatically, provided the abbreviation is unique.
1387 resolve to the work tree's base commit and branch head, respectively.
1388 The former is only valid if invoked in a work tree, while the latter will
1389 resolve to the tip of the work tree's current branch if invoked in a
1390 work tree, otherwise it will resolve to the repository's HEAD reference.
1391 Keywords and reference names may be appended with
1395 modifiers and an optional integer N to denote the
1396 Nth descendant or antecedent by first parent traversal, respectively;
1399 denotes the work tree branch head's 2nd generation ancestor, and
1401 will denote the 3rd generation ancestor of the commit resolved by the
1404 If an integer does not follow the
1410 is implicitly appended
1417 Cannot be used together with any other options except
1420 Delete the reference with the specified
1422 from the repository.
1423 Any commit, tree, tag, and blob objects belonging to deleted references
1424 remain in the repository and may be removed separately with
1425 Git's garbage collector or
1426 .Cm gotadmin cleanup .
1427 Cannot be used together with any other options except
1430 List references in the repository.
1433 is specified, list all existing references in the repository.
1436 is a reference namespace, list all references in this namespace.
1437 Otherwise, show only the reference with the given
1439 Cannot be used together with any other options except
1443 .It Fl r Ar repository-path
1444 Use the repository at the specified path.
1445 If not specified, assume the repository is located at or above the current
1447 If this directory is a
1449 work tree, use the repository path associated with this work tree.
1450 .It Fl s Ar reference
1451 Create a symbolic reference, or change an existing symbolic reference.
1452 The symbolic reference with the specified
1454 will point at the specified
1456 which must already exist in the repository.
1457 Care should be taken not to create loops between references when
1458 this option is used.
1459 Cannot be used together with any other options except
1462 Sort listed references by modification time (most recently modified first)
1463 instead of sorting by lexicographical order.
1464 Use of this option requires the
1466 option to be used as well.
1474 .Op Fl r Ar repository-path
1478 Create, list, or delete branches.
1480 Local branches are managed via references which live in the
1482 reference namespace.
1485 command creates references in this namespace only.
1487 When deleting branches, the specified
1491 reference namespace first.
1492 If no corresponding branch is found, the
1494 namespace will be searched next.
1496 If invoked in a work tree without any arguments, print the name of the
1497 work tree's current branch.
1501 argument is passed, attempt to create a branch reference with the given name.
1502 By default the new branch reference will point at the latest commit on the
1503 work tree's current branch if invoked in a work tree, and otherwise to a commit
1504 resolved via the repository's HEAD reference.
1506 If invoked in a work tree, once the branch was created successfully
1507 switch the work tree's head reference to the newly created branch and
1508 update files across the entire work tree, just like
1509 .Cm got update -b Ar name
1511 Show the status of each affected file, using the following status codes:
1512 .Bl -column YXZ description
1513 .It U Ta file was updated and contained no local changes
1514 .It G Ta file was updated and local changes were merged cleanly
1515 .It C Ta file was updated and conflicts occurred during merge
1516 .It D Ta file was deleted
1517 .It A Ta new file was added
1518 .It \(a~ Ta versioned file is obstructed by a non-regular file
1519 .It ! Ta a missing versioned file was restored
1527 Make a newly created branch reference point at the specified
1529 The expected argument is a commit ID SHA1 hash, or a reference name or keyword
1530 which will be resolved to a commit ID.
1531 An abbreviated hash argument will be expanded to a full SHA1 hash
1532 automatically, provided the abbreviation is unique.
1537 resolve to the work tree's base commit and branch head, respectively.
1538 The former is only valid if invoked in a work tree, while the latter will
1539 resolve to the tip of the work tree's current branch if invoked in a
1540 work tree, otherwise it will resolve to the repository's HEAD reference.
1541 Keywords and references may be appended with
1545 modifiers and an optional integer N to denote the
1546 Nth descendant or antecedent by first parent traversal, respectively;
1549 denotes the work tree branch head's 2nd generation ancestor, and
1551 denotes the 4th generation descendant of the work tree's base commit.
1554 will denote the 3rd generation descendant of the commit resolved by the
1561 modifier without a trailing integer has an implicit
1570 Delete the branch with the specified
1576 reference namespace.
1578 Only the branch reference is deleted.
1579 Any commit, tree, and blob objects belonging to the branch
1580 remain in the repository and may be removed separately with
1581 Git's garbage collector or
1582 .Cm gotadmin cleanup .
1584 List all existing branches in the repository, including copies of remote
1585 repositories' branches in the
1587 reference namespace.
1589 If invoked in a work tree, the work tree's current branch is shown
1590 with one of the following annotations:
1591 .Bl -column YXZ description
1592 .It * Ta work tree's base commit and the base commit of all tracked files
1593 matches the branch tip
1594 .It \(a~ Ta work tree comprises mixed commits or its base commit is out-of-date
1597 Do not switch and update the work tree after creating a new branch.
1598 .It Fl r Ar repository-path
1599 Use the repository at the specified path.
1600 If not specified, assume the repository is located at or above the current
1602 If this directory is a
1604 work tree, use the repository path associated with this work tree.
1606 Sort listed branches by modification time (most recently modified first)
1607 instead of sorting by lexicographical order.
1610 reference namespace are listed before branches in
1613 Use of this option requires the
1615 option to be used as well.
1622 .Op Fl r Ar repository-path
1623 .Op Fl s Ar signer-id
1626 Manage tags in a repository.
1628 Tags are managed via references which live in the
1630 reference namespace.
1633 command operates on references in this namespace only.
1634 References in this namespace point at tag objects which contain a pointer
1635 to another object, a tag message, as well as author and timestamp information.
1637 Attempt to create a tag with the given
1639 and make this tag point at the given
1641 If no commit is specified, default to the latest commit on the work tree's
1642 current branch if invoked in a work tree, and to a commit resolved via
1643 the repository's HEAD reference otherwise.
1650 Make the newly created tag reference point at the specified
1654 argument is a commit ID SHA1 hash, or a reference or keyword
1655 which will be resolved to a commit ID.
1656 An abbreviated hash argument will be expanded to a full SHA1 hash
1657 automatically, provided the abbreviation is unique.
1662 resolve to the work tree's base commit and branch head, respectively.
1663 The former is only valid if invoked in a work tree, while the latter will
1664 resolve to the tip of the work tree's current branch if invoked in a
1665 work tree, otherwise it will resolve to the repository's HEAD reference.
1666 Keywords and references may be appended with
1670 modifiers and an optional integer N to denote the
1671 Nth descendant or antecedent by first parent traversal, respectively;
1674 denotes the work tree branch head's 2nd generation ancestor, and
1676 denotes the 4th generation descendant of the work tree's base commit.
1679 will denote the 3rd generation ancestor of the commit resolved by the
1686 modifier without a trailing integer has an implicit
1695 List all existing tags in the repository instead of creating a new tag.
1698 argument is passed, show only the tag with the given
1701 Use the specified tag message when creating the new tag.
1706 opens a temporary file in an editor where a tag message can be written.
1707 Quitting the editor without saving the file will abort the tag operation.
1708 .It Fl r Ar repository-path
1709 Use the repository at the specified path.
1710 If not specified, assume the repository is located at or above the current
1712 If this directory is a
1714 work tree, use the repository path associated with this work tree.
1715 .It Fl s Ar signer-id
1716 While creating a new tag, sign this tag with the identity given in
1719 For SSH-based signatures,
1721 is the path to a file which may refer to either a private SSH key,
1722 or a public SSH key with the private half available via
1725 will sign the tag object by invoking
1729 command, using the signature namespace
1731 for compatibility with
1734 Verify tag object signatures.
1737 is specified, show and verify the tag object with the provided name.
1738 Otherwise, list all tag objects and verify signatures where present.
1741 verifies SSH-based signatures by invoking
1744 .Fl Y Cm verify Fl f Ar allowed_signers .
1749 otherwise verification is impossible.
1752 During SSH signature creation and verification this option will be passed to
1754 Multiple -v options increase the verbosity.
1760 command will not delete tags or change existing tags.
1761 If a tag must be deleted, the
1763 command may be used to delete a tag's reference.
1764 This should only be done if the tag has not already been copied to
1771 Schedule unversioned files in a work tree for addition to the
1772 repository in the next commit.
1773 By default, files which match a
1775 ignore pattern will not be added.
1779 mentioned in the command line is not an unversioned file then
1782 To avoid unnecessary errors from paths picked up by file globbing patterns
1783 in the shell, paths in the argument list will be silently ignored if they
1786 at all, or if they are reported with one of the following status codes
1787 and do not have changes staged via
1789 .Bl -column YXZ description
1790 .It M Ta modified file
1791 .It A Ta file scheduled for addition in next commit
1792 .It C Ta modified or added file which contains merge conflicts
1793 .It m Ta modified file modes (executable bit only)
1801 Add files even if they match a
1805 Permit recursion into directories.
1806 If this option is not specified,
1808 will refuse to run if a specified
1816 .Op Fl s Ar status-codes
1820 Remove versioned files from a work tree and schedule them for deletion
1821 from the repository in the next commit.
1828 Perform the operation even if a file contains local modifications,
1829 and do not raise an error if a specified
1831 does not exist on disk.
1833 Keep affected files on disk.
1835 Permit recursion into directories.
1836 If this option is not specified,
1838 will refuse to run if a specified
1841 .It Fl s Ar status-codes
1842 Only delete files with a modification status matching one of the
1843 single-character status codes contained in the
1846 The following status codes may be specified:
1847 .Bl -column YXZ description
1848 .It M Ta modified file (this implies the
1851 .It ! Ta versioned file expected on disk but missing
1859 .Op Fl p Ar strip-count
1865 to files in a work tree.
1866 Files added or removed by a patch will be scheduled for addition or removal in
1869 The patch must be in the unified diff format as produced by
1876 diff when invoked with their
1881 argument is provided, read unified diff data from standard input instead.
1885 contains multiple patches, then attempt to apply each of them in sequence.
1887 Show the status of each affected file, using the following status codes:
1888 .Bl -column XYZ description
1889 .It M Ta file was modified
1890 .It G Ta file was merged using a merge-base found in the repository
1891 .It C Ta file was merged and conflicts occurred during merge
1892 .It D Ta file was deleted
1893 .It A Ta file was added
1894 .It # Ta failed to patch the file
1897 If a change does not match at its exact line number, attempt to
1898 apply it somewhere else in the file if a good spot can be found.
1899 Otherwise, the patch will fail to apply.
1903 will refuse to apply a patch if certain preconditions are not met.
1904 Files to be deleted must already be under version control, and must
1905 not have been scheduled for deletion already.
1906 Files to be added must not yet be under version control and must not
1907 already be present on disk.
1908 Files to be modified must already be under version control and may not
1909 contain conflict markers.
1911 If an error occurs, the
1913 operation will be aborted.
1914 Any changes made to the work tree up to this point will be left behind.
1915 Such changes can be viewed with
1917 and can be reverted with
1926 Attempt to locate files within the specified
1928 for use as a merge-base for 3-way merges.
1932 option is not used then
1934 will attempt to locate merge-bases via object IDs found in
1936 meta-data, such as produced by
1942 option is only recommended in the absence of such meta-data.
1944 Ideally, the specified
1946 should contain versions of files which the changes contained in the
1949 Files will be located by path, relative to the repository root.
1952 option is used then leading path components will be stripped
1953 before paths are looked up in the repository.
1955 In case no merge-base is available for a file, changes will be applied
1956 without doing a 3-way merge.
1957 Changes which do not apply cleanly may then be rejected entirely, rather
1958 than producing merge conflicts in the patched target file.
1962 argument is a commit ID SHA1 hash, or a reference name or a keyword
1963 which will be resolved to a commit ID.
1964 An abbreviated hash argument will be expanded to a full SHA1 hash
1965 automatically, provided the abbreviation is unique.
1970 resolve to the work tree's base commit and branch head, respectively.
1971 Keywords and references may be appended with
1975 modifiers and an optional integer N to denote the
1976 Nth descendant or antecedent by first parent traversal, respectively;
1979 denotes the work tree branch head's 2nd generation ancestor, and
1981 denotes the 4th generation descendant of the work tree's base commit.
1984 will denote the 3rd generation descendant of the commit resolved by the
1991 modifier without a trailing integer has an implicit
2000 Do not make any modifications to the work tree.
2001 This can be used to check whether a patch would apply without issues.
2004 contains diffs that affect the same file multiple times, the results
2005 displayed may be incorrect.
2006 .It Fl p Ar strip-count
2007 Specify the number of leading path components to strip from paths
2016 path prefixes generated by
2018 will be recognized and stripped automatically.
2020 Reverse the patch before applying it.
2026 .Op Fl F Ar response-script
2030 Revert any local changes in files at the specified paths in a work tree.
2031 File contents will be overwritten with those contained in the
2032 work tree's base commit.
2033 There is no way to bring discarded changes back after
2036 If a file was added with
2038 it will become an unversioned file again.
2039 If a file was deleted with
2041 it will be restored.
2047 .It Fl F Ar response-script
2055 responses line-by-line from the specified
2057 file instead of prompting interactively.
2059 Instead of reverting all changes in files, interactively select or reject
2060 changes to revert based on
2066 (quit reverting this file) responses.
2067 If a file is in modified status, individual patches derived from the
2068 modified file content can be reverted.
2069 Files in added or deleted status may only be reverted in their entirety.
2071 Permit recursion into directories.
2072 If this option is not specified,
2074 will refuse to run if a specified
2088 Create a new commit in the repository from changes in a work tree
2089 and use this commit as the new base commit for the work tree.
2092 is specified, commit all changes in the work tree.
2093 Otherwise, commit changes at or within the specified paths.
2095 If changes have been explicitly staged for commit with
2097 only commit staged changes and reject any specified paths which
2098 have not been staged.
2101 opens a temporary file in an editor where a log message can be written
2109 options are used together.
2110 Quitting the editor without saving the file will abort the commit operation.
2112 Show the status of each affected file, using the following status codes:
2113 .Bl -column YXZ description
2114 .It M Ta modified file
2115 .It D Ta file was deleted
2116 .It A Ta new file was added
2117 .It m Ta modified file modes (executable bit only)
2120 Files which are not part of the new commit will retain their previously
2121 recorded base commit.
2124 commands may refuse to run while the work tree contains files from
2125 multiple base commits.
2126 The base commit of such a work tree can be made consistent by running
2128 across the entire work tree.
2132 command requires the
2134 environment variable to be set,
2135 unless an author has been configured in
2141 configuration settings can be
2142 obtained from the repository's
2144 file or from Git's global
2153 Set author information in the newly created commit to
2155 This is useful when committing changes on behalf of someone else.
2158 argument must use the same format as the
2160 environment variable.
2162 In addition to storing author information, the newly created commit
2165 information which is obtained, as usual, from the
2167 environment variable, or
2169 or Git configuration settings.
2171 Allow committing files in conflicted status.
2173 Committing files with conflict markers should generally be avoided.
2174 Cases where conflict markers must be stored in the repository for
2175 some legitimate reason should be very rare.
2176 There are usually ways to avoid storing conflict markers verbatim by
2177 applying appropriate programming tricks.
2179 Use the prepared log message stored in the file found at
2181 when creating the new commit.
2183 opens a temporary file in an editor where the prepared log message can be
2184 reviewed and edited further if needed.
2185 Cannot be used together with the
2189 Use the specified log message when creating the new commit.
2190 Cannot be used together with the
2194 This option prevents
2196 from opening the commit message in an editor.
2197 It has no effect unless it is used together with the
2199 option and is intended for non-interactive use such as scripting.
2201 This option prevents
2203 from generating a diff of the to-be-committed changes in a temporary file
2204 which can be viewed while editing a commit message.
2206 Allow the addition of symbolic links which point outside of the path space
2207 that is under version control.
2210 will reject such symbolic links due to safety concerns.
2213 may decide to represent such a symbolic link as a regular file which contains
2214 the link's target path, rather than creating an actual symbolic link which
2215 points outside of the work tree.
2216 Use of this option is discouraged because external mechanisms such as
2218 are better suited for managing symbolic links to paths not under
2223 will refuse to run if certain preconditions are not met.
2224 If the work tree's current branch is not in the
2226 reference namespace, new commits may not be created on this branch.
2227 Local changes may only be committed if they are based on file content
2228 found in the most recent commit on the work tree's branch.
2229 If a path is found to be out of date,
2231 must be used first in order to merge local changes with changes made
2239 .Op Fl r Ar repository-path
2241 .Op Ar remote-repository
2244 Send new changes to a remote repository.
2246 .Ar remote-repository
2250 The remote repository's URL is obtained from the corresponding entry in
2254 file of the local repository, as created by
2257 All objects corresponding to new changes will be written to a temporary
2258 pack file which is then uploaded to the server.
2259 Upon success, references in the
2261 reference namespace of the local repository will be updated to point at
2262 the commits which have been sent.
2264 By default, changes will only be sent if they are based on up-to-date
2265 copies of relevant branches in the remote repository.
2266 If any changes to be sent are based on out-of-date copies or would
2267 otherwise break linear history of existing branches, new changes must
2268 be fetched from the server with
2270 and local branches must be rebased with
2277 option can be used to make exceptions to these requirements.
2284 Send all branches from the local repository's
2286 reference namespace.
2289 option is equivalent to listing all branches with multiple
2292 Cannot be used together with the
2298 from the local repository's
2300 reference namespace.
2301 This option may be specified multiple times to build a list of branches
2303 If this option is not specified, default to the work tree's current branch
2304 if invoked in a work tree, or to the repository's HEAD reference.
2305 Cannot be used together with the
2309 Delete the specified
2311 from the remote repository's
2313 reference namespace.
2314 This option may be specified multiple times to build a list of branches
2317 Only references are deleted.
2318 Any commit, tree, tag, and blob objects belonging to deleted branches
2319 may become subject to deletion by Git's garbage collector running on
2322 Requesting deletion of branches results in an error if the server
2323 does not support this feature or disallows the deletion of branches
2324 based on its configuration.
2326 Attempt to force the server to overwrite existing branches or tags
2327 in the remote repository, even when
2333 would usually be required before changes can be sent.
2334 The server may reject forced requests regardless, depending on its
2337 Any commit, tree, tag, and blob objects belonging to overwritten branches
2338 or tags may become subject to deletion by Git's garbage collector running
2343 reference namespace is globally shared between all repositories.
2346 option to overwrite tags is discouraged because it can lead to
2347 inconsistencies between the tags present in different repositories.
2348 In general, creating a new tag with a different name is recommended
2349 instead of overwriting an existing tag.
2353 option is particularly discouraged if changes being sent are based
2354 on an out-of-date copy of a branch in the remote repository.
2355 Instead of using the
2357 option, new changes should
2360 and local branches should be rebased with
2364 followed by another attempt to send the changes.
2368 option should only be needed in situations where the remote repository's
2369 copy of a branch or tag is known to be out-of-date and is considered
2371 The risks of creating inconsistencies between different repositories
2372 should also be taken into account.
2374 Suppress progress reporting output.
2375 The same option will be passed to
2378 .It Fl r Ar repository-path
2379 Use the repository at the specified path.
2380 If not specified, assume the repository is located at or above the current
2382 If this directory is a
2384 work tree, use the repository path associated with this work tree.
2386 Attempt to send all tags from the local repository's
2388 reference namespace.
2391 option is equivalent to listing all tags with multiple
2394 Cannot be used together with the
2400 from the local repository's
2402 reference namespace, in addition to any branches that are being sent.
2405 option may be specified multiple times to build a list of tags to send.
2406 No tags will be sent if the
2410 Raise an error if the specified
2412 already exists in the remote repository, unless the
2414 option is used to overwrite the server's copy of the tag.
2415 In general, creating a new tag with a different name is recommended
2416 instead of overwriting an existing tag.
2418 Cannot be used together with the
2425 to print debugging messages to standard error output.
2426 The same option will be passed to
2429 Multiple -v options increase the verbosity.
2439 Merge changes from a single
2444 should be on a different branch than the work tree's base commit.
2446 The expected argument is a commit ID SHA1 hash, or a reference name or
2447 keyword which will be resolved to a commit ID.
2448 An abbreviated hash argument will be expanded to a full SHA1 hash
2449 automatically, provided the abbreviation is unique.
2454 resolve to the work tree's base commit and branch head, respectively.
2455 Keywords and references may be appended with
2459 modifiers and an optional integer N to denote the
2460 Nth descendant or antecedent by first parent traversal, respectively;
2463 denotes the work tree branch head's 2nd generation ancestor, and
2465 denotes the 4th generation descendant of the work tree's base commit.
2468 will denote the 3rd generation descendant of the commit resolved by the
2475 modifier without a trailing integer has an implicit
2484 Show the status of each affected file, using the following status codes:
2485 .Bl -column YXZ description
2486 .It G Ta file was merged
2487 .It C Ta file was merged and conflicts occurred during merge
2488 .It ! Ta changes destined for a missing file were not merged
2489 .It D Ta file was deleted
2490 .It d Ta file's deletion was prevented by local modifications
2491 .It A Ta new file was added
2492 .It \(a~ Ta changes destined for a non-regular file were not merged
2493 .It ? Ta changes destined for an unversioned file were not merged
2496 The merged changes will appear as local changes in the work tree, which
2499 amended manually or with further
2505 If invoked in a work tree where no
2510 operation is taking place,
2512 creates a record of commits which have been merged into the work tree.
2513 When a file changed by
2517 the log messages of relevant merged commits will then appear in the editor,
2518 where the messages should be further adjusted to convey the reasons for
2519 cherrypicking the changes.
2520 Upon exiting the editor, if the time stamp of the log message file
2521 is unchanged or the log message is empty,
2523 will fail with an unmodified or empty log message error.
2525 If all the changes in all files touched by a given commit are discarded,
2528 this commit's log message record will also disappear.
2531 will refuse to run if certain preconditions are not met.
2532 If the work tree contains multiple base commits, it must first be updated
2533 to a single base commit with
2535 If any relevant files already contain merge conflicts, these
2536 conflicts must be resolved first.
2544 Display a list of commit log messages recorded by cherrypick operations,
2545 represented by references in the
2546 .Dq refs/got/worktree
2547 reference namespace.
2550 is specified, only show the log message of the specified commit.
2552 If invoked in a work tree, only log messages recorded by cherrypick operations
2553 in the current work tree will be displayed.
2554 Otherwise, all commit log messages will be displayed irrespective of the
2555 work tree in which they were created.
2556 This option cannot be used with
2559 Delete log messages created by previous cherrypick operations, represented by
2561 .Dq refs/got/worktree
2562 reference namespace.
2565 is specified, only delete the log message of the specified commit.
2567 If invoked in a work tree, only log messages recorded by cherrypick operations
2568 in the current work tree will be deleted.
2569 Otherwise, all commit log messages will be deleted irrespective of the
2570 work tree in which they were created.
2571 This option cannot be used with
2582 Reverse-merge changes from a single
2587 should be on the same branch as the work tree's base commit.
2589 The expected argument is a commit ID SHA1 hash, or a reference name
2590 or keyword which will be resolved to a commit ID.
2591 An abbreviated hash argument will be expanded to a full SHA1 hash
2592 automatically, provided the abbreviation is unique.
2597 resolve to the work tree's base commit and branch head, respectively.
2598 Keywords and references may be appended with
2602 modifiers and an optional integer N to denote the
2603 Nth descendant or antecedent by first parent traversal, respectively;
2606 denotes the work tree branch head's 2nd generation ancestor, and
2608 denotes the 4th generation descendant of the work tree's base commit.
2611 will denote the 5th generation descendant of the commit resolved by the
2618 modifier without a trailing integer has an implicit
2627 Show the status of each affected file, using the following status codes:
2628 .Bl -column YXZ description
2629 .It G Ta file was merged
2630 .It C Ta file was merged and conflicts occurred during merge
2631 .It ! Ta changes destined for a missing file were not merged
2632 .It D Ta file was deleted
2633 .It d Ta file's deletion was prevented by local modifications
2634 .It A Ta new file was added
2635 .It \(a~ Ta changes destined for a non-regular file were not merged
2636 .It ? Ta changes destined for an unversioned file were not merged
2639 The reverse-merged changes will appear as local changes in the work tree,
2640 which may be viewed with
2642 amended manually or with further
2648 If invoked in a work tree where no
2653 operation is taking place,
2655 creates a record of commits which have been reverse-merged into the work tree.
2656 When a file changed by
2660 the log messages of relevant reverse-merged commits will then appear in
2661 the editor, where the messages should be further adjusted to convey the
2662 reasons for backing out the changes.
2663 Upon exiting the editor, if the time stamp of the log message file
2664 is unchanged or the log message is empty,
2666 will fail with an unmodified or empty log message error.
2668 If all the changes in all files touched by a given commit are discarded,
2671 this commit's log message record will also disappear.
2674 will refuse to run if certain preconditions are not met.
2675 If the work tree contains multiple base commits, it must first be updated
2676 to a single base commit with
2678 If any relevant files already contain merge conflicts, these
2679 conflicts must be resolved first.
2687 Display a list of commit log messages recorded by backout operations,
2688 represented by references in the
2689 .Dq refs/got/worktree
2690 reference namespace.
2693 is specified, only show the log message of the specified commit.
2695 If invoked in a work tree, only log messages recorded by backout operations
2696 in the current work tree will be displayed.
2697 Otherwise, all commit log messages will be displayed irrespective of the
2698 work tree in which they were created.
2699 This option cannot be used with
2702 Delete log messages created by previous backout operations, represented by
2704 .Dq refs/got/worktree
2705 reference namespace.
2708 is specified, only delete the log message of the specified commit.
2710 If invoked in a work tree, only log messages recorded by backout operations
2711 in the current work tree will be deleted.
2712 Otherwise, all commit log messages will be deleted irrespective of the
2713 work tree in which they were created.
2714 This option cannot be used with
2725 Rebase commits on the specified
2727 onto the tip of the current branch of the work tree.
2730 must share common ancestry with the work tree's current branch.
2731 Rebasing begins with the first descendant commit of the youngest
2732 common ancestor commit shared by the specified
2734 and the work tree's current branch, and stops once the tip commit
2741 is used as intended, the specified
2743 represents a local commit history and may already contain changes
2744 that are not yet visible in any other repositories.
2745 The work tree's current branch, which must be set with
2749 operation, represents a branch from a remote repository which shares
2750 a common history with the specified
2752 but has progressed, and perhaps diverged, due to commits added to the
2755 Rebased commits are accumulated on a temporary branch which the work tree
2756 will remain switched to throughout the entire rebase operation.
2757 Commits on this branch represent the same changes with the same log
2758 messages as their counterparts on the original
2760 but with different commit IDs.
2761 Once rebasing has completed successfully, the temporary branch becomes
2762 the new version of the specified
2764 and the work tree is automatically switched to it.
2765 If author information is available via the
2767 environment variable,
2773 configuration settings, this author information will be used to identify
2778 Old commits in their pre-rebase state are automatically backed up in the
2779 .Dq refs/got/backup/rebase
2780 reference namespace.
2781 As long as these references are not removed older versions of rebased
2782 commits will remain in the repository and can be viewed with the
2785 Removal of these references makes objects which become unreachable via
2786 any reference subject to removal by Git's garbage collector or
2787 .Cm gotadmin cleanup .
2789 While rebasing commits, show the status of each affected file,
2790 using the following status codes:
2791 .Bl -column YXZ description
2792 .It G Ta file was merged
2793 .It C Ta file was merged and conflicts occurred during merge
2794 .It ! Ta changes destined for a missing file were not merged
2795 .It D Ta file was deleted
2796 .It d Ta file's deletion was prevented by local modifications
2797 .It A Ta new file was added
2798 .It \(a~ Ta changes destined for a non-regular file were not merged
2799 .It ? Ta changes destined for an unversioned file were not merged
2802 If merge conflicts occur, the rebase operation is interrupted and may
2803 be continued once conflicts have been resolved.
2804 If any files with destined changes are found to be missing or unversioned,
2805 or if files could not be deleted due to differences in deleted content,
2806 the rebase operation will be interrupted to prevent potentially incomplete
2807 changes from being committed to the repository without user intervention.
2808 The work tree may be modified as desired and the rebase operation can be
2809 continued once the changes present in the work tree are considered complete.
2810 Alternatively, the rebase operation may be aborted which will leave
2812 unmodified and the work tree switched back to its original branch.
2814 If a merge conflict is resolved in a way which renders the merged
2815 change into a no-op change, the corresponding commit will be elided
2816 when the rebase operation continues.
2819 will refuse to run if certain preconditions are not met.
2824 reference namespace, the branch may not be rebased.
2825 If the work tree is not yet fully updated to the tip commit of its
2826 branch, then the work tree must first be updated with
2828 If changes have been staged with
2830 these changes must first be committed with
2834 If the work tree contains local changes, these changes must first be
2841 contains changes to files outside of the work tree's path prefix,
2842 the work tree cannot be used to rebase this branch.
2851 commands will refuse to run while a rebase operation is in progress.
2852 Other commands which manipulate the work tree may be used for
2853 conflict resolution purposes.
2857 is already based on the work tree's current branch, then no commits
2858 need to be rebased and
2860 will simply switch the work tree to the specified
2862 and update files in the work tree accordingly.
2869 Abort an interrupted rebase operation.
2870 If this option is used, no other command-line arguments are allowed.
2872 Allow a rebase operation to continue with files in conflicted status.
2873 This option should generally be avoided, and can only be used with the
2877 Continue an interrupted rebase operation.
2878 If this option is used, no other command-line arguments are allowed except
2881 Show a list of past rebase operations, represented by references in the
2882 .Dq refs/got/backup/rebase
2883 reference namespace.
2885 Display the author, date, and log message of each backed up commit,
2886 the object ID of the corresponding post-rebase commit, and
2887 the object ID of their common ancestor commit.
2888 Given these object IDs,
2895 options can be used to examine the history of either version of the branch,
2900 option can be used to create a new branch from a pre-rebase state if desired.
2904 is specified, only show commits which at some point in time represented this
2906 Otherwise, list all backed up commits for any branches.
2908 If this option is used,
2910 does not require a work tree.
2911 None of the other options can be used together with
2914 Delete backups created by past rebase operations, represented by references
2916 .Dq refs/got/backup/rebase
2917 reference namespace.
2921 is specified, only delete backups which at some point in time represented
2923 Otherwise, delete all references found within
2924 .Dq refs/got/backup/rebase .
2926 Any commit, tree, tag, and blob objects belonging to deleted backups
2927 remain in the repository and may be removed separately with
2928 Git's garbage collector or
2929 .Cm gotadmin cleanup .
2931 If this option is used,
2933 does not require a work tree.
2934 None of the other options can be used together with
2941 .Op Fl F Ar histedit-script
2945 Edit commit history between the work tree's current base commit and
2946 the tip commit of the work tree's current branch.
2950 command requires the
2952 environment variable to be set,
2953 unless an author has been configured in
2959 configuration settings can be obtained from the repository's
2961 file or from Git's global
2967 operation, the work tree's current branch must be set with
2969 to the branch which should be edited, unless this branch is already the
2970 current branch of the work tree.
2971 The tip of this branch represents the upper bound (inclusive) of commits
2976 Furthermore, the work tree's base commit
2979 to a point in this branch's commit history where editing should begin.
2980 This commit represents the lower bound (non-inclusive) of commits touched
2985 Editing of commit history is controlled via a
2987 which can be written in an editor based on a template, passed on the
2988 command line, or generated with the
2995 Quitting the editor without saving the file will abort the histedit operation.
2997 The format of the histedit script is line-based.
2998 Each line in the script begins with a command name, followed by
2999 whitespace and an argument.
3000 For most commands, the expected argument is a commit ID SHA1 hash.
3001 Any remaining text on the line is ignored.
3002 Lines which begin with the
3004 character are ignored entirely.
3006 The available histedit script commands are as follows:
3007 .Bl -column YXZ pick-commit
3008 .It Cm pick Ar commit Ta Use the specified commit as it is.
3009 .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
3010 then interrupt the histedit operation for amending, without creating a commit.
3011 While the histedit operation is interrupted arbitrary files may be edited,
3012 and commands which manipulate the work tree can be used freely.
3017 commands can be used to add new files or remove existing ones.
3020 command can be used to eliminate arbitrary changes from files in the work tree.
3023 command may be used to prepare a subset of changes for inclusion in the
3027 command can be used to insert arbitrary commits into the edited history.
3028 Regular editing of history must eventually be resumed by running
3029 .Cm got histedit -c .
3030 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
3031 listed further below that will be used.
3032 .It Cm drop Ar commit Ta Remove this commit from the edited history.
3033 .It Cm mesg Ar commit Ta Open an editor to create a new log message for this
3037 Every commit in the history being edited must be mentioned in the script.
3038 Lines may be re-ordered to change the order of commits in the edited history.
3039 No commit may be listed more than once.
3041 Edited commits are accumulated on a temporary branch which the work tree
3042 will remain switched to throughout the entire histedit operation.
3043 Once history editing has completed successfully, the temporary branch becomes
3044 the new version of the work tree's branch and the work tree is automatically
3047 Old commits in their pre-histedit state are automatically backed up in the
3048 .Dq refs/got/backup/histedit
3049 reference namespace.
3050 As long as these references are not removed older versions of edited
3051 commits will remain in the repository and can be viewed with the
3054 Removal of these references makes objects which become unreachable via
3055 any reference subject to removal by Git's garbage collector or
3056 .Cm gotadmin cleanup .
3058 While merging commits, show the status of each affected file,
3059 using the following status codes:
3060 .Bl -column YXZ description
3061 .It G Ta file was merged
3062 .It C Ta file was merged and conflicts occurred during merge
3063 .It ! Ta changes destined for a missing file were not merged
3064 .It D Ta file was deleted
3065 .It d Ta file's deletion was prevented by local modifications
3066 .It A Ta new file was added
3067 .It \(a~ Ta changes destined for a non-regular file were not merged
3068 .It ? Ta changes destined for an unversioned file were not merged
3071 If merge conflicts occur, the histedit operation is interrupted and may
3072 be continued once conflicts have been resolved.
3073 If any files with destined changes are found to be missing or unversioned,
3074 or if files could not be deleted due to differences in deleted content,
3075 the histedit operation will be interrupted to prevent potentially incomplete
3076 changes from being committed to the repository without user intervention.
3077 The work tree may be modified as desired and the histedit operation can be
3078 continued once the changes present in the work tree are considered complete.
3079 Alternatively, the histedit operation may be aborted which will leave
3080 the work tree switched back to its original branch.
3082 If a merge conflict is resolved in a way which renders the merged
3083 change into a no-op change, the corresponding commit will be elided
3084 when the histedit operation continues.
3087 will refuse to run if certain preconditions are not met.
3088 If the work tree's current branch is not in the
3090 reference namespace, the history of the branch may not be edited.
3091 If the work tree contains multiple base commits, it must first be updated
3092 to a single base commit with
3094 If changes have been staged with
3096 these changes must first be committed with
3100 If the work tree contains local changes, these changes must first be
3105 If the edited history contains changes to files outside of the work tree's
3106 path prefix, the work tree cannot be used to edit the history of this branch.
3114 commands will refuse to run while a histedit operation is in progress.
3115 Other commands which manipulate the work tree may be used, and the
3117 command may be used to commit arbitrary changes to the temporary branch
3118 while the histedit operation is interrupted.
3125 Abort an interrupted histedit operation.
3126 If this option is used, no other command-line arguments are allowed.
3128 Allow a histedit operation to continue with files in conflicted status.
3129 This option should generally be avoided, and can only be used with the
3133 Continue an interrupted histedit operation.
3134 If this option is used, no other command-line arguments are allowed except
3138 This option is a quick equivalent to a histedit script which drops all
3142 option can only be used when starting a new histedit operation.
3143 If this option is used, no other command-line arguments are allowed.
3145 Interrupt the histedit operation for editing after merging each commit.
3146 This option is a quick equivalent to a histedit script which uses the
3148 command for all commits.
3151 option can only be used when starting a new histedit operation.
3152 If this option is used, no other command-line arguments are allowed.
3153 .It Fl F Ar histedit-script
3156 instead of opening a temporary file in an editor where a histedit script
3159 Fold all commits into a single commit.
3160 This option is a quick equivalent to a histedit script which folds all
3161 commits, combining them all into one commit.
3164 option can only be used when starting a new histedit operation.
3165 If this option is used, no other command-line arguments are allowed.
3167 Show a list of past histedit operations, represented by references in the
3168 .Dq refs/got/backup/histedit
3169 reference namespace.
3171 Display the author, date, and log message of each backed up commit,
3172 the object ID of the corresponding post-histedit commit, and
3173 the object ID of their common ancestor commit.
3174 Given these object IDs,
3181 options can be used to examine the history of either version of the branch,
3186 option can be used to create a new branch from a pre-histedit state if desired.
3190 is specified, only show commits which at some point in time represented this
3192 Otherwise, list all backed up commits for any branches.
3194 If this option is used,
3196 does not require a work tree.
3197 None of the other options can be used together with
3200 Edit log messages only.
3201 This option is a quick equivalent to a histedit script which edits
3202 only log messages but otherwise leaves every picked commit as-is.
3205 option can only be used when starting a new histedit operation.
3206 If this option is used, no other command-line arguments are allowed.
3208 Delete backups created by past histedit operations, represented by references
3210 .Dq refs/got/backup/histedit
3211 reference namespace.
3215 is specified, only delete backups which at some point in time represented
3217 Otherwise, delete all references found within
3218 .Dq refs/got/backup/histedit .
3220 Any commit, tree, tag, and blob objects belonging to deleted backups
3221 remain in the repository and may be removed separately with
3222 Git's garbage collector or
3223 .Cm gotadmin cleanup .
3225 If this option is used,
3227 does not require a work tree.
3228 None of the other options can be used together with
3232 .It Cm integrate Ar branch
3234 Integrate the specified
3236 into the work tree's current branch.
3237 Files in the work tree are updated to match the contents on the integrated
3239 and the reference of the work tree's branch is changed to point at the
3240 head commit of the integrated
3243 Both branches can be considered equivalent after integration since they
3244 will be pointing at the same commit.
3245 Both branches remain available for future work, if desired.
3246 In case the integrated
3248 is no longer needed it may be deleted with
3251 Show the status of each affected file, using the following status codes:
3252 .Bl -column YXZ description
3253 .It U Ta file was updated
3254 .It D Ta file was deleted
3255 .It A Ta new file was added
3256 .It \(a~ Ta versioned file is obstructed by a non-regular file
3257 .It ! Ta a missing versioned file was restored
3261 will refuse to run if certain preconditions are not met.
3262 Most importantly, the
3264 must have been rebased onto the work tree's current branch with
3266 before it can be integrated, in order to linearize commit history and
3267 resolve merge conflicts.
3268 If the work tree contains multiple base commits, it must first be updated
3269 to a single base commit with
3271 If changes have been staged with
3273 these changes must first be committed with
3277 If the work tree contains local changes, these changes must first be
3291 into the current branch of the work tree.
3292 If the branches have diverged, merge changes into the work tree
3293 and create a merge commit.
3294 Otherwise, if the specified
3296 is already based on the work tree's current branch, make the work tree's
3297 current branch equivalent to the specified
3299 and update files in the work tree accordingly.
3301 Merge commits are commits based on multiple parent commits.
3302 The tip commit of the work tree's current branch will be used as the
3304 The tip commit of the specified
3306 will be used as the second parent.
3307 The work tree's current branch
3310 reference namespace and can be set with
3316 No ancestral relationship between the two branches is required.
3317 If the two branches have already been merged previously, only new changes
3320 It is not possible to create merge commits with more than two parents.
3321 If more than one branch needs to be merged, then multiple merge commits
3322 with two parents each can be created in sequence.
3324 If a linear project history is desired, then use of
3326 should generally be preferred over
3328 However, even strictly linear projects may require occasional merge commits,
3329 for example in order to merge in new versions of third-party code stored
3332 branches created with
3335 While merging changes found on the
3337 into the work tree, show the status of each affected file,
3338 using the following status codes:
3339 .Bl -column YXZ description
3340 .It G Ta file was merged
3341 .It C Ta file was merged and conflicts occurred during merge
3342 .It ! Ta changes destined for a missing file were not merged
3343 .It D Ta file was deleted
3344 .It d Ta file's deletion was prevented by local modifications
3345 .It A Ta new file was added
3346 .It \(a~ Ta changes destined for a non-regular file were not merged
3347 .It ? Ta changes destined for an unversioned file were not merged
3350 If merge conflicts occur, the merge operation is interrupted and conflicts
3351 must be resolved before the merge operation can continue.
3352 If any files with destined changes are found to be missing or unversioned,
3353 or if files could not be deleted due to differences in deleted content,
3354 the merge operation will be interrupted to prevent potentially incomplete
3355 changes from being committed to the repository without user intervention.
3356 The work tree may be modified as desired and the merge can be continued
3357 once the changes present in the work tree are considered complete.
3358 Alternatively, the merge operation may be aborted which will leave
3359 the work tree's current branch unmodified.
3362 will refuse to run if certain preconditions are not met.
3363 If the work tree's current branch is not in the
3365 reference namespace then the work tree must first be switched to a
3370 If the work tree is not yet fully updated to the tip commit of its
3371 branch, then the work tree must first be updated with
3373 If the work tree contains multiple base commits, it must first be updated
3374 to a single base commit with
3376 If changes have been staged with
3378 these changes must first be committed with
3382 If the work tree contains local changes, these changes must first be
3389 contains changes to files outside of the work tree's path prefix,
3390 the work tree cannot be used to merge this branch.
3400 commands will refuse to run while a merge operation is in progress.
3401 Other commands which manipulate the work tree may be used for
3402 conflict resolution purposes.
3409 Abort an interrupted merge operation.
3410 If this option is used, no other command-line arguments are allowed.
3412 Allow a merge operation to continue with files in conflicted status.
3413 This option should generally be avoided, and can only be used with the
3417 Continue an interrupted merge operation.
3418 If this option is used, no other command-line arguments are allowed except
3421 Create a merge commit even if the branches have not diverged.
3423 Merge changes into the work tree as usual but do not create a merge
3425 The merge result can be adjusted as desired before a merge commit is
3428 Alternatively, the merge may be aborted with
3435 .Op Fl F Ar response-script
3439 Stage local changes for inclusion in the next commit.
3442 is specified, stage all changes in the work tree.
3443 Otherwise, stage changes at or within the specified paths.
3444 Paths may be staged if they are added, modified, or deleted according to
3447 Show the status of each affected file, using the following status codes:
3448 .Bl -column YXZ description
3449 .It A Ta file addition has been staged
3450 .It M Ta file modification has been staged
3451 .It D Ta file deletion has been staged
3454 Staged file contents are saved in newly created blob objects in the repository.
3455 These blobs will be referred to by tree objects once staged changes have been
3458 Staged changes affect the behaviour of
3463 While paths with staged changes exist, the
3465 command will refuse to commit any paths which do not have staged changes.
3466 Local changes created on top of staged changes can only be committed if
3467 the path is staged again, or if the staged changes are committed first.
3470 command will show both local changes and staged changes.
3473 command is able to display local changes relative to staged changes,
3474 and to display staged changes relative to the repository.
3477 command cannot revert staged changes but may be used to revert
3478 local changes created on top of staged changes.
3484 .It Fl F Ar response-script
3492 responses line-by-line from the specified
3494 file instead of prompting interactively.
3496 Instead of staging new changes, list paths which are already staged,
3497 along with the IDs of staged blob objects and stage status codes.
3498 If paths were provided on the command line, show the staged paths
3499 among the specified paths.
3500 Otherwise, show all staged paths.
3502 Instead of staging the entire content of a changed file, interactively
3503 select or reject changes for staging based on
3507 (reject change), and
3509 (quit staging this file) responses.
3510 If a file is in modified status, individual patches derived from the
3511 modified file content can be staged.
3512 Files in added or deleted status may only be staged or rejected in
3515 Allow staging of symbolic links which point outside of the path space
3516 that is under version control.
3519 will reject such symbolic links due to safety concerns.
3522 may decide to represent such a symbolic link as a regular file which contains
3523 the link's target path, rather than creating an actual symbolic link which
3524 points outside of the work tree.
3525 Use of this option is discouraged because external mechanisms such as
3527 are better suited for managing symbolic links to paths not under
3532 will refuse to run if certain preconditions are not met.
3533 If a file contains merge conflicts, these conflicts must be resolved first.
3534 If a file is found to be out of date relative to the head commit on the
3535 work tree's current branch, the file must be updated with
3537 before it can be staged (however, this does not prevent the file from
3538 becoming out-of-date at some point after having been staged).
3546 commands will refuse to run while staged changes exist.
3547 If staged changes cannot be committed because a staged path
3548 is out of date, the path must be unstaged with
3550 before it can be updated with
3552 and may then be staged again if necessary.
3557 .Op Fl F Ar response-script
3561 Merge staged changes back into the work tree and put affected paths
3562 back into non-staged status.
3565 is specified, unstage all staged changes across the entire work tree.
3566 Otherwise, unstage changes at or within the specified paths.
3568 Show the status of each affected file, using the following status codes:
3569 .Bl -column YXZ description
3570 .It G Ta file was unstaged
3571 .It C Ta file was unstaged and conflicts occurred during merge
3572 .It ! Ta changes destined for a missing file were not merged
3573 .It D Ta file was staged as deleted and still is deleted
3574 .It d Ta file's deletion was prevented by local modifications
3575 .It \(a~ Ta changes destined for a non-regular file were not merged
3582 .It Fl F Ar response-script
3590 responses line-by-line from the specified
3592 file instead of prompting interactively.
3594 Instead of unstaging the entire content of a changed file, interactively
3595 select or reject changes for unstaging based on
3599 (keep change staged), and
3601 (quit unstaging this file) responses.
3602 If a file is staged in modified status, individual patches derived from the
3603 staged file content can be unstaged.
3604 Files staged in added or deleted status may only be unstaged in their entirety.
3610 .Op Fl r Ar repository-path
3613 Parse and print contents of objects to standard output in a line-based
3615 Content of commit, tree, and tag objects is printed in a way similar
3616 to the actual content stored in such objects.
3617 Blob object contents are printed as they would appear in files on disk.
3619 Attempt to interpret each argument as a reference, a tag name, or
3620 an object ID SHA1 hash.
3621 References will be resolved to an object ID.
3622 Tag names will resolved to a tag object.
3623 An abbreviated hash argument will be expanded to a full SHA1 hash
3624 automatically, provided the abbreviation is unique.
3626 If none of the above interpretations produce a valid result, or if the
3628 option is used, attempt to interpret the argument as a path which will
3629 be resolved to the ID of an object found at this path in the repository.
3636 Look up paths in the specified
3638 If this option is not used, paths are looked up in the commit resolved
3639 via the repository's HEAD reference.
3641 The expected argument is a commit ID SHA1 hash, or a reference name
3642 or keyword which will be resolved to a commit ID.
3643 An abbreviated hash argument will be expanded to a full SHA1 hash
3644 automatically, provided the abbreviation is unique.
3649 resolve to the work tree's base commit and branch head, respectively.
3650 The former is only valid if invoked in a work tree, while the latter will
3651 resolve to the tip of the work tree's current branch if invoked in a
3652 work tree, otherwise it will resolve to the repository's HEAD reference.
3653 Keywords and references may be appended with
3657 modifiers and an optional integer N to denote the
3658 Nth descendant or antecedent by first parent traversal, respectively;
3661 denotes the work tree branch head's 2nd generation ancestor, and
3663 denotes the 4th generation descendant of the work tree's base commit.
3666 will denote the 8th generation ancestor of the commit resolved by the
3673 modifier without a trailing integer has an implicit
3682 Interpret all arguments as paths only.
3683 This option can be used to resolve ambiguity in cases where paths
3684 look like tag names, reference names, or object IDs.
3685 .It Fl r Ar repository-path
3686 Use the repository at the specified path.
3687 If not specified, assume the repository is located at or above the current
3689 If this directory is a
3691 work tree, use the repository path associated with this work tree.
3693 .It Cm info Op Ar path ...
3694 Display meta-data stored in a work tree.
3699 The work tree to use is resolved implicitly by walking upwards from the
3700 current working directory.
3704 arguments are specified, show additional per-file information for tracked
3705 files located at or within these paths.
3708 argument corresponds to the work tree's root directory, display information
3709 for all tracked files.
3712 .Bl -tag -width GOT_IGNORE_GITCONFIG
3714 The author's name and email address, such as
3715 .Qq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3726 may fail to parse commits without an email address in author data,
3730 environment variables with a missing email address.
3732 .Ev GOT_AUTHOR will be overridden by configuration settings in
3738 configuration settings in the repository's
3745 configuration settings contained in Git's global
3747 configuration file will only be used if neither
3751 environment variable provide author information.
3752 .It Ev GOT_IGNORE_GITCONFIG
3753 If this variable is set then any remote repository definitions or author
3754 information found in Git configuration files will be ignored.
3755 .It Ev GOT_LOG_DEFAULT_LIMIT
3756 The default limit on the number of commits traversed by
3758 If set to zero, the limit is unbounded.
3759 This variable will be silently ignored if it is set to a non-numeric value.
3760 .It Ev VISUAL , EDITOR
3761 The editor spawned by
3769 text editor will be spawned.
3772 .Bl -tag -width packed-refs -compact
3774 Repository-wide configuration settings for
3778 configuration file located in the root directory of a Git repository
3779 supersedes any relevant settings in Git's
3783 .It Pa .got/got.conf
3784 Worktree-specific configuration settings for
3788 configuration file in the
3790 meta-data directory of a work tree supersedes any relevant settings in
3793 configuration file and Git's
3800 Enable tab-completion of
3805 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3807 Clone an existing Git repository for use with
3811 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3813 Unfortunately, many of the popular Git hosting sites do not offer anonymous
3815 Such sites will require an account to be created, and a public SSH key to be
3816 uploaded to this account, before repository access via ssh:// URLs will work.
3818 Use of HTTP URLs currently requires
3822 .Dl $ git clone --bare https://github.com/openbsd/src.git
3824 Alternatively, for quick and dirty local testing of
3826 a new Git repository could be created and populated with files,
3827 e.g. from a temporary CVS checkout located at
3830 .Dl $ gotadmin init /var/git/src.git
3831 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3833 Check out a work tree from the Git repository to /usr/src:
3835 .Dl $ got checkout /var/git/src.git /usr/src
3837 View local changes in a work tree directory:
3839 .Dl $ got diff | less
3841 In a work tree, display files in a potentially problematic state:
3843 .Dl $ got status -s 'C!~?'
3845 Interactively revert selected local changes in a work tree directory:
3847 .Dl $ got revert -p -R\ .
3849 In a work tree or a git repository directory, list all branch references:
3853 As above, but list the most recently modified branches only:
3855 .Dl $ got branch -lt | head
3857 In a work tree or a git repository directory, create a new branch called
3858 .Dq unified-buffer-cache
3859 which is forked off the
3863 .Dl $ got branch -c master unified-buffer-cache
3865 Switch an existing work tree to the branch
3866 .Dq unified-buffer-cache .
3867 Local changes in the work tree will be preserved and merged if necessary:
3869 .Dl $ got update -b unified-buffer-cache
3871 Create a new commit from local changes in a work tree directory.
3872 This new commit will become the head commit of the work tree's current branch:
3876 In a work tree or a git repository directory, view changes committed in
3877 the 3 most recent commits to the work tree's branch, or the branch resolved
3878 via the repository's HEAD reference, respectively:
3880 .Dl $ got log -p -l 3
3882 As above, but display changes in the order in which
3884 could apply them in sequence:
3886 .Dl $ got log -p -l 3 -R
3888 In a work tree or a git repository directory, log the history of a subdirectory:
3890 .Dl $ got log sys/uvm
3892 While operating inside a work tree, paths are specified relative to the current
3893 working directory, so this command will log the subdirectory
3896 .Dl $ cd sys/uvm && got log\ .
3898 And this command has the same effect:
3900 .Dl $ cd sys/dev/usb && got log ../../uvm
3902 And this command displays work tree meta-data about all tracked files:
3905 .Dl $ got info\ . | less
3907 Add new files and remove obsolete files in a work tree directory:
3909 .Dl $ got add sys/uvm/uvm_ubc.c
3910 .Dl $ got remove sys/uvm/uvm_vnode.c
3912 Create a new commit from local changes in a work tree directory
3913 with a pre-defined log message.
3915 .Dl $ got commit -m 'unify the buffer cache'
3917 Alternatively, create a new commit from local changes in a work tree
3918 directory with a log message that has been prepared in the file
3921 .Dl $ got commit -F /tmp/msg
3923 Update any work tree checked out from the
3924 .Dq unified-buffer-cache
3925 branch to the latest commit on this branch:
3929 Roll file content on the unified-buffer-cache branch back by one commit,
3930 and then fetch the rolled-back change into the work tree as a local change
3931 to be amended and perhaps committed again:
3933 .Dl $ got backout unified-buffer-cache
3934 .Dl $ got commit -m 'roll back previous'
3935 .Dl $ # now back out the previous backout :-)
3936 .Dl $ got backout unified-buffer-cache
3938 Fetch new changes on the remote repository's
3940 branch, making them visible on the local repository's
3947 In a repository created with a HTTP URL and
3948 .Cm git clone --bare
3951 command must be used instead:
3953 .Dl $ cd /var/git/src.git
3954 .Dl $ git fetch origin master:refs/remotes/origin/master
3958 branch to merge the new changes that are now visible on the
3963 .Dl $ got update -b origin/master
3964 .Dl $ got rebase master
3967 .Dq unified-buffer-cache
3968 branch on top of the new head commit of the
3972 .Dl $ got update -b master
3973 .Dl $ got rebase unified-buffer-cache
3975 Create a patch from all changes on the unified-buffer-cache branch.
3976 The patch can be mailed out for review and applied to
3980 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
3982 Edit the entire commit history of the
3983 .Dq unified-buffer-cache
3986 .Dl $ got update -b unified-buffer-cache
3987 .Dl $ got update -c master
3990 Before working against existing branches in a repository cloned with
3991 .Cm git clone --bare
3996 must be configured to map all references in the remote repository
3999 namespace of the local repository.
4000 This can be achieved by setting Git's
4001 .Pa remote.origin.fetch
4002 configuration variable to the value
4003 .Dq +refs/heads/*:refs/remotes/origin/*
4008 .Dl $ cd /var/git/repo
4009 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
4013 option must be disabled:
4015 .Dl $ cd /var/git/repo
4016 .Dl $ git config remote.origin.mirror false
4018 Alternatively, the following
4020 configuration item can be added manually to the Git repository's
4024 .Dl [remote \&"origin\&"]
4026 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
4029 This configuration leaves the local repository's
4031 namespace free for use by local branches checked out with
4033 and, if needed, created with
4036 .Dq refs/remotes/origin
4037 namespace can now be updated with incoming changes from the remote
4042 without extra command line arguments.
4043 Newly fetched changes can be examined with
4046 Display changes on the remote repository's version of the
4048 branch, as of the last time
4052 .Dl $ got log -c origin/master | less
4054 As shown here, most commands accept abbreviated reference names such as
4057 .Dq refs/remotes/origin/master .
4058 The latter is only needed in case of ambiguity.
4061 can be used to merge changes which are visible on the
4066 This will also merge local changes, if any, with the incoming changes:
4068 .Dl $ got update -b origin/master
4069 .Dl $ got rebase master
4071 In order to make changes committed to the
4072 .Dq unified-buffer-cache
4076 .Dq unified-buffer-cache
4077 branch can be rebased onto the
4081 .Dl $ got update -b master
4082 .Dl $ got rebase unified-buffer-cache
4085 .Dq unified-buffer-cache
4086 branch can now be made visible on the
4090 Because the rebase operation switched the work tree to the
4091 .Dq unified-buffer-cache
4092 branch, the work tree must be switched back to the
4096 .Dl $ got update -b master
4097 .Dl $ got integrate unified-buffer-cache
4101 branch, log messages for local changes can now be amended with
4103 by other developers and any other important new information:
4105 .Dl $ got update -c origin/master
4106 .Dl $ got histedit -m
4108 If the remote repository offers write access, local changes on the
4110 branch can be sent to the remote repository with
4114 can be run without further arguments.
4115 The arguments shown here match defaults, provided the work tree's
4116 current branch is the
4120 .Dl $ got send -b master origin
4122 If the remote repository requires the HTTPS protocol, the
4124 command must be used instead:
4126 .Dl $ cd /var/git/src.git
4127 .Dl $ git push origin master
4129 When making contributions to projects which use the
4131 workflow, SSH protocol repository access needs to be set up first.
4132 Once an account has been created on a Git hosting site it should
4133 be possible to upload a public SSH key for repository access
4138 workflow will usually involve two remote repositories.
4139 In the real-life example below, the
4141 repository was forked from the
4143 repository by using the Git hosting site's web interface.
4146 file in the local repository describes both remote repositories:
4147 .Bd -literal -offset indent
4148 # Jelmers's repository, which accepts pull requests
4150 server git@github.com
4152 repository "/jelmer/dulwich"
4156 # Stefan's fork, used as the default remote repository
4158 server git@github.com
4160 repository "/stspdotname/dulwich"
4165 With this configuration, Stefan can create commits on
4166 .Dq refs/heads/master
4167 and send them to the
4169 repository by running:
4171 .Dl $ got send -b master origin
4173 The changes can now be proposed to Jelmer by opening a pull request
4174 via the Git hosting site's web interface.
4175 If Jelmer requests further changes to be made, additional commits
4176 can be created on the
4178 branch and be added to the pull request by running
4182 If Jelmer prefers additional commits to be
4184 then the following commands can be used to achieve this:
4186 .Dl $ got update -b master
4187 .Dl $ got update -c origin/master
4188 .Dl $ got histedit -f
4189 .Dl $ got send -f -b master origin
4191 In addition to reviewing the pull request in the web user interface,
4192 Jelmer can fetch the pull request's branch into his local repository
4193 and create a local branch which contains the proposed changes:
4195 .Dl $ got fetch -R refs/pull/1046/head origin
4196 .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
4198 Once Jelmer has accepted the pull request, Stefan can fetch the
4199 merged changes, and possibly several other new changes, by running:
4201 .Dl $ got fetch upstream
4203 The merged changes will now be visible under the reference
4204 .Dq refs/remotes/upstream/master .
4207 branch can now be rebased on top of the latest changes
4210 .Dl $ got update -b upstream/master
4211 .Dl $ got rebase master
4213 As an alternative to
4215 branches can be merged with
4218 .Dl $ got update -b master
4219 .Dl $ got merge upstream/master
4221 The question of whether to rebase or merge branches is philosophical.
4222 When in doubt, refer to the software project's policies set by project
4225 As a final step, the forked repository's copy of the master branch needs
4226 to be kept in sync by sending the new changes there:
4228 .Dl $ got send -f -b master origin
4230 If multiple pull requests need to be managed in parallel, a separate branch
4231 must be created for each pull request with
4233 Each such branch can then be used as above, in place of
4234 .Dq refs/heads/master .
4235 Changes for any accepted pull requests will still appear under
4236 .Dq refs/remotes/upstream/master,
4237 regardless of which branch was used in the forked repository to
4238 create a pull request.
4242 .Xr git-repository 5 ,
4243 .Xr got-worktree 5 ,
4247 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
4248 .An Christian Weisgerber Aq Mt naddy@openbsd.org
4249 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
4250 .An Josh Rickmar Aq Mt jrick@zettaport.com
4251 .An Joshua Stein Aq Mt jcs@openbsd.org
4252 .An Klemens Nanni Aq Mt kn@openbsd.org
4253 .An Martin Pieuchot Aq Mt mpi@openbsd.org
4254 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
4255 .An Omar Polo Aq Mt op@openbsd.org
4256 .An Ori Bernstein Aq Mt ori@openbsd.org
4257 .An Sebastien Marie Aq Mt semarie@openbsd.org
4258 .An Stefan Sperling Aq Mt stsp@openbsd.org
4259 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
4260 .An Theo Buehler Aq Mt tb@openbsd.org
4261 .An Thomas Adam Aq Mt thomas@xteddy.org
4262 .An Tracey Emery Aq Mt tracey@traceyemery.net
4263 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
4270 were derived from code under copyright by:
4272 .An Caldera International
4273 .An Daniel Hartmeier
4278 .An Jean-Francois Brousseau
4284 .An Niklas Hallqvist
4289 .An Xavier Santolaria
4292 contains code contributed to the public domain by
4293 .An Austin Appleby .
4296 is a work-in-progress and some features remain to be implemented.
4298 At present, the user has to fall back on
4300 to perform some tasks.
4304 Reading from remote repositories over HTTP or HTTPS protocols requires
4309 Writing to remote repositories over HTTP or HTTPS protocols requires
4312 The creation of merge commits with more than two parent commits requires
4315 In situations where files or directories were moved around
4317 will not automatically merge changes to new locations and
4319 will usually produce better results.