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 i Ar identity-file
209 .Op Fl R Ar reference
214 Clone a Git repository at the specified
220 is specified, the directory name will be derived from the name of the
223 will refuse to run if the
229 specifies a protocol scheme, a server hostname, an optional port number
230 separated from the hostname by a colon, and a path to the repository on
232 .Lk scheme://hostname:port/path/to/repository
234 The following protocol schemes are supported:
235 .Bl -tag -width https
237 The Git protocol as implemented by the
240 Use of this protocol is discouraged since it supports neither authentication
243 The Git protocol wrapped in an authenticated and encrypted
246 With this protocol the hostname may contain an embedded username for
254 Not compatible with servers using the
260 Git HTTP protocol is supported by
266 Sending from a repository cloned over HTTP will require use of a
272 protocol will be used by
275 Use of this protocol is discouraged since it supports neither authentication
280 Git HTTP protocol wrapped in SSL/TLS.
283 Objects in the cloned repository are stored in a pack file which is downloaded
285 This pack file will then be indexed to facilitate access to the objects stored
287 If any objects in the pack file are stored in deltified form, all deltas will
288 be fully resolved in order to compute the ID of such objects.
289 This can take some time.
290 More details about the pack file format are documented in
291 .Xr git-repository 5 .
294 creates a remote repository entry in the
298 files of the cloned repository to store the
304 arguments for future use by
314 Fetch all branches from the remote repository's
316 reference namespace and set
317 .Cm fetch_all_branches
318 in the cloned repository's
320 file for future use by
322 If this option is not specified, a branch resolved via the remote
323 repository's HEAD reference will be fetched.
324 Cannot be used together with the
330 from the remote repository's
333 This option may be specified multiple times to build a list of branches
335 If the branch corresponding to the remote repository's HEAD reference is not
336 in this list, the cloned repository's HEAD reference will be set to the first
337 branch which was fetched.
338 If this option is not specified, a branch resolved via the remote
339 repository's HEAD reference will be fetched.
340 Cannot be used together with the
343 .It Fl i Ar identity-file
346 containing a private SSH key, to use with SSH connections.
347 The same option will be passed to
352 to use with SSH connections.
353 The same option will be passed to
356 List branches and tags available for fetching from the remote repository
357 and exit immediately.
358 Cannot be used together with any of the other options except
363 Create the cloned repository as a mirror of the original repository.
364 This is useful if the cloned repository will not be used to store
365 locally created commits.
371 files will be set up with the
373 option enabled, such that
377 will write incoming changes directly to branches in the
379 reference namespace, rather than to branches in the
382 This avoids the usual requirement of having to run
388 in order to make incoming changes appear on branches in the
391 But maintaining custom changes in the cloned repository becomes difficult
392 since such changes will be at risk of being discarded whenever incoming
395 Suppress progress reporting output.
396 The same option will be passed to
399 .It Fl R Ar reference
400 In addition to the branches and tags that will be fetched, fetch an arbitrary
402 from the remote repository's
405 This option may be specified multiple times to build a list of additional
409 may either be a path to a specific reference, or a reference namespace
410 which will cause all references in this namespace to be fetched.
412 Each reference will be mapped into the cloned repository's
414 namespace, unless the
416 option is used to mirror references directly into the cloned repository's
421 will refuse to fetch references from the remote repository's
430 to print debugging messages to standard error output.
431 This option will be passed to
434 Multiple -v options increase the verbosity.
442 .Op Fl i Ar identity-file
444 .Op Fl R Ar reference
445 .Op Fl r Ar repository-path
446 .Op Ar remote-repository
449 Fetch new changes from a remote repository.
451 .Ar remote-repository
455 The remote repository's URL is obtained from the corresponding entry in
459 file of the local repository, as created by
462 By default, any branches configured in
465 .Ar remote-repository
469 is invoked in a work tree then this work tree's current branch will be
470 fetched, too, provided it is present on the server.
471 If no branches to fetch can be found in
473 or via a work tree, or said branches are not found on the server, a branch
474 resolved via the remote repository's HEAD reference will be fetched.
475 Likewise, if a HEAD reference for the
476 .Ar remote-repository
477 exists but its target no longer matches the remote HEAD, then
478 the new target branch will be fetched.
479 This default behaviour can be overridden with the
485 New changes will be stored in a separate pack file downloaded from the server.
486 Optionally, separate pack files stored in the repository can be combined with
489 By default, branch references in the
491 reference namespace will be updated to point at the newly fetched commits.
496 command can then be used to make new changes visible on branches in the
498 namespace, merging incoming changes with the changes on those branches
501 If the repository was created as a mirror with
503 then all branches in the
505 namespace will be updated directly to match the corresponding branches in
506 the remote repository.
507 If those branches contained local commits, these commits will no longer be
508 reachable via a reference and will therefore be at risk of being discarded
509 by Git's garbage collector or
510 .Cm gotadmin cleanup .
511 Maintaining custom changes in a mirror repository is therefore discouraged.
513 In any case, references in the
515 namespace will always be fetched and mapped directly to local references
516 in the same namespace.
523 Fetch all branches from the remote repository's
526 This option can be enabled by default for specific repositories in
528 Cannot be used together with the
534 from the remote repository's
537 This option may be specified multiple times to build a list of branches
539 Cannot be used together with the
543 Delete branches and tags from the local repository which are no longer
544 present in the remote repository.
545 Only references are deleted.
546 Any commit, tree, tag, and blob objects belonging to deleted branches or
547 tags remain in the repository and may be removed separately with
548 Git's garbage collector or
549 .Cm gotadmin cleanup .
550 .It Fl i Ar identity-file
553 containing a private SSH key, to use with SSH connections.
554 The same option will be passed to
559 to use with SSH connections.
560 The same option will be passed to
563 List branches and tags available for fetching from the remote repository
564 and exit immediately.
565 Cannot be used together with any of the other options except
571 Suppress progress reporting output.
572 The same option will be passed to
575 .It Fl R Ar reference
576 In addition to the branches and tags that will be fetched, fetch an arbitrary
578 from the remote repository's
581 This option may be specified multiple times to build a list of additional
585 may either be a path to a specific reference, or a reference namespace
586 which will cause all references in this namespace to be fetched.
588 Each reference will be mapped into the local repository's
590 namespace, unless the local repository was created as a mirror with
592 in which case references will be mapped directly into the local repository's
596 Once a reference has been fetched, a branch based on it can be created with
601 will refuse to fetch references from the remote repository's
606 .It Fl r Ar repository-path
607 Use the repository at the specified path.
608 If not specified, assume the repository is located at or above the current
610 If this directory is a
612 work tree, use the repository path associated with this work tree.
614 Allow existing references in the
616 namespace to be updated if they have changed on the server.
617 If not specified, only new tag references will be created.
622 to print debugging messages to standard error output.
623 The same option will be passed to
626 Multiple -v options increase the verbosity.
629 Delete all references which correspond to a particular
630 .Ar remote-repository
631 instead of fetching new changes.
632 This can be useful when a remote repository is being removed from
638 .Ar remote-repository
639 argument is mandatory and no other options except
646 Only references are deleted.
647 Any commit, tree, tag, and blob objects fetched from a remote repository
648 will generally be stored in pack files and may be removed separately with
650 and Git's garbage collector.
658 .Op Fl p Ar path-prefix
660 .Op Ar work-tree-path
663 Copy files from a repository into a new work tree.
664 Show the status of each affected file, using the following status codes:
665 .Bl -column YXZ description
666 .It A Ta new file was added
667 .It E Ta file already exists in work tree's meta-data
672 is not specified, either use the last component of
673 .Ar repository path ,
676 was specified use the last component of
684 Check out files from a commit on the specified
686 If this option is not specified, a branch resolved via the repository's HEAD
687 reference will be used.
689 Check out files from the specified
691 on the selected branch.
692 If this option is not specified, the most recent commit on the selected
697 argument is a commit ID, or a reference name or a keyword
698 which will be resolved to a commit ID.
699 An abbreviated hash argument will be expanded to a full commit ID
700 automatically, provided the abbreviation is unique.
705 resolve to the repository's HEAD reference, or, if the
707 option is used, the head of the checked-out
709 Keywords and reference names may be appended with
713 modifiers and an optional integer N to denote the
714 Nth descendant or antecedent by first parent traversal, respectively;
717 denotes the work tree branch head's 2nd generation ancestor, and
719 will denote the 3rd generation ancestor of the commit resolved by the
722 If an integer does not follow the
728 is implicitly appended
737 is not contained in the selected branch, a different branch which contains
738 this commit must be specified with the
741 If no such branch is known, a new branch must be created for this
747 Checking out work trees with an unknown branch is intentionally not supported.
749 Proceed with the checkout operation even if the directory at
752 Existing files will be left intact.
753 .It Fl p Ar path-prefix
754 Restrict the work tree to a subset of the repository's tree hierarchy.
755 Only files beneath the specified
759 Silence progress output.
770 Update an existing work tree to a different
772 Change existing files in the work tree as necessary to match file contents
774 Preserve any local changes in the work tree and merge them with the
777 Files which already contain merge conflicts will not be updated to avoid
778 further complications.
779 Such files will be updated when
781 is run again after merge conflicts have been resolved.
782 If the conflicting changes are no longer needed, affected files can be
789 Show the status of each affected file, using the following status codes:
790 .Bl -column YXZ description
791 .It U Ta file was updated and contained no local changes
792 .It G Ta file was updated and local changes were merged cleanly
793 .It C Ta file was updated and conflicts occurred during merge
794 .It D Ta file was deleted
795 .It d Ta file's deletion was prevented by local modifications
796 .It A Ta new file was added
797 .It \(a~ Ta versioned file is obstructed by a non-regular file
798 .It ! Ta a missing versioned file was restored
799 .It # Ta file was not updated because it contains merge conflicts
800 .It ? Ta changes destined for an unversioned file were not merged
805 is specified, update the entire work tree.
806 Otherwise, restrict the update operation to files at or within the
808 Each path is required to exist in the update operation's target commit.
809 Files in the work tree outside specified paths will remain unchanged and
810 will retain their previously recorded base commit.
813 commands may refuse to run while the work tree contains files from
814 multiple base commits.
815 The base commit of such a work tree can be made consistent by running
817 across the entire work tree.
820 is incompatible with the
825 cannot update paths with staged changes.
826 If changes have been staged with
828 these changes must first be committed with
838 Switch the work tree's branch reference to the specified
840 before updating the work tree.
841 This option requires that all paths in the work tree are updated.
843 As usual, any local changes in the work tree will be preserved.
844 This can be useful when switching to a newly created branch in order
845 to commit existing local changes to this branch.
847 Any local changes must be dealt with separately in order to obtain a
848 work tree with pristine file contents corresponding exactly to the specified
850 Such changes could first be committed to a different branch with
852 or could be discarded with
855 Update the work tree to the specified
857 If this option is not specified, the most recent commit on the work tree's
862 argument is a commit ID, or a reference name or a keyword
863 which will be resolved to a commit ID.
864 An abbreviated hash argument will be expanded to a full commit ID
865 automatically, provided the abbreviation is unique.
870 resolve to the work tree's base commit and branch head, respectively.
871 Keywords and reference names may be appended with
875 modifiers and an optional integer N to denote the
876 Nth descendant or antecedent, respectively, by first parent traversal;
879 denotes the work tree branch head's 2nd generation ancestor, and
881 denotes the 4th generation descendant of the work tree's base commit.
884 will denote the 3rd generation ancestor of the commit resolved by the
887 If an integer does not follow the
893 is implicitly appended
900 Silence progress output.
906 .Op Fl S Ar status-codes
907 .Op Fl s Ar status-codes
911 Show the current modification status of files in a work tree,
912 using the following status codes:
913 .Bl -column YXZ description
914 .It M Ta modified file
915 .It A Ta file scheduled for addition in next commit
916 .It D Ta file scheduled for deletion in next commit
917 .It C Ta modified or added file which contains merge conflicts
918 .It ! Ta versioned file was expected on disk but is missing
919 .It \(a~ Ta versioned file is obstructed by a non-regular file
920 .It ? Ta unversioned item not tracked by
922 .It m Ta modified file modes (executable bit only)
923 .It N Ta non-existent
925 specified on the command line
930 is specified, show modifications in the entire work tree.
931 Otherwise, show modifications at or within the specified paths.
933 If changes have been staged with
935 staged changes are shown in the second output column, using the following
937 .Bl -column YXZ description
938 .It M Ta file modification is staged
939 .It A Ta file addition is staged
940 .It D Ta file deletion is staged
943 Changes created on top of staged changes are indicated in the first column:
944 .Bl -column YXZ description
945 .It MM Ta file was modified after earlier changes have been staged
946 .It MA Ta file was modified after having been staged for addition
949 If the work tree contains the results of an interrupted
954 operation then display a message which shows the branches involved.
961 Show unversioned files even if they match an ignore pattern.
962 .It Fl S Ar status-codes
963 Suppress the output of files with a modification status matching any of the
964 single-character status codes contained in the
967 Any combination of codes from the above list of possible status codes
969 For staged files, status codes displayed in either column will be matched.
970 Cannot be used together with the
973 .It Fl s Ar status-codes
974 Only show files with a modification status matching any of the
975 single-character status codes contained in the
978 Any combination of codes from the above list of possible status codes
980 For staged files, status codes displayed in either column will be matched.
981 Cannot be used together with the
986 For compatibility with
997 files in each traversed directory and will not display unversioned files
998 which match these patterns.
999 Ignore patterns which end with a slash,
1001 will only match directories.
1006 supports consecutive asterisks,
1008 which will match an arbitrary amount of directories.
1012 only supports a single ignore pattern per line.
1016 does not support negated ignore patterns prefixed with
1018 and gives no special significance to the location of path component separators,
1027 .Op Fl r Ar repository-path
1028 .Op Fl S Ar search-pattern
1032 Display history of a repository.
1035 is specified, show only commits which modified this path.
1036 If invoked in a work tree, the
1038 is interpreted relative to the current working directory,
1039 and the work tree's path prefix is implicitly prepended.
1040 Otherwise, the path is interpreted relative to the repository root.
1047 Display individual commits which were merged into the current branch
1048 from other branches.
1051 shows the linear history of the current branch only.
1053 Set the number of context lines shown in diffs with
1055 By default, 3 lines of context are shown.
1057 Start traversing history at the specified
1059 If this option is not specified, default to the work tree's current branch
1060 if invoked in a work tree, or to the repository's HEAD reference.
1064 argument is a commit ID, or a reference name or a keyword
1065 which will be resolved to a commit ID.
1066 An abbreviated hash argument will be expanded to a full commit ID
1067 automatically, provided the abbreviation is unique.
1072 resolve to the work tree's base commit and branch head, respectively.
1073 The former is only valid if invoked in a work tree, while the latter will
1074 resolve to the tip of the work tree's current branch if invoked in a
1075 work tree, otherwise it will resolve to the repository's HEAD reference.
1076 Keywords and references may be appended with
1080 modifiers and an optional integer N to denote the
1081 Nth descendant or antecedent, respectively, by first parent traversal;
1084 denotes the HEAD reference's 2nd generation ancestor, and
1086 denotes the 4th generation descendant of the work tree's base commit.
1089 will denote the 3rd generation descendant of the commit resolved by the
1096 modifier without a trailing integer has an implicit
1105 Display diffstat of changes introduced in each commit.
1106 Cannot be used with the
1111 option (diffstat displays a list of changed paths).
1113 Limit history traversal to a given number of commits.
1114 If this option is not specified, a default limit value of zero is used,
1115 which is treated as an unbounded limit.
1117 .Ev GOT_LOG_DEFAULT_LIMIT
1118 environment variable may be set to change this default value.
1120 Display the list of file paths changed in each commit, using the following
1122 .Bl -column YXZ description
1123 .It M Ta modified file
1124 .It D Ta file was deleted
1125 .It A Ta new file was added
1126 .It m Ta modified file modes (executable bit only)
1129 Cannot be used with the
1133 Display the patch of modifications made in each commit.
1136 is specified, only show the patch of modifications at or within this path.
1137 Cannot be used with the
1141 Determine a set of commits to display as usual, but display these commits
1143 .It Fl r Ar repository-path
1144 Use the repository at the specified path.
1145 If not specified, assume the repository is located at or above the current
1147 If this directory is a
1149 work tree, use the repository path associated with this work tree.
1150 .It Fl S Ar search-pattern
1151 If specified, show only commits with a log message, author name,
1152 committer name, or commit ID matched by the extended regular
1154 .Ar search-pattern .
1155 Lines in committed patches will be matched if
1158 File paths changed by a commit will be matched if
1161 Regular expression syntax is documented in
1164 Display a short one-line summary of each commit, instead of the default
1166 Cannot be used together with the
1172 Display commits in topological order.
1173 This option has no effect without the
1175 option because a linear history is sorted in topological order by definition.
1176 Topological sorting is disabled by default because the present implementation
1177 requires that commit history is fully traversed before any output can be shown.
1179 Stop traversing commit history immediately after the specified
1186 argument is a commit ID, or a reference name or a keyword
1187 which will be resolved to a commit ID.
1188 This option has no effect if the specified
1198 .Op Fl r Ar repository-path
1199 .Op Ar object1 Ar object2 | Ar path ...
1202 When invoked within a work tree without any arguments, display all
1203 local changes in the work tree.
1206 arguments are specified, only show changes within the specified paths.
1208 If two arguments are provided, treat each argument as a reference, a tag
1209 name, or an object ID, and display differences between the
1210 corresponding objects.
1211 Both objects must be of the same type (blobs, trees, or commits).
1212 An abbreviated hash argument will be expanded to a full commit ID
1213 automatically, provided the abbreviation is unique.
1214 If none of these interpretations produce a valid result or if the
1219 is running in a work tree, attempt to interpret the two arguments as paths.
1226 Treat file contents as ASCII text even if binary data is detected.
1228 Set the number of context lines shown in the diff.
1229 By default, 3 lines of context are shown.
1231 Show differences between commits in the repository.
1232 This option may be used up to two times.
1233 When used only once, show differences between the specified
1235 and its first parent commit.
1236 When used twice, show differences between the two specified commits.
1240 option is used, all non-option arguments will be interpreted as paths.
1243 arguments are provided, only show differences for the specified paths.
1247 argument is a commit ID, or a reference name or a keyword
1248 which will be resolved to a commit ID.
1249 An abbreviated hash argument will be expanded to a full commit ID
1250 automatically, provided the abbreviation is unique.
1255 resolve to the work tree's base commit and branch head, respectively.
1256 The former is only valid if invoked in a work tree, while the latter will
1257 resolve to the tip of the work tree's current branch if invoked in a
1258 work tree, otherwise it will resolve to the repository's HEAD reference.
1259 Keywords and references may be appended with
1263 modifiers and an optional integer N to denote the
1264 Nth descendant or antecedent, respectively, by first parent traversal;
1267 denotes the HEAD reference's 2nd generation ancestor, and
1269 denotes the 4th generation descendant of the work tree's base commit.
1272 will denote the 8th generation descendant of the commit resolved by the
1275 If an integer does not follow the
1281 is implicitly appended
1288 Cannot be used together with the
1292 Display diffstat of changes before the actual diff by annotating each file path
1293 or blob hash being diffed with the total number of lines added and removed.
1294 A summary line will display the total number of changes across all files.
1296 Interpret all arguments as paths only.
1297 This option can be used to resolve ambiguity in cases where paths
1298 look like tag names, reference names, or object IDs.
1299 This option is only valid when
1301 is invoked in a work tree.
1302 .It Fl r Ar repository-path
1303 Use the repository at the specified path.
1304 If not specified, assume the repository is located at or above the current
1306 If this directory is a
1308 work tree, use the repository path associated with this work tree.
1310 Show changes staged with
1312 instead of showing local changes in the work tree.
1313 This option is only valid when
1315 is invoked in a work tree.
1317 Ignore whitespace-only changes.
1323 .Op Fl r Ar repository-path
1327 Display line-by-line history of a file at the specified path.
1334 Start traversing history at the specified
1336 The expected argument is a commit ID, or a reference name
1337 or a keyword which will be resolved to a commit ID.
1338 An abbreviated hash argument will be expanded to a full commit ID
1339 automatically, provided the abbreviation is unique.
1344 resolve to the work tree's base commit and branch head, respectively.
1345 The former is only valid if invoked in a work tree, while the latter will
1346 resolve to the tip of the work tree's current branch if invoked in a
1347 work tree, otherwise it will resolve to the repository's HEAD reference.
1348 Keywords and references may be appended with
1352 modifiers and an optional integer N to denote the
1353 Nth descendant or antecedent by first parent traversal, respectively;
1356 denotes the work tree branch head's 2nd generation ancestor, and
1358 denotes the 4th generation descendant of the work tree's base commit.
1361 will denote the 5th generation ancestor of the commit resolved by the
1368 modifier without a trailing integer has an implicit
1376 .It Fl r Ar repository-path
1377 Use the repository at the specified path.
1378 If not specified, assume the repository is located at or above the current
1380 If this directory is a
1382 work tree, use the repository path associated with this work tree.
1389 .Op Fl r Ar repository-path
1393 Display a listing of files and directories at the specified
1394 directory path in the repository.
1395 Entries shown in this listing may carry one of the following trailing
1397 .Bl -column YXZ description
1398 .It @ Ta entry is a symbolic link
1399 .It / Ta entry is a directory
1400 .It * Ta entry is an executable file
1401 .It $ Ta entry is a Git submodule
1404 Symbolic link entries are also annotated with the target path of the link.
1408 is specified, list the repository path corresponding to the current
1409 directory of the work tree, or the root directory of the repository
1410 if there is no work tree.
1417 List files and directories as they appear in the specified
1420 The expected argument is a commit ID, or a reference name
1421 or a keyword which will be resolved to a commit ID.
1422 An abbreviated hash argument will be expanded to a full commit ID
1423 automatically, provided the abbreviation is unique.
1428 resolve to the work tree's base commit and branch head, respectively.
1429 The former is only valid if invoked in a work tree, while the latter will
1430 resolve to the tip of the work tree's current branch if invoked in a
1431 work tree, otherwise it will resolve to the repository's HEAD reference.
1432 Keywords and references may be appended with
1436 modifiers and an optional integer N to denote the
1437 Nth descendant or antecedent by first parent traversal, respectively;
1440 denotes the work tree branch head's 2nd generation ancestor, and
1442 denotes the 4th generation descendant of the work tree's base commit.
1445 will denote the 3rd generation ancestor of the commit resolved by the
1452 modifier without a trailing integer has an implicit
1461 Show object IDs of files (blob objects) and directories (tree objects).
1463 Recurse into sub-directories in the repository.
1464 .It Fl r Ar repository-path
1465 Use the repository at the specified path.
1466 If not specified, assume the repository is located at or above the current
1468 If this directory is a
1470 work tree, use the repository path associated with this work tree.
1476 .Op Fl r Ar repository-path
1477 .Op Fl s Ar reference
1480 Manage references in a repository.
1482 References may be listed, created, deleted, and changed.
1483 When creating, deleting, or changing a reference the specified
1485 must be an absolute reference name, i.e. it must begin with
1493 Create a reference or change an existing reference.
1494 The reference with the specified
1496 will point at the specified
1501 argument is an object ID or an existing reference or tag name
1502 or a keyword which will be resolved to the ID of a corresponding commit,
1503 tree, tag, or blob object.
1504 An abbreviated hash argument will be expanded to a full commit ID
1505 automatically, provided the abbreviation is unique.
1510 resolve to the work tree's base commit and branch head, respectively.
1511 The former is only valid if invoked in a work tree, while the latter will
1512 resolve to the tip of the work tree's current branch if invoked in a
1513 work tree, otherwise it will resolve to the repository's HEAD reference.
1514 Keywords and reference names may be appended with
1518 modifiers and an optional integer N to denote the
1519 Nth descendant or antecedent by first parent traversal, respectively;
1522 denotes the work tree branch head's 2nd generation ancestor, and
1524 will denote the 3rd generation ancestor of the commit resolved by the
1527 If an integer does not follow the
1533 is implicitly appended
1540 Cannot be used together with any other options except
1543 Delete the reference with the specified
1545 from the repository.
1546 Any commit, tree, tag, and blob objects belonging to deleted references
1547 remain in the repository and may be removed separately with
1548 Git's garbage collector or
1549 .Cm gotadmin cleanup .
1550 Cannot be used together with any other options except
1553 List references in the repository.
1556 is specified, list all existing references in the repository.
1559 is a reference namespace, list all references in this namespace.
1560 Otherwise, show only the reference with the given
1562 Cannot be used together with any other options except
1566 .It Fl r Ar repository-path
1567 Use the repository at the specified path.
1568 If not specified, assume the repository is located at or above the current
1570 If this directory is a
1572 work tree, use the repository path associated with this work tree.
1573 .It Fl s Ar reference
1574 Create a symbolic reference, or change an existing symbolic reference.
1575 The symbolic reference with the specified
1577 will point at the specified
1579 which must already exist in the repository.
1580 Care should be taken not to create loops between references when
1581 this option is used.
1582 Cannot be used together with any other options except
1585 Sort listed references by modification time (most recently modified first)
1586 instead of sorting by lexicographical order.
1587 Use of this option requires the
1589 option to be used as well.
1597 .Op Fl r Ar repository-path
1601 Create, list, or delete branches.
1603 Local branches are managed via references which live in the
1605 reference namespace.
1608 command creates references in this namespace only.
1610 When deleting branches, the specified
1614 reference namespace first.
1615 If no corresponding branch is found, the
1617 namespace will be searched next.
1619 If invoked in a work tree without any arguments, print the name of the
1620 work tree's current branch.
1624 argument is passed, attempt to create a branch reference with the given name.
1625 By default the new branch reference will point at the latest commit on the
1626 work tree's current branch if invoked in a work tree, and otherwise to a commit
1627 resolved via the repository's HEAD reference.
1629 If invoked in a work tree, once the branch was created successfully
1630 switch the work tree's head reference to the newly created branch and
1631 update files across the entire work tree, just like
1632 .Cm got update -b Ar name
1634 Show the status of each affected file, using the following status codes:
1635 .Bl -column YXZ description
1636 .It U Ta file was updated and contained no local changes
1637 .It G Ta file was updated and local changes were merged cleanly
1638 .It C Ta file was updated and conflicts occurred during merge
1639 .It D Ta file was deleted
1640 .It A Ta new file was added
1641 .It \(a~ Ta versioned file is obstructed by a non-regular file
1642 .It ! Ta a missing versioned file was restored
1650 Make a newly created branch reference point at the specified
1652 The expected argument is a commit ID, or a reference name or keyword
1653 which will be resolved to a commit ID.
1654 An abbreviated hash argument will be expanded to a full commit ID
1655 automatically, provided the abbreviation is unique.
1660 resolve to the work tree's base commit and branch head, respectively.
1661 The former is only valid if invoked in a work tree, while the latter will
1662 resolve to the tip of the work tree's current branch if invoked in a
1663 work tree, otherwise it will resolve to the repository's HEAD reference.
1664 Keywords and references may be appended with
1668 modifiers and an optional integer N to denote the
1669 Nth descendant or antecedent by first parent traversal, respectively;
1672 denotes the work tree branch head's 2nd generation ancestor, and
1674 denotes the 4th generation descendant of the work tree's base commit.
1677 will denote the 3rd generation descendant of the commit resolved by the
1684 modifier without a trailing integer has an implicit
1693 Delete the branch with the specified
1699 reference namespace.
1701 Only the branch reference is deleted.
1702 Any commit, tree, and blob objects belonging to the branch
1703 remain in the repository and may be removed separately with
1704 Git's garbage collector or
1705 .Cm gotadmin cleanup .
1707 List all existing branches in the repository, including copies of remote
1708 repositories' branches in the
1710 reference namespace.
1712 If invoked in a work tree, the work tree's current branch is shown
1713 with one of the following annotations:
1714 .Bl -column YXZ description
1715 .It * Ta work tree's base commit and the base commit of all tracked files
1716 matches the branch tip
1717 .It \(a~ Ta work tree comprises mixed commits or its base commit is out-of-date
1720 Do not switch and update the work tree after creating a new branch.
1721 .It Fl r Ar repository-path
1722 Use the repository at the specified path.
1723 If not specified, assume the repository is located at or above the current
1725 If this directory is a
1727 work tree, use the repository path associated with this work tree.
1729 Sort listed branches by modification time (most recently modified first)
1730 instead of sorting by lexicographical order.
1733 reference namespace are listed before branches in
1736 Use of this option requires the
1738 option to be used as well.
1745 .Op Fl r Ar repository-path
1746 .Op Fl S Ar signer-id
1749 Manage tags in a repository.
1751 Tags are managed via references which live in the
1753 reference namespace.
1756 command operates on references in this namespace only.
1757 References in this namespace point at tag objects which contain a pointer
1758 to another object, a tag message, as well as author and timestamp information.
1760 Attempt to create a tag with the given
1762 and make this tag point at the given
1764 If no commit is specified, default to the latest commit on the work tree's
1765 current branch if invoked in a work tree, and to a commit resolved via
1766 the repository's HEAD reference otherwise.
1773 Make the newly created tag reference point at the specified
1777 argument is a commit ID, or a reference or keyword
1778 which will be resolved to a commit ID.
1779 An abbreviated hash argument will be expanded to a full commit ID
1780 automatically, provided the abbreviation is unique.
1785 resolve to the work tree's base commit and branch head, respectively.
1786 The former is only valid if invoked in a work tree, while the latter will
1787 resolve to the tip of the work tree's current branch if invoked in a
1788 work tree, otherwise it will resolve to the repository's HEAD reference.
1789 Keywords and references may be appended with
1793 modifiers and an optional integer N to denote the
1794 Nth descendant or antecedent by first parent traversal, respectively;
1797 denotes the work tree branch head's 2nd generation ancestor, and
1799 denotes the 4th generation descendant of the work tree's base commit.
1802 will denote the 3rd generation ancestor of the commit resolved by the
1809 modifier without a trailing integer has an implicit
1818 List all existing tags in the repository instead of creating a new tag.
1821 argument is passed, show only the tag with the given
1824 Use the specified tag message when creating the new tag.
1829 opens a temporary file in an editor where a tag message can be written.
1830 Quitting the editor without saving the file will abort the tag operation.
1831 .It Fl r Ar repository-path
1832 Use the repository at the specified path.
1833 If not specified, assume the repository is located at or above the current
1835 If this directory is a
1837 work tree, use the repository path associated with this work tree.
1838 .It Fl S Ar signer-id
1839 While creating a new tag, sign this tag with the identity given in
1842 For SSH-based signatures,
1844 is the path to a file which may refer to either a private SSH key,
1845 or a public SSH key with the private half available via
1848 will sign the tag object by invoking
1852 command, using the signature namespace
1854 for compatibility with
1857 Display a short one-line summary of each tag, instead of the default
1859 Can only be used with the
1863 Verify tag object signatures.
1866 is specified, show and verify the tag object with the provided name.
1867 Otherwise, list all tag objects and verify signatures where present.
1870 verifies SSH-based signatures by invoking
1873 .Fl Y Cm verify Fl f Ar allowed_signers .
1878 otherwise verification is impossible.
1881 During SSH signature creation and verification this option will be passed to
1883 Multiple -v options increase the verbosity.
1889 command will not delete tags or change existing tags.
1890 If a tag must be deleted, the
1892 command may be used to delete a tag's reference.
1893 This should only be done if the tag has not already been copied to
1900 Schedule unversioned files in a work tree for addition to the
1901 repository in the next commit.
1902 By default, files which match a
1904 ignore pattern will not be added.
1908 mentioned in the command line is not an unversioned file then
1911 To avoid unnecessary errors from paths picked up by file globbing patterns
1912 in the shell, paths in the argument list will be silently ignored if they
1915 at all, or if they are reported with one of the following status codes
1916 and do not have changes staged via
1918 .Bl -column YXZ description
1919 .It M Ta modified file
1920 .It A Ta file scheduled for addition in next commit
1921 .It C Ta modified or added file which contains merge conflicts
1922 .It m Ta modified file modes (executable bit only)
1930 Add files even if they match a
1934 Permit recursion into directories.
1935 If this option is not specified,
1937 will refuse to run if a specified
1945 .Op Fl s Ar status-codes
1949 Remove versioned files from a work tree and schedule them for deletion
1950 from the repository in the next commit.
1957 Perform the operation even if a file contains local modifications,
1958 and do not raise an error if a specified
1960 does not exist on disk.
1962 Keep affected files on disk.
1964 Permit recursion into directories.
1965 If this option is not specified,
1967 will refuse to run if a specified
1970 .It Fl s Ar status-codes
1971 Only delete files with a modification status matching one of the
1972 single-character status codes contained in the
1975 The following status codes may be specified:
1976 .Bl -column YXZ description
1977 .It M Ta modified file (this implies the
1980 .It ! Ta versioned file expected on disk but missing
1988 .Op Fl p Ar strip-count
1994 to files in a work tree.
1995 Files added or removed by a patch will be scheduled for addition or removal in
1998 The patch must be in the unified diff format as produced by
2005 diff when invoked with their
2010 argument is provided, read unified diff data from standard input instead.
2014 contains multiple patches, then attempt to apply each of them in sequence.
2016 Show the status of each affected file, using the following status codes:
2017 .Bl -column XYZ description
2018 .It M Ta file was modified
2019 .It G Ta file was merged using a merge-base found in the repository
2020 .It C Ta file was merged and conflicts occurred during merge
2021 .It D Ta file was deleted
2022 .It A Ta file was added
2023 .It # Ta failed to patch the file
2026 If a change does not match at its exact line number, attempt to
2027 apply it somewhere else in the file if a good spot can be found.
2028 Otherwise, the patch will fail to apply.
2032 will refuse to apply a patch if certain preconditions are not met.
2033 Files to be deleted must already be under version control, and must
2034 not have been scheduled for deletion already.
2035 Files to be added must not yet be under version control and must not
2036 already be present on disk.
2037 Files to be modified must already be under version control and may not
2038 contain conflict markers.
2040 If an error occurs, the
2042 operation will be aborted.
2043 Any changes made to the work tree up to this point will be left behind.
2044 Such changes can be viewed with
2046 and can be reverted with
2055 Attempt to locate files within the specified
2057 for use as a merge-base for 3-way merges.
2061 option is not used then
2063 will attempt to locate merge-bases via object IDs found in
2065 meta-data, such as produced by
2071 option is only recommended in the absence of such meta-data.
2073 Ideally, the specified
2075 should contain versions of files which the changes contained in the
2078 Files will be located by path, relative to the repository root.
2081 option is used then leading path components will be stripped
2082 before paths are looked up in the repository.
2084 In case no merge-base is available for a file, changes will be applied
2085 without doing a 3-way merge.
2086 Changes which do not apply cleanly may then be rejected entirely, rather
2087 than producing merge conflicts in the patched target file.
2091 argument is a commit ID, or a reference name or a keyword
2092 which will be resolved to a commit ID.
2093 An abbreviated hash argument will be expanded to a full commit ID
2094 automatically, provided the abbreviation is unique.
2099 resolve to the work tree's base commit and branch head, respectively.
2100 Keywords and references may be appended with
2104 modifiers and an optional integer N to denote the
2105 Nth descendant or antecedent by first parent traversal, respectively;
2108 denotes the work tree branch head's 2nd generation ancestor, and
2110 denotes the 4th generation descendant of the work tree's base commit.
2113 will denote the 3rd generation descendant of the commit resolved by the
2120 modifier without a trailing integer has an implicit
2129 Do not make any modifications to the work tree.
2130 This can be used to check whether a patch would apply without issues.
2133 contains diffs that affect the same file multiple times, the results
2134 displayed may be incorrect.
2135 .It Fl p Ar strip-count
2136 Specify the number of leading path components to strip from paths
2145 path prefixes generated by
2147 will be recognized and stripped automatically.
2149 Reverse the patch before applying it.
2155 .Op Fl F Ar response-script
2159 Revert any local changes in files at the specified paths in a work tree.
2160 File contents will be overwritten with those contained in the
2161 work tree's base commit.
2162 There is no way to bring discarded changes back after
2165 If a file was added with
2167 it will become an unversioned file again.
2168 If a file was deleted with
2170 it will be restored.
2176 .It Fl F Ar response-script
2184 responses line-by-line from the specified
2186 file instead of prompting interactively.
2188 Instead of reverting all changes in files, interactively select or reject
2189 changes to revert based on
2195 (quit reverting this file) responses.
2196 If a file is in modified status, individual patches derived from the
2197 modified file content can be reverted.
2198 Files in added or deleted status may only be reverted in their entirety.
2200 Permit recursion into directories.
2201 If this option is not specified,
2203 will refuse to run if a specified
2217 Create a new commit in the repository from changes in a work tree
2218 and use this commit as the new base commit for the work tree.
2221 is specified, commit all changes in the work tree.
2222 Otherwise, commit changes at or within the specified paths.
2224 If changes have been explicitly staged for commit with
2226 only commit staged changes and reject any specified paths which
2227 have not been staged.
2230 opens a temporary file in an editor where a log message can be written
2238 options are used together.
2239 Quitting the editor without saving the file will abort the commit operation.
2241 Show the status of each affected file, using the following status codes:
2242 .Bl -column YXZ description
2243 .It M Ta modified file
2244 .It D Ta file was deleted
2245 .It A Ta new file was added
2246 .It m Ta modified file modes (executable bit only)
2249 Files which are not part of the new commit will retain their previously
2250 recorded base commit.
2253 commands may refuse to run while the work tree contains files from
2254 multiple base commits.
2255 The base commit of such a work tree can be made consistent by running
2257 across the entire work tree.
2261 command requires the
2263 environment variable to be set,
2264 unless an author has been configured in
2270 configuration settings can be
2271 obtained from the repository's
2273 file or from Git's global
2282 Set author information in the newly created commit to
2284 This is useful when committing changes on behalf of someone else.
2287 argument must use the same format as the
2289 environment variable.
2291 In addition to storing author information, the newly created commit
2294 information which is obtained, as usual, from the
2296 environment variable, or
2298 or Git configuration settings.
2300 Allow committing files in conflicted status.
2302 Committing files with conflict markers should generally be avoided.
2303 Cases where conflict markers must be stored in the repository for
2304 some legitimate reason should be very rare.
2305 There are usually ways to avoid storing conflict markers verbatim by
2306 applying appropriate programming tricks.
2308 Use the prepared log message stored in the file found at
2310 when creating the new commit.
2312 opens a temporary file in an editor where the prepared log message can be
2313 reviewed and edited further if needed.
2314 Cannot be used together with the
2318 Use the specified log message when creating the new commit.
2319 Cannot be used together with the
2323 This option prevents
2325 from opening the commit message in an editor.
2326 It has no effect unless it is used together with the
2328 option and is intended for non-interactive use such as scripting.
2330 This option prevents
2332 from generating a diff of the to-be-committed changes in a temporary file
2333 which can be viewed while editing a commit message.
2335 Allow the addition of symbolic links which point outside of the path space
2336 that is under version control.
2339 will reject such symbolic links due to safety concerns.
2342 may decide to represent such a symbolic link as a regular file which contains
2343 the link's target path, rather than creating an actual symbolic link which
2344 points outside of the work tree.
2345 Use of this option is discouraged because external mechanisms such as
2347 are better suited for managing symbolic links to paths not under
2352 will refuse to run if certain preconditions are not met.
2353 If the work tree's current branch is not in the
2355 reference namespace, new commits may not be created on this branch.
2356 Local changes may only be committed if they are based on file content
2357 found in the most recent commit on the work tree's branch.
2358 If a path is found to be out of date,
2360 must be used first in order to merge local changes with changes made
2368 .Op Fl i Ar identity-file
2369 .Op Fl J Ar jumphost
2370 .Op Fl r Ar repository-path
2372 .Op Ar remote-repository
2375 Send new changes to a remote repository.
2377 .Ar remote-repository
2381 The remote repository's URL is obtained from the corresponding entry in
2385 file of the local repository, as created by
2388 All objects corresponding to new changes will be written to a temporary
2389 pack file which is then uploaded to the server.
2390 Upon success, references in the
2392 reference namespace of the local repository will be updated to point at
2393 the commits which have been sent.
2395 By default, changes will only be sent if they are based on up-to-date
2396 copies of relevant branches in the remote repository.
2397 If any changes to be sent are based on out-of-date copies or would
2398 otherwise break linear history of existing branches, new changes must
2399 be fetched from the server with
2401 and local branches must be rebased with
2408 option can be used to make exceptions to these requirements.
2415 Send all branches from the local repository's
2417 reference namespace.
2420 option is equivalent to listing all branches with multiple
2423 Cannot be used together with the
2429 from the local repository's
2431 reference namespace.
2432 This option may be specified multiple times to build a list of branches
2434 If this option is not specified, default to the work tree's current branch
2435 if invoked in a work tree, or to the repository's HEAD reference.
2436 Cannot be used together with the
2440 Delete the specified
2442 from the remote repository's
2444 reference namespace.
2445 This option may be specified multiple times to build a list of branches
2448 Only references are deleted.
2449 Any commit, tree, tag, and blob objects belonging to deleted branches
2450 may become subject to deletion by Git's garbage collector running on
2453 Requesting deletion of branches results in an error if the server
2454 does not support this feature or disallows the deletion of branches
2455 based on its configuration.
2457 Attempt to force the server to overwrite existing branches or tags
2458 in the remote repository, even when
2464 would usually be required before changes can be sent.
2465 The server may reject forced requests regardless, depending on its
2468 Any commit, tree, tag, and blob objects belonging to overwritten branches
2469 or tags may become subject to deletion by Git's garbage collector running
2474 reference namespace is globally shared between all repositories.
2477 option to overwrite tags is discouraged because it can lead to
2478 inconsistencies between the tags present in different repositories.
2479 In general, creating a new tag with a different name is recommended
2480 instead of overwriting an existing tag.
2484 option is particularly discouraged if changes being sent are based
2485 on an out-of-date copy of a branch in the remote repository.
2486 Instead of using the
2488 option, new changes should
2491 and local branches should be rebased with
2495 followed by another attempt to send the changes.
2499 option should only be needed in situations where the remote repository's
2500 copy of a branch or tag is known to be out-of-date and is considered
2502 The risks of creating inconsistencies between different repositories
2503 should also be taken into account.
2504 .It Fl i Ar identity-file
2507 containing a private SSH key, to use with SSH connections.
2508 The same option will be passed to
2510 .It Fl J Ar jumphost
2513 to use with SSH connections.
2514 The same option will be passed to
2517 Suppress progress reporting output.
2518 The same option will be passed to
2521 .It Fl r Ar repository-path
2522 Use the repository at the specified path.
2523 If not specified, assume the repository is located at or above the current
2525 If this directory is a
2527 work tree, use the repository path associated with this work tree.
2529 Attempt to send all tags from the local repository's
2531 reference namespace.
2534 option is equivalent to listing all tags with multiple
2537 Cannot be used together with the
2543 from the local repository's
2545 reference namespace, in addition to any branches that are being sent.
2548 option may be specified multiple times to build a list of tags to send.
2549 No tags will be sent if the
2553 Raise an error if the specified
2555 already exists in the remote repository, unless the
2557 option is used to overwrite the server's copy of the tag.
2558 In general, creating a new tag with a different name is recommended
2559 instead of overwriting an existing tag.
2561 Cannot be used together with the
2568 to print debugging messages to standard error output.
2569 The same option will be passed to
2572 Multiple -v options increase the verbosity.
2582 Merge changes from a single
2587 should be on a different branch than the work tree's base commit.
2589 The expected argument is a commit ID, or a reference name or
2590 keyword which will be resolved to a commit ID.
2591 An abbreviated hash argument will be expanded to a full commit ID
2592 automatically, provided the abbreviation is unique.
2597 resolve to the work tree's base commit and branch head, respectively.
2598 Keywords and references may be appended with
2602 modifiers and an optional integer N to denote the
2603 Nth descendant or antecedent by first parent traversal, respectively;
2606 denotes the work tree branch head's 2nd generation ancestor, and
2608 denotes the 4th generation descendant of the work tree's base commit.
2611 will denote the 3rd generation descendant of the commit resolved by the
2618 modifier without a trailing integer has an implicit
2627 Show the status of each affected file, using the following status codes:
2628 .Bl -column YXZ description
2629 .It G Ta file was merged
2630 .It C Ta file was merged and conflicts occurred during merge
2631 .It ! Ta changes destined for a missing file were not merged
2632 .It D Ta file was deleted
2633 .It d Ta file's deletion was prevented by local modifications
2634 .It A Ta new file was added
2635 .It \(a~ Ta changes destined for a non-regular file were not merged
2636 .It ? Ta changes destined for an unversioned file were not merged
2639 The merged changes will appear as local changes in the work tree, which
2642 amended manually or with further
2648 If invoked in a work tree where no
2653 operation is taking place,
2655 creates a record of commits which have been merged into the work tree.
2656 When a file changed by
2660 the log messages of relevant merged commits will then appear in the editor,
2661 where the messages should be further adjusted to convey the reasons for
2662 cherrypicking the changes.
2663 Upon exiting the editor, if the time stamp of the log message file
2664 is unchanged or the log message is empty,
2666 will fail with an unmodified or empty log message error.
2668 If all the changes in all files touched by a given commit are discarded,
2671 this commit's log message record will also disappear.
2674 will refuse to run if certain preconditions are not met.
2675 If the work tree contains multiple base commits, it must first be updated
2676 to a single base commit with
2678 If any relevant files already contain merge conflicts, these
2679 conflicts must be resolved first.
2687 Display a list of commit log messages recorded by cherrypick operations,
2688 represented by references in the
2689 .Dq refs/got/worktree
2690 reference namespace.
2693 is specified, only show the log message of the specified commit.
2695 If invoked in a work tree, only log messages recorded by cherrypick operations
2696 in the current work tree will be displayed.
2697 Otherwise, all commit log messages will be displayed irrespective of the
2698 work tree in which they were created.
2699 This option cannot be used with
2702 Delete log messages created by previous cherrypick operations, represented by
2704 .Dq refs/got/worktree
2705 reference namespace.
2708 is specified, only delete the log message of the specified commit.
2710 If invoked in a work tree, only log messages recorded by cherrypick operations
2711 in the current work tree will be deleted.
2712 Otherwise, all commit log messages will be deleted irrespective of the
2713 work tree in which they were created.
2714 This option cannot be used with
2725 Reverse-merge changes from a single
2730 should be on the same branch as the work tree's base commit.
2732 The expected argument is a commit ID, or a reference name
2733 or keyword which will be resolved to a commit ID.
2734 An abbreviated hash argument will be expanded to a full commit ID
2735 automatically, provided the abbreviation is unique.
2740 resolve to the work tree's base commit and branch head, respectively.
2741 Keywords and references may be appended with
2745 modifiers and an optional integer N to denote the
2746 Nth descendant or antecedent by first parent traversal, respectively;
2749 denotes the work tree branch head's 2nd generation ancestor, and
2751 denotes the 4th generation descendant of the work tree's base commit.
2754 will denote the 5th generation descendant of the commit resolved by the
2761 modifier without a trailing integer has an implicit
2770 Show the status of each affected file, using the following status codes:
2771 .Bl -column YXZ description
2772 .It G Ta file was merged
2773 .It C Ta file was merged and conflicts occurred during merge
2774 .It ! Ta changes destined for a missing file were not merged
2775 .It D Ta file was deleted
2776 .It d Ta file's deletion was prevented by local modifications
2777 .It A Ta new file was added
2778 .It \(a~ Ta changes destined for a non-regular file were not merged
2779 .It ? Ta changes destined for an unversioned file were not merged
2782 The reverse-merged changes will appear as local changes in the work tree,
2783 which may be viewed with
2785 amended manually or with further
2791 If invoked in a work tree where no
2796 operation is taking place,
2798 creates a record of commits which have been reverse-merged into the work tree.
2799 When a file changed by
2803 the log messages of relevant reverse-merged commits will then appear in
2804 the editor, where the messages should be further adjusted to convey the
2805 reasons for backing out the changes.
2806 Upon exiting the editor, if the time stamp of the log message file
2807 is unchanged or the log message is empty,
2809 will fail with an unmodified or empty log message error.
2811 If all the changes in all files touched by a given commit are discarded,
2814 this commit's log message record will also disappear.
2817 will refuse to run if certain preconditions are not met.
2818 If the work tree contains multiple base commits, it must first be updated
2819 to a single base commit with
2821 If any relevant files already contain merge conflicts, these
2822 conflicts must be resolved first.
2830 Display a list of commit log messages recorded by backout operations,
2831 represented by references in the
2832 .Dq refs/got/worktree
2833 reference namespace.
2836 is specified, only show the log message of the specified commit.
2838 If invoked in a work tree, only log messages recorded by backout operations
2839 in the current work tree will be displayed.
2840 Otherwise, all commit log messages will be displayed irrespective of the
2841 work tree in which they were created.
2842 This option cannot be used with
2845 Delete log messages created by previous backout operations, represented by
2847 .Dq refs/got/worktree
2848 reference namespace.
2851 is specified, only delete the log message of the specified commit.
2853 If invoked in a work tree, only log messages recorded by backout operations
2854 in the current work tree will be deleted.
2855 Otherwise, all commit log messages will be deleted irrespective of the
2856 work tree in which they were created.
2857 This option cannot be used with
2868 Rebase commits on the specified
2870 onto the tip of the current branch of the work tree.
2873 must share common ancestry with the work tree's current branch.
2874 Rebasing begins with the first descendant commit of the youngest
2875 common ancestor commit shared by the specified
2877 and the work tree's current branch, and stops once the tip commit
2884 is used as intended, the specified
2886 represents a local commit history and may already contain changes
2887 that are not yet visible in any other repositories.
2888 The work tree's current branch, which must be set with
2892 operation, represents a branch from a remote repository which shares
2893 a common history with the specified
2895 but has progressed, and perhaps diverged, due to commits added to the
2898 Rebased commits are accumulated on a temporary branch which the work tree
2899 will remain switched to throughout the entire rebase operation.
2900 Commits on this branch represent the same changes with the same log
2901 messages as their counterparts on the original
2903 but with different commit IDs.
2904 Once rebasing has completed successfully, the temporary branch becomes
2905 the new version of the specified
2907 and the work tree is automatically switched to it.
2908 If author information is available via the
2910 environment variable,
2916 configuration settings, this author information will be used to identify
2921 Old commits in their pre-rebase state are automatically backed up in the
2922 .Dq refs/got/backup/rebase
2923 reference namespace.
2924 As long as these references are not removed older versions of rebased
2925 commits will remain in the repository and can be viewed with the
2928 Removal of these references makes objects which become unreachable via
2929 any reference subject to removal by Git's garbage collector or
2930 .Cm gotadmin cleanup .
2932 While rebasing commits, show the status of each affected file,
2933 using the following status codes:
2934 .Bl -column YXZ description
2935 .It G Ta file was merged
2936 .It C Ta file was merged and conflicts occurred during merge
2937 .It ! Ta changes destined for a missing file were not merged
2938 .It D Ta file was deleted
2939 .It d Ta file's deletion was prevented by local modifications
2940 .It A Ta new file was added
2941 .It \(a~ Ta changes destined for a non-regular file were not merged
2942 .It ? Ta changes destined for an unversioned file were not merged
2945 If merge conflicts occur, the rebase operation is interrupted and may
2946 be continued once conflicts have been resolved.
2947 If any files with destined changes are found to be missing or unversioned,
2948 or if files could not be deleted due to differences in deleted content,
2949 the rebase operation will be interrupted to prevent potentially incomplete
2950 changes from being committed to the repository without user intervention.
2951 The work tree may be modified as desired and the rebase operation can be
2952 continued once the changes present in the work tree are considered complete.
2953 Alternatively, the rebase operation may be aborted which will leave
2955 unmodified and the work tree switched back to its original branch.
2957 If a merge conflict is resolved in a way which renders the merged
2958 change into a no-op change, the corresponding commit will be elided
2959 when the rebase operation continues.
2962 will refuse to run if certain preconditions are not met.
2967 reference namespace, the branch may not be rebased.
2968 If the work tree is not yet fully updated to the tip commit of its
2969 branch, then the work tree must first be updated with
2971 If changes have been staged with
2973 these changes must first be committed with
2977 If the work tree contains local changes, these changes must first be
2984 contains changes to files outside of the work tree's path prefix,
2985 the work tree cannot be used to rebase this branch.
2994 commands will refuse to run while a rebase operation is in progress.
2995 Other commands which manipulate the work tree may be used for
2996 conflict resolution purposes.
3000 is already based on the work tree's current branch, then no commits
3001 need to be rebased and
3003 will simply switch the work tree to the specified
3005 and update files in the work tree accordingly.
3012 Abort an interrupted rebase operation.
3013 If this option is used, no other command-line arguments are allowed.
3015 Allow a rebase operation to continue with files in conflicted status.
3016 This option should generally be avoided, and can only be used with the
3020 Continue an interrupted rebase operation.
3021 If this option is used, no other command-line arguments are allowed except
3024 Show a list of past rebase operations, represented by references in the
3025 .Dq refs/got/backup/rebase
3026 reference namespace.
3028 Display the author, date, and log message of each backed up commit,
3029 the object ID of the corresponding post-rebase commit, and
3030 the object ID of their common ancestor commit.
3031 Given these object IDs,
3038 options can be used to examine the history of either version of the branch,
3043 option can be used to create a new branch from a pre-rebase state if desired.
3047 is specified, only show commits which at some point in time represented this
3049 Otherwise, list all backed up commits for any branches.
3051 If this option is used,
3053 does not require a work tree.
3054 None of the other options can be used together with
3057 Delete backups created by past rebase operations, represented by references
3059 .Dq refs/got/backup/rebase
3060 reference namespace.
3064 is specified, only delete backups which at some point in time represented
3066 Otherwise, delete all references found within
3067 .Dq refs/got/backup/rebase .
3069 Any commit, tree, tag, and blob objects belonging to deleted backups
3070 remain in the repository and may be removed separately with
3071 Git's garbage collector or
3072 .Cm gotadmin cleanup .
3074 If this option is used,
3076 does not require a work tree.
3077 None of the other options can be used together with
3084 .Op Fl F Ar histedit-script
3088 Edit commit history between the work tree's current base commit and
3089 the tip commit of the work tree's current branch.
3093 command requires the
3095 environment variable to be set,
3096 unless an author has been configured in
3102 configuration settings can be obtained from the repository's
3104 file or from Git's global
3110 operation, the work tree's current branch must be set with
3112 to the branch which should be edited, unless this branch is already the
3113 current branch of the work tree.
3114 The tip of this branch represents the upper bound (inclusive) of commits
3119 Furthermore, the work tree's base commit
3122 to a point in this branch's commit history where editing should begin.
3123 This commit represents the lower bound (non-inclusive) of commits touched
3128 Editing of commit history is controlled via a
3130 which can be written in an editor based on a template, passed on the
3131 command line, or generated with the
3138 Quitting the editor without saving the file will abort the histedit operation.
3140 The format of the histedit script is line-based.
3141 Each line in the script begins with a command name, followed by
3142 whitespace and an argument.
3143 For most commands, the expected argument is a commit ID.
3144 Any remaining text on the line is ignored.
3145 Lines which begin with the
3147 character are ignored entirely.
3149 The available histedit script commands are as follows:
3150 .Bl -column YXZ pick-commit
3151 .It Cm pick Ar commit Ta Use the specified commit as it is.
3152 .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
3153 then interrupt the histedit operation for amending, without creating a commit.
3154 While the histedit operation is interrupted arbitrary files may be edited,
3155 and commands which manipulate the work tree can be used freely.
3160 commands can be used to add new files or remove existing ones.
3163 command can be used to eliminate arbitrary changes from files in the work tree.
3166 command may be used to prepare a subset of changes for inclusion in the
3170 command can be used to insert arbitrary commits into the edited history.
3171 Regular editing of history must eventually be resumed by running
3172 .Cm got histedit -c .
3173 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
3174 listed further below that will be used.
3175 .It Cm drop Ar commit Ta Remove this commit from the edited history.
3176 .It Cm mesg Ar commit Ta Open an editor to create a new log message for this
3180 Every commit in the history being edited must be mentioned in the script.
3181 Lines may be re-ordered to change the order of commits in the edited history.
3182 No commit may be listed more than once.
3184 Edited commits are accumulated on a temporary branch which the work tree
3185 will remain switched to throughout the entire histedit operation.
3186 Once history editing has completed successfully, the temporary branch becomes
3187 the new version of the work tree's branch and the work tree is automatically
3190 Old commits in their pre-histedit state are automatically backed up in the
3191 .Dq refs/got/backup/histedit
3192 reference namespace.
3193 As long as these references are not removed older versions of edited
3194 commits will remain in the repository and can be viewed with the
3197 Removal of these references makes objects which become unreachable via
3198 any reference subject to removal by Git's garbage collector or
3199 .Cm gotadmin cleanup .
3201 While merging commits, show the status of each affected file,
3202 using the following status codes:
3203 .Bl -column YXZ description
3204 .It G Ta file was merged
3205 .It C Ta file was merged and conflicts occurred during merge
3206 .It ! Ta changes destined for a missing file were not merged
3207 .It D Ta file was deleted
3208 .It d Ta file's deletion was prevented by local modifications
3209 .It A Ta new file was added
3210 .It \(a~ Ta changes destined for a non-regular file were not merged
3211 .It ? Ta changes destined for an unversioned file were not merged
3214 If merge conflicts occur, the histedit operation is interrupted and may
3215 be continued once conflicts have been resolved.
3216 If any files with destined changes are found to be missing or unversioned,
3217 or if files could not be deleted due to differences in deleted content,
3218 the histedit operation will be interrupted to prevent potentially incomplete
3219 changes from being committed to the repository without user intervention.
3220 The work tree may be modified as desired and the histedit operation can be
3221 continued once the changes present in the work tree are considered complete.
3222 Alternatively, the histedit operation may be aborted which will leave
3223 the work tree switched back to its original branch.
3225 If a merge conflict is resolved in a way which renders the merged
3226 change into a no-op change, the corresponding commit will be elided
3227 when the histedit operation continues.
3230 will refuse to run if certain preconditions are not met.
3231 If the work tree's current branch is not in the
3233 reference namespace, the history of the branch may not be edited.
3234 If the work tree contains multiple base commits, it must first be updated
3235 to a single base commit with
3237 If changes have been staged with
3239 these changes must first be committed with
3243 If the work tree contains local changes, these changes must first be
3248 If the edited history contains changes to files outside of the work tree's
3249 path prefix, the work tree cannot be used to edit the history of this branch.
3257 commands will refuse to run while a histedit operation is in progress.
3258 Other commands which manipulate the work tree may be used, and the
3260 command may be used to commit arbitrary changes to the temporary branch
3261 while the histedit operation is interrupted.
3268 Abort an interrupted histedit operation.
3269 If this option is used, no other command-line arguments are allowed.
3271 Allow a histedit operation to continue with files in conflicted status.
3272 This option should generally be avoided, and can only be used with the
3276 Continue an interrupted histedit operation.
3277 If this option is used, no other command-line arguments are allowed except
3281 This option is a quick equivalent to a histedit script which drops all
3285 option can only be used when starting a new histedit operation.
3286 If this option is used, no other command-line arguments are allowed.
3288 Interrupt the histedit operation for editing after merging each commit.
3289 This option is a quick equivalent to a histedit script which uses the
3291 command for all commits.
3294 option can only be used when starting a new histedit operation.
3295 If this option is used, no other command-line arguments are allowed.
3296 .It Fl F Ar histedit-script
3299 instead of opening a temporary file in an editor where a histedit script
3302 Fold all commits into a single commit.
3303 This option is a quick equivalent to a histedit script which folds all
3304 commits, combining them all into one commit.
3307 option can only be used when starting a new histedit operation.
3308 If this option is used, no other command-line arguments are allowed.
3310 Show a list of past histedit operations, represented by references in the
3311 .Dq refs/got/backup/histedit
3312 reference namespace.
3314 Display the author, date, and log message of each backed up commit,
3315 the object ID of the corresponding post-histedit commit, and
3316 the object ID of their common ancestor commit.
3317 Given these object IDs,
3324 options can be used to examine the history of either version of the branch,
3329 option can be used to create a new branch from a pre-histedit state if desired.
3333 is specified, only show commits which at some point in time represented this
3335 Otherwise, list all backed up commits for any branches.
3337 If this option is used,
3339 does not require a work tree.
3340 None of the other options can be used together with
3343 Edit log messages only.
3344 This option is a quick equivalent to a histedit script which edits
3345 only log messages but otherwise leaves every picked commit as-is.
3348 option can only be used when starting a new histedit operation.
3349 If this option is used, no other command-line arguments are allowed.
3351 Delete backups created by past histedit operations, represented by references
3353 .Dq refs/got/backup/histedit
3354 reference namespace.
3358 is specified, only delete backups which at some point in time represented
3360 Otherwise, delete all references found within
3361 .Dq refs/got/backup/histedit .
3363 Any commit, tree, tag, and blob objects belonging to deleted backups
3364 remain in the repository and may be removed separately with
3365 Git's garbage collector or
3366 .Cm gotadmin cleanup .
3368 If this option is used,
3370 does not require a work tree.
3371 None of the other options can be used together with
3375 .It Cm integrate Ar branch
3377 Integrate the specified
3379 into the work tree's current branch.
3380 Files in the work tree are updated to match the contents on the integrated
3382 and the reference of the work tree's branch is changed to point at the
3383 head commit of the integrated
3386 Both branches can be considered equivalent after integration since they
3387 will be pointing at the same commit.
3388 Both branches remain available for future work, if desired.
3389 In case the integrated
3391 is no longer needed it may be deleted with
3394 Show the status of each affected file, using the following status codes:
3395 .Bl -column YXZ description
3396 .It U Ta file was updated
3397 .It D Ta file was deleted
3398 .It A Ta new file was added
3399 .It \(a~ Ta versioned file is obstructed by a non-regular file
3400 .It ! Ta a missing versioned file was restored
3404 will refuse to run if certain preconditions are not met.
3405 Most importantly, the
3407 must have been rebased onto the work tree's current branch with
3409 before it can be integrated, in order to linearize commit history and
3410 resolve merge conflicts.
3411 If the work tree contains multiple base commits, it must first be updated
3412 to a single base commit with
3414 If changes have been staged with
3416 these changes must first be committed with
3420 If the work tree contains local changes, these changes must first be
3434 into the current branch of the work tree.
3435 If the branches have diverged, merge changes into the work tree
3436 and create a merge commit.
3437 Otherwise, if the specified
3439 is already based on the work tree's current branch, make the work tree's
3440 current branch equivalent to the specified
3442 and update files in the work tree accordingly.
3444 Merge commits are commits based on multiple parent commits.
3445 The tip commit of the work tree's current branch will be used as the
3447 The tip commit of the specified
3449 will be used as the second parent.
3450 The work tree's current branch
3453 reference namespace and can be set with
3459 No ancestral relationship between the two branches is required.
3460 If the two branches have already been merged previously, only new changes
3463 It is not possible to create merge commits with more than two parents.
3464 If more than one branch needs to be merged, then multiple merge commits
3465 with two parents each can be created in sequence.
3467 If a linear project history is desired, then use of
3469 should generally be preferred over
3471 However, even strictly linear projects may require occasional merge commits,
3472 for example in order to merge in new versions of third-party code stored
3475 branches created with
3478 While merging changes found on the
3480 into the work tree, show the status of each affected file,
3481 using the following status codes:
3482 .Bl -column YXZ description
3483 .It U Ta file was updated
3484 .It G Ta file was merged
3485 .It C Ta file was merged and conflicts occurred during merge
3486 .It ! Ta changes destined for a missing file were not merged
3487 .It D Ta file was deleted
3488 .It d Ta file's deletion was prevented by local modifications
3489 .It A Ta new file was added
3490 .It \(a~ Ta changes destined for a non-regular file were not merged
3491 .It ? Ta changes destined for an unversioned file were not merged
3494 If merge conflicts occur, the merge operation is interrupted and conflicts
3495 must be resolved before the merge operation can continue.
3496 If any files with destined changes are found to be missing or unversioned,
3497 or if files could not be deleted due to differences in deleted content,
3498 the merge operation will be interrupted to prevent potentially incomplete
3499 changes from being committed to the repository without user intervention.
3500 The work tree may be modified as desired and the merge can be continued
3501 once the changes present in the work tree are considered complete.
3502 Alternatively, the merge operation may be aborted which will leave
3503 the work tree's current branch unmodified.
3506 will refuse to run if certain preconditions are not met.
3507 If the work tree's current branch is not in the
3509 reference namespace then the work tree must first be switched to a
3514 If the work tree is not yet fully updated to the tip commit of its
3515 branch, then the work tree must first be updated with
3517 If the work tree contains multiple base commits, it must first be updated
3518 to a single base commit with
3520 If changes have been staged with
3522 these changes must first be committed with
3526 If the work tree contains local changes, these changes must first be
3533 contains changes to files outside of the work tree's path prefix,
3534 the work tree cannot be used to merge this branch.
3544 commands will refuse to run while a merge operation is in progress.
3545 Other commands which manipulate the work tree may be used for
3546 conflict resolution purposes.
3553 Abort an interrupted merge operation.
3554 If this option is used, no other command-line arguments are allowed.
3556 Allow a merge operation to continue with files in conflicted status.
3557 This option should generally be avoided, and can only be used with the
3561 Continue an interrupted merge operation.
3562 If this option is used, no other command-line arguments are allowed except
3565 Create a merge commit even if the branches have not diverged.
3567 Merge changes into the work tree as usual but do not create a merge
3569 The merge result can be adjusted as desired before a merge commit is
3572 Alternatively, the merge may be aborted with
3579 .Op Fl F Ar response-script
3583 Stage local changes for inclusion in the next commit.
3586 is specified, stage all changes in the work tree.
3587 Otherwise, stage changes at or within the specified paths.
3588 Paths may be staged if they are added, modified, or deleted according to
3591 Show the status of each affected file, using the following status codes:
3592 .Bl -column YXZ description
3593 .It A Ta file addition has been staged
3594 .It M Ta file modification has been staged
3595 .It D Ta file deletion has been staged
3598 Staged file contents are saved in newly created blob objects in the repository.
3599 These blobs will be referred to by tree objects once staged changes have been
3602 Staged changes affect the behaviour of
3607 While paths with staged changes exist, the
3609 command will refuse to commit any paths which do not have staged changes.
3610 Local changes created on top of staged changes can only be committed if
3611 the path is staged again, or if the staged changes are committed first.
3614 command will show both local changes and staged changes.
3617 command is able to display local changes relative to staged changes,
3618 and to display staged changes relative to the repository.
3621 command cannot revert staged changes but may be used to revert
3622 local changes created on top of staged changes.
3628 .It Fl F Ar response-script
3636 responses line-by-line from the specified
3638 file instead of prompting interactively.
3640 Instead of staging new changes, list paths which are already staged,
3641 along with the IDs of staged blob objects and stage status codes.
3642 If paths were provided on the command line, show the staged paths
3643 among the specified paths.
3644 Otherwise, show all staged paths.
3646 Instead of staging the entire content of a changed file, interactively
3647 select or reject changes for staging based on
3651 (reject change), and
3653 (quit staging this file) responses.
3654 If a file is in modified status, individual patches derived from the
3655 modified file content can be staged.
3656 Files in added or deleted status may only be staged or rejected in
3659 Allow staging of symbolic links which point outside of the path space
3660 that is under version control.
3663 will reject such symbolic links due to safety concerns.
3666 may decide to represent such a symbolic link as a regular file which contains
3667 the link's target path, rather than creating an actual symbolic link which
3668 points outside of the work tree.
3669 Use of this option is discouraged because external mechanisms such as
3671 are better suited for managing symbolic links to paths not under
3676 will refuse to run if certain preconditions are not met.
3677 If a file contains merge conflicts, these conflicts must be resolved first.
3678 If a file is found to be out of date relative to the head commit on the
3679 work tree's current branch, the file must be updated with
3681 before it can be staged (however, this does not prevent the file from
3682 becoming out-of-date at some point after having been staged).
3690 commands will refuse to run while staged changes exist.
3691 If staged changes cannot be committed because a staged path
3692 is out of date, the path must be unstaged with
3694 before it can be updated with
3696 and may then be staged again if necessary.
3701 .Op Fl F Ar response-script
3705 Merge staged changes back into the work tree and put affected paths
3706 back into non-staged status.
3709 is specified, unstage all staged changes across the entire work tree.
3710 Otherwise, unstage changes at or within the specified paths.
3712 Show the status of each affected file, using the following status codes:
3713 .Bl -column YXZ description
3714 .It G Ta file was unstaged
3715 .It C Ta file was unstaged and conflicts occurred during merge
3716 .It ! Ta changes destined for a missing file were not merged
3717 .It D Ta file was staged as deleted and still is deleted
3718 .It d Ta file's deletion was prevented by local modifications
3719 .It \(a~ Ta changes destined for a non-regular file were not merged
3726 .It Fl F Ar response-script
3734 responses line-by-line from the specified
3736 file instead of prompting interactively.
3738 Instead of unstaging the entire content of a changed file, interactively
3739 select or reject changes for unstaging based on
3743 (keep change staged), and
3745 (quit unstaging this file) responses.
3746 If a file is staged in modified status, individual patches derived from the
3747 staged file content can be unstaged.
3748 Files staged in added or deleted status may only be unstaged in their entirety.
3754 .Op Fl r Ar repository-path
3757 Parse and print contents of objects to standard output in a line-based
3759 Content of commit, tree, and tag objects is printed in a way similar
3760 to the actual content stored in such objects.
3761 Blob object contents are printed as they would appear in files on disk.
3763 Attempt to interpret each argument as a reference, a tag name, or
3765 References will be resolved to an object ID.
3766 Tag names will resolved to a tag object.
3767 An abbreviated hash argument will be expanded to a full commit ID
3768 automatically, provided the abbreviation is unique.
3770 If none of the above interpretations produce a valid result, or if the
3772 option is used, attempt to interpret the argument as a path which will
3773 be resolved to the ID of an object found at this path in the repository.
3780 Look up paths in the specified
3782 If this option is not used, paths are looked up in the commit resolved
3783 via the repository's HEAD reference.
3785 The expected argument is a commit ID, or a reference name
3786 or keyword which will be resolved to a commit ID.
3787 An abbreviated hash argument will be expanded to a full commit ID
3788 automatically, provided the abbreviation is unique.
3793 resolve to the work tree's base commit and branch head, respectively.
3794 The former is only valid if invoked in a work tree, while the latter will
3795 resolve to the tip of the work tree's current branch if invoked in a
3796 work tree, otherwise it will resolve to the repository's HEAD reference.
3797 Keywords and references may be appended with
3801 modifiers and an optional integer N to denote the
3802 Nth descendant or antecedent by first parent traversal, respectively;
3805 denotes the work tree branch head's 2nd generation ancestor, and
3807 denotes the 4th generation descendant of the work tree's base commit.
3810 will denote the 8th generation ancestor of the commit resolved by the
3817 modifier without a trailing integer has an implicit
3826 Interpret all arguments as paths only.
3827 This option can be used to resolve ambiguity in cases where paths
3828 look like tag names, reference names, or object IDs.
3829 .It Fl r Ar repository-path
3830 Use the repository at the specified path.
3831 If not specified, assume the repository is located at or above the current
3833 If this directory is a
3835 work tree, use the repository path associated with this work tree.
3837 .It Cm info Op Ar path ...
3838 Display meta-data stored in a work tree.
3843 The work tree to use is resolved implicitly by walking upwards from the
3844 current working directory.
3848 arguments are specified, show additional per-file information for tracked
3849 files located at or within these paths.
3852 argument corresponds to the work tree's root directory, display information
3853 for all tracked files.
3856 .Bl -tag -width GOT_IGNORE_GITCONFIG
3858 The author's name and email address, such as
3859 .Qq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3870 may fail to parse commits without an email address in author data,
3874 environment variables with a missing email address.
3876 .Ev GOT_AUTHOR will be overridden by configuration settings in
3882 configuration settings in the repository's
3889 configuration settings contained in Git's global
3891 configuration file will only be used if neither
3895 environment variable provide author information.
3896 .It Ev GOT_IGNORE_GITCONFIG
3897 If this variable is set then any remote repository definitions or author
3898 information found in Git configuration files will be ignored.
3899 .It Ev GOT_LOG_DEFAULT_LIMIT
3900 The default limit on the number of commits traversed by
3902 If set to zero, the limit is unbounded.
3903 This variable will be silently ignored if it is set to a non-numeric value.
3904 .It Ev VISUAL , EDITOR
3905 The editor spawned by
3913 text editor will be spawned.
3916 .Bl -tag -width packed-refs -compact
3918 Repository-wide configuration settings for
3922 configuration file located in the root directory of a Git repository
3923 supersedes any relevant settings in Git's
3927 .It Pa .got/got.conf
3928 Worktree-specific configuration settings for
3932 configuration file in the
3934 meta-data directory of a work tree supersedes any relevant settings in
3937 configuration file and Git's
3944 Enable tab-completion of
3949 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3951 Clone an existing Git repository for use with
3955 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3957 Unfortunately, many of the popular Git hosting sites do not offer anonymous
3959 Such sites will require an account to be created, and a public SSH key to be
3960 uploaded to this account, before repository access via ssh:// URLs will work.
3962 Most sites offer anonymous repository access via HTTPS:
3965 .Dl $ got clone https://github.com/openbsd/src.git
3967 Alternatively, for quick and dirty local testing of
3969 a new Git repository could be created and populated with files,
3970 e.g. from a temporary CVS checkout located at
3973 .Dl $ got init /var/git/src.git
3974 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3976 Check out a work tree from the Git repository to /usr/src:
3978 .Dl $ got checkout /var/git/src.git /usr/src
3980 View local changes in a work tree directory:
3982 .Dl $ got diff | less
3984 In a work tree, display files in a potentially problematic state:
3986 .Dl $ got status -s 'C!~?'
3988 Interactively revert selected local changes in a work tree directory:
3990 .Dl $ got revert -p -R\ .
3992 In a work tree or a git repository directory, list all branch references:
3996 As above, but list the most recently modified branches only:
3998 .Dl $ got branch -lt | head
4000 In a work tree or a git repository directory, create a new branch called
4001 .Dq unified-buffer-cache
4002 which is forked off the
4006 .Dl $ got branch -c master unified-buffer-cache
4008 Switch an existing work tree to the branch
4009 .Dq unified-buffer-cache .
4010 Local changes in the work tree will be preserved and merged if necessary:
4012 .Dl $ got update -b unified-buffer-cache
4014 Create a new commit from local changes in a work tree directory.
4015 This new commit will become the head commit of the work tree's current branch:
4019 In a work tree or a git repository directory, view changes committed in
4020 the 3 most recent commits to the work tree's branch, or the branch resolved
4021 via the repository's HEAD reference, respectively:
4023 .Dl $ got log -p -l 3
4025 As above, but display changes in the order in which
4027 could apply them in sequence:
4029 .Dl $ got log -p -l 3 -R
4031 In a work tree or a git repository directory, log the history of a subdirectory:
4033 .Dl $ got log sys/uvm
4035 While operating inside a work tree, paths are specified relative to the current
4036 working directory, so this command will log the subdirectory
4039 .Dl $ cd sys/uvm && got log\ .
4041 And this command has the same effect:
4043 .Dl $ cd sys/dev/usb && got log ../../uvm
4045 And this command displays work tree meta-data about all tracked files:
4048 .Dl $ got info\ . | less
4050 Add new files and remove obsolete files in a work tree directory:
4052 .Dl $ got add sys/uvm/uvm_ubc.c
4053 .Dl $ got remove sys/uvm/uvm_vnode.c
4055 A file can be renamed or moved by removing it from its old location
4056 and adding it at the new location:
4058 .Dl $ cp oldfile.c newfile.c
4059 .Dl $ got remove oldfile.c
4060 .Dl $ got add newfile.c
4063 does not yet follow file history across renames, but
4065 will be able to do so regardless.
4067 Create a new commit from local changes in a work tree directory
4068 with a pre-defined log message.
4070 .Dl $ got commit -m 'unify the buffer cache'
4072 Alternatively, create a new commit from local changes in a work tree
4073 directory with a log message that has been prepared in the file
4076 .Dl $ got commit -F /tmp/msg
4078 Update any work tree checked out from the
4079 .Dq unified-buffer-cache
4080 branch to the latest commit on this branch:
4084 Roll file content on the unified-buffer-cache branch back by one commit,
4085 and then fetch the rolled-back change into the work tree as a local change
4086 to be amended and perhaps committed again:
4088 .Dl $ got backout unified-buffer-cache
4089 .Dl $ got commit -m 'roll back previous'
4090 .Dl $ # now back out the previous backout :-)
4091 .Dl $ got backout unified-buffer-cache
4093 Fetch new changes on the remote repository's
4095 branch, making them visible on the local repository's
4104 branch to merge the new changes that are now visible on the
4109 .Dl $ got update -b origin/master
4110 .Dl $ got rebase master
4113 .Dq unified-buffer-cache
4114 branch on top of the new head commit of the
4118 .Dl $ got update -b master
4119 .Dl $ got rebase unified-buffer-cache
4121 Create a patch from all changes on the unified-buffer-cache branch.
4122 The patch can be mailed out for review and applied to
4126 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
4128 Edit the entire commit history of the
4129 .Dq unified-buffer-cache
4132 .Dl $ got update -b unified-buffer-cache
4133 .Dl $ got update -c master
4136 Before working against existing branches in a repository cloned with
4137 .Cm git clone --bare
4142 must be configured to map all references in the remote repository
4145 namespace of the local repository.
4146 This can be achieved by setting Git's
4147 .Pa remote.origin.fetch
4148 configuration variable to the value
4149 .Dq +refs/heads/*:refs/remotes/origin/*
4154 .Dl $ cd /var/git/repo
4155 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
4159 option must be disabled:
4161 .Dl $ cd /var/git/repo
4162 .Dl $ git config remote.origin.mirror false
4164 Alternatively, the following
4166 configuration item can be added manually to the Git repository's
4170 .Dl [remote \&"origin\&"]
4172 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
4175 This configuration leaves the local repository's
4177 namespace free for use by local branches checked out with
4179 and, if needed, created with
4182 .Dq refs/remotes/origin
4183 namespace can now be updated with incoming changes from the remote
4188 without extra command line arguments.
4189 Newly fetched changes can be examined with
4192 Display changes on the remote repository's version of the
4194 branch, as of the last time
4198 .Dl $ got log -c origin/master | less
4200 As shown here, most commands accept abbreviated reference names such as
4203 .Dq refs/remotes/origin/master .
4204 The latter is only needed in case of ambiguity.
4207 can be used to merge changes which are visible on the
4212 This will also merge local changes, if any, with the incoming changes:
4214 .Dl $ got update -b origin/master
4215 .Dl $ got rebase master
4217 In order to make changes committed to the
4218 .Dq unified-buffer-cache
4222 .Dq unified-buffer-cache
4223 branch can be rebased onto the
4227 .Dl $ got update -b master
4228 .Dl $ got rebase unified-buffer-cache
4231 .Dq unified-buffer-cache
4232 branch can now be made visible on the
4236 Because the rebase operation switched the work tree to the
4237 .Dq unified-buffer-cache
4238 branch, the work tree must be switched back to the
4242 .Dl $ got update -b master
4243 .Dl $ got integrate unified-buffer-cache
4247 branch, log messages for local changes can now be amended with
4249 by other developers and any other important new information:
4251 .Dl $ got update -c origin/master
4252 .Dl $ got histedit -m
4254 If the remote repository offers write access, local changes on the
4256 branch can be sent to the remote repository with
4260 can be run without further arguments.
4261 The arguments shown here match defaults, provided the work tree's
4262 current branch is the
4266 .Dl $ got send -b master origin
4268 If the remote repository requires the HTTPS protocol, the
4270 command must be used instead:
4272 .Dl $ cd /var/git/src.git
4273 .Dl $ git push origin master
4275 When making contributions to projects which use the
4277 workflow, SSH protocol repository access needs to be set up first.
4278 Once an account has been created on a Git hosting site it should
4279 be possible to upload a public SSH key for repository access
4284 workflow will usually involve two remote repositories.
4285 In the real-life example below, the
4287 repository was forked from the
4289 repository by using the Git hosting site's web interface.
4292 file in the local repository describes both remote repositories:
4293 .Bd -literal -offset indent
4294 # Jelmers's repository, which accepts pull requests
4296 server git@github.com
4298 repository "/jelmer/dulwich"
4302 # Stefan's fork, used as the default remote repository
4304 server git@github.com
4306 repository "/stspdotname/dulwich"
4311 With this configuration, Stefan can create commits on
4312 .Dq refs/heads/master
4313 and send them to the
4315 repository by running:
4317 .Dl $ got send -b master origin
4319 The changes can now be proposed to Jelmer by opening a pull request
4320 via the Git hosting site's web interface.
4321 If Jelmer requests further changes to be made, additional commits
4322 can be created on the
4324 branch and be added to the pull request by running
4328 If Jelmer prefers additional commits to be
4330 then the following commands can be used to achieve this:
4332 .Dl $ got update -b master
4333 .Dl $ got update -c origin/master
4334 .Dl $ got histedit -f
4335 .Dl $ got send -f -b master origin
4337 In addition to reviewing the pull request in the web user interface,
4338 Jelmer can fetch the pull request's branch into his local repository
4339 and create a local branch which contains the proposed changes:
4341 .Dl $ got fetch -R refs/pull/1046/head origin
4342 .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
4344 Once Jelmer has accepted the pull request, Stefan can fetch the
4345 merged changes, and possibly several other new changes, by running:
4347 .Dl $ got fetch upstream
4349 The merged changes will now be visible under the reference
4350 .Dq refs/remotes/upstream/master .
4353 branch can now be rebased on top of the latest changes
4356 .Dl $ got update -b upstream/master
4357 .Dl $ got rebase master
4359 As an alternative to
4361 branches can be merged with
4364 .Dl $ got update -b master
4365 .Dl $ got merge upstream/master
4367 The question of whether to rebase or merge branches is philosophical.
4368 When in doubt, refer to the software project's policies set by project
4371 As a final step, the forked repository's copy of the master branch needs
4372 to be kept in sync by sending the new changes there:
4374 .Dl $ got send -f -b master origin
4376 If multiple pull requests need to be managed in parallel, a separate branch
4377 must be created for each pull request with
4379 Each such branch can then be used as above, in place of
4380 .Dq refs/heads/master .
4381 Changes for any accepted pull requests will still appear under
4382 .Dq refs/remotes/upstream/master,
4383 regardless of which branch was used in the forked repository to
4384 create a pull request.
4388 .Xr git-repository 5 ,
4389 .Xr got-worktree 5 ,
4393 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
4394 .An Christian Weisgerber Aq Mt naddy@openbsd.org
4395 .An Florian Obser Aq Mt florian@narrans.de
4396 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
4397 .An James Cook Aq Mt falsifian@falsifian.org
4398 .An Jasper Lievisse Adriaanse Aq Mt j@jasper.la
4399 .An Josh Rickmar Aq Mt jrick@zettaport.com
4400 .An Joshua Stein Aq Mt jcs@openbsd.org
4401 .An Josiah Frentsos Aq Mt jfrent@tilde.team
4402 .An Klemens Nanni Aq Mt kn@openbsd.org
4403 .An Kyle Ackerman Aq Mt kackerman0102@gmail.com
4404 .An Lorenz (xha) Aq Mt me@xha.li
4405 .An Lucas Gabriel Vuotto Aq Mt lucas@sexy.is
4406 .An Mark Jamsek Aq Mt mark@jamsek.dev
4407 .An Martin Pieuchot Aq Mt mpi@openbsd.org
4408 .An Mikhail Pchelin Aq Mt misha@freebsd.org
4409 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
4410 .An Omar Polo Aq Mt op@openbsd.org
4411 .An Ori Bernstein Aq Mt ori@openbsd.org
4412 .An Sebastien Marie Aq Mt semarie@openbsd.org
4413 .An Stefan Sperling Aq Mt stsp@openbsd.org
4414 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
4415 .An Ted Unangst Aq Mt tedu@tedunangst.com
4416 .An Theo Buehler Aq Mt tb@openbsd.org
4417 .An Thomas Adam Aq Mt thomas@xteddy.org
4418 .An Tobias Heider Aq Mt me@tobhe.de
4419 .An Tom Jones Aq Mt thj@freebsd.org
4420 .An Tracey Emery Aq Mt tracey@traceyemery.net
4421 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
4429 were derived from code under copyright by:
4431 .An Bjoern Hoehrmann
4432 .An Caldera International
4433 .An Daniel Hartmeier
4440 .An Jean-Francois Brousseau
4448 .An Niklas Hallqvist
4455 .An Xavier Santolaria
4458 contains code contributed to the public domain by
4459 .An Austin Appleby .
4462 is a work-in-progress and some features remain to be implemented.
4464 At present, the user has to fall back on
4466 to perform some tasks.
4470 With repositories that use the sha256 object ID hashing algorithm,
4472 is currently required for all network operations (clone, fetch, and push)
4475 does not yet support version 2 of the Git network protocol.
4477 Writing to remote repositories over HTTP or HTTPS protocols requires
4480 The creation of merge commits with more than two parent commits requires
4483 In situations where files or directories were moved around
4485 will not automatically merge changes to new locations and
4487 will usually produce better results.