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
53 utility provides global and command-specific options.
54 Global options must precede the command name, and are as follows:
55 .Bl -tag -width tenletters
57 Display usage information and exit immediately.
59 Display program version and exit immediately.
64 utility only provides commands needed to perform version control tasks.
65 Commands needed for repository maintenance tasks are provided by
67 Git repository server functionality is provided by
69 A repository interface for web browsers is provided by
71 An interactive repository interface for the terminal is provided by
77 .Bl -tag -width checkout
78 .It Cm init Oo Fl A Ar hashing-algorithm Oc Oo Fl b Ar branch Oc Ar repository-path
79 Create a new empty repository at the specified
84 the new repository must be populated before
89 command can be used to populate the new repository with data from
91 Alternatively, on a server running
93 the new repository can be made available to
97 clients by adding the repository to
101 Clients may then clone the new repository from the server, populate the cloned
102 repository, and then populate the new repository on the server via
111 .It Fl A Ar hashing-algorithm
112 Configure the repository's
113 .Ar hashing-algorithm
114 used for the computation of Git object IDs.
121 Make the repository's HEAD reference point to the specified
123 instead of the default branch
129 command is equivalent to
137 .Op Fl r Ar repository-path
141 Create an initial commit in a repository from the file hierarchy
144 The created commit will not have any parent commits, i.e. it will be a
146 Also create a new reference which provides a branch name for the newly
148 Show the path of each imported file to indicate progress.
154 environment variable to be set,
155 unless an author has been configured in
161 configuration settings can be obtained from the repository's
163 file or from Git's global
174 If this option is not specified, a branch corresponding to the repository's
175 HEAD reference will be used.
176 Use of this option is required if the branch resolved via the repository's
177 HEAD reference already exists.
179 Ignore files or directories with a name which matches the specified
181 This option may be specified multiple times to build a list of ignore patterns.
184 follows the globbing rules documented in
186 Ignore patterns which end with a slash,
188 will only match directories.
190 Use the specified log message when creating the new commit.
195 opens a temporary file in an editor where a log message can be written.
196 Quitting the editor without saving the file will abort the import operation.
197 .It Fl r Ar repository-path
198 Use the repository at the specified path.
199 If not specified, assume the repository is located at or above the current
207 .Op Fl R Ar reference
212 Clone a Git repository at the specified
218 is specified, the directory name will be derived from the name of the
221 will refuse to run if the
227 specifies a protocol scheme, a server hostname, an optional port number
228 separated from the hostname by a colon, and a path to the repository on
230 .Lk scheme://hostname:port/path/to/repository
232 The following protocol schemes are supported:
233 .Bl -tag -width https
235 The Git protocol as implemented by the
238 Use of this protocol is discouraged since it supports neither authentication
241 The Git protocol wrapped in an authenticated and encrypted
244 With this protocol the hostname may contain an embedded username for
252 Not compatible with servers using the
258 Git HTTP protocol is supported by
264 Sending from a repository cloned over HTTP will require use of a
270 protocol will be used by
273 Use of this protocol is discouraged since it supports neither authentication
278 Git HTTP protocol wrapped in SSL/TLS.
281 Objects in the cloned repository are stored in a pack file which is downloaded
283 This pack file will then be indexed to facilitate access to the objects stored
285 If any objects in the pack file are stored in deltified form, all deltas will
286 be fully resolved in order to compute the ID of such objects.
287 This can take some time.
288 More details about the pack file format are documented in
289 .Xr git-repository 5 .
292 creates a remote repository entry in the
296 files of the cloned repository to store the
302 arguments for future use by
312 Fetch all branches from the remote repository's
314 reference namespace and set
315 .Cm fetch_all_branches
316 in the cloned repository's
318 file for future use by
320 If this option is not specified, a branch resolved via the remote
321 repository's HEAD reference will be fetched.
322 Cannot be used together with the
328 from the remote repository's
331 This option may be specified multiple times to build a list of branches
333 If the branch corresponding to the remote repository's HEAD reference is not
334 in this list, the cloned repository's HEAD reference will be set to the first
335 branch which was fetched.
336 If this option is not specified, a branch resolved via the remote
337 repository's HEAD reference will be fetched.
338 Cannot be used together with the
342 List branches and tags available for fetching from the remote repository
343 and exit immediately.
344 Cannot be used together with any of the other options except
349 Create the cloned repository as a mirror of the original repository.
350 This is useful if the cloned repository will not be used to store
351 locally created commits.
357 files will be set up with the
359 option enabled, such that
363 will write incoming changes directly to branches in the
365 reference namespace, rather than to branches in the
368 This avoids the usual requirement of having to run
374 in order to make incoming changes appear on branches in the
377 But maintaining custom changes in the cloned repository becomes difficult
378 since such changes will be at risk of being discarded whenever incoming
381 Suppress progress reporting output.
382 The same option will be passed to
385 .It Fl R Ar reference
386 In addition to the branches and tags that will be fetched, fetch an arbitrary
388 from the remote repository's
391 This option may be specified multiple times to build a list of additional
395 may either be a path to a specific reference, or a reference namespace
396 which will cause all references in this namespace to be fetched.
398 Each reference will be mapped into the cloned repository's
400 namespace, unless the
402 option is used to mirror references directly into the cloned repository's
407 will refuse to fetch references from the remote repository's
416 to print debugging messages to standard error output.
417 This option will be passed to
420 Multiple -v options increase the verbosity.
428 .Op Fl R Ar reference
429 .Op Fl r Ar repository-path
430 .Op Ar remote-repository
433 Fetch new changes from a remote repository.
435 .Ar remote-repository
439 The remote repository's URL is obtained from the corresponding entry in
443 file of the local repository, as created by
446 By default, any branches configured in
449 .Ar remote-repository
453 is invoked in a work tree then this work tree's current branch will be
454 fetched, too, provided it is present on the server.
455 If no branches to fetch can be found in
457 or via a work tree, or said branches are not found on the server, a branch
458 resolved via the remote repository's HEAD reference will be fetched.
459 Likewise, if a HEAD reference for the
460 .Ar remote-repository
461 exists but its target no longer matches the remote HEAD, then
462 the new target branch will be fetched.
463 This default behaviour can be overridden with the
469 New changes will be stored in a separate pack file downloaded from the server.
470 Optionally, separate pack files stored in the repository can be combined with
473 By default, branch references in the
475 reference namespace will be updated to point at the newly fetched commits.
480 command can then be used to make new changes visible on branches in the
482 namespace, merging incoming changes with the changes on those branches
485 If the repository was created as a mirror with
487 then all branches in the
489 namespace will be updated directly to match the corresponding branches in
490 the remote repository.
491 If those branches contained local commits, these commits will no longer be
492 reachable via a reference and will therefore be at risk of being discarded
493 by Git's garbage collector or
494 .Cm gotadmin cleanup .
495 Maintaining custom changes in a mirror repository is therefore discouraged.
497 In any case, references in the
499 namespace will always be fetched and mapped directly to local references
500 in the same namespace.
507 Fetch all branches from the remote repository's
510 This option can be enabled by default for specific repositories in
512 Cannot be used together with the
518 from the remote repository's
521 This option may be specified multiple times to build a list of branches
523 Cannot be used together with the
527 Delete branches and tags from the local repository which are no longer
528 present in the remote repository.
529 Only references are deleted.
530 Any commit, tree, tag, and blob objects belonging to deleted branches or
531 tags remain in the repository and may be removed separately with
532 Git's garbage collector or
533 .Cm gotadmin cleanup .
535 List branches and tags available for fetching from the remote repository
536 and exit immediately.
537 Cannot be used together with any of the other options except
543 Suppress progress reporting output.
544 The same option will be passed to
547 .It Fl R Ar reference
548 In addition to the branches and tags that will be fetched, fetch an arbitrary
550 from the remote repository's
553 This option may be specified multiple times to build a list of additional
557 may either be a path to a specific reference, or a reference namespace
558 which will cause all references in this namespace to be fetched.
560 Each reference will be mapped into the local repository's
562 namespace, unless the local repository was created as a mirror with
564 in which case references will be mapped directly into the local repository's
568 Once a reference has been fetched, a branch based on it can be created with
573 will refuse to fetch references from the remote repository's
578 .It Fl r Ar repository-path
579 Use the repository at the specified path.
580 If not specified, assume the repository is located at or above the current
582 If this directory is a
584 work tree, use the repository path associated with this work tree.
586 Allow existing references in the
588 namespace to be updated if they have changed on the server.
589 If not specified, only new tag references will be created.
594 to print debugging messages to standard error output.
595 The same option will be passed to
598 Multiple -v options increase the verbosity.
601 Delete all references which correspond to a particular
602 .Ar remote-repository
603 instead of fetching new changes.
604 This can be useful when a remote repository is being removed from
610 .Ar remote-repository
611 argument is mandatory and no other options except
618 Only references are deleted.
619 Any commit, tree, tag, and blob objects fetched from a remote repository
620 will generally be stored in pack files and may be removed separately with
622 and Git's garbage collector.
630 .Op Fl p Ar path-prefix
632 .Op Ar work-tree-path
635 Copy files from a repository into a new work tree.
636 Show the status of each affected file, using the following status codes:
637 .Bl -column YXZ description
638 .It A Ta new file was added
639 .It E Ta file already exists in work tree's meta-data
644 is not specified, either use the last component of
645 .Ar repository path ,
648 was specified use the last component of
656 Check out files from a commit on the specified
658 If this option is not specified, a branch resolved via the repository's HEAD
659 reference will be used.
661 Check out files from the specified
663 on the selected branch.
664 If this option is not specified, the most recent commit on the selected
669 argument is a commit ID, or a reference name or a keyword
670 which will be resolved to a commit ID.
671 An abbreviated hash argument will be expanded to a full commit ID
672 automatically, provided the abbreviation is unique.
677 resolve to the repository's HEAD reference, or, if the
679 option is used, the head of the checked-out
681 Keywords and reference names may be appended with
685 modifiers and an optional integer N to denote the
686 Nth descendant or antecedent by first parent traversal, respectively;
689 denotes the work tree branch head's 2nd generation ancestor, and
691 will denote the 3rd generation ancestor of the commit resolved by the
694 If an integer does not follow the
700 is implicitly appended
709 is not contained in the selected branch, a different branch which contains
710 this commit must be specified with the
713 If no such branch is known, a new branch must be created for this
719 Checking out work trees with an unknown branch is intentionally not supported.
721 Proceed with the checkout operation even if the directory at
724 Existing files will be left intact.
725 .It Fl p Ar path-prefix
726 Restrict the work tree to a subset of the repository's tree hierarchy.
727 Only files beneath the specified
731 Silence progress output.
742 Update an existing work tree to a different
744 Change existing files in the work tree as necessary to match file contents
746 Preserve any local changes in the work tree and merge them with the
749 Files which already contain merge conflicts will not be updated to avoid
750 further complications.
751 Such files will be updated when
753 is run again after merge conflicts have been resolved.
754 If the conflicting changes are no longer needed, affected files can be
761 Show the status of each affected file, using the following status codes:
762 .Bl -column YXZ description
763 .It U Ta file was updated and contained no local changes
764 .It G Ta file was updated and local changes were merged cleanly
765 .It C Ta file was updated and conflicts occurred during merge
766 .It D Ta file was deleted
767 .It d Ta file's deletion was prevented by local modifications
768 .It A Ta new file was added
769 .It \(a~ Ta versioned file is obstructed by a non-regular file
770 .It ! Ta a missing versioned file was restored
771 .It # Ta file was not updated because it contains merge conflicts
772 .It ? Ta changes destined for an unversioned file were not merged
777 is specified, update the entire work tree.
778 Otherwise, restrict the update operation to files at or within the
780 Each path is required to exist in the update operation's target commit.
781 Files in the work tree outside specified paths will remain unchanged and
782 will retain their previously recorded base commit.
785 commands may refuse to run while the work tree contains files from
786 multiple base commits.
787 The base commit of such a work tree can be made consistent by running
789 across the entire work tree.
792 is incompatible with the
797 cannot update paths with staged changes.
798 If changes have been staged with
800 these changes must first be committed with
810 Switch the work tree's branch reference to the specified
812 before updating the work tree.
813 This option requires that all paths in the work tree are updated.
815 As usual, any local changes in the work tree will be preserved.
816 This can be useful when switching to a newly created branch in order
817 to commit existing local changes to this branch.
819 Any local changes must be dealt with separately in order to obtain a
820 work tree with pristine file contents corresponding exactly to the specified
822 Such changes could first be committed to a different branch with
824 or could be discarded with
827 Update the work tree to the specified
829 If this option is not specified, the most recent commit on the work tree's
834 argument is a commit ID, or a reference name or a keyword
835 which will be resolved to a commit ID.
836 An abbreviated hash argument will be expanded to a full commit ID
837 automatically, provided the abbreviation is unique.
842 resolve to the work tree's base commit and branch head, respectively.
843 Keywords and reference names may be appended with
847 modifiers and an optional integer N to denote the
848 Nth descendant or antecedent, respectively, by first parent traversal;
851 denotes the work tree branch head's 2nd generation ancestor, and
853 denotes the 4th generation descendant of the work tree's base commit.
856 will denote the 3rd generation ancestor of the commit resolved by the
859 If an integer does not follow the
865 is implicitly appended
872 Silence progress output.
878 .Op Fl S Ar status-codes
879 .Op Fl s Ar status-codes
883 Show the current modification status of files in a work tree,
884 using the following status codes:
885 .Bl -column YXZ description
886 .It M Ta modified file
887 .It A Ta file scheduled for addition in next commit
888 .It D Ta file scheduled for deletion in next commit
889 .It C Ta modified or added file which contains merge conflicts
890 .It ! Ta versioned file was expected on disk but is missing
891 .It \(a~ Ta versioned file is obstructed by a non-regular file
892 .It ? Ta unversioned item not tracked by
894 .It m Ta modified file modes (executable bit only)
895 .It N Ta non-existent
897 specified on the command line
902 is specified, show modifications in the entire work tree.
903 Otherwise, show modifications at or within the specified paths.
905 If changes have been staged with
907 staged changes are shown in the second output column, using the following
909 .Bl -column YXZ description
910 .It M Ta file modification is staged
911 .It A Ta file addition is staged
912 .It D Ta file deletion is staged
915 Changes created on top of staged changes are indicated in the first column:
916 .Bl -column YXZ description
917 .It MM Ta file was modified after earlier changes have been staged
918 .It MA Ta file was modified after having been staged for addition
921 If the work tree contains the results of an interrupted
926 operation then display a message which shows the branches involved.
933 Show unversioned files even if they match an ignore pattern.
934 .It Fl S Ar status-codes
935 Suppress the output of files with a modification status matching any of the
936 single-character status codes contained in the
939 Any combination of codes from the above list of possible status codes
941 For staged files, status codes displayed in either column will be matched.
942 Cannot be used together with the
945 .It Fl s Ar status-codes
946 Only show files with a modification status matching any of the
947 single-character status codes contained in the
950 Any combination of codes from the above list of possible status codes
952 For staged files, status codes displayed in either column will be matched.
953 Cannot be used together with the
958 For compatibility with
969 files in each traversed directory and will not display unversioned files
970 which match these patterns.
971 Ignore patterns which end with a slash,
973 will only match directories.
978 supports consecutive asterisks,
980 which will match an arbitrary amount of directories.
984 only supports a single ignore pattern per line.
988 does not support negated ignore patterns prefixed with
990 and gives no special significance to the location of path component separators,
999 .Op Fl r Ar repository-path
1000 .Op Fl S Ar search-pattern
1004 Display history of a repository.
1007 is specified, show only commits which modified this path.
1008 If invoked in a work tree, the
1010 is interpreted relative to the current working directory,
1011 and the work tree's path prefix is implicitly prepended.
1012 Otherwise, the path is interpreted relative to the repository root.
1019 Display individual commits which were merged into the current branch
1020 from other branches.
1023 shows the linear history of the current branch only.
1025 Set the number of context lines shown in diffs with
1027 By default, 3 lines of context are shown.
1029 Start traversing history at the specified
1031 If this option is not specified, default to the work tree's current branch
1032 if invoked in a work tree, or to the repository's HEAD reference.
1036 argument is a commit ID, or a reference name or a keyword
1037 which will be resolved to a commit ID.
1038 An abbreviated hash argument will be expanded to a full commit ID
1039 automatically, provided the abbreviation is unique.
1044 resolve to the work tree's base commit and branch head, respectively.
1045 The former is only valid if invoked in a work tree, while the latter will
1046 resolve to the tip of the work tree's current branch if invoked in a
1047 work tree, otherwise it will resolve to the repository's HEAD reference.
1048 Keywords and references may be appended with
1052 modifiers and an optional integer N to denote the
1053 Nth descendant or antecedent, respectively, by first parent traversal;
1056 denotes the HEAD reference's 2nd generation ancestor, and
1058 denotes the 4th generation descendant of the work tree's base commit.
1061 will denote the 3rd generation descendant of the commit resolved by the
1068 modifier without a trailing integer has an implicit
1077 Display diffstat of changes introduced in each commit.
1078 Cannot be used with the
1083 option (diffstat displays a list of changed paths).
1085 Limit history traversal to a given number of commits.
1086 If this option is not specified, a default limit value of zero is used,
1087 which is treated as an unbounded limit.
1089 .Ev GOT_LOG_DEFAULT_LIMIT
1090 environment variable may be set to change this default value.
1092 Display the list of file paths changed in each commit, using the following
1094 .Bl -column YXZ description
1095 .It M Ta modified file
1096 .It D Ta file was deleted
1097 .It A Ta new file was added
1098 .It m Ta modified file modes (executable bit only)
1101 Cannot be used with the
1105 Display the patch of modifications made in each commit.
1108 is specified, only show the patch of modifications at or within this path.
1109 Cannot be used with the
1113 Determine a set of commits to display as usual, but display these commits
1115 .It Fl r Ar repository-path
1116 Use the repository at the specified path.
1117 If not specified, assume the repository is located at or above the current
1119 If this directory is a
1121 work tree, use the repository path associated with this work tree.
1122 .It Fl S Ar search-pattern
1123 If specified, show only commits with a log message, author name,
1124 committer name, or commit ID matched by the extended regular
1126 .Ar search-pattern .
1127 Lines in committed patches will be matched if
1130 File paths changed by a commit will be matched if
1133 Regular expression syntax is documented in
1136 Display a short one-line summary of each commit, instead of the default
1138 Cannot be used together with the
1144 Display commits in topological order.
1145 This option has no effect without the
1147 option because a linear history is sorted in topological order by definition.
1148 Topological sorting is disabled by default because the present implementation
1149 requires that commit history is fully traversed before any output can be shown.
1151 Stop traversing commit history immediately after the specified
1158 argument is a commit ID, or a reference name or a keyword
1159 which will be resolved to a commit ID.
1160 This option has no effect if the specified
1170 .Op Fl r Ar repository-path
1171 .Op Ar object1 Ar object2 | Ar path ...
1174 When invoked within a work tree without any arguments, display all
1175 local changes in the work tree.
1178 arguments are specified, only show changes within the specified paths.
1180 If two arguments are provided, treat each argument as a reference, a tag
1181 name, or an object ID, and display differences between the
1182 corresponding objects.
1183 Both objects must be of the same type (blobs, trees, or commits).
1184 An abbreviated hash argument will be expanded to a full commit ID
1185 automatically, provided the abbreviation is unique.
1186 If none of these interpretations produce a valid result or if the
1191 is running in a work tree, attempt to interpret the two arguments as paths.
1198 Treat file contents as ASCII text even if binary data is detected.
1200 Set the number of context lines shown in the diff.
1201 By default, 3 lines of context are shown.
1203 Show differences between commits in the repository.
1204 This option may be used up to two times.
1205 When used only once, show differences between the specified
1207 and its first parent commit.
1208 When used twice, show differences between the two specified commits.
1212 option is used, all non-option arguments will be interpreted as paths.
1215 arguments are provided, only show differences for the specified paths.
1219 argument is a commit ID, or a reference name or a keyword
1220 which will be resolved to a commit ID.
1221 An abbreviated hash argument will be expanded to a full commit ID
1222 automatically, provided the abbreviation is unique.
1227 resolve to the work tree's base commit and branch head, respectively.
1228 The former is only valid if invoked in a work tree, while the latter will
1229 resolve to the tip of the work tree's current branch if invoked in a
1230 work tree, otherwise it will resolve to the repository's HEAD reference.
1231 Keywords and references may be appended with
1235 modifiers and an optional integer N to denote the
1236 Nth descendant or antecedent, respectively, by first parent traversal;
1239 denotes the HEAD reference's 2nd generation ancestor, and
1241 denotes the 4th generation descendant of the work tree's base commit.
1244 will denote the 8th generation descendant of the commit resolved by the
1247 If an integer does not follow the
1253 is implicitly appended
1260 Cannot be used together with the
1264 Display diffstat of changes before the actual diff by annotating each file path
1265 or blob hash being diffed with the total number of lines added and removed.
1266 A summary line will display the total number of changes across all files.
1268 Interpret all arguments as paths only.
1269 This option can be used to resolve ambiguity in cases where paths
1270 look like tag names, reference names, or object IDs.
1271 This option is only valid when
1273 is invoked in a work tree.
1274 .It Fl r Ar repository-path
1275 Use the repository at the specified path.
1276 If not specified, assume the repository is located at or above the current
1278 If this directory is a
1280 work tree, use the repository path associated with this work tree.
1282 Show changes staged with
1284 instead of showing local changes in the work tree.
1285 This option is only valid when
1287 is invoked in a work tree.
1289 Ignore whitespace-only changes.
1295 .Op Fl r Ar repository-path
1299 Display line-by-line history of a file at the specified path.
1306 Start traversing history at the specified
1308 The expected argument is a commit ID, or a reference name
1309 or a keyword which will be resolved to a commit ID.
1310 An abbreviated hash argument will be expanded to a full commit ID
1311 automatically, provided the abbreviation is unique.
1316 resolve to the work tree's base commit and branch head, respectively.
1317 The former is only valid if invoked in a work tree, while the latter will
1318 resolve to the tip of the work tree's current branch if invoked in a
1319 work tree, otherwise it will resolve to the repository's HEAD reference.
1320 Keywords and references may be appended with
1324 modifiers and an optional integer N to denote the
1325 Nth descendant or antecedent by first parent traversal, respectively;
1328 denotes the work tree branch head's 2nd generation ancestor, and
1330 denotes the 4th generation descendant of the work tree's base commit.
1333 will denote the 5th generation ancestor of the commit resolved by the
1340 modifier without a trailing integer has an implicit
1348 .It Fl r Ar repository-path
1349 Use the repository at the specified path.
1350 If not specified, assume the repository is located at or above the current
1352 If this directory is a
1354 work tree, use the repository path associated with this work tree.
1361 .Op Fl r Ar repository-path
1365 Display a listing of files and directories at the specified
1366 directory path in the repository.
1367 Entries shown in this listing may carry one of the following trailing
1369 .Bl -column YXZ description
1370 .It @ Ta entry is a symbolic link
1371 .It / Ta entry is a directory
1372 .It * Ta entry is an executable file
1373 .It $ Ta entry is a Git submodule
1376 Symbolic link entries are also annotated with the target path of the link.
1380 is specified, list the repository path corresponding to the current
1381 directory of the work tree, or the root directory of the repository
1382 if there is no work tree.
1389 List files and directories as they appear in the specified
1392 The expected argument is a commit ID, or a reference name
1393 or a keyword which will be resolved to a commit ID.
1394 An abbreviated hash argument will be expanded to a full commit ID
1395 automatically, provided the abbreviation is unique.
1400 resolve to the work tree's base commit and branch head, respectively.
1401 The former is only valid if invoked in a work tree, while the latter will
1402 resolve to the tip of the work tree's current branch if invoked in a
1403 work tree, otherwise it will resolve to the repository's HEAD reference.
1404 Keywords and references may be appended with
1408 modifiers and an optional integer N to denote the
1409 Nth descendant or antecedent by first parent traversal, respectively;
1412 denotes the work tree branch head's 2nd generation ancestor, and
1414 denotes the 4th generation descendant of the work tree's base commit.
1417 will denote the 3rd generation ancestor of the commit resolved by the
1424 modifier without a trailing integer has an implicit
1433 Show object IDs of files (blob objects) and directories (tree objects).
1435 Recurse into sub-directories in the repository.
1436 .It Fl r Ar repository-path
1437 Use the repository at the specified path.
1438 If not specified, assume the repository is located at or above the current
1440 If this directory is a
1442 work tree, use the repository path associated with this work tree.
1448 .Op Fl r Ar repository-path
1449 .Op Fl s Ar reference
1452 Manage references in a repository.
1454 References may be listed, created, deleted, and changed.
1455 When creating, deleting, or changing a reference the specified
1457 must be an absolute reference name, i.e. it must begin with
1465 Create a reference or change an existing reference.
1466 The reference with the specified
1468 will point at the specified
1473 argument is an object ID or an existing reference or tag name
1474 or a keyword which will be resolved to the ID of a corresponding commit,
1475 tree, tag, or blob object.
1476 An abbreviated hash argument will be expanded to a full commit ID
1477 automatically, provided the abbreviation is unique.
1482 resolve to the work tree's base commit and branch head, respectively.
1483 The former is only valid if invoked in a work tree, while the latter will
1484 resolve to the tip of the work tree's current branch if invoked in a
1485 work tree, otherwise it will resolve to the repository's HEAD reference.
1486 Keywords and reference names may be appended with
1490 modifiers and an optional integer N to denote the
1491 Nth descendant or antecedent by first parent traversal, respectively;
1494 denotes the work tree branch head's 2nd generation ancestor, and
1496 will denote the 3rd generation ancestor of the commit resolved by the
1499 If an integer does not follow the
1505 is implicitly appended
1512 Cannot be used together with any other options except
1515 Delete the reference with the specified
1517 from the repository.
1518 Any commit, tree, tag, and blob objects belonging to deleted references
1519 remain in the repository and may be removed separately with
1520 Git's garbage collector or
1521 .Cm gotadmin cleanup .
1522 Cannot be used together with any other options except
1525 List references in the repository.
1528 is specified, list all existing references in the repository.
1531 is a reference namespace, list all references in this namespace.
1532 Otherwise, show only the reference with the given
1534 Cannot be used together with any other options except
1538 .It Fl r Ar repository-path
1539 Use the repository at the specified path.
1540 If not specified, assume the repository is located at or above the current
1542 If this directory is a
1544 work tree, use the repository path associated with this work tree.
1545 .It Fl s Ar reference
1546 Create a symbolic reference, or change an existing symbolic reference.
1547 The symbolic reference with the specified
1549 will point at the specified
1551 which must already exist in the repository.
1552 Care should be taken not to create loops between references when
1553 this option is used.
1554 Cannot be used together with any other options except
1557 Sort listed references by modification time (most recently modified first)
1558 instead of sorting by lexicographical order.
1559 Use of this option requires the
1561 option to be used as well.
1569 .Op Fl r Ar repository-path
1573 Create, list, or delete branches.
1575 Local branches are managed via references which live in the
1577 reference namespace.
1580 command creates references in this namespace only.
1582 When deleting branches, the specified
1586 reference namespace first.
1587 If no corresponding branch is found, the
1589 namespace will be searched next.
1591 If invoked in a work tree without any arguments, print the name of the
1592 work tree's current branch.
1596 argument is passed, attempt to create a branch reference with the given name.
1597 By default the new branch reference will point at the latest commit on the
1598 work tree's current branch if invoked in a work tree, and otherwise to a commit
1599 resolved via the repository's HEAD reference.
1601 If invoked in a work tree, once the branch was created successfully
1602 switch the work tree's head reference to the newly created branch and
1603 update files across the entire work tree, just like
1604 .Cm got update -b Ar name
1606 Show the status of each affected file, using the following status codes:
1607 .Bl -column YXZ description
1608 .It U Ta file was updated and contained no local changes
1609 .It G Ta file was updated and local changes were merged cleanly
1610 .It C Ta file was updated and conflicts occurred during merge
1611 .It D Ta file was deleted
1612 .It A Ta new file was added
1613 .It \(a~ Ta versioned file is obstructed by a non-regular file
1614 .It ! Ta a missing versioned file was restored
1622 Make a newly created branch reference point at the specified
1624 The expected argument is a commit ID, or a reference name or keyword
1625 which will be resolved to a commit ID.
1626 An abbreviated hash argument will be expanded to a full commit ID
1627 automatically, provided the abbreviation is unique.
1632 resolve to the work tree's base commit and branch head, respectively.
1633 The former is only valid if invoked in a work tree, while the latter will
1634 resolve to the tip of the work tree's current branch if invoked in a
1635 work tree, otherwise it will resolve to the repository's HEAD reference.
1636 Keywords and references may be appended with
1640 modifiers and an optional integer N to denote the
1641 Nth descendant or antecedent by first parent traversal, respectively;
1644 denotes the work tree branch head's 2nd generation ancestor, and
1646 denotes the 4th generation descendant of the work tree's base commit.
1649 will denote the 3rd generation descendant of the commit resolved by the
1656 modifier without a trailing integer has an implicit
1665 Delete the branch with the specified
1671 reference namespace.
1673 Only the branch reference is deleted.
1674 Any commit, tree, and blob objects belonging to the branch
1675 remain in the repository and may be removed separately with
1676 Git's garbage collector or
1677 .Cm gotadmin cleanup .
1679 List all existing branches in the repository, including copies of remote
1680 repositories' branches in the
1682 reference namespace.
1684 If invoked in a work tree, the work tree's current branch is shown
1685 with one of the following annotations:
1686 .Bl -column YXZ description
1687 .It * Ta work tree's base commit and the base commit of all tracked files
1688 matches the branch tip
1689 .It \(a~ Ta work tree comprises mixed commits or its base commit is out-of-date
1692 Do not switch and update the work tree after creating a new branch.
1693 .It Fl r Ar repository-path
1694 Use the repository at the specified path.
1695 If not specified, assume the repository is located at or above the current
1697 If this directory is a
1699 work tree, use the repository path associated with this work tree.
1701 Sort listed branches by modification time (most recently modified first)
1702 instead of sorting by lexicographical order.
1705 reference namespace are listed before branches in
1708 Use of this option requires the
1710 option to be used as well.
1717 .Op Fl r Ar repository-path
1718 .Op Fl s Ar signer-id
1721 Manage tags in a repository.
1723 Tags are managed via references which live in the
1725 reference namespace.
1728 command operates on references in this namespace only.
1729 References in this namespace point at tag objects which contain a pointer
1730 to another object, a tag message, as well as author and timestamp information.
1732 Attempt to create a tag with the given
1734 and make this tag point at the given
1736 If no commit is specified, default to the latest commit on the work tree's
1737 current branch if invoked in a work tree, and to a commit resolved via
1738 the repository's HEAD reference otherwise.
1745 Make the newly created tag reference point at the specified
1749 argument is a commit ID, or a reference or keyword
1750 which will be resolved to a commit ID.
1751 An abbreviated hash argument will be expanded to a full commit ID
1752 automatically, provided the abbreviation is unique.
1757 resolve to the work tree's base commit and branch head, respectively.
1758 The former is only valid if invoked in a work tree, while the latter will
1759 resolve to the tip of the work tree's current branch if invoked in a
1760 work tree, otherwise it will resolve to the repository's HEAD reference.
1761 Keywords and references may be appended with
1765 modifiers and an optional integer N to denote the
1766 Nth descendant or antecedent by first parent traversal, respectively;
1769 denotes the work tree branch head's 2nd generation ancestor, and
1771 denotes the 4th generation descendant of the work tree's base commit.
1774 will denote the 3rd generation ancestor of the commit resolved by the
1781 modifier without a trailing integer has an implicit
1790 List all existing tags in the repository instead of creating a new tag.
1793 argument is passed, show only the tag with the given
1796 Use the specified tag message when creating the new tag.
1801 opens a temporary file in an editor where a tag message can be written.
1802 Quitting the editor without saving the file will abort the tag operation.
1803 .It Fl r Ar repository-path
1804 Use the repository at the specified path.
1805 If not specified, assume the repository is located at or above the current
1807 If this directory is a
1809 work tree, use the repository path associated with this work tree.
1810 .It Fl s Ar signer-id
1811 While creating a new tag, sign this tag with the identity given in
1814 For SSH-based signatures,
1816 is the path to a file which may refer to either a private SSH key,
1817 or a public SSH key with the private half available via
1820 will sign the tag object by invoking
1824 command, using the signature namespace
1826 for compatibility with
1829 Verify tag object signatures.
1832 is specified, show and verify the tag object with the provided name.
1833 Otherwise, list all tag objects and verify signatures where present.
1836 verifies SSH-based signatures by invoking
1839 .Fl Y Cm verify Fl f Ar allowed_signers .
1844 otherwise verification is impossible.
1847 During SSH signature creation and verification this option will be passed to
1849 Multiple -v options increase the verbosity.
1855 command will not delete tags or change existing tags.
1856 If a tag must be deleted, the
1858 command may be used to delete a tag's reference.
1859 This should only be done if the tag has not already been copied to
1866 Schedule unversioned files in a work tree for addition to the
1867 repository in the next commit.
1868 By default, files which match a
1870 ignore pattern will not be added.
1874 mentioned in the command line is not an unversioned file then
1877 To avoid unnecessary errors from paths picked up by file globbing patterns
1878 in the shell, paths in the argument list will be silently ignored if they
1881 at all, or if they are reported with one of the following status codes
1882 and do not have changes staged via
1884 .Bl -column YXZ description
1885 .It M Ta modified file
1886 .It A Ta file scheduled for addition in next commit
1887 .It C Ta modified or added file which contains merge conflicts
1888 .It m Ta modified file modes (executable bit only)
1896 Add files even if they match a
1900 Permit recursion into directories.
1901 If this option is not specified,
1903 will refuse to run if a specified
1911 .Op Fl s Ar status-codes
1915 Remove versioned files from a work tree and schedule them for deletion
1916 from the repository in the next commit.
1923 Perform the operation even if a file contains local modifications,
1924 and do not raise an error if a specified
1926 does not exist on disk.
1928 Keep affected files on disk.
1930 Permit recursion into directories.
1931 If this option is not specified,
1933 will refuse to run if a specified
1936 .It Fl s Ar status-codes
1937 Only delete files with a modification status matching one of the
1938 single-character status codes contained in the
1941 The following status codes may be specified:
1942 .Bl -column YXZ description
1943 .It M Ta modified file (this implies the
1946 .It ! Ta versioned file expected on disk but missing
1954 .Op Fl p Ar strip-count
1960 to files in a work tree.
1961 Files added or removed by a patch will be scheduled for addition or removal in
1964 The patch must be in the unified diff format as produced by
1971 diff when invoked with their
1976 argument is provided, read unified diff data from standard input instead.
1980 contains multiple patches, then attempt to apply each of them in sequence.
1982 Show the status of each affected file, using the following status codes:
1983 .Bl -column XYZ description
1984 .It M Ta file was modified
1985 .It G Ta file was merged using a merge-base found in the repository
1986 .It C Ta file was merged and conflicts occurred during merge
1987 .It D Ta file was deleted
1988 .It A Ta file was added
1989 .It # Ta failed to patch the file
1992 If a change does not match at its exact line number, attempt to
1993 apply it somewhere else in the file if a good spot can be found.
1994 Otherwise, the patch will fail to apply.
1998 will refuse to apply a patch if certain preconditions are not met.
1999 Files to be deleted must already be under version control, and must
2000 not have been scheduled for deletion already.
2001 Files to be added must not yet be under version control and must not
2002 already be present on disk.
2003 Files to be modified must already be under version control and may not
2004 contain conflict markers.
2006 If an error occurs, the
2008 operation will be aborted.
2009 Any changes made to the work tree up to this point will be left behind.
2010 Such changes can be viewed with
2012 and can be reverted with
2021 Attempt to locate files within the specified
2023 for use as a merge-base for 3-way merges.
2027 option is not used then
2029 will attempt to locate merge-bases via object IDs found in
2031 meta-data, such as produced by
2037 option is only recommended in the absence of such meta-data.
2039 Ideally, the specified
2041 should contain versions of files which the changes contained in the
2044 Files will be located by path, relative to the repository root.
2047 option is used then leading path components will be stripped
2048 before paths are looked up in the repository.
2050 In case no merge-base is available for a file, changes will be applied
2051 without doing a 3-way merge.
2052 Changes which do not apply cleanly may then be rejected entirely, rather
2053 than producing merge conflicts in the patched target file.
2057 argument is a commit ID, or a reference name or a keyword
2058 which will be resolved to a commit ID.
2059 An abbreviated hash argument will be expanded to a full commit ID
2060 automatically, provided the abbreviation is unique.
2065 resolve to the work tree's base commit and branch head, respectively.
2066 Keywords and references may be appended with
2070 modifiers and an optional integer N to denote the
2071 Nth descendant or antecedent by first parent traversal, respectively;
2074 denotes the work tree branch head's 2nd generation ancestor, and
2076 denotes the 4th generation descendant of the work tree's base commit.
2079 will denote the 3rd generation descendant of the commit resolved by the
2086 modifier without a trailing integer has an implicit
2095 Do not make any modifications to the work tree.
2096 This can be used to check whether a patch would apply without issues.
2099 contains diffs that affect the same file multiple times, the results
2100 displayed may be incorrect.
2101 .It Fl p Ar strip-count
2102 Specify the number of leading path components to strip from paths
2111 path prefixes generated by
2113 will be recognized and stripped automatically.
2115 Reverse the patch before applying it.
2121 .Op Fl F Ar response-script
2125 Revert any local changes in files at the specified paths in a work tree.
2126 File contents will be overwritten with those contained in the
2127 work tree's base commit.
2128 There is no way to bring discarded changes back after
2131 If a file was added with
2133 it will become an unversioned file again.
2134 If a file was deleted with
2136 it will be restored.
2142 .It Fl F Ar response-script
2150 responses line-by-line from the specified
2152 file instead of prompting interactively.
2154 Instead of reverting all changes in files, interactively select or reject
2155 changes to revert based on
2161 (quit reverting this file) responses.
2162 If a file is in modified status, individual patches derived from the
2163 modified file content can be reverted.
2164 Files in added or deleted status may only be reverted in their entirety.
2166 Permit recursion into directories.
2167 If this option is not specified,
2169 will refuse to run if a specified
2183 Create a new commit in the repository from changes in a work tree
2184 and use this commit as the new base commit for the work tree.
2187 is specified, commit all changes in the work tree.
2188 Otherwise, commit changes at or within the specified paths.
2190 If changes have been explicitly staged for commit with
2192 only commit staged changes and reject any specified paths which
2193 have not been staged.
2196 opens a temporary file in an editor where a log message can be written
2204 options are used together.
2205 Quitting the editor without saving the file will abort the commit operation.
2207 Show the status of each affected file, using the following status codes:
2208 .Bl -column YXZ description
2209 .It M Ta modified file
2210 .It D Ta file was deleted
2211 .It A Ta new file was added
2212 .It m Ta modified file modes (executable bit only)
2215 Files which are not part of the new commit will retain their previously
2216 recorded base commit.
2219 commands may refuse to run while the work tree contains files from
2220 multiple base commits.
2221 The base commit of such a work tree can be made consistent by running
2223 across the entire work tree.
2227 command requires the
2229 environment variable to be set,
2230 unless an author has been configured in
2236 configuration settings can be
2237 obtained from the repository's
2239 file or from Git's global
2248 Set author information in the newly created commit to
2250 This is useful when committing changes on behalf of someone else.
2253 argument must use the same format as the
2255 environment variable.
2257 In addition to storing author information, the newly created commit
2260 information which is obtained, as usual, from the
2262 environment variable, or
2264 or Git configuration settings.
2266 Allow committing files in conflicted status.
2268 Committing files with conflict markers should generally be avoided.
2269 Cases where conflict markers must be stored in the repository for
2270 some legitimate reason should be very rare.
2271 There are usually ways to avoid storing conflict markers verbatim by
2272 applying appropriate programming tricks.
2274 Use the prepared log message stored in the file found at
2276 when creating the new commit.
2278 opens a temporary file in an editor where the prepared log message can be
2279 reviewed and edited further if needed.
2280 Cannot be used together with the
2284 Use the specified log message when creating the new commit.
2285 Cannot be used together with the
2289 This option prevents
2291 from opening the commit message in an editor.
2292 It has no effect unless it is used together with the
2294 option and is intended for non-interactive use such as scripting.
2296 This option prevents
2298 from generating a diff of the to-be-committed changes in a temporary file
2299 which can be viewed while editing a commit message.
2301 Allow the addition of symbolic links which point outside of the path space
2302 that is under version control.
2305 will reject such symbolic links due to safety concerns.
2308 may decide to represent such a symbolic link as a regular file which contains
2309 the link's target path, rather than creating an actual symbolic link which
2310 points outside of the work tree.
2311 Use of this option is discouraged because external mechanisms such as
2313 are better suited for managing symbolic links to paths not under
2318 will refuse to run if certain preconditions are not met.
2319 If the work tree's current branch is not in the
2321 reference namespace, new commits may not be created on this branch.
2322 Local changes may only be committed if they are based on file content
2323 found in the most recent commit on the work tree's branch.
2324 If a path is found to be out of date,
2326 must be used first in order to merge local changes with changes made
2334 .Op Fl r Ar repository-path
2336 .Op Ar remote-repository
2339 Send new changes to a remote repository.
2341 .Ar remote-repository
2345 The remote repository's URL is obtained from the corresponding entry in
2349 file of the local repository, as created by
2352 All objects corresponding to new changes will be written to a temporary
2353 pack file which is then uploaded to the server.
2354 Upon success, references in the
2356 reference namespace of the local repository will be updated to point at
2357 the commits which have been sent.
2359 By default, changes will only be sent if they are based on up-to-date
2360 copies of relevant branches in the remote repository.
2361 If any changes to be sent are based on out-of-date copies or would
2362 otherwise break linear history of existing branches, new changes must
2363 be fetched from the server with
2365 and local branches must be rebased with
2372 option can be used to make exceptions to these requirements.
2379 Send all branches from the local repository's
2381 reference namespace.
2384 option is equivalent to listing all branches with multiple
2387 Cannot be used together with the
2393 from the local repository's
2395 reference namespace.
2396 This option may be specified multiple times to build a list of branches
2398 If this option is not specified, default to the work tree's current branch
2399 if invoked in a work tree, or to the repository's HEAD reference.
2400 Cannot be used together with the
2404 Delete the specified
2406 from the remote repository's
2408 reference namespace.
2409 This option may be specified multiple times to build a list of branches
2412 Only references are deleted.
2413 Any commit, tree, tag, and blob objects belonging to deleted branches
2414 may become subject to deletion by Git's garbage collector running on
2417 Requesting deletion of branches results in an error if the server
2418 does not support this feature or disallows the deletion of branches
2419 based on its configuration.
2421 Attempt to force the server to overwrite existing branches or tags
2422 in the remote repository, even when
2428 would usually be required before changes can be sent.
2429 The server may reject forced requests regardless, depending on its
2432 Any commit, tree, tag, and blob objects belonging to overwritten branches
2433 or tags may become subject to deletion by Git's garbage collector running
2438 reference namespace is globally shared between all repositories.
2441 option to overwrite tags is discouraged because it can lead to
2442 inconsistencies between the tags present in different repositories.
2443 In general, creating a new tag with a different name is recommended
2444 instead of overwriting an existing tag.
2448 option is particularly discouraged if changes being sent are based
2449 on an out-of-date copy of a branch in the remote repository.
2450 Instead of using the
2452 option, new changes should
2455 and local branches should be rebased with
2459 followed by another attempt to send the changes.
2463 option should only be needed in situations where the remote repository's
2464 copy of a branch or tag is known to be out-of-date and is considered
2466 The risks of creating inconsistencies between different repositories
2467 should also be taken into account.
2469 Suppress progress reporting output.
2470 The same option will be passed to
2473 .It Fl r Ar repository-path
2474 Use the repository at the specified path.
2475 If not specified, assume the repository is located at or above the current
2477 If this directory is a
2479 work tree, use the repository path associated with this work tree.
2481 Attempt to send all tags from the local repository's
2483 reference namespace.
2486 option is equivalent to listing all tags with multiple
2489 Cannot be used together with the
2495 from the local repository's
2497 reference namespace, in addition to any branches that are being sent.
2500 option may be specified multiple times to build a list of tags to send.
2501 No tags will be sent if the
2505 Raise an error if the specified
2507 already exists in the remote repository, unless the
2509 option is used to overwrite the server's copy of the tag.
2510 In general, creating a new tag with a different name is recommended
2511 instead of overwriting an existing tag.
2513 Cannot be used together with the
2520 to print debugging messages to standard error output.
2521 The same option will be passed to
2524 Multiple -v options increase the verbosity.
2534 Merge changes from a single
2539 should be on a different branch than the work tree's base commit.
2541 The expected argument is a commit ID, or a reference name or
2542 keyword which will be resolved to a commit ID.
2543 An abbreviated hash argument will be expanded to a full commit ID
2544 automatically, provided the abbreviation is unique.
2549 resolve to the work tree's base commit and branch head, respectively.
2550 Keywords and references may be appended with
2554 modifiers and an optional integer N to denote the
2555 Nth descendant or antecedent by first parent traversal, respectively;
2558 denotes the work tree branch head's 2nd generation ancestor, and
2560 denotes the 4th generation descendant of the work tree's base commit.
2563 will denote the 3rd generation descendant of the commit resolved by the
2570 modifier without a trailing integer has an implicit
2579 Show the status of each affected file, using the following status codes:
2580 .Bl -column YXZ description
2581 .It G Ta file was merged
2582 .It C Ta file was merged and conflicts occurred during merge
2583 .It ! Ta changes destined for a missing file were not merged
2584 .It D Ta file was deleted
2585 .It d Ta file's deletion was prevented by local modifications
2586 .It A Ta new file was added
2587 .It \(a~ Ta changes destined for a non-regular file were not merged
2588 .It ? Ta changes destined for an unversioned file were not merged
2591 The merged changes will appear as local changes in the work tree, which
2594 amended manually or with further
2600 If invoked in a work tree where no
2605 operation is taking place,
2607 creates a record of commits which have been merged into the work tree.
2608 When a file changed by
2612 the log messages of relevant merged commits will then appear in the editor,
2613 where the messages should be further adjusted to convey the reasons for
2614 cherrypicking the changes.
2615 Upon exiting the editor, if the time stamp of the log message file
2616 is unchanged or the log message is empty,
2618 will fail with an unmodified or empty log message error.
2620 If all the changes in all files touched by a given commit are discarded,
2623 this commit's log message record will also disappear.
2626 will refuse to run if certain preconditions are not met.
2627 If the work tree contains multiple base commits, it must first be updated
2628 to a single base commit with
2630 If any relevant files already contain merge conflicts, these
2631 conflicts must be resolved first.
2639 Display a list of commit log messages recorded by cherrypick operations,
2640 represented by references in the
2641 .Dq refs/got/worktree
2642 reference namespace.
2645 is specified, only show the log message of the specified commit.
2647 If invoked in a work tree, only log messages recorded by cherrypick operations
2648 in the current work tree will be displayed.
2649 Otherwise, all commit log messages will be displayed irrespective of the
2650 work tree in which they were created.
2651 This option cannot be used with
2654 Delete log messages created by previous cherrypick operations, represented by
2656 .Dq refs/got/worktree
2657 reference namespace.
2660 is specified, only delete the log message of the specified commit.
2662 If invoked in a work tree, only log messages recorded by cherrypick operations
2663 in the current work tree will be deleted.
2664 Otherwise, all commit log messages will be deleted irrespective of the
2665 work tree in which they were created.
2666 This option cannot be used with
2677 Reverse-merge changes from a single
2682 should be on the same branch as the work tree's base commit.
2684 The expected argument is a commit ID, or a reference name
2685 or keyword which will be resolved to a commit ID.
2686 An abbreviated hash argument will be expanded to a full commit ID
2687 automatically, provided the abbreviation is unique.
2692 resolve to the work tree's base commit and branch head, respectively.
2693 Keywords and references may be appended with
2697 modifiers and an optional integer N to denote the
2698 Nth descendant or antecedent by first parent traversal, respectively;
2701 denotes the work tree branch head's 2nd generation ancestor, and
2703 denotes the 4th generation descendant of the work tree's base commit.
2706 will denote the 5th generation descendant of the commit resolved by the
2713 modifier without a trailing integer has an implicit
2722 Show the status of each affected file, using the following status codes:
2723 .Bl -column YXZ description
2724 .It G Ta file was merged
2725 .It C Ta file was merged and conflicts occurred during merge
2726 .It ! Ta changes destined for a missing file were not merged
2727 .It D Ta file was deleted
2728 .It d Ta file's deletion was prevented by local modifications
2729 .It A Ta new file was added
2730 .It \(a~ Ta changes destined for a non-regular file were not merged
2731 .It ? Ta changes destined for an unversioned file were not merged
2734 The reverse-merged changes will appear as local changes in the work tree,
2735 which may be viewed with
2737 amended manually or with further
2743 If invoked in a work tree where no
2748 operation is taking place,
2750 creates a record of commits which have been reverse-merged into the work tree.
2751 When a file changed by
2755 the log messages of relevant reverse-merged commits will then appear in
2756 the editor, where the messages should be further adjusted to convey the
2757 reasons for backing out the changes.
2758 Upon exiting the editor, if the time stamp of the log message file
2759 is unchanged or the log message is empty,
2761 will fail with an unmodified or empty log message error.
2763 If all the changes in all files touched by a given commit are discarded,
2766 this commit's log message record will also disappear.
2769 will refuse to run if certain preconditions are not met.
2770 If the work tree contains multiple base commits, it must first be updated
2771 to a single base commit with
2773 If any relevant files already contain merge conflicts, these
2774 conflicts must be resolved first.
2782 Display a list of commit log messages recorded by backout operations,
2783 represented by references in the
2784 .Dq refs/got/worktree
2785 reference namespace.
2788 is specified, only show the log message of the specified commit.
2790 If invoked in a work tree, only log messages recorded by backout operations
2791 in the current work tree will be displayed.
2792 Otherwise, all commit log messages will be displayed irrespective of the
2793 work tree in which they were created.
2794 This option cannot be used with
2797 Delete log messages created by previous backout operations, represented by
2799 .Dq refs/got/worktree
2800 reference namespace.
2803 is specified, only delete the log message of the specified commit.
2805 If invoked in a work tree, only log messages recorded by backout operations
2806 in the current work tree will be deleted.
2807 Otherwise, all commit log messages will be deleted irrespective of the
2808 work tree in which they were created.
2809 This option cannot be used with
2820 Rebase commits on the specified
2822 onto the tip of the current branch of the work tree.
2825 must share common ancestry with the work tree's current branch.
2826 Rebasing begins with the first descendant commit of the youngest
2827 common ancestor commit shared by the specified
2829 and the work tree's current branch, and stops once the tip commit
2836 is used as intended, the specified
2838 represents a local commit history and may already contain changes
2839 that are not yet visible in any other repositories.
2840 The work tree's current branch, which must be set with
2844 operation, represents a branch from a remote repository which shares
2845 a common history with the specified
2847 but has progressed, and perhaps diverged, due to commits added to the
2850 Rebased commits are accumulated on a temporary branch which the work tree
2851 will remain switched to throughout the entire rebase operation.
2852 Commits on this branch represent the same changes with the same log
2853 messages as their counterparts on the original
2855 but with different commit IDs.
2856 Once rebasing has completed successfully, the temporary branch becomes
2857 the new version of the specified
2859 and the work tree is automatically switched to it.
2860 If author information is available via the
2862 environment variable,
2868 configuration settings, this author information will be used to identify
2873 Old commits in their pre-rebase state are automatically backed up in the
2874 .Dq refs/got/backup/rebase
2875 reference namespace.
2876 As long as these references are not removed older versions of rebased
2877 commits will remain in the repository and can be viewed with the
2880 Removal of these references makes objects which become unreachable via
2881 any reference subject to removal by Git's garbage collector or
2882 .Cm gotadmin cleanup .
2884 While rebasing commits, show the status of each affected file,
2885 using the following status codes:
2886 .Bl -column YXZ description
2887 .It G Ta file was merged
2888 .It C Ta file was merged and conflicts occurred during merge
2889 .It ! Ta changes destined for a missing file were not merged
2890 .It D Ta file was deleted
2891 .It d Ta file's deletion was prevented by local modifications
2892 .It A Ta new file was added
2893 .It \(a~ Ta changes destined for a non-regular file were not merged
2894 .It ? Ta changes destined for an unversioned file were not merged
2897 If merge conflicts occur, the rebase operation is interrupted and may
2898 be continued once conflicts have been resolved.
2899 If any files with destined changes are found to be missing or unversioned,
2900 or if files could not be deleted due to differences in deleted content,
2901 the rebase operation will be interrupted to prevent potentially incomplete
2902 changes from being committed to the repository without user intervention.
2903 The work tree may be modified as desired and the rebase operation can be
2904 continued once the changes present in the work tree are considered complete.
2905 Alternatively, the rebase operation may be aborted which will leave
2907 unmodified and the work tree switched back to its original branch.
2909 If a merge conflict is resolved in a way which renders the merged
2910 change into a no-op change, the corresponding commit will be elided
2911 when the rebase operation continues.
2914 will refuse to run if certain preconditions are not met.
2919 reference namespace, the branch may not be rebased.
2920 If the work tree is not yet fully updated to the tip commit of its
2921 branch, then the work tree must first be updated with
2923 If changes have been staged with
2925 these changes must first be committed with
2929 If the work tree contains local changes, these changes must first be
2936 contains changes to files outside of the work tree's path prefix,
2937 the work tree cannot be used to rebase this branch.
2946 commands will refuse to run while a rebase operation is in progress.
2947 Other commands which manipulate the work tree may be used for
2948 conflict resolution purposes.
2952 is already based on the work tree's current branch, then no commits
2953 need to be rebased and
2955 will simply switch the work tree to the specified
2957 and update files in the work tree accordingly.
2964 Abort an interrupted rebase operation.
2965 If this option is used, no other command-line arguments are allowed.
2967 Allow a rebase operation to continue with files in conflicted status.
2968 This option should generally be avoided, and can only be used with the
2972 Continue an interrupted rebase operation.
2973 If this option is used, no other command-line arguments are allowed except
2976 Show a list of past rebase operations, represented by references in the
2977 .Dq refs/got/backup/rebase
2978 reference namespace.
2980 Display the author, date, and log message of each backed up commit,
2981 the object ID of the corresponding post-rebase commit, and
2982 the object ID of their common ancestor commit.
2983 Given these object IDs,
2990 options can be used to examine the history of either version of the branch,
2995 option can be used to create a new branch from a pre-rebase state if desired.
2999 is specified, only show commits which at some point in time represented this
3001 Otherwise, list all backed up commits for any branches.
3003 If this option is used,
3005 does not require a work tree.
3006 None of the other options can be used together with
3009 Delete backups created by past rebase operations, represented by references
3011 .Dq refs/got/backup/rebase
3012 reference namespace.
3016 is specified, only delete backups which at some point in time represented
3018 Otherwise, delete all references found within
3019 .Dq refs/got/backup/rebase .
3021 Any commit, tree, tag, and blob objects belonging to deleted backups
3022 remain in the repository and may be removed separately with
3023 Git's garbage collector or
3024 .Cm gotadmin cleanup .
3026 If this option is used,
3028 does not require a work tree.
3029 None of the other options can be used together with
3036 .Op Fl F Ar histedit-script
3040 Edit commit history between the work tree's current base commit and
3041 the tip commit of the work tree's current branch.
3045 command requires the
3047 environment variable to be set,
3048 unless an author has been configured in
3054 configuration settings can be obtained from the repository's
3056 file or from Git's global
3062 operation, the work tree's current branch must be set with
3064 to the branch which should be edited, unless this branch is already the
3065 current branch of the work tree.
3066 The tip of this branch represents the upper bound (inclusive) of commits
3071 Furthermore, the work tree's base commit
3074 to a point in this branch's commit history where editing should begin.
3075 This commit represents the lower bound (non-inclusive) of commits touched
3080 Editing of commit history is controlled via a
3082 which can be written in an editor based on a template, passed on the
3083 command line, or generated with the
3090 Quitting the editor without saving the file will abort the histedit operation.
3092 The format of the histedit script is line-based.
3093 Each line in the script begins with a command name, followed by
3094 whitespace and an argument.
3095 For most commands, the expected argument is a commit ID.
3096 Any remaining text on the line is ignored.
3097 Lines which begin with the
3099 character are ignored entirely.
3101 The available histedit script commands are as follows:
3102 .Bl -column YXZ pick-commit
3103 .It Cm pick Ar commit Ta Use the specified commit as it is.
3104 .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
3105 then interrupt the histedit operation for amending, without creating a commit.
3106 While the histedit operation is interrupted arbitrary files may be edited,
3107 and commands which manipulate the work tree can be used freely.
3112 commands can be used to add new files or remove existing ones.
3115 command can be used to eliminate arbitrary changes from files in the work tree.
3118 command may be used to prepare a subset of changes for inclusion in the
3122 command can be used to insert arbitrary commits into the edited history.
3123 Regular editing of history must eventually be resumed by running
3124 .Cm got histedit -c .
3125 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
3126 listed further below that will be used.
3127 .It Cm drop Ar commit Ta Remove this commit from the edited history.
3128 .It Cm mesg Ar commit Ta Open an editor to create a new log message for this
3132 Every commit in the history being edited must be mentioned in the script.
3133 Lines may be re-ordered to change the order of commits in the edited history.
3134 No commit may be listed more than once.
3136 Edited commits are accumulated on a temporary branch which the work tree
3137 will remain switched to throughout the entire histedit operation.
3138 Once history editing has completed successfully, the temporary branch becomes
3139 the new version of the work tree's branch and the work tree is automatically
3142 Old commits in their pre-histedit state are automatically backed up in the
3143 .Dq refs/got/backup/histedit
3144 reference namespace.
3145 As long as these references are not removed older versions of edited
3146 commits will remain in the repository and can be viewed with the
3149 Removal of these references makes objects which become unreachable via
3150 any reference subject to removal by Git's garbage collector or
3151 .Cm gotadmin cleanup .
3153 While merging commits, show the status of each affected file,
3154 using the following status codes:
3155 .Bl -column YXZ description
3156 .It G Ta file was merged
3157 .It C Ta file was merged and conflicts occurred during merge
3158 .It ! Ta changes destined for a missing file were not merged
3159 .It D Ta file was deleted
3160 .It d Ta file's deletion was prevented by local modifications
3161 .It A Ta new file was added
3162 .It \(a~ Ta changes destined for a non-regular file were not merged
3163 .It ? Ta changes destined for an unversioned file were not merged
3166 If merge conflicts occur, the histedit operation is interrupted and may
3167 be continued once conflicts have been resolved.
3168 If any files with destined changes are found to be missing or unversioned,
3169 or if files could not be deleted due to differences in deleted content,
3170 the histedit operation will be interrupted to prevent potentially incomplete
3171 changes from being committed to the repository without user intervention.
3172 The work tree may be modified as desired and the histedit operation can be
3173 continued once the changes present in the work tree are considered complete.
3174 Alternatively, the histedit operation may be aborted which will leave
3175 the work tree switched back to its original branch.
3177 If a merge conflict is resolved in a way which renders the merged
3178 change into a no-op change, the corresponding commit will be elided
3179 when the histedit operation continues.
3182 will refuse to run if certain preconditions are not met.
3183 If the work tree's current branch is not in the
3185 reference namespace, the history of the branch may not be edited.
3186 If the work tree contains multiple base commits, it must first be updated
3187 to a single base commit with
3189 If changes have been staged with
3191 these changes must first be committed with
3195 If the work tree contains local changes, these changes must first be
3200 If the edited history contains changes to files outside of the work tree's
3201 path prefix, the work tree cannot be used to edit the history of this branch.
3209 commands will refuse to run while a histedit operation is in progress.
3210 Other commands which manipulate the work tree may be used, and the
3212 command may be used to commit arbitrary changes to the temporary branch
3213 while the histedit operation is interrupted.
3220 Abort an interrupted histedit operation.
3221 If this option is used, no other command-line arguments are allowed.
3223 Allow a histedit operation to continue with files in conflicted status.
3224 This option should generally be avoided, and can only be used with the
3228 Continue an interrupted histedit operation.
3229 If this option is used, no other command-line arguments are allowed except
3233 This option is a quick equivalent to a histedit script which drops all
3237 option can only be used when starting a new histedit operation.
3238 If this option is used, no other command-line arguments are allowed.
3240 Interrupt the histedit operation for editing after merging each commit.
3241 This option is a quick equivalent to a histedit script which uses the
3243 command for all commits.
3246 option can only be used when starting a new histedit operation.
3247 If this option is used, no other command-line arguments are allowed.
3248 .It Fl F Ar histedit-script
3251 instead of opening a temporary file in an editor where a histedit script
3254 Fold all commits into a single commit.
3255 This option is a quick equivalent to a histedit script which folds all
3256 commits, combining them all into one commit.
3259 option can only be used when starting a new histedit operation.
3260 If this option is used, no other command-line arguments are allowed.
3262 Show a list of past histedit operations, represented by references in the
3263 .Dq refs/got/backup/histedit
3264 reference namespace.
3266 Display the author, date, and log message of each backed up commit,
3267 the object ID of the corresponding post-histedit commit, and
3268 the object ID of their common ancestor commit.
3269 Given these object IDs,
3276 options can be used to examine the history of either version of the branch,
3281 option can be used to create a new branch from a pre-histedit state if desired.
3285 is specified, only show commits which at some point in time represented this
3287 Otherwise, list all backed up commits for any branches.
3289 If this option is used,
3291 does not require a work tree.
3292 None of the other options can be used together with
3295 Edit log messages only.
3296 This option is a quick equivalent to a histedit script which edits
3297 only log messages but otherwise leaves every picked commit as-is.
3300 option can only be used when starting a new histedit operation.
3301 If this option is used, no other command-line arguments are allowed.
3303 Delete backups created by past histedit operations, represented by references
3305 .Dq refs/got/backup/histedit
3306 reference namespace.
3310 is specified, only delete backups which at some point in time represented
3312 Otherwise, delete all references found within
3313 .Dq refs/got/backup/histedit .
3315 Any commit, tree, tag, and blob objects belonging to deleted backups
3316 remain in the repository and may be removed separately with
3317 Git's garbage collector or
3318 .Cm gotadmin cleanup .
3320 If this option is used,
3322 does not require a work tree.
3323 None of the other options can be used together with
3327 .It Cm integrate Ar branch
3329 Integrate the specified
3331 into the work tree's current branch.
3332 Files in the work tree are updated to match the contents on the integrated
3334 and the reference of the work tree's branch is changed to point at the
3335 head commit of the integrated
3338 Both branches can be considered equivalent after integration since they
3339 will be pointing at the same commit.
3340 Both branches remain available for future work, if desired.
3341 In case the integrated
3343 is no longer needed it may be deleted with
3346 Show the status of each affected file, using the following status codes:
3347 .Bl -column YXZ description
3348 .It U Ta file was updated
3349 .It D Ta file was deleted
3350 .It A Ta new file was added
3351 .It \(a~ Ta versioned file is obstructed by a non-regular file
3352 .It ! Ta a missing versioned file was restored
3356 will refuse to run if certain preconditions are not met.
3357 Most importantly, the
3359 must have been rebased onto the work tree's current branch with
3361 before it can be integrated, in order to linearize commit history and
3362 resolve merge conflicts.
3363 If the work tree contains multiple base commits, it must first be updated
3364 to a single base commit with
3366 If changes have been staged with
3368 these changes must first be committed with
3372 If the work tree contains local changes, these changes must first be
3386 into the current branch of the work tree.
3387 If the branches have diverged, merge changes into the work tree
3388 and create a merge commit.
3389 Otherwise, if the specified
3391 is already based on the work tree's current branch, make the work tree's
3392 current branch equivalent to the specified
3394 and update files in the work tree accordingly.
3396 Merge commits are commits based on multiple parent commits.
3397 The tip commit of the work tree's current branch will be used as the
3399 The tip commit of the specified
3401 will be used as the second parent.
3402 The work tree's current branch
3405 reference namespace and can be set with
3411 No ancestral relationship between the two branches is required.
3412 If the two branches have already been merged previously, only new changes
3415 It is not possible to create merge commits with more than two parents.
3416 If more than one branch needs to be merged, then multiple merge commits
3417 with two parents each can be created in sequence.
3419 If a linear project history is desired, then use of
3421 should generally be preferred over
3423 However, even strictly linear projects may require occasional merge commits,
3424 for example in order to merge in new versions of third-party code stored
3427 branches created with
3430 While merging changes found on the
3432 into the work tree, show the status of each affected file,
3433 using the following status codes:
3434 .Bl -column YXZ description
3435 .It G Ta file was merged
3436 .It C Ta file was merged and conflicts occurred during merge
3437 .It ! Ta changes destined for a missing file were not merged
3438 .It D Ta file was deleted
3439 .It d Ta file's deletion was prevented by local modifications
3440 .It A Ta new file was added
3441 .It \(a~ Ta changes destined for a non-regular file were not merged
3442 .It ? Ta changes destined for an unversioned file were not merged
3445 If merge conflicts occur, the merge operation is interrupted and conflicts
3446 must be resolved before the merge operation can continue.
3447 If any files with destined changes are found to be missing or unversioned,
3448 or if files could not be deleted due to differences in deleted content,
3449 the merge operation will be interrupted to prevent potentially incomplete
3450 changes from being committed to the repository without user intervention.
3451 The work tree may be modified as desired and the merge can be continued
3452 once the changes present in the work tree are considered complete.
3453 Alternatively, the merge operation may be aborted which will leave
3454 the work tree's current branch unmodified.
3457 will refuse to run if certain preconditions are not met.
3458 If the work tree's current branch is not in the
3460 reference namespace then the work tree must first be switched to a
3465 If the work tree is not yet fully updated to the tip commit of its
3466 branch, then the work tree must first be updated with
3468 If the work tree contains multiple base commits, it must first be updated
3469 to a single base commit with
3471 If changes have been staged with
3473 these changes must first be committed with
3477 If the work tree contains local changes, these changes must first be
3484 contains changes to files outside of the work tree's path prefix,
3485 the work tree cannot be used to merge this branch.
3495 commands will refuse to run while a merge operation is in progress.
3496 Other commands which manipulate the work tree may be used for
3497 conflict resolution purposes.
3504 Abort an interrupted merge operation.
3505 If this option is used, no other command-line arguments are allowed.
3507 Allow a merge operation to continue with files in conflicted status.
3508 This option should generally be avoided, and can only be used with the
3512 Continue an interrupted merge operation.
3513 If this option is used, no other command-line arguments are allowed except
3516 Create a merge commit even if the branches have not diverged.
3518 Merge changes into the work tree as usual but do not create a merge
3520 The merge result can be adjusted as desired before a merge commit is
3523 Alternatively, the merge may be aborted with
3530 .Op Fl F Ar response-script
3534 Stage local changes for inclusion in the next commit.
3537 is specified, stage all changes in the work tree.
3538 Otherwise, stage changes at or within the specified paths.
3539 Paths may be staged if they are added, modified, or deleted according to
3542 Show the status of each affected file, using the following status codes:
3543 .Bl -column YXZ description
3544 .It A Ta file addition has been staged
3545 .It M Ta file modification has been staged
3546 .It D Ta file deletion has been staged
3549 Staged file contents are saved in newly created blob objects in the repository.
3550 These blobs will be referred to by tree objects once staged changes have been
3553 Staged changes affect the behaviour of
3558 While paths with staged changes exist, the
3560 command will refuse to commit any paths which do not have staged changes.
3561 Local changes created on top of staged changes can only be committed if
3562 the path is staged again, or if the staged changes are committed first.
3565 command will show both local changes and staged changes.
3568 command is able to display local changes relative to staged changes,
3569 and to display staged changes relative to the repository.
3572 command cannot revert staged changes but may be used to revert
3573 local changes created on top of staged changes.
3579 .It Fl F Ar response-script
3587 responses line-by-line from the specified
3589 file instead of prompting interactively.
3591 Instead of staging new changes, list paths which are already staged,
3592 along with the IDs of staged blob objects and stage status codes.
3593 If paths were provided on the command line, show the staged paths
3594 among the specified paths.
3595 Otherwise, show all staged paths.
3597 Instead of staging the entire content of a changed file, interactively
3598 select or reject changes for staging based on
3602 (reject change), and
3604 (quit staging this file) responses.
3605 If a file is in modified status, individual patches derived from the
3606 modified file content can be staged.
3607 Files in added or deleted status may only be staged or rejected in
3610 Allow staging of symbolic links which point outside of the path space
3611 that is under version control.
3614 will reject such symbolic links due to safety concerns.
3617 may decide to represent such a symbolic link as a regular file which contains
3618 the link's target path, rather than creating an actual symbolic link which
3619 points outside of the work tree.
3620 Use of this option is discouraged because external mechanisms such as
3622 are better suited for managing symbolic links to paths not under
3627 will refuse to run if certain preconditions are not met.
3628 If a file contains merge conflicts, these conflicts must be resolved first.
3629 If a file is found to be out of date relative to the head commit on the
3630 work tree's current branch, the file must be updated with
3632 before it can be staged (however, this does not prevent the file from
3633 becoming out-of-date at some point after having been staged).
3641 commands will refuse to run while staged changes exist.
3642 If staged changes cannot be committed because a staged path
3643 is out of date, the path must be unstaged with
3645 before it can be updated with
3647 and may then be staged again if necessary.
3652 .Op Fl F Ar response-script
3656 Merge staged changes back into the work tree and put affected paths
3657 back into non-staged status.
3660 is specified, unstage all staged changes across the entire work tree.
3661 Otherwise, unstage changes at or within the specified paths.
3663 Show the status of each affected file, using the following status codes:
3664 .Bl -column YXZ description
3665 .It G Ta file was unstaged
3666 .It C Ta file was unstaged and conflicts occurred during merge
3667 .It ! Ta changes destined for a missing file were not merged
3668 .It D Ta file was staged as deleted and still is deleted
3669 .It d Ta file's deletion was prevented by local modifications
3670 .It \(a~ Ta changes destined for a non-regular file were not merged
3677 .It Fl F Ar response-script
3685 responses line-by-line from the specified
3687 file instead of prompting interactively.
3689 Instead of unstaging the entire content of a changed file, interactively
3690 select or reject changes for unstaging based on
3694 (keep change staged), and
3696 (quit unstaging this file) responses.
3697 If a file is staged in modified status, individual patches derived from the
3698 staged file content can be unstaged.
3699 Files staged in added or deleted status may only be unstaged in their entirety.
3705 .Op Fl r Ar repository-path
3708 Parse and print contents of objects to standard output in a line-based
3710 Content of commit, tree, and tag objects is printed in a way similar
3711 to the actual content stored in such objects.
3712 Blob object contents are printed as they would appear in files on disk.
3714 Attempt to interpret each argument as a reference, a tag name, or
3716 References will be resolved to an object ID.
3717 Tag names will resolved to a tag object.
3718 An abbreviated hash argument will be expanded to a full commit ID
3719 automatically, provided the abbreviation is unique.
3721 If none of the above interpretations produce a valid result, or if the
3723 option is used, attempt to interpret the argument as a path which will
3724 be resolved to the ID of an object found at this path in the repository.
3731 Look up paths in the specified
3733 If this option is not used, paths are looked up in the commit resolved
3734 via the repository's HEAD reference.
3736 The expected argument is a commit ID, or a reference name
3737 or keyword which will be resolved to a commit ID.
3738 An abbreviated hash argument will be expanded to a full commit ID
3739 automatically, provided the abbreviation is unique.
3744 resolve to the work tree's base commit and branch head, respectively.
3745 The former is only valid if invoked in a work tree, while the latter will
3746 resolve to the tip of the work tree's current branch if invoked in a
3747 work tree, otherwise it will resolve to the repository's HEAD reference.
3748 Keywords and references may be appended with
3752 modifiers and an optional integer N to denote the
3753 Nth descendant or antecedent by first parent traversal, respectively;
3756 denotes the work tree branch head's 2nd generation ancestor, and
3758 denotes the 4th generation descendant of the work tree's base commit.
3761 will denote the 8th generation ancestor of the commit resolved by the
3768 modifier without a trailing integer has an implicit
3777 Interpret all arguments as paths only.
3778 This option can be used to resolve ambiguity in cases where paths
3779 look like tag names, reference names, or object IDs.
3780 .It Fl r Ar repository-path
3781 Use the repository at the specified path.
3782 If not specified, assume the repository is located at or above the current
3784 If this directory is a
3786 work tree, use the repository path associated with this work tree.
3788 .It Cm info Op Ar path ...
3789 Display meta-data stored in a work tree.
3794 The work tree to use is resolved implicitly by walking upwards from the
3795 current working directory.
3799 arguments are specified, show additional per-file information for tracked
3800 files located at or within these paths.
3803 argument corresponds to the work tree's root directory, display information
3804 for all tracked files.
3807 .Bl -tag -width GOT_IGNORE_GITCONFIG
3809 The author's name and email address, such as
3810 .Qq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3821 may fail to parse commits without an email address in author data,
3825 environment variables with a missing email address.
3827 .Ev GOT_AUTHOR will be overridden by configuration settings in
3833 configuration settings in the repository's
3840 configuration settings contained in Git's global
3842 configuration file will only be used if neither
3846 environment variable provide author information.
3847 .It Ev GOT_IGNORE_GITCONFIG
3848 If this variable is set then any remote repository definitions or author
3849 information found in Git configuration files will be ignored.
3850 .It Ev GOT_LOG_DEFAULT_LIMIT
3851 The default limit on the number of commits traversed by
3853 If set to zero, the limit is unbounded.
3854 This variable will be silently ignored if it is set to a non-numeric value.
3855 .It Ev VISUAL , EDITOR
3856 The editor spawned by
3864 text editor will be spawned.
3867 .Bl -tag -width packed-refs -compact
3869 Repository-wide configuration settings for
3873 configuration file located in the root directory of a Git repository
3874 supersedes any relevant settings in Git's
3878 .It Pa .got/got.conf
3879 Worktree-specific configuration settings for
3883 configuration file in the
3885 meta-data directory of a work tree supersedes any relevant settings in
3888 configuration file and Git's
3895 Enable tab-completion of
3900 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3902 Clone an existing Git repository for use with
3906 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3908 Unfortunately, many of the popular Git hosting sites do not offer anonymous
3910 Such sites will require an account to be created, and a public SSH key to be
3911 uploaded to this account, before repository access via ssh:// URLs will work.
3913 Most sites offer anonymous repository access via HTTPS:
3916 .Dl $ got clone https://github.com/openbsd/src.git
3918 Alternatively, for quick and dirty local testing of
3920 a new Git repository could be created and populated with files,
3921 e.g. from a temporary CVS checkout located at
3924 .Dl $ got init /var/git/src.git
3925 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3927 Check out a work tree from the Git repository to /usr/src:
3929 .Dl $ got checkout /var/git/src.git /usr/src
3931 View local changes in a work tree directory:
3933 .Dl $ got diff | less
3935 In a work tree, display files in a potentially problematic state:
3937 .Dl $ got status -s 'C!~?'
3939 Interactively revert selected local changes in a work tree directory:
3941 .Dl $ got revert -p -R\ .
3943 In a work tree or a git repository directory, list all branch references:
3947 As above, but list the most recently modified branches only:
3949 .Dl $ got branch -lt | head
3951 In a work tree or a git repository directory, create a new branch called
3952 .Dq unified-buffer-cache
3953 which is forked off the
3957 .Dl $ got branch -c master unified-buffer-cache
3959 Switch an existing work tree to the branch
3960 .Dq unified-buffer-cache .
3961 Local changes in the work tree will be preserved and merged if necessary:
3963 .Dl $ got update -b unified-buffer-cache
3965 Create a new commit from local changes in a work tree directory.
3966 This new commit will become the head commit of the work tree's current branch:
3970 In a work tree or a git repository directory, view changes committed in
3971 the 3 most recent commits to the work tree's branch, or the branch resolved
3972 via the repository's HEAD reference, respectively:
3974 .Dl $ got log -p -l 3
3976 As above, but display changes in the order in which
3978 could apply them in sequence:
3980 .Dl $ got log -p -l 3 -R
3982 In a work tree or a git repository directory, log the history of a subdirectory:
3984 .Dl $ got log sys/uvm
3986 While operating inside a work tree, paths are specified relative to the current
3987 working directory, so this command will log the subdirectory
3990 .Dl $ cd sys/uvm && got log\ .
3992 And this command has the same effect:
3994 .Dl $ cd sys/dev/usb && got log ../../uvm
3996 And this command displays work tree meta-data about all tracked files:
3999 .Dl $ got info\ . | less
4001 Add new files and remove obsolete files in a work tree directory:
4003 .Dl $ got add sys/uvm/uvm_ubc.c
4004 .Dl $ got remove sys/uvm/uvm_vnode.c
4006 A file can be renamed or moved by removing it from its old location
4007 and adding it at the new location:
4009 .Dl $ cp oldfile.c newfile.c
4010 .Dl $ got remove oldfile.c
4011 .Dl $ got add newfile.c
4014 does not yet follow file history across renames, but
4016 will be able to do so regardless.
4018 Create a new commit from local changes in a work tree directory
4019 with a pre-defined log message.
4021 .Dl $ got commit -m 'unify the buffer cache'
4023 Alternatively, create a new commit from local changes in a work tree
4024 directory with a log message that has been prepared in the file
4027 .Dl $ got commit -F /tmp/msg
4029 Update any work tree checked out from the
4030 .Dq unified-buffer-cache
4031 branch to the latest commit on this branch:
4035 Roll file content on the unified-buffer-cache branch back by one commit,
4036 and then fetch the rolled-back change into the work tree as a local change
4037 to be amended and perhaps committed again:
4039 .Dl $ got backout unified-buffer-cache
4040 .Dl $ got commit -m 'roll back previous'
4041 .Dl $ # now back out the previous backout :-)
4042 .Dl $ got backout unified-buffer-cache
4044 Fetch new changes on the remote repository's
4046 branch, making them visible on the local repository's
4055 branch to merge the new changes that are now visible on the
4060 .Dl $ got update -b origin/master
4061 .Dl $ got rebase master
4064 .Dq unified-buffer-cache
4065 branch on top of the new head commit of the
4069 .Dl $ got update -b master
4070 .Dl $ got rebase unified-buffer-cache
4072 Create a patch from all changes on the unified-buffer-cache branch.
4073 The patch can be mailed out for review and applied to
4077 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
4079 Edit the entire commit history of the
4080 .Dq unified-buffer-cache
4083 .Dl $ got update -b unified-buffer-cache
4084 .Dl $ got update -c master
4087 Before working against existing branches in a repository cloned with
4088 .Cm git clone --bare
4093 must be configured to map all references in the remote repository
4096 namespace of the local repository.
4097 This can be achieved by setting Git's
4098 .Pa remote.origin.fetch
4099 configuration variable to the value
4100 .Dq +refs/heads/*:refs/remotes/origin/*
4105 .Dl $ cd /var/git/repo
4106 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
4110 option must be disabled:
4112 .Dl $ cd /var/git/repo
4113 .Dl $ git config remote.origin.mirror false
4115 Alternatively, the following
4117 configuration item can be added manually to the Git repository's
4121 .Dl [remote \&"origin\&"]
4123 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
4126 This configuration leaves the local repository's
4128 namespace free for use by local branches checked out with
4130 and, if needed, created with
4133 .Dq refs/remotes/origin
4134 namespace can now be updated with incoming changes from the remote
4139 without extra command line arguments.
4140 Newly fetched changes can be examined with
4143 Display changes on the remote repository's version of the
4145 branch, as of the last time
4149 .Dl $ got log -c origin/master | less
4151 As shown here, most commands accept abbreviated reference names such as
4154 .Dq refs/remotes/origin/master .
4155 The latter is only needed in case of ambiguity.
4158 can be used to merge changes which are visible on the
4163 This will also merge local changes, if any, with the incoming changes:
4165 .Dl $ got update -b origin/master
4166 .Dl $ got rebase master
4168 In order to make changes committed to the
4169 .Dq unified-buffer-cache
4173 .Dq unified-buffer-cache
4174 branch can be rebased onto the
4178 .Dl $ got update -b master
4179 .Dl $ got rebase unified-buffer-cache
4182 .Dq unified-buffer-cache
4183 branch can now be made visible on the
4187 Because the rebase operation switched the work tree to the
4188 .Dq unified-buffer-cache
4189 branch, the work tree must be switched back to the
4193 .Dl $ got update -b master
4194 .Dl $ got integrate unified-buffer-cache
4198 branch, log messages for local changes can now be amended with
4200 by other developers and any other important new information:
4202 .Dl $ got update -c origin/master
4203 .Dl $ got histedit -m
4205 If the remote repository offers write access, local changes on the
4207 branch can be sent to the remote repository with
4211 can be run without further arguments.
4212 The arguments shown here match defaults, provided the work tree's
4213 current branch is the
4217 .Dl $ got send -b master origin
4219 If the remote repository requires the HTTPS protocol, the
4221 command must be used instead:
4223 .Dl $ cd /var/git/src.git
4224 .Dl $ git push origin master
4226 When making contributions to projects which use the
4228 workflow, SSH protocol repository access needs to be set up first.
4229 Once an account has been created on a Git hosting site it should
4230 be possible to upload a public SSH key for repository access
4235 workflow will usually involve two remote repositories.
4236 In the real-life example below, the
4238 repository was forked from the
4240 repository by using the Git hosting site's web interface.
4243 file in the local repository describes both remote repositories:
4244 .Bd -literal -offset indent
4245 # Jelmers's repository, which accepts pull requests
4247 server git@github.com
4249 repository "/jelmer/dulwich"
4253 # Stefan's fork, used as the default remote repository
4255 server git@github.com
4257 repository "/stspdotname/dulwich"
4262 With this configuration, Stefan can create commits on
4263 .Dq refs/heads/master
4264 and send them to the
4266 repository by running:
4268 .Dl $ got send -b master origin
4270 The changes can now be proposed to Jelmer by opening a pull request
4271 via the Git hosting site's web interface.
4272 If Jelmer requests further changes to be made, additional commits
4273 can be created on the
4275 branch and be added to the pull request by running
4279 If Jelmer prefers additional commits to be
4281 then the following commands can be used to achieve this:
4283 .Dl $ got update -b master
4284 .Dl $ got update -c origin/master
4285 .Dl $ got histedit -f
4286 .Dl $ got send -f -b master origin
4288 In addition to reviewing the pull request in the web user interface,
4289 Jelmer can fetch the pull request's branch into his local repository
4290 and create a local branch which contains the proposed changes:
4292 .Dl $ got fetch -R refs/pull/1046/head origin
4293 .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
4295 Once Jelmer has accepted the pull request, Stefan can fetch the
4296 merged changes, and possibly several other new changes, by running:
4298 .Dl $ got fetch upstream
4300 The merged changes will now be visible under the reference
4301 .Dq refs/remotes/upstream/master .
4304 branch can now be rebased on top of the latest changes
4307 .Dl $ got update -b upstream/master
4308 .Dl $ got rebase master
4310 As an alternative to
4312 branches can be merged with
4315 .Dl $ got update -b master
4316 .Dl $ got merge upstream/master
4318 The question of whether to rebase or merge branches is philosophical.
4319 When in doubt, refer to the software project's policies set by project
4322 As a final step, the forked repository's copy of the master branch needs
4323 to be kept in sync by sending the new changes there:
4325 .Dl $ got send -f -b master origin
4327 If multiple pull requests need to be managed in parallel, a separate branch
4328 must be created for each pull request with
4330 Each such branch can then be used as above, in place of
4331 .Dq refs/heads/master .
4332 Changes for any accepted pull requests will still appear under
4333 .Dq refs/remotes/upstream/master,
4334 regardless of which branch was used in the forked repository to
4335 create a pull request.
4339 .Xr git-repository 5 ,
4340 .Xr got-worktree 5 ,
4344 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
4345 .An Christian Weisgerber Aq Mt naddy@openbsd.org
4346 .An Florian Obser Aq Mt florian@narrans.de
4347 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
4348 .An James Cook Aq Mt falsifian@falsifian.org
4349 .An Jasper Lievisse Adriaanse Aq Mt j@jasper.la
4350 .An Josh Rickmar Aq Mt jrick@zettaport.com
4351 .An Joshua Stein Aq Mt jcs@openbsd.org
4352 .An Josiah Frentsos Aq Mt jfrent@tilde.team
4353 .An Klemens Nanni Aq Mt kn@openbsd.org
4354 .An Kyle Ackerman Aq Mt kackerman0102@gmail.com
4355 .An Lorenz (xha) Aq Mt me@xha.li
4356 .An Lucas Gabriel Vuotto Aq Mt lucas@sexy.is
4357 .An Mark Jamsek Aq Mt mark@jamsek.dev
4358 .An Martin Pieuchot Aq Mt mpi@openbsd.org
4359 .An Mikhail Pchelin Aq Mt misha@freebsd.org
4360 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
4361 .An Omar Polo Aq Mt op@openbsd.org
4362 .An Ori Bernstein Aq Mt ori@openbsd.org
4363 .An Sebastien Marie Aq Mt semarie@openbsd.org
4364 .An Stefan Sperling Aq Mt stsp@openbsd.org
4365 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
4366 .An Ted Unangst Aq Mt tedu@tedunangst.com
4367 .An Theo Buehler Aq Mt tb@openbsd.org
4368 .An Thomas Adam Aq Mt thomas@xteddy.org
4369 .An Tobias Heider Aq Mt me@tobhe.de
4370 .An Tom Jones Aq Mt thj@freebsd.org
4371 .An Tracey Emery Aq Mt tracey@traceyemery.net
4372 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
4380 were derived from code under copyright by:
4382 .An Bjoern Hoehrmann
4383 .An Caldera International
4384 .An Daniel Hartmeier
4391 .An Jean-Francois Brousseau
4399 .An Niklas Hallqvist
4406 .An Xavier Santolaria
4409 contains code contributed to the public domain by
4410 .An Austin Appleby .
4413 is a work-in-progress and some features remain to be implemented.
4415 At present, the user has to fall back on
4417 to perform some tasks.
4421 With repositories that use the sha256 object ID hashing algorithm,
4423 is currently required for all network operations (clone, fetch, and push)
4426 does not yet support version 2 of the Git network protocol.
4428 Writing to remote repositories over HTTP or HTTPS protocols requires
4431 The creation of merge commits with more than two parent commits requires
4434 In situations where files or directories were moved around
4436 will not automatically merge changes to new locations and
4438 will usually produce better results.