2 .\" Copyright (c) 2017 Martin Pieuchot
3 .\" Copyright (c) 2018, 2019, 2020 Stefan Sperling
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
30 is a version control system which stores the history of tracked files
31 in a Git repository, as used by the Git version control system.
32 This repository format is described in
33 .Xr git-repository 5 .
38 version control system because every copy of a repository is writeable.
39 Modifications made to files can be synchronized between repositories
44 must be checked out from the repository for modification.
45 Checked out files are stored in a
47 which can be placed at an arbitrary directory in the filesystem hierarchy.
48 The on-disk format of this work tree is described in
52 provides global and command-specific options.
53 Global options must precede the command name, and are as follows:
54 .Bl -tag -width tenletters
56 Display usage information and exit immediately.
58 Display program version and exit immediately.
64 .Bl -tag -width checkout
71 .Op Fl r Ar repository-path
75 Create an initial commit in a repository from the file hierarchy
78 The created commit will not have any parent commits, i.e. it will be a
80 Also create a new reference which provides a branch name for the newly
82 Show the path of each imported file to indicate progress.
88 environment variable to be set,
89 unless an author has been configured in
95 configuration settings can be obtained from the repository's
97 file or from Git's global
108 If this option is not specified, a branch corresponding to the repository's
109 HEAD reference will be used.
110 Use of this option is required if the branch resolved via the repository's
111 HEAD reference already exists.
113 Ignore files or directories with a name which matches the specified
115 This option may be specified multiple times to build a list of ignore patterns.
118 follows the globbing rules documented in
120 Ignore patterns which end with a slash,
122 will only match directories.
124 Use the specified log message when creating the new commit.
129 opens a temporary file in an editor where a log message can be written.
130 Quitting the editor without saving the file will abort the import operation.
131 .It Fl r Ar repository-path
132 Use the repository at the specified path.
133 If not specified, assume the repository is located at or above the current
141 .Op Fl R Ar reference
146 Clone a Git repository at the specified
152 is specified, the directory name will be derived from the name of the
155 will refuse to run if the
161 specifies a protocol scheme, a server hostname, an optional port number
162 separated from the hostname by a colon, and a path to the repository on
164 .Lk scheme://hostname:port/path/to/repository
166 The following protocol schemes are supported:
167 .Bl -tag -width https
169 The Git protocol as implemented by the
172 Use of this protocol is discouraged since it supports neither authentication
175 The Git protocol wrapped in an authenticated and encrypted
178 With this protocol the hostname may contain an embedded username for
186 Not compatible with servers using the
192 Git HTTP protocol is supported by
198 Sending from a repository cloned over HTTP will require use of a
204 protocol will be used by
207 Use of this protocol is discouraged since it supports neither authentication
212 Git HTTP protocol wrapped in SSL/TLS.
215 Objects in the cloned repository are stored in a pack file which is downloaded
217 This pack file will then be indexed to facilitate access to the objects stored
219 If any objects in the pack file are stored in deltified form, all deltas will
220 be fully resolved in order to compute the ID of such objects.
221 This can take some time.
222 More details about the pack file format are documented in
223 .Xr git-repository 5 .
226 creates a remote repository entry in the
230 files of the cloned repository to store the
236 arguments for future use by
246 Fetch all branches from the remote repository's
248 reference namespace and set
249 .Cm fetch_all_branches
250 in the cloned repository's
252 file for future use by
254 If this option is not specified, a branch resolved via the remote
255 repository's HEAD reference will be fetched.
256 Cannot be used together with the
262 from the remote repository's
265 This option may be specified multiple times to build a list of branches
267 If the branch corresponding to the remote repository's HEAD reference is not
268 in this list, the cloned repository's HEAD reference will be set to the first
269 branch which was fetched.
270 If this option is not specified, a branch resolved via the remote
271 repository's HEAD reference will be fetched.
272 Cannot be used together with the
276 List branches and tags available for fetching from the remote repository
277 and exit immediately.
278 Cannot be used together with any of the other options except
283 Create the cloned repository as a mirror of the original repository.
284 This is useful if the cloned repository will not be used to store
285 locally created commits.
291 files will be set up with the
293 option enabled, such that
297 will write incoming changes directly to branches in the
299 reference namespace, rather than to branches in the
302 This avoids the usual requirement of having to run
308 in order to make incoming changes appear on branches in the
311 But maintaining custom changes in the cloned repository becomes difficult
312 since such changes will be at risk of being discarded whenever incoming
315 Suppress progress reporting output.
316 The same option will be passed to
319 .It Fl R Ar reference
320 In addition to the branches and tags that will be fetched, fetch an arbitrary
322 from the remote repository's
325 This option may be specified multiple times to build a list of additional
329 may either be a path to a specific reference, or a reference namespace
330 which will cause all references in this namespace to be fetched.
332 Each reference will be mapped into the cloned repository's
334 namespace, unless the
336 option is used to mirror references directly into the cloned repository's
341 will refuse to fetch references from the remote repository's
350 to print debugging messages to standard error output.
351 This option will be passed to
354 Multiple -v options increase the verbosity.
362 .Op Fl R Ar reference
363 .Op Fl r Ar repository-path
364 .Op Ar remote-repository
367 Fetch new changes from a remote repository.
369 .Ar remote-repository
373 The remote repository's URL is obtained from the corresponding entry in
377 file of the local repository, as created by
380 By default, any branches configured in
383 .Ar remote-repository
387 is invoked in a work tree then this work tree's current branch will be
388 fetched, too, provided it is present on the server.
389 If no branches to fetch can be found in
391 or via a work tree, or said branches are not found on the server, a branch
392 resolved via the remote repository's HEAD reference will be fetched.
393 Likewise, if a HEAD reference for the
394 .Ar remote-repository
395 exists but its target no longer matches the remote HEAD, then
396 the new target branch will be fetched.
397 This default behaviour can be overridden with the
403 New changes will be stored in a separate pack file downloaded from the server.
404 Optionally, separate pack files stored in the repository can be combined with
407 By default, branch references in the
409 reference namespace will be updated to point at the newly fetched commits.
414 command can then be used to make new changes visible on branches in the
416 namespace, merging incoming changes with the changes on those branches
419 If the repository was created as a mirror with
421 then all branches in the
423 namespace will be updated directly to match the corresponding branches in
424 the remote repository.
425 If those branches contained local commits, these commits will no longer be
426 reachable via a reference and will therefore be at risk of being discarded
427 by Git's garbage collector or
428 .Cm gotadmin cleanup .
429 Maintaining custom changes in a mirror repository is therefore discouraged.
431 In any case, references in the
433 namespace will always be fetched and mapped directly to local references
434 in the same namespace.
441 Fetch all branches from the remote repository's
444 This option can be enabled by default for specific repositories in
446 Cannot be used together with the
452 from the remote repository's
455 This option may be specified multiple times to build a list of branches
457 Cannot be used together with the
461 Delete branches and tags from the local repository which are no longer
462 present in the remote repository.
463 Only references are deleted.
464 Any commit, tree, tag, and blob objects belonging to deleted branches or
465 tags remain in the repository and may be removed separately with
466 Git's garbage collector or
467 .Cm gotadmin cleanup .
469 List branches and tags available for fetching from the remote repository
470 and exit immediately.
471 Cannot be used together with any of the other options except
477 Suppress progress reporting output.
478 The same option will be passed to
481 .It Fl R Ar reference
482 In addition to the branches and tags that will be fetched, fetch an arbitrary
484 from the remote repository's
487 This option may be specified multiple times to build a list of additional
491 may either be a path to a specific reference, or a reference namespace
492 which will cause all references in this namespace to be fetched.
494 Each reference will be mapped into the local repository's
496 namespace, unless the local repository was created as a mirror with
498 in which case references will be mapped directly into the local repository's
502 Once a reference has been fetched, a branch based on it can be created with
507 will refuse to fetch references from the remote repository's
512 .It Fl r Ar repository-path
513 Use the repository at the specified path.
514 If not specified, assume the repository is located at or above the current
516 If this directory is a
518 work tree, use the repository path associated with this work tree.
520 Allow existing references in the
522 namespace to be updated if they have changed on the server.
523 If not specified, only new tag references will be created.
528 to print debugging messages to standard error output.
529 The same option will be passed to
532 Multiple -v options increase the verbosity.
535 Delete all references which correspond to a particular
536 .Ar remote-repository
537 instead of fetching new changes.
538 This can be useful when a remote repository is being removed from
544 .Ar remote-repository
545 argument is mandatory and no other options except
552 Only references are deleted.
553 Any commit, tree, tag, and blob objects fetched from a remote repository
554 will generally be stored in pack files and may be removed separately with
556 and Git's garbage collector.
564 .Op Fl p Ar path-prefix
566 .Op Ar work-tree-path
569 Copy files from a repository into a new work tree.
570 Show the status of each affected file, using the following status codes:
571 .Bl -column YXZ description
572 .It A Ta new file was added
573 .It E Ta file already exists in work tree's meta-data
578 is not specified, either use the last component of
579 .Ar repository path ,
582 was specified use the last component of
590 Check out files from a commit on the specified
592 If this option is not specified, a branch resolved via the repository's HEAD
593 reference will be used.
595 Check out files from the specified
597 on the selected branch.
598 If this option is not specified, the most recent commit on the selected
603 argument is a commit ID SHA1 hash, or a reference name or a keyword
604 which will be resolved to a commit ID.
605 An abbreviated hash argument will be expanded to a full SHA1 hash
606 automatically, provided the abbreviation is unique.
611 resolve to the repository's HEAD reference, or, if the
613 option is used, the head of the checked-out
615 Keywords and reference names may be appended with
619 modifiers and an optional integer N to denote the
620 Nth descendant or antecedent by first parent traversal, respectively;
623 denotes the work tree branch head's 2nd generation ancestor, and
625 will denote the 3rd generation ancestor of the commit resolved by the
628 If an integer does not follow the
634 is implicitly appended
643 is not contained in the selected branch, a different branch which contains
644 this commit must be specified with the
647 If no such branch is known, a new branch must be created for this
653 Checking out work trees with an unknown branch is intentionally not supported.
655 Proceed with the checkout operation even if the directory at
658 Existing files will be left intact.
659 .It Fl p Ar path-prefix
660 Restrict the work tree to a subset of the repository's tree hierarchy.
661 Only files beneath the specified
665 Silence progress output.
676 Update an existing work tree to a different
678 Change existing files in the work tree as necessary to match file contents
680 Preserve any local changes in the work tree and merge them with the
683 Files which already contain merge conflicts will not be updated to avoid
684 further complications.
685 Such files will be updated when
687 is run again after merge conflicts have been resolved.
688 If the conflicting changes are no longer needed, affected files can be
695 Show the status of each affected file, using the following status codes:
696 .Bl -column YXZ description
697 .It U Ta file was updated and contained no local changes
698 .It G Ta file was updated and local changes were merged cleanly
699 .It C Ta file was updated and conflicts occurred during merge
700 .It D Ta file was deleted
701 .It d Ta file's deletion was prevented by local modifications
702 .It A Ta new file was added
703 .It \(a~ Ta versioned file is obstructed by a non-regular file
704 .It ! Ta a missing versioned file was restored
705 .It # Ta file was not updated because it contains merge conflicts
706 .It ? Ta changes destined for an unversioned file were not merged
711 is specified, update the entire work tree.
712 Otherwise, restrict the update operation to files at or within the
714 Each path is required to exist in the update operation's target commit.
715 Files in the work tree outside specified paths will remain unchanged and
716 will retain their previously recorded base commit.
719 commands may refuse to run while the work tree contains files from
720 multiple base commits.
721 The base commit of such a work tree can be made consistent by running
723 across the entire work tree.
726 is incompatible with the
731 cannot update paths with staged changes.
732 If changes have been staged with
734 these changes must first be committed with
744 Switch the work tree's branch reference to the specified
746 before updating the work tree.
747 This option requires that all paths in the work tree are updated.
749 As usual, any local changes in the work tree will be preserved.
750 This can be useful when switching to a newly created branch in order
751 to commit existing local changes to this branch.
753 Any local changes must be dealt with separately in order to obtain a
754 work tree with pristine file contents corresponding exactly to the specified
756 Such changes could first be committed to a different branch with
758 or could be discarded with
761 Update the work tree to the specified
763 If this option is not specified, the most recent commit on the work tree's
768 argument is a commit ID SHA1 hash, or a reference name or a keyword
769 which will be resolved to a commit ID.
770 An abbreviated hash argument will be expanded to a full SHA1 hash
771 automatically, provided the abbreviation is unique.
776 resolve to the work tree's base commit and branch head, respectively.
777 Keywords and reference names may be appended with
781 modifiers and an optional integer N to denote the
782 Nth descendant or antecedent, respectively, by first parent traversal;
785 denotes the work tree branch head's 2nd generation ancestor, and
787 denotes the 4th generation descendant of the work tree's base commit.
790 will denote the 3rd generation ancestor of the commit resolved by the
793 If an integer does not follow the
799 is implicitly appended
806 Silence progress output.
812 .Op Fl S Ar status-codes
813 .Op Fl s Ar status-codes
817 Show the current modification status of files in a work tree,
818 using the following status codes:
819 .Bl -column YXZ description
820 .It M Ta modified file
821 .It A Ta file scheduled for addition in next commit
822 .It D Ta file scheduled for deletion in next commit
823 .It C Ta modified or added file which contains merge conflicts
824 .It ! Ta versioned file was expected on disk but is missing
825 .It \(a~ Ta versioned file is obstructed by a non-regular file
826 .It ? Ta unversioned item not tracked by
828 .It m Ta modified file modes (executable bit only)
829 .It N Ta non-existent
831 specified on the command line
836 is specified, show modifications in the entire work tree.
837 Otherwise, show modifications at or within the specified paths.
839 If changes have been staged with
841 staged changes are shown in the second output column, using the following
843 .Bl -column YXZ description
844 .It M Ta file modification is staged
845 .It A Ta file addition is staged
846 .It D Ta file deletion is staged
849 Changes created on top of staged changes are indicated in the first column:
850 .Bl -column YXZ description
851 .It MM Ta file was modified after earlier changes have been staged
852 .It MA Ta file was modified after having been staged for addition
855 If the work tree contains the results of an interrupted
860 operation then display a message which shows the branches involved.
867 Show unversioned files even if they match an ignore pattern.
868 .It Fl S Ar status-codes
869 Suppress the output of files with a modification status matching any of the
870 single-character status codes contained in the
873 Any combination of codes from the above list of possible status codes
875 For staged files, status codes displayed in either column will be matched.
876 Cannot be used together with the
879 .It Fl s Ar status-codes
880 Only show files with a modification status matching any of the
881 single-character status codes contained in the
884 Any combination of codes from the above list of possible status codes
886 For staged files, status codes displayed in either column will be matched.
887 Cannot be used together with the
892 For compatibility with
903 files in each traversed directory and will not display unversioned files
904 which match these patterns.
905 Ignore patterns which end with a slash,
907 will only match directories.
912 supports consecutive asterisks,
914 which will match an arbitrary amount of directories.
918 only supports a single ignore pattern per line.
922 does not support negated ignore patterns prefixed with
924 and gives no special significance to the location of path component separators,
933 .Op Fl r Ar repository-path
934 .Op Fl S Ar search-pattern
938 Display history of a repository.
941 is specified, show only commits which modified this path.
942 If invoked in a work tree, the
944 is interpreted relative to the current working directory,
945 and the work tree's path prefix is implicitly prepended.
946 Otherwise, the path is interpreted relative to the repository root.
953 Display individual commits which were merged into the current branch
957 shows the linear history of the current branch only.
959 Set the number of context lines shown in diffs with
961 By default, 3 lines of context are shown.
963 Start traversing history at the specified
965 If this option is not specified, default to the work tree's current branch
966 if invoked in a work tree, or to the repository's HEAD reference.
970 argument is a commit ID SHA1 hash, or a reference name or a keyword
971 which will be resolved to a commit ID.
972 An abbreviated hash argument will be expanded to a full SHA1 hash
973 automatically, provided the abbreviation is unique.
978 resolve to the work tree's base commit and branch head, respectively.
979 The former is only valid if invoked in a work tree, while the latter will
980 resolve to the tip of the work tree's current branch if invoked in a
981 work tree, otherwise it will resolve to the repository's HEAD reference.
982 Keywords and references may be appended with
986 modifiers and an optional integer N to denote the
987 Nth descendant or antecedent, respectively, by first parent traversal;
990 denotes the HEAD reference's 2nd generation ancestor, and
992 denotes the 4th generation descendant of the work tree's base commit.
995 will denote the 3rd generation descendant of the commit resolved by the
1002 modifier without a trailing integer has an implicit
1011 Display diffstat of changes introduced in each commit.
1012 Cannot be used with the
1017 option (diffstat displays a list of changed paths).
1019 Limit history traversal to a given number of commits.
1020 If this option is not specified, a default limit value of zero is used,
1021 which is treated as an unbounded limit.
1023 .Ev GOT_LOG_DEFAULT_LIMIT
1024 environment variable may be set to change this default value.
1026 Display the list of file paths changed in each commit, using the following
1028 .Bl -column YXZ description
1029 .It M Ta modified file
1030 .It D Ta file was deleted
1031 .It A Ta new file was added
1032 .It m Ta modified file modes (executable bit only)
1035 Cannot be used with the
1039 Display the patch of modifications made in each commit.
1042 is specified, only show the patch of modifications at or within this path.
1043 Cannot be used with the
1047 Determine a set of commits to display as usual, but display these commits
1049 .It Fl r Ar repository-path
1050 Use the repository at the specified path.
1051 If not specified, assume the repository is located at or above the current
1053 If this directory is a
1055 work tree, use the repository path associated with this work tree.
1056 .It Fl S Ar search-pattern
1057 If specified, show only commits with a log message, author name,
1058 committer name, or ID SHA1 hash matched by the extended regular
1060 .Ar search-pattern .
1061 Lines in committed patches will be matched if
1064 File paths changed by a commit will be matched if
1067 Regular expression syntax is documented in
1070 Display a short one-line summary of each commit, instead of the default
1072 Cannot be used together with the
1078 Display commits in topological order.
1079 This option has no effect without the
1081 option because a linear history is sorted in topological order by definition.
1082 Topological sorting is disabled by default because the present implementation
1083 requires that commit history is fully traversed before any output can be shown.
1085 Stop traversing commit history immediately after the specified
1092 argument is a commit ID SHA1 hash, or a reference name or a keyword
1093 which will be resolved to a commit ID.
1094 This option has no effect if the specified
1104 .Op Fl r Ar repository-path
1105 .Op Ar object1 Ar object2 | Ar path ...
1108 When invoked within a work tree without any arguments, display all
1109 local changes in the work tree.
1112 arguments are specified, only show changes within the specified paths.
1114 If two arguments are provided, treat each argument as a reference, a tag
1115 name, or an object ID SHA1 hash, and display differences between the
1116 corresponding objects.
1117 Both objects must be of the same type (blobs, trees, or commits).
1118 An abbreviated hash argument will be expanded to a full SHA1 hash
1119 automatically, provided the abbreviation is unique.
1120 If none of these interpretations produce a valid result or if the
1125 is running in a work tree, attempt to interpret the two arguments as paths.
1132 Treat file contents as ASCII text even if binary data is detected.
1134 Set the number of context lines shown in the diff.
1135 By default, 3 lines of context are shown.
1137 Show differences between commits in the repository.
1138 This option may be used up to two times.
1139 When used only once, show differences between the specified
1141 and its first parent commit.
1142 When used twice, show differences between the two specified commits.
1146 option is used, all non-option arguments will be interpreted as paths.
1149 arguments are provided, only show differences for the specified paths.
1153 argument is a commit ID SHA1 hash, or a reference name or a keyword
1154 which will be resolved to a commit ID.
1155 An abbreviated hash argument will be expanded to a full SHA1 hash
1156 automatically, provided the abbreviation is unique.
1161 resolve to the work tree's base commit and branch head, respectively.
1162 The former is only valid if invoked in a work tree, while the latter will
1163 resolve to the tip of the work tree's current branch if invoked in a
1164 work tree, otherwise it will resolve to the repository's HEAD reference.
1165 Keywords and references may be appended with
1169 modifiers and an optional integer N to denote the
1170 Nth descendant or antecedent, respectively, by first parent traversal;
1173 denotes the HEAD reference's 2nd generation ancestor, and
1175 denotes the 4th generation descendant of the work tree's base commit.
1178 will denote the 8th generation descendant of the commit resolved by the
1181 If an integer does not follow the
1187 is implicitly appended
1194 Cannot be used together with the
1198 Display diffstat of changes before the actual diff by annotating each file path
1199 or blob hash being diffed with the total number of lines added and removed.
1200 A summary line will display the total number of changes across all files.
1202 Interpret all arguments as paths only.
1203 This option can be used to resolve ambiguity in cases where paths
1204 look like tag names, reference names, or object IDs.
1205 This option is only valid when
1207 is invoked in a work tree.
1208 .It Fl r Ar repository-path
1209 Use the repository at the specified path.
1210 If not specified, assume the repository is located at or above the current
1212 If this directory is a
1214 work tree, use the repository path associated with this work tree.
1216 Show changes staged with
1218 instead of showing local changes in the work tree.
1219 This option is only valid when
1221 is invoked in a work tree.
1223 Ignore whitespace-only changes.
1229 .Op Fl r Ar repository-path
1233 Display line-by-line history of a file at the specified path.
1240 Start traversing history at the specified
1242 The expected argument is a commit ID SHA1 hash, or a reference name
1243 or a keyword which will be resolved to a commit ID.
1244 An abbreviated hash argument will be expanded to a full SHA1 hash
1245 automatically, provided the abbreviation is unique.
1250 resolve to the work tree's base commit and branch head, respectively.
1251 The former is only valid if invoked in a work tree, while the latter will
1252 resolve to the tip of the work tree's current branch if invoked in a
1253 work tree, otherwise it will resolve to the repository's HEAD reference.
1254 Keywords and references may be appended with
1258 modifiers and an optional integer N to denote the
1259 Nth descendant or antecedent by first parent traversal, respectively;
1262 denotes the work tree branch head's 2nd generation ancestor, and
1264 denotes the 4th generation descendant of the work tree's base commit.
1267 will denote the 5th generation ancestor of the commit resolved by the
1274 modifier without a trailing integer has an implicit
1282 .It Fl r Ar repository-path
1283 Use the repository at the specified path.
1284 If not specified, assume the repository is located at or above the current
1286 If this directory is a
1288 work tree, use the repository path associated with this work tree.
1295 .Op Fl r Ar repository-path
1299 Display a listing of files and directories at the specified
1300 directory path in the repository.
1301 Entries shown in this listing may carry one of the following trailing
1303 .Bl -column YXZ description
1304 .It @ Ta entry is a symbolic link
1305 .It / Ta entry is a directory
1306 .It * Ta entry is an executable file
1307 .It $ Ta entry is a Git submodule
1310 Symbolic link entries are also annotated with the target path of the link.
1314 is specified, list the repository path corresponding to the current
1315 directory of the work tree, or the root directory of the repository
1316 if there is no work tree.
1323 List files and directories as they appear in the specified
1326 The expected argument is a commit ID SHA1 hash, or a reference name
1327 or a keyword which will be resolved to a commit ID.
1328 An abbreviated hash argument will be expanded to a full SHA1 hash
1329 automatically, provided the abbreviation is unique.
1334 resolve to the work tree's base commit and branch head, respectively.
1335 The former is only valid if invoked in a work tree, while the latter will
1336 resolve to the tip of the work tree's current branch if invoked in a
1337 work tree, otherwise it will resolve to the repository's HEAD reference.
1338 Keywords and references may be appended with
1342 modifiers and an optional integer N to denote the
1343 Nth descendant or antecedent by first parent traversal, respectively;
1346 denotes the work tree branch head's 2nd generation ancestor, and
1348 denotes the 4th generation descendant of the work tree's base commit.
1351 will denote the 3rd generation ancestor of the commit resolved by the
1358 modifier without a trailing integer has an implicit
1367 Show object IDs of files (blob objects) and directories (tree objects).
1369 Recurse into sub-directories in the repository.
1370 .It Fl r Ar repository-path
1371 Use the repository at the specified path.
1372 If not specified, assume the repository is located at or above the current
1374 If this directory is a
1376 work tree, use the repository path associated with this work tree.
1382 .Op Fl r Ar repository-path
1383 .Op Fl s Ar reference
1386 Manage references in a repository.
1388 References may be listed, created, deleted, and changed.
1389 When creating, deleting, or changing a reference the specified
1391 must be an absolute reference name, i.e. it must begin with
1399 Create a reference or change an existing reference.
1400 The reference with the specified
1402 will point at the specified
1407 argument is an ID SHA1 hash or an existing reference or tag name
1408 or a keyword which will be resolved to the ID of a corresponding commit,
1409 tree, tag, or blob object.
1410 An abbreviated hash argument will be expanded to a full SHA1 hash
1411 automatically, provided the abbreviation is unique.
1416 resolve to the work tree's base commit and branch head, respectively.
1417 The former is only valid if invoked in a work tree, while the latter will
1418 resolve to the tip of the work tree's current branch if invoked in a
1419 work tree, otherwise it will resolve to the repository's HEAD reference.
1420 Keywords and reference names may be appended with
1424 modifiers and an optional integer N to denote the
1425 Nth descendant or antecedent by first parent traversal, respectively;
1428 denotes the work tree branch head's 2nd generation ancestor, and
1430 will denote the 3rd generation ancestor of the commit resolved by the
1433 If an integer does not follow the
1439 is implicitly appended
1446 Cannot be used together with any other options except
1449 Delete the reference with the specified
1451 from the repository.
1452 Any commit, tree, tag, and blob objects belonging to deleted references
1453 remain in the repository and may be removed separately with
1454 Git's garbage collector or
1455 .Cm gotadmin cleanup .
1456 Cannot be used together with any other options except
1459 List references in the repository.
1462 is specified, list all existing references in the repository.
1465 is a reference namespace, list all references in this namespace.
1466 Otherwise, show only the reference with the given
1468 Cannot be used together with any other options except
1472 .It Fl r Ar repository-path
1473 Use the repository at the specified path.
1474 If not specified, assume the repository is located at or above the current
1476 If this directory is a
1478 work tree, use the repository path associated with this work tree.
1479 .It Fl s Ar reference
1480 Create a symbolic reference, or change an existing symbolic reference.
1481 The symbolic reference with the specified
1483 will point at the specified
1485 which must already exist in the repository.
1486 Care should be taken not to create loops between references when
1487 this option is used.
1488 Cannot be used together with any other options except
1491 Sort listed references by modification time (most recently modified first)
1492 instead of sorting by lexicographical order.
1493 Use of this option requires the
1495 option to be used as well.
1503 .Op Fl r Ar repository-path
1507 Create, list, or delete branches.
1509 Local branches are managed via references which live in the
1511 reference namespace.
1514 command creates references in this namespace only.
1516 When deleting branches, the specified
1520 reference namespace first.
1521 If no corresponding branch is found, the
1523 namespace will be searched next.
1525 If invoked in a work tree without any arguments, print the name of the
1526 work tree's current branch.
1530 argument is passed, attempt to create a branch reference with the given name.
1531 By default the new branch reference will point at the latest commit on the
1532 work tree's current branch if invoked in a work tree, and otherwise to a commit
1533 resolved via the repository's HEAD reference.
1535 If invoked in a work tree, once the branch was created successfully
1536 switch the work tree's head reference to the newly created branch and
1537 update files across the entire work tree, just like
1538 .Cm got update -b Ar name
1540 Show the status of each affected file, using the following status codes:
1541 .Bl -column YXZ description
1542 .It U Ta file was updated and contained no local changes
1543 .It G Ta file was updated and local changes were merged cleanly
1544 .It C Ta file was updated and conflicts occurred during merge
1545 .It D Ta file was deleted
1546 .It A Ta new file was added
1547 .It \(a~ Ta versioned file is obstructed by a non-regular file
1548 .It ! Ta a missing versioned file was restored
1556 Make a newly created branch reference point at the specified
1558 The expected argument is a commit ID SHA1 hash, or a reference name or keyword
1559 which will be resolved to a commit ID.
1560 An abbreviated hash argument will be expanded to a full SHA1 hash
1561 automatically, provided the abbreviation is unique.
1566 resolve to the work tree's base commit and branch head, respectively.
1567 The former is only valid if invoked in a work tree, while the latter will
1568 resolve to the tip of the work tree's current branch if invoked in a
1569 work tree, otherwise it will resolve to the repository's HEAD reference.
1570 Keywords and references may be appended with
1574 modifiers and an optional integer N to denote the
1575 Nth descendant or antecedent by first parent traversal, respectively;
1578 denotes the work tree branch head's 2nd generation ancestor, and
1580 denotes the 4th generation descendant of the work tree's base commit.
1583 will denote the 3rd generation descendant of the commit resolved by the
1590 modifier without a trailing integer has an implicit
1599 Delete the branch with the specified
1605 reference namespace.
1607 Only the branch reference is deleted.
1608 Any commit, tree, and blob objects belonging to the branch
1609 remain in the repository and may be removed separately with
1610 Git's garbage collector or
1611 .Cm gotadmin cleanup .
1613 List all existing branches in the repository, including copies of remote
1614 repositories' branches in the
1616 reference namespace.
1618 If invoked in a work tree, the work tree's current branch is shown
1619 with one of the following annotations:
1620 .Bl -column YXZ description
1621 .It * Ta work tree's base commit and the base commit of all tracked files
1622 matches the branch tip
1623 .It \(a~ Ta work tree comprises mixed commits or its base commit is out-of-date
1626 Do not switch and update the work tree after creating a new branch.
1627 .It Fl r Ar repository-path
1628 Use the repository at the specified path.
1629 If not specified, assume the repository is located at or above the current
1631 If this directory is a
1633 work tree, use the repository path associated with this work tree.
1635 Sort listed branches by modification time (most recently modified first)
1636 instead of sorting by lexicographical order.
1639 reference namespace are listed before branches in
1642 Use of this option requires the
1644 option to be used as well.
1651 .Op Fl r Ar repository-path
1652 .Op Fl s Ar signer-id
1655 Manage tags in a repository.
1657 Tags are managed via references which live in the
1659 reference namespace.
1662 command operates on references in this namespace only.
1663 References in this namespace point at tag objects which contain a pointer
1664 to another object, a tag message, as well as author and timestamp information.
1666 Attempt to create a tag with the given
1668 and make this tag point at the given
1670 If no commit is specified, default to the latest commit on the work tree's
1671 current branch if invoked in a work tree, and to a commit resolved via
1672 the repository's HEAD reference otherwise.
1679 Make the newly created tag reference point at the specified
1683 argument is a commit ID SHA1 hash, or a reference or keyword
1684 which will be resolved to a commit ID.
1685 An abbreviated hash argument will be expanded to a full SHA1 hash
1686 automatically, provided the abbreviation is unique.
1691 resolve to the work tree's base commit and branch head, respectively.
1692 The former is only valid if invoked in a work tree, while the latter will
1693 resolve to the tip of the work tree's current branch if invoked in a
1694 work tree, otherwise it will resolve to the repository's HEAD reference.
1695 Keywords and references may be appended with
1699 modifiers and an optional integer N to denote the
1700 Nth descendant or antecedent by first parent traversal, respectively;
1703 denotes the work tree branch head's 2nd generation ancestor, and
1705 denotes the 4th generation descendant of the work tree's base commit.
1708 will denote the 3rd generation ancestor of the commit resolved by the
1715 modifier without a trailing integer has an implicit
1724 List all existing tags in the repository instead of creating a new tag.
1727 argument is passed, show only the tag with the given
1730 Use the specified tag message when creating the new tag.
1735 opens a temporary file in an editor where a tag message can be written.
1736 Quitting the editor without saving the file will abort the tag operation.
1737 .It Fl r Ar repository-path
1738 Use the repository at the specified path.
1739 If not specified, assume the repository is located at or above the current
1741 If this directory is a
1743 work tree, use the repository path associated with this work tree.
1744 .It Fl s Ar signer-id
1745 While creating a new tag, sign this tag with the identity given in
1748 For SSH-based signatures,
1750 is the path to a file which may refer to either a private SSH key,
1751 or a public SSH key with the private half available via
1754 will sign the tag object by invoking
1758 command, using the signature namespace
1760 for compatibility with
1763 Verify tag object signatures.
1766 is specified, show and verify the tag object with the provided name.
1767 Otherwise, list all tag objects and verify signatures where present.
1770 verifies SSH-based signatures by invoking
1773 .Fl Y Cm verify Fl f Ar allowed_signers .
1778 otherwise verification is impossible.
1781 During SSH signature creation and verification this option will be passed to
1783 Multiple -v options increase the verbosity.
1789 command will not delete tags or change existing tags.
1790 If a tag must be deleted, the
1792 command may be used to delete a tag's reference.
1793 This should only be done if the tag has not already been copied to
1800 Schedule unversioned files in a work tree for addition to the
1801 repository in the next commit.
1802 By default, files which match a
1804 ignore pattern will not be added.
1808 mentioned in the command line is not an unversioned file then
1811 To avoid unnecessary errors from paths picked up by file globbing patterns
1812 in the shell, paths in the argument list will be silently ignored if they
1815 at all, or if they are reported with one of the following status codes
1816 and do not have changes staged via
1818 .Bl -column YXZ description
1819 .It M Ta modified file
1820 .It A Ta file scheduled for addition in next commit
1821 .It C Ta modified or added file which contains merge conflicts
1822 .It m Ta modified file modes (executable bit only)
1830 Add files even if they match a
1834 Permit recursion into directories.
1835 If this option is not specified,
1837 will refuse to run if a specified
1845 .Op Fl s Ar status-codes
1849 Remove versioned files from a work tree and schedule them for deletion
1850 from the repository in the next commit.
1857 Perform the operation even if a file contains local modifications,
1858 and do not raise an error if a specified
1860 does not exist on disk.
1862 Keep affected files on disk.
1864 Permit recursion into directories.
1865 If this option is not specified,
1867 will refuse to run if a specified
1870 .It Fl s Ar status-codes
1871 Only delete files with a modification status matching one of the
1872 single-character status codes contained in the
1875 The following status codes may be specified:
1876 .Bl -column YXZ description
1877 .It M Ta modified file (this implies the
1880 .It ! Ta versioned file expected on disk but missing
1888 .Op Fl p Ar strip-count
1894 to files in a work tree.
1895 Files added or removed by a patch will be scheduled for addition or removal in
1898 The patch must be in the unified diff format as produced by
1905 diff when invoked with their
1910 argument is provided, read unified diff data from standard input instead.
1914 contains multiple patches, then attempt to apply each of them in sequence.
1916 Show the status of each affected file, using the following status codes:
1917 .Bl -column XYZ description
1918 .It M Ta file was modified
1919 .It G Ta file was merged using a merge-base found in the repository
1920 .It C Ta file was merged and conflicts occurred during merge
1921 .It D Ta file was deleted
1922 .It A Ta file was added
1923 .It # Ta failed to patch the file
1926 If a change does not match at its exact line number, attempt to
1927 apply it somewhere else in the file if a good spot can be found.
1928 Otherwise, the patch will fail to apply.
1932 will refuse to apply a patch if certain preconditions are not met.
1933 Files to be deleted must already be under version control, and must
1934 not have been scheduled for deletion already.
1935 Files to be added must not yet be under version control and must not
1936 already be present on disk.
1937 Files to be modified must already be under version control and may not
1938 contain conflict markers.
1940 If an error occurs, the
1942 operation will be aborted.
1943 Any changes made to the work tree up to this point will be left behind.
1944 Such changes can be viewed with
1946 and can be reverted with
1955 Attempt to locate files within the specified
1957 for use as a merge-base for 3-way merges.
1961 option is not used then
1963 will attempt to locate merge-bases via object IDs found in
1965 meta-data, such as produced by
1971 option is only recommended in the absence of such meta-data.
1973 Ideally, the specified
1975 should contain versions of files which the changes contained in the
1978 Files will be located by path, relative to the repository root.
1981 option is used then leading path components will be stripped
1982 before paths are looked up in the repository.
1984 In case no merge-base is available for a file, changes will be applied
1985 without doing a 3-way merge.
1986 Changes which do not apply cleanly may then be rejected entirely, rather
1987 than producing merge conflicts in the patched target file.
1991 argument is a commit ID SHA1 hash, or a reference name or a keyword
1992 which will be resolved to a commit ID.
1993 An abbreviated hash argument will be expanded to a full SHA1 hash
1994 automatically, provided the abbreviation is unique.
1999 resolve to the work tree's base commit and branch head, respectively.
2000 Keywords and references may be appended with
2004 modifiers and an optional integer N to denote the
2005 Nth descendant or antecedent by first parent traversal, respectively;
2008 denotes the work tree branch head's 2nd generation ancestor, and
2010 denotes the 4th generation descendant of the work tree's base commit.
2013 will denote the 3rd generation descendant of the commit resolved by the
2020 modifier without a trailing integer has an implicit
2029 Do not make any modifications to the work tree.
2030 This can be used to check whether a patch would apply without issues.
2033 contains diffs that affect the same file multiple times, the results
2034 displayed may be incorrect.
2035 .It Fl p Ar strip-count
2036 Specify the number of leading path components to strip from paths
2045 path prefixes generated by
2047 will be recognized and stripped automatically.
2049 Reverse the patch before applying it.
2055 .Op Fl F Ar response-script
2059 Revert any local changes in files at the specified paths in a work tree.
2060 File contents will be overwritten with those contained in the
2061 work tree's base commit.
2062 There is no way to bring discarded changes back after
2065 If a file was added with
2067 it will become an unversioned file again.
2068 If a file was deleted with
2070 it will be restored.
2076 .It Fl F Ar response-script
2084 responses line-by-line from the specified
2086 file instead of prompting interactively.
2088 Instead of reverting all changes in files, interactively select or reject
2089 changes to revert based on
2095 (quit reverting this file) responses.
2096 If a file is in modified status, individual patches derived from the
2097 modified file content can be reverted.
2098 Files in added or deleted status may only be reverted in their entirety.
2100 Permit recursion into directories.
2101 If this option is not specified,
2103 will refuse to run if a specified
2117 Create a new commit in the repository from changes in a work tree
2118 and use this commit as the new base commit for the work tree.
2121 is specified, commit all changes in the work tree.
2122 Otherwise, commit changes at or within the specified paths.
2124 If changes have been explicitly staged for commit with
2126 only commit staged changes and reject any specified paths which
2127 have not been staged.
2130 opens a temporary file in an editor where a log message can be written
2138 options are used together.
2139 Quitting the editor without saving the file will abort the commit operation.
2141 Show the status of each affected file, using the following status codes:
2142 .Bl -column YXZ description
2143 .It M Ta modified file
2144 .It D Ta file was deleted
2145 .It A Ta new file was added
2146 .It m Ta modified file modes (executable bit only)
2149 Files which are not part of the new commit will retain their previously
2150 recorded base commit.
2153 commands may refuse to run while the work tree contains files from
2154 multiple base commits.
2155 The base commit of such a work tree can be made consistent by running
2157 across the entire work tree.
2161 command requires the
2163 environment variable to be set,
2164 unless an author has been configured in
2170 configuration settings can be
2171 obtained from the repository's
2173 file or from Git's global
2182 Set author information in the newly created commit to
2184 This is useful when committing changes on behalf of someone else.
2187 argument must use the same format as the
2189 environment variable.
2191 In addition to storing author information, the newly created commit
2194 information which is obtained, as usual, from the
2196 environment variable, or
2198 or Git configuration settings.
2200 Allow committing files in conflicted status.
2202 Committing files with conflict markers should generally be avoided.
2203 Cases where conflict markers must be stored in the repository for
2204 some legitimate reason should be very rare.
2205 There are usually ways to avoid storing conflict markers verbatim by
2206 applying appropriate programming tricks.
2208 Use the prepared log message stored in the file found at
2210 when creating the new commit.
2212 opens a temporary file in an editor where the prepared log message can be
2213 reviewed and edited further if needed.
2214 Cannot be used together with the
2218 Use the specified log message when creating the new commit.
2219 Cannot be used together with the
2223 This option prevents
2225 from opening the commit message in an editor.
2226 It has no effect unless it is used together with the
2228 option and is intended for non-interactive use such as scripting.
2230 This option prevents
2232 from generating a diff of the to-be-committed changes in a temporary file
2233 which can be viewed while editing a commit message.
2235 Allow the addition of symbolic links which point outside of the path space
2236 that is under version control.
2239 will reject such symbolic links due to safety concerns.
2242 may decide to represent such a symbolic link as a regular file which contains
2243 the link's target path, rather than creating an actual symbolic link which
2244 points outside of the work tree.
2245 Use of this option is discouraged because external mechanisms such as
2247 are better suited for managing symbolic links to paths not under
2252 will refuse to run if certain preconditions are not met.
2253 If the work tree's current branch is not in the
2255 reference namespace, new commits may not be created on this branch.
2256 Local changes may only be committed if they are based on file content
2257 found in the most recent commit on the work tree's branch.
2258 If a path is found to be out of date,
2260 must be used first in order to merge local changes with changes made
2268 .Op Fl r Ar repository-path
2270 .Op Ar remote-repository
2273 Send new changes to a remote repository.
2275 .Ar remote-repository
2279 The remote repository's URL is obtained from the corresponding entry in
2283 file of the local repository, as created by
2286 All objects corresponding to new changes will be written to a temporary
2287 pack file which is then uploaded to the server.
2288 Upon success, references in the
2290 reference namespace of the local repository will be updated to point at
2291 the commits which have been sent.
2293 By default, changes will only be sent if they are based on up-to-date
2294 copies of relevant branches in the remote repository.
2295 If any changes to be sent are based on out-of-date copies or would
2296 otherwise break linear history of existing branches, new changes must
2297 be fetched from the server with
2299 and local branches must be rebased with
2306 option can be used to make exceptions to these requirements.
2313 Send all branches from the local repository's
2315 reference namespace.
2318 option is equivalent to listing all branches with multiple
2321 Cannot be used together with the
2327 from the local repository's
2329 reference namespace.
2330 This option may be specified multiple times to build a list of branches
2332 If this option is not specified, default to the work tree's current branch
2333 if invoked in a work tree, or to the repository's HEAD reference.
2334 Cannot be used together with the
2338 Delete the specified
2340 from the remote repository's
2342 reference namespace.
2343 This option may be specified multiple times to build a list of branches
2346 Only references are deleted.
2347 Any commit, tree, tag, and blob objects belonging to deleted branches
2348 may become subject to deletion by Git's garbage collector running on
2351 Requesting deletion of branches results in an error if the server
2352 does not support this feature or disallows the deletion of branches
2353 based on its configuration.
2355 Attempt to force the server to overwrite existing branches or tags
2356 in the remote repository, even when
2362 would usually be required before changes can be sent.
2363 The server may reject forced requests regardless, depending on its
2366 Any commit, tree, tag, and blob objects belonging to overwritten branches
2367 or tags may become subject to deletion by Git's garbage collector running
2372 reference namespace is globally shared between all repositories.
2375 option to overwrite tags is discouraged because it can lead to
2376 inconsistencies between the tags present in different repositories.
2377 In general, creating a new tag with a different name is recommended
2378 instead of overwriting an existing tag.
2382 option is particularly discouraged if changes being sent are based
2383 on an out-of-date copy of a branch in the remote repository.
2384 Instead of using the
2386 option, new changes should
2389 and local branches should be rebased with
2393 followed by another attempt to send the changes.
2397 option should only be needed in situations where the remote repository's
2398 copy of a branch or tag is known to be out-of-date and is considered
2400 The risks of creating inconsistencies between different repositories
2401 should also be taken into account.
2403 Suppress progress reporting output.
2404 The same option will be passed to
2407 .It Fl r Ar repository-path
2408 Use the repository at the specified path.
2409 If not specified, assume the repository is located at or above the current
2411 If this directory is a
2413 work tree, use the repository path associated with this work tree.
2415 Attempt to send all tags from the local repository's
2417 reference namespace.
2420 option is equivalent to listing all tags with multiple
2423 Cannot be used together with the
2429 from the local repository's
2431 reference namespace, in addition to any branches that are being sent.
2434 option may be specified multiple times to build a list of tags to send.
2435 No tags will be sent if the
2439 Raise an error if the specified
2441 already exists in the remote repository, unless the
2443 option is used to overwrite the server's copy of the tag.
2444 In general, creating a new tag with a different name is recommended
2445 instead of overwriting an existing tag.
2447 Cannot be used together with the
2454 to print debugging messages to standard error output.
2455 The same option will be passed to
2458 Multiple -v options increase the verbosity.
2468 Merge changes from a single
2473 should be on a different branch than the work tree's base commit.
2475 The expected argument is a commit ID SHA1 hash, or a reference name or
2476 keyword which will be resolved to a commit ID.
2477 An abbreviated hash argument will be expanded to a full SHA1 hash
2478 automatically, provided the abbreviation is unique.
2483 resolve to the work tree's base commit and branch head, respectively.
2484 Keywords and references may be appended with
2488 modifiers and an optional integer N to denote the
2489 Nth descendant or antecedent by first parent traversal, respectively;
2492 denotes the work tree branch head's 2nd generation ancestor, and
2494 denotes the 4th generation descendant of the work tree's base commit.
2497 will denote the 3rd generation descendant of the commit resolved by the
2504 modifier without a trailing integer has an implicit
2513 Show the status of each affected file, using the following status codes:
2514 .Bl -column YXZ description
2515 .It G Ta file was merged
2516 .It C Ta file was merged and conflicts occurred during merge
2517 .It ! Ta changes destined for a missing file were not merged
2518 .It D Ta file was deleted
2519 .It d Ta file's deletion was prevented by local modifications
2520 .It A Ta new file was added
2521 .It \(a~ Ta changes destined for a non-regular file were not merged
2522 .It ? Ta changes destined for an unversioned file were not merged
2525 The merged changes will appear as local changes in the work tree, which
2528 amended manually or with further
2534 If invoked in a work tree where no
2539 operation is taking place,
2541 creates a record of commits which have been merged into the work tree.
2542 When a file changed by
2546 the log messages of relevant merged commits will then appear in the editor,
2547 where the messages should be further adjusted to convey the reasons for
2548 cherrypicking the changes.
2549 Upon exiting the editor, if the time stamp of the log message file
2550 is unchanged or the log message is empty,
2552 will fail with an unmodified or empty log message error.
2554 If all the changes in all files touched by a given commit are discarded,
2557 this commit's log message record will also disappear.
2560 will refuse to run if certain preconditions are not met.
2561 If the work tree contains multiple base commits, it must first be updated
2562 to a single base commit with
2564 If any relevant files already contain merge conflicts, these
2565 conflicts must be resolved first.
2573 Display a list of commit log messages recorded by cherrypick operations,
2574 represented by references in the
2575 .Dq refs/got/worktree
2576 reference namespace.
2579 is specified, only show the log message of the specified commit.
2581 If invoked in a work tree, only log messages recorded by cherrypick operations
2582 in the current work tree will be displayed.
2583 Otherwise, all commit log messages will be displayed irrespective of the
2584 work tree in which they were created.
2585 This option cannot be used with
2588 Delete log messages created by previous cherrypick operations, represented by
2590 .Dq refs/got/worktree
2591 reference namespace.
2594 is specified, only delete the log message of the specified commit.
2596 If invoked in a work tree, only log messages recorded by cherrypick operations
2597 in the current work tree will be deleted.
2598 Otherwise, all commit log messages will be deleted irrespective of the
2599 work tree in which they were created.
2600 This option cannot be used with
2611 Reverse-merge changes from a single
2616 should be on the same branch as the work tree's base commit.
2618 The expected argument is a commit ID SHA1 hash, or a reference name
2619 or keyword which will be resolved to a commit ID.
2620 An abbreviated hash argument will be expanded to a full SHA1 hash
2621 automatically, provided the abbreviation is unique.
2626 resolve to the work tree's base commit and branch head, respectively.
2627 Keywords and references may be appended with
2631 modifiers and an optional integer N to denote the
2632 Nth descendant or antecedent by first parent traversal, respectively;
2635 denotes the work tree branch head's 2nd generation ancestor, and
2637 denotes the 4th generation descendant of the work tree's base commit.
2640 will denote the 5th generation descendant of the commit resolved by the
2647 modifier without a trailing integer has an implicit
2656 Show the status of each affected file, using the following status codes:
2657 .Bl -column YXZ description
2658 .It G Ta file was merged
2659 .It C Ta file was merged and conflicts occurred during merge
2660 .It ! Ta changes destined for a missing file were not merged
2661 .It D Ta file was deleted
2662 .It d Ta file's deletion was prevented by local modifications
2663 .It A Ta new file was added
2664 .It \(a~ Ta changes destined for a non-regular file were not merged
2665 .It ? Ta changes destined for an unversioned file were not merged
2668 The reverse-merged changes will appear as local changes in the work tree,
2669 which may be viewed with
2671 amended manually or with further
2677 If invoked in a work tree where no
2682 operation is taking place,
2684 creates a record of commits which have been reverse-merged into the work tree.
2685 When a file changed by
2689 the log messages of relevant reverse-merged commits will then appear in
2690 the editor, where the messages should be further adjusted to convey the
2691 reasons for backing out the changes.
2692 Upon exiting the editor, if the time stamp of the log message file
2693 is unchanged or the log message is empty,
2695 will fail with an unmodified or empty log message error.
2697 If all the changes in all files touched by a given commit are discarded,
2700 this commit's log message record will also disappear.
2703 will refuse to run if certain preconditions are not met.
2704 If the work tree contains multiple base commits, it must first be updated
2705 to a single base commit with
2707 If any relevant files already contain merge conflicts, these
2708 conflicts must be resolved first.
2716 Display a list of commit log messages recorded by backout operations,
2717 represented by references in the
2718 .Dq refs/got/worktree
2719 reference namespace.
2722 is specified, only show the log message of the specified commit.
2724 If invoked in a work tree, only log messages recorded by backout operations
2725 in the current work tree will be displayed.
2726 Otherwise, all commit log messages will be displayed irrespective of the
2727 work tree in which they were created.
2728 This option cannot be used with
2731 Delete log messages created by previous backout operations, represented by
2733 .Dq refs/got/worktree
2734 reference namespace.
2737 is specified, only delete the log message of the specified commit.
2739 If invoked in a work tree, only log messages recorded by backout operations
2740 in the current work tree will be deleted.
2741 Otherwise, all commit log messages will be deleted irrespective of the
2742 work tree in which they were created.
2743 This option cannot be used with
2754 Rebase commits on the specified
2756 onto the tip of the current branch of the work tree.
2759 must share common ancestry with the work tree's current branch.
2760 Rebasing begins with the first descendant commit of the youngest
2761 common ancestor commit shared by the specified
2763 and the work tree's current branch, and stops once the tip commit
2770 is used as intended, the specified
2772 represents a local commit history and may already contain changes
2773 that are not yet visible in any other repositories.
2774 The work tree's current branch, which must be set with
2778 operation, represents a branch from a remote repository which shares
2779 a common history with the specified
2781 but has progressed, and perhaps diverged, due to commits added to the
2784 Rebased commits are accumulated on a temporary branch which the work tree
2785 will remain switched to throughout the entire rebase operation.
2786 Commits on this branch represent the same changes with the same log
2787 messages as their counterparts on the original
2789 but with different commit IDs.
2790 Once rebasing has completed successfully, the temporary branch becomes
2791 the new version of the specified
2793 and the work tree is automatically switched to it.
2794 If author information is available via the
2796 environment variable,
2802 configuration settings, this author information will be used to identify
2807 Old commits in their pre-rebase state are automatically backed up in the
2808 .Dq refs/got/backup/rebase
2809 reference namespace.
2810 As long as these references are not removed older versions of rebased
2811 commits will remain in the repository and can be viewed with the
2814 Removal of these references makes objects which become unreachable via
2815 any reference subject to removal by Git's garbage collector or
2816 .Cm gotadmin cleanup .
2818 While rebasing commits, show the status of each affected file,
2819 using the following status codes:
2820 .Bl -column YXZ description
2821 .It G Ta file was merged
2822 .It C Ta file was merged and conflicts occurred during merge
2823 .It ! Ta changes destined for a missing file were not merged
2824 .It D Ta file was deleted
2825 .It d Ta file's deletion was prevented by local modifications
2826 .It A Ta new file was added
2827 .It \(a~ Ta changes destined for a non-regular file were not merged
2828 .It ? Ta changes destined for an unversioned file were not merged
2831 If merge conflicts occur, the rebase operation is interrupted and may
2832 be continued once conflicts have been resolved.
2833 If any files with destined changes are found to be missing or unversioned,
2834 or if files could not be deleted due to differences in deleted content,
2835 the rebase operation will be interrupted to prevent potentially incomplete
2836 changes from being committed to the repository without user intervention.
2837 The work tree may be modified as desired and the rebase operation can be
2838 continued once the changes present in the work tree are considered complete.
2839 Alternatively, the rebase operation may be aborted which will leave
2841 unmodified and the work tree switched back to its original branch.
2843 If a merge conflict is resolved in a way which renders the merged
2844 change into a no-op change, the corresponding commit will be elided
2845 when the rebase operation continues.
2848 will refuse to run if certain preconditions are not met.
2853 reference namespace, the branch may not be rebased.
2854 If the work tree is not yet fully updated to the tip commit of its
2855 branch, then the work tree must first be updated with
2857 If changes have been staged with
2859 these changes must first be committed with
2863 If the work tree contains local changes, these changes must first be
2870 contains changes to files outside of the work tree's path prefix,
2871 the work tree cannot be used to rebase this branch.
2880 commands will refuse to run while a rebase operation is in progress.
2881 Other commands which manipulate the work tree may be used for
2882 conflict resolution purposes.
2886 is already based on the work tree's current branch, then no commits
2887 need to be rebased and
2889 will simply switch the work tree to the specified
2891 and update files in the work tree accordingly.
2898 Abort an interrupted rebase operation.
2899 If this option is used, no other command-line arguments are allowed.
2901 Allow a rebase operation to continue with files in conflicted status.
2902 This option should generally be avoided, and can only be used with the
2906 Continue an interrupted rebase operation.
2907 If this option is used, no other command-line arguments are allowed except
2910 Show a list of past rebase operations, represented by references in the
2911 .Dq refs/got/backup/rebase
2912 reference namespace.
2914 Display the author, date, and log message of each backed up commit,
2915 the object ID of the corresponding post-rebase commit, and
2916 the object ID of their common ancestor commit.
2917 Given these object IDs,
2924 options can be used to examine the history of either version of the branch,
2929 option can be used to create a new branch from a pre-rebase state if desired.
2933 is specified, only show commits which at some point in time represented this
2935 Otherwise, list all backed up commits for any branches.
2937 If this option is used,
2939 does not require a work tree.
2940 None of the other options can be used together with
2943 Delete backups created by past rebase operations, represented by references
2945 .Dq refs/got/backup/rebase
2946 reference namespace.
2950 is specified, only delete backups which at some point in time represented
2952 Otherwise, delete all references found within
2953 .Dq refs/got/backup/rebase .
2955 Any commit, tree, tag, and blob objects belonging to deleted backups
2956 remain in the repository and may be removed separately with
2957 Git's garbage collector or
2958 .Cm gotadmin cleanup .
2960 If this option is used,
2962 does not require a work tree.
2963 None of the other options can be used together with
2970 .Op Fl F Ar histedit-script
2974 Edit commit history between the work tree's current base commit and
2975 the tip commit of the work tree's current branch.
2979 command requires the
2981 environment variable to be set,
2982 unless an author has been configured in
2988 configuration settings can be obtained from the repository's
2990 file or from Git's global
2996 operation, the work tree's current branch must be set with
2998 to the branch which should be edited, unless this branch is already the
2999 current branch of the work tree.
3000 The tip of this branch represents the upper bound (inclusive) of commits
3005 Furthermore, the work tree's base commit
3008 to a point in this branch's commit history where editing should begin.
3009 This commit represents the lower bound (non-inclusive) of commits touched
3014 Editing of commit history is controlled via a
3016 which can be written in an editor based on a template, passed on the
3017 command line, or generated with the
3024 Quitting the editor without saving the file will abort the histedit operation.
3026 The format of the histedit script is line-based.
3027 Each line in the script begins with a command name, followed by
3028 whitespace and an argument.
3029 For most commands, the expected argument is a commit ID SHA1 hash.
3030 Any remaining text on the line is ignored.
3031 Lines which begin with the
3033 character are ignored entirely.
3035 The available histedit script commands are as follows:
3036 .Bl -column YXZ pick-commit
3037 .It Cm pick Ar commit Ta Use the specified commit as it is.
3038 .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
3039 then interrupt the histedit operation for amending, without creating a commit.
3040 While the histedit operation is interrupted arbitrary files may be edited,
3041 and commands which manipulate the work tree can be used freely.
3046 commands can be used to add new files or remove existing ones.
3049 command can be used to eliminate arbitrary changes from files in the work tree.
3052 command may be used to prepare a subset of changes for inclusion in the
3056 command can be used to insert arbitrary commits into the edited history.
3057 Regular editing of history must eventually be resumed by running
3058 .Cm got histedit -c .
3059 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
3060 listed further below that will be used.
3061 .It Cm drop Ar commit Ta Remove this commit from the edited history.
3062 .It Cm mesg Ar commit Ta Open an editor to create a new log message for this
3066 Every commit in the history being edited must be mentioned in the script.
3067 Lines may be re-ordered to change the order of commits in the edited history.
3068 No commit may be listed more than once.
3070 Edited commits are accumulated on a temporary branch which the work tree
3071 will remain switched to throughout the entire histedit operation.
3072 Once history editing has completed successfully, the temporary branch becomes
3073 the new version of the work tree's branch and the work tree is automatically
3076 Old commits in their pre-histedit state are automatically backed up in the
3077 .Dq refs/got/backup/histedit
3078 reference namespace.
3079 As long as these references are not removed older versions of edited
3080 commits will remain in the repository and can be viewed with the
3083 Removal of these references makes objects which become unreachable via
3084 any reference subject to removal by Git's garbage collector or
3085 .Cm gotadmin cleanup .
3087 While merging commits, show the status of each affected file,
3088 using the following status codes:
3089 .Bl -column YXZ description
3090 .It G Ta file was merged
3091 .It C Ta file was merged and conflicts occurred during merge
3092 .It ! Ta changes destined for a missing file were not merged
3093 .It D Ta file was deleted
3094 .It d Ta file's deletion was prevented by local modifications
3095 .It A Ta new file was added
3096 .It \(a~ Ta changes destined for a non-regular file were not merged
3097 .It ? Ta changes destined for an unversioned file were not merged
3100 If merge conflicts occur, the histedit operation is interrupted and may
3101 be continued once conflicts have been resolved.
3102 If any files with destined changes are found to be missing or unversioned,
3103 or if files could not be deleted due to differences in deleted content,
3104 the histedit operation will be interrupted to prevent potentially incomplete
3105 changes from being committed to the repository without user intervention.
3106 The work tree may be modified as desired and the histedit operation can be
3107 continued once the changes present in the work tree are considered complete.
3108 Alternatively, the histedit operation may be aborted which will leave
3109 the work tree switched back to its original branch.
3111 If a merge conflict is resolved in a way which renders the merged
3112 change into a no-op change, the corresponding commit will be elided
3113 when the histedit operation continues.
3116 will refuse to run if certain preconditions are not met.
3117 If the work tree's current branch is not in the
3119 reference namespace, the history of the branch may not be edited.
3120 If the work tree contains multiple base commits, it must first be updated
3121 to a single base commit with
3123 If changes have been staged with
3125 these changes must first be committed with
3129 If the work tree contains local changes, these changes must first be
3134 If the edited history contains changes to files outside of the work tree's
3135 path prefix, the work tree cannot be used to edit the history of this branch.
3143 commands will refuse to run while a histedit operation is in progress.
3144 Other commands which manipulate the work tree may be used, and the
3146 command may be used to commit arbitrary changes to the temporary branch
3147 while the histedit operation is interrupted.
3154 Abort an interrupted histedit operation.
3155 If this option is used, no other command-line arguments are allowed.
3157 Allow a histedit operation to continue with files in conflicted status.
3158 This option should generally be avoided, and can only be used with the
3162 Continue an interrupted histedit operation.
3163 If this option is used, no other command-line arguments are allowed except
3167 This option is a quick equivalent to a histedit script which drops all
3171 option can only be used when starting a new histedit operation.
3172 If this option is used, no other command-line arguments are allowed.
3174 Interrupt the histedit operation for editing after merging each commit.
3175 This option is a quick equivalent to a histedit script which uses the
3177 command for all commits.
3180 option can only be used when starting a new histedit operation.
3181 If this option is used, no other command-line arguments are allowed.
3182 .It Fl F Ar histedit-script
3185 instead of opening a temporary file in an editor where a histedit script
3188 Fold all commits into a single commit.
3189 This option is a quick equivalent to a histedit script which folds all
3190 commits, combining them all into one commit.
3193 option can only be used when starting a new histedit operation.
3194 If this option is used, no other command-line arguments are allowed.
3196 Show a list of past histedit operations, represented by references in the
3197 .Dq refs/got/backup/histedit
3198 reference namespace.
3200 Display the author, date, and log message of each backed up commit,
3201 the object ID of the corresponding post-histedit commit, and
3202 the object ID of their common ancestor commit.
3203 Given these object IDs,
3210 options can be used to examine the history of either version of the branch,
3215 option can be used to create a new branch from a pre-histedit state if desired.
3219 is specified, only show commits which at some point in time represented this
3221 Otherwise, list all backed up commits for any branches.
3223 If this option is used,
3225 does not require a work tree.
3226 None of the other options can be used together with
3229 Edit log messages only.
3230 This option is a quick equivalent to a histedit script which edits
3231 only log messages but otherwise leaves every picked commit as-is.
3234 option can only be used when starting a new histedit operation.
3235 If this option is used, no other command-line arguments are allowed.
3237 Delete backups created by past histedit operations, represented by references
3239 .Dq refs/got/backup/histedit
3240 reference namespace.
3244 is specified, only delete backups which at some point in time represented
3246 Otherwise, delete all references found within
3247 .Dq refs/got/backup/histedit .
3249 Any commit, tree, tag, and blob objects belonging to deleted backups
3250 remain in the repository and may be removed separately with
3251 Git's garbage collector or
3252 .Cm gotadmin cleanup .
3254 If this option is used,
3256 does not require a work tree.
3257 None of the other options can be used together with
3261 .It Cm integrate Ar branch
3263 Integrate the specified
3265 into the work tree's current branch.
3266 Files in the work tree are updated to match the contents on the integrated
3268 and the reference of the work tree's branch is changed to point at the
3269 head commit of the integrated
3272 Both branches can be considered equivalent after integration since they
3273 will be pointing at the same commit.
3274 Both branches remain available for future work, if desired.
3275 In case the integrated
3277 is no longer needed it may be deleted with
3280 Show the status of each affected file, using the following status codes:
3281 .Bl -column YXZ description
3282 .It U Ta file was updated
3283 .It D Ta file was deleted
3284 .It A Ta new file was added
3285 .It \(a~ Ta versioned file is obstructed by a non-regular file
3286 .It ! Ta a missing versioned file was restored
3290 will refuse to run if certain preconditions are not met.
3291 Most importantly, the
3293 must have been rebased onto the work tree's current branch with
3295 before it can be integrated, in order to linearize commit history and
3296 resolve merge conflicts.
3297 If the work tree contains multiple base commits, it must first be updated
3298 to a single base commit with
3300 If changes have been staged with
3302 these changes must first be committed with
3306 If the work tree contains local changes, these changes must first be
3320 into the current branch of the work tree.
3321 If the branches have diverged, merge changes into the work tree
3322 and create a merge commit.
3323 Otherwise, if the specified
3325 is already based on the work tree's current branch, make the work tree's
3326 current branch equivalent to the specified
3328 and update files in the work tree accordingly.
3330 Merge commits are commits based on multiple parent commits.
3331 The tip commit of the work tree's current branch will be used as the
3333 The tip commit of the specified
3335 will be used as the second parent.
3336 The work tree's current branch
3339 reference namespace and can be set with
3345 No ancestral relationship between the two branches is required.
3346 If the two branches have already been merged previously, only new changes
3349 It is not possible to create merge commits with more than two parents.
3350 If more than one branch needs to be merged, then multiple merge commits
3351 with two parents each can be created in sequence.
3353 If a linear project history is desired, then use of
3355 should generally be preferred over
3357 However, even strictly linear projects may require occasional merge commits,
3358 for example in order to merge in new versions of third-party code stored
3361 branches created with
3364 While merging changes found on the
3366 into the work tree, show the status of each affected file,
3367 using the following status codes:
3368 .Bl -column YXZ description
3369 .It G Ta file was merged
3370 .It C Ta file was merged and conflicts occurred during merge
3371 .It ! Ta changes destined for a missing file were not merged
3372 .It D Ta file was deleted
3373 .It d Ta file's deletion was prevented by local modifications
3374 .It A Ta new file was added
3375 .It \(a~ Ta changes destined for a non-regular file were not merged
3376 .It ? Ta changes destined for an unversioned file were not merged
3379 If merge conflicts occur, the merge operation is interrupted and conflicts
3380 must be resolved before the merge operation can continue.
3381 If any files with destined changes are found to be missing or unversioned,
3382 or if files could not be deleted due to differences in deleted content,
3383 the merge operation will be interrupted to prevent potentially incomplete
3384 changes from being committed to the repository without user intervention.
3385 The work tree may be modified as desired and the merge can be continued
3386 once the changes present in the work tree are considered complete.
3387 Alternatively, the merge operation may be aborted which will leave
3388 the work tree's current branch unmodified.
3391 will refuse to run if certain preconditions are not met.
3392 If the work tree's current branch is not in the
3394 reference namespace then the work tree must first be switched to a
3399 If the work tree is not yet fully updated to the tip commit of its
3400 branch, then the work tree must first be updated with
3402 If the work tree contains multiple base commits, it must first be updated
3403 to a single base commit with
3405 If changes have been staged with
3407 these changes must first be committed with
3411 If the work tree contains local changes, these changes must first be
3418 contains changes to files outside of the work tree's path prefix,
3419 the work tree cannot be used to merge this branch.
3429 commands will refuse to run while a merge operation is in progress.
3430 Other commands which manipulate the work tree may be used for
3431 conflict resolution purposes.
3438 Abort an interrupted merge operation.
3439 If this option is used, no other command-line arguments are allowed.
3441 Allow a merge operation to continue with files in conflicted status.
3442 This option should generally be avoided, and can only be used with the
3446 Continue an interrupted merge operation.
3447 If this option is used, no other command-line arguments are allowed except
3450 Create a merge commit even if the branches have not diverged.
3452 Merge changes into the work tree as usual but do not create a merge
3454 The merge result can be adjusted as desired before a merge commit is
3457 Alternatively, the merge may be aborted with
3464 .Op Fl F Ar response-script
3468 Stage local changes for inclusion in the next commit.
3471 is specified, stage all changes in the work tree.
3472 Otherwise, stage changes at or within the specified paths.
3473 Paths may be staged if they are added, modified, or deleted according to
3476 Show the status of each affected file, using the following status codes:
3477 .Bl -column YXZ description
3478 .It A Ta file addition has been staged
3479 .It M Ta file modification has been staged
3480 .It D Ta file deletion has been staged
3483 Staged file contents are saved in newly created blob objects in the repository.
3484 These blobs will be referred to by tree objects once staged changes have been
3487 Staged changes affect the behaviour of
3492 While paths with staged changes exist, the
3494 command will refuse to commit any paths which do not have staged changes.
3495 Local changes created on top of staged changes can only be committed if
3496 the path is staged again, or if the staged changes are committed first.
3499 command will show both local changes and staged changes.
3502 command is able to display local changes relative to staged changes,
3503 and to display staged changes relative to the repository.
3506 command cannot revert staged changes but may be used to revert
3507 local changes created on top of staged changes.
3513 .It Fl F Ar response-script
3521 responses line-by-line from the specified
3523 file instead of prompting interactively.
3525 Instead of staging new changes, list paths which are already staged,
3526 along with the IDs of staged blob objects and stage status codes.
3527 If paths were provided on the command line, show the staged paths
3528 among the specified paths.
3529 Otherwise, show all staged paths.
3531 Instead of staging the entire content of a changed file, interactively
3532 select or reject changes for staging based on
3536 (reject change), and
3538 (quit staging this file) responses.
3539 If a file is in modified status, individual patches derived from the
3540 modified file content can be staged.
3541 Files in added or deleted status may only be staged or rejected in
3544 Allow staging of symbolic links which point outside of the path space
3545 that is under version control.
3548 will reject such symbolic links due to safety concerns.
3551 may decide to represent such a symbolic link as a regular file which contains
3552 the link's target path, rather than creating an actual symbolic link which
3553 points outside of the work tree.
3554 Use of this option is discouraged because external mechanisms such as
3556 are better suited for managing symbolic links to paths not under
3561 will refuse to run if certain preconditions are not met.
3562 If a file contains merge conflicts, these conflicts must be resolved first.
3563 If a file is found to be out of date relative to the head commit on the
3564 work tree's current branch, the file must be updated with
3566 before it can be staged (however, this does not prevent the file from
3567 becoming out-of-date at some point after having been staged).
3575 commands will refuse to run while staged changes exist.
3576 If staged changes cannot be committed because a staged path
3577 is out of date, the path must be unstaged with
3579 before it can be updated with
3581 and may then be staged again if necessary.
3586 .Op Fl F Ar response-script
3590 Merge staged changes back into the work tree and put affected paths
3591 back into non-staged status.
3594 is specified, unstage all staged changes across the entire work tree.
3595 Otherwise, unstage changes at or within the specified paths.
3597 Show the status of each affected file, using the following status codes:
3598 .Bl -column YXZ description
3599 .It G Ta file was unstaged
3600 .It C Ta file was unstaged and conflicts occurred during merge
3601 .It ! Ta changes destined for a missing file were not merged
3602 .It D Ta file was staged as deleted and still is deleted
3603 .It d Ta file's deletion was prevented by local modifications
3604 .It \(a~ Ta changes destined for a non-regular file were not merged
3611 .It Fl F Ar response-script
3619 responses line-by-line from the specified
3621 file instead of prompting interactively.
3623 Instead of unstaging the entire content of a changed file, interactively
3624 select or reject changes for unstaging based on
3628 (keep change staged), and
3630 (quit unstaging this file) responses.
3631 If a file is staged in modified status, individual patches derived from the
3632 staged file content can be unstaged.
3633 Files staged in added or deleted status may only be unstaged in their entirety.
3639 .Op Fl r Ar repository-path
3642 Parse and print contents of objects to standard output in a line-based
3644 Content of commit, tree, and tag objects is printed in a way similar
3645 to the actual content stored in such objects.
3646 Blob object contents are printed as they would appear in files on disk.
3648 Attempt to interpret each argument as a reference, a tag name, or
3649 an object ID SHA1 hash.
3650 References will be resolved to an object ID.
3651 Tag names will resolved to a tag object.
3652 An abbreviated hash argument will be expanded to a full SHA1 hash
3653 automatically, provided the abbreviation is unique.
3655 If none of the above interpretations produce a valid result, or if the
3657 option is used, attempt to interpret the argument as a path which will
3658 be resolved to the ID of an object found at this path in the repository.
3665 Look up paths in the specified
3667 If this option is not used, paths are looked up in the commit resolved
3668 via the repository's HEAD reference.
3670 The expected argument is a commit ID SHA1 hash, or a reference name
3671 or keyword which will be resolved to a commit ID.
3672 An abbreviated hash argument will be expanded to a full SHA1 hash
3673 automatically, provided the abbreviation is unique.
3678 resolve to the work tree's base commit and branch head, respectively.
3679 The former is only valid if invoked in a work tree, while the latter will
3680 resolve to the tip of the work tree's current branch if invoked in a
3681 work tree, otherwise it will resolve to the repository's HEAD reference.
3682 Keywords and references may be appended with
3686 modifiers and an optional integer N to denote the
3687 Nth descendant or antecedent by first parent traversal, respectively;
3690 denotes the work tree branch head's 2nd generation ancestor, and
3692 denotes the 4th generation descendant of the work tree's base commit.
3695 will denote the 8th generation ancestor of the commit resolved by the
3702 modifier without a trailing integer has an implicit
3711 Interpret all arguments as paths only.
3712 This option can be used to resolve ambiguity in cases where paths
3713 look like tag names, reference names, or object IDs.
3714 .It Fl r Ar repository-path
3715 Use the repository at the specified path.
3716 If not specified, assume the repository is located at or above the current
3718 If this directory is a
3720 work tree, use the repository path associated with this work tree.
3722 .It Cm info Op Ar path ...
3723 Display meta-data stored in a work tree.
3728 The work tree to use is resolved implicitly by walking upwards from the
3729 current working directory.
3733 arguments are specified, show additional per-file information for tracked
3734 files located at or within these paths.
3737 argument corresponds to the work tree's root directory, display information
3738 for all tracked files.
3741 .Bl -tag -width GOT_IGNORE_GITCONFIG
3743 The author's name and email address, such as
3744 .Qq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3755 may fail to parse commits without an email address in author data,
3759 environment variables with a missing email address.
3761 .Ev GOT_AUTHOR will be overridden by configuration settings in
3767 configuration settings in the repository's
3774 configuration settings contained in Git's global
3776 configuration file will only be used if neither
3780 environment variable provide author information.
3781 .It Ev GOT_IGNORE_GITCONFIG
3782 If this variable is set then any remote repository definitions or author
3783 information found in Git configuration files will be ignored.
3784 .It Ev GOT_LOG_DEFAULT_LIMIT
3785 The default limit on the number of commits traversed by
3787 If set to zero, the limit is unbounded.
3788 This variable will be silently ignored if it is set to a non-numeric value.
3789 .It Ev VISUAL , EDITOR
3790 The editor spawned by
3798 text editor will be spawned.
3801 .Bl -tag -width packed-refs -compact
3803 Repository-wide configuration settings for
3807 configuration file located in the root directory of a Git repository
3808 supersedes any relevant settings in Git's
3812 .It Pa .got/got.conf
3813 Worktree-specific configuration settings for
3817 configuration file in the
3819 meta-data directory of a work tree supersedes any relevant settings in
3822 configuration file and Git's
3829 Enable tab-completion of
3834 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3836 Clone an existing Git repository for use with
3840 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3842 Unfortunately, many of the popular Git hosting sites do not offer anonymous
3844 Such sites will require an account to be created, and a public SSH key to be
3845 uploaded to this account, before repository access via ssh:// URLs will work.
3847 Most sites offer anonymous repository access via HTTPS:
3850 .Dl $ got clone https://github.com/openbsd/src.git
3852 Alternatively, for quick and dirty local testing of
3854 a new Git repository could be created and populated with files,
3855 e.g. from a temporary CVS checkout located at
3858 .Dl $ gotadmin init /var/git/src.git
3859 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3861 Check out a work tree from the Git repository to /usr/src:
3863 .Dl $ got checkout /var/git/src.git /usr/src
3865 View local changes in a work tree directory:
3867 .Dl $ got diff | less
3869 In a work tree, display files in a potentially problematic state:
3871 .Dl $ got status -s 'C!~?'
3873 Interactively revert selected local changes in a work tree directory:
3875 .Dl $ got revert -p -R\ .
3877 In a work tree or a git repository directory, list all branch references:
3881 As above, but list the most recently modified branches only:
3883 .Dl $ got branch -lt | head
3885 In a work tree or a git repository directory, create a new branch called
3886 .Dq unified-buffer-cache
3887 which is forked off the
3891 .Dl $ got branch -c master unified-buffer-cache
3893 Switch an existing work tree to the branch
3894 .Dq unified-buffer-cache .
3895 Local changes in the work tree will be preserved and merged if necessary:
3897 .Dl $ got update -b unified-buffer-cache
3899 Create a new commit from local changes in a work tree directory.
3900 This new commit will become the head commit of the work tree's current branch:
3904 In a work tree or a git repository directory, view changes committed in
3905 the 3 most recent commits to the work tree's branch, or the branch resolved
3906 via the repository's HEAD reference, respectively:
3908 .Dl $ got log -p -l 3
3910 As above, but display changes in the order in which
3912 could apply them in sequence:
3914 .Dl $ got log -p -l 3 -R
3916 In a work tree or a git repository directory, log the history of a subdirectory:
3918 .Dl $ got log sys/uvm
3920 While operating inside a work tree, paths are specified relative to the current
3921 working directory, so this command will log the subdirectory
3924 .Dl $ cd sys/uvm && got log\ .
3926 And this command has the same effect:
3928 .Dl $ cd sys/dev/usb && got log ../../uvm
3930 And this command displays work tree meta-data about all tracked files:
3933 .Dl $ got info\ . | less
3935 Add new files and remove obsolete files in a work tree directory:
3937 .Dl $ got add sys/uvm/uvm_ubc.c
3938 .Dl $ got remove sys/uvm/uvm_vnode.c
3940 A file can be renamed or moved by removing it from its old location
3941 and adding it at the new location:
3943 .Dl $ cp oldfile.c newfile.c
3944 .Dl $ got remove oldfile.c
3945 .Dl $ got add newfile.c
3948 does not yet follow file history across renames, but
3950 will be able to do so regardless.
3952 Create a new commit from local changes in a work tree directory
3953 with a pre-defined log message.
3955 .Dl $ got commit -m 'unify the buffer cache'
3957 Alternatively, create a new commit from local changes in a work tree
3958 directory with a log message that has been prepared in the file
3961 .Dl $ got commit -F /tmp/msg
3963 Update any work tree checked out from the
3964 .Dq unified-buffer-cache
3965 branch to the latest commit on this branch:
3969 Roll file content on the unified-buffer-cache branch back by one commit,
3970 and then fetch the rolled-back change into the work tree as a local change
3971 to be amended and perhaps committed again:
3973 .Dl $ got backout unified-buffer-cache
3974 .Dl $ got commit -m 'roll back previous'
3975 .Dl $ # now back out the previous backout :-)
3976 .Dl $ got backout unified-buffer-cache
3978 Fetch new changes on the remote repository's
3980 branch, making them visible on the local repository's
3989 branch to merge the new changes that are now visible on the
3994 .Dl $ got update -b origin/master
3995 .Dl $ got rebase master
3998 .Dq unified-buffer-cache
3999 branch on top of the new head commit of the
4003 .Dl $ got update -b master
4004 .Dl $ got rebase unified-buffer-cache
4006 Create a patch from all changes on the unified-buffer-cache branch.
4007 The patch can be mailed out for review and applied to
4011 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
4013 Edit the entire commit history of the
4014 .Dq unified-buffer-cache
4017 .Dl $ got update -b unified-buffer-cache
4018 .Dl $ got update -c master
4021 Before working against existing branches in a repository cloned with
4022 .Cm git clone --bare
4027 must be configured to map all references in the remote repository
4030 namespace of the local repository.
4031 This can be achieved by setting Git's
4032 .Pa remote.origin.fetch
4033 configuration variable to the value
4034 .Dq +refs/heads/*:refs/remotes/origin/*
4039 .Dl $ cd /var/git/repo
4040 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
4044 option must be disabled:
4046 .Dl $ cd /var/git/repo
4047 .Dl $ git config remote.origin.mirror false
4049 Alternatively, the following
4051 configuration item can be added manually to the Git repository's
4055 .Dl [remote \&"origin\&"]
4057 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
4060 This configuration leaves the local repository's
4062 namespace free for use by local branches checked out with
4064 and, if needed, created with
4067 .Dq refs/remotes/origin
4068 namespace can now be updated with incoming changes from the remote
4073 without extra command line arguments.
4074 Newly fetched changes can be examined with
4077 Display changes on the remote repository's version of the
4079 branch, as of the last time
4083 .Dl $ got log -c origin/master | less
4085 As shown here, most commands accept abbreviated reference names such as
4088 .Dq refs/remotes/origin/master .
4089 The latter is only needed in case of ambiguity.
4092 can be used to merge changes which are visible on the
4097 This will also merge local changes, if any, with the incoming changes:
4099 .Dl $ got update -b origin/master
4100 .Dl $ got rebase master
4102 In order to make changes committed to the
4103 .Dq unified-buffer-cache
4107 .Dq unified-buffer-cache
4108 branch can be rebased onto the
4112 .Dl $ got update -b master
4113 .Dl $ got rebase unified-buffer-cache
4116 .Dq unified-buffer-cache
4117 branch can now be made visible on the
4121 Because the rebase operation switched the work tree to the
4122 .Dq unified-buffer-cache
4123 branch, the work tree must be switched back to the
4127 .Dl $ got update -b master
4128 .Dl $ got integrate unified-buffer-cache
4132 branch, log messages for local changes can now be amended with
4134 by other developers and any other important new information:
4136 .Dl $ got update -c origin/master
4137 .Dl $ got histedit -m
4139 If the remote repository offers write access, local changes on the
4141 branch can be sent to the remote repository with
4145 can be run without further arguments.
4146 The arguments shown here match defaults, provided the work tree's
4147 current branch is the
4151 .Dl $ got send -b master origin
4153 If the remote repository requires the HTTPS protocol, the
4155 command must be used instead:
4157 .Dl $ cd /var/git/src.git
4158 .Dl $ git push origin master
4160 When making contributions to projects which use the
4162 workflow, SSH protocol repository access needs to be set up first.
4163 Once an account has been created on a Git hosting site it should
4164 be possible to upload a public SSH key for repository access
4169 workflow will usually involve two remote repositories.
4170 In the real-life example below, the
4172 repository was forked from the
4174 repository by using the Git hosting site's web interface.
4177 file in the local repository describes both remote repositories:
4178 .Bd -literal -offset indent
4179 # Jelmers's repository, which accepts pull requests
4181 server git@github.com
4183 repository "/jelmer/dulwich"
4187 # Stefan's fork, used as the default remote repository
4189 server git@github.com
4191 repository "/stspdotname/dulwich"
4196 With this configuration, Stefan can create commits on
4197 .Dq refs/heads/master
4198 and send them to the
4200 repository by running:
4202 .Dl $ got send -b master origin
4204 The changes can now be proposed to Jelmer by opening a pull request
4205 via the Git hosting site's web interface.
4206 If Jelmer requests further changes to be made, additional commits
4207 can be created on the
4209 branch and be added to the pull request by running
4213 If Jelmer prefers additional commits to be
4215 then the following commands can be used to achieve this:
4217 .Dl $ got update -b master
4218 .Dl $ got update -c origin/master
4219 .Dl $ got histedit -f
4220 .Dl $ got send -f -b master origin
4222 In addition to reviewing the pull request in the web user interface,
4223 Jelmer can fetch the pull request's branch into his local repository
4224 and create a local branch which contains the proposed changes:
4226 .Dl $ got fetch -R refs/pull/1046/head origin
4227 .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
4229 Once Jelmer has accepted the pull request, Stefan can fetch the
4230 merged changes, and possibly several other new changes, by running:
4232 .Dl $ got fetch upstream
4234 The merged changes will now be visible under the reference
4235 .Dq refs/remotes/upstream/master .
4238 branch can now be rebased on top of the latest changes
4241 .Dl $ got update -b upstream/master
4242 .Dl $ got rebase master
4244 As an alternative to
4246 branches can be merged with
4249 .Dl $ got update -b master
4250 .Dl $ got merge upstream/master
4252 The question of whether to rebase or merge branches is philosophical.
4253 When in doubt, refer to the software project's policies set by project
4256 As a final step, the forked repository's copy of the master branch needs
4257 to be kept in sync by sending the new changes there:
4259 .Dl $ got send -f -b master origin
4261 If multiple pull requests need to be managed in parallel, a separate branch
4262 must be created for each pull request with
4264 Each such branch can then be used as above, in place of
4265 .Dq refs/heads/master .
4266 Changes for any accepted pull requests will still appear under
4267 .Dq refs/remotes/upstream/master,
4268 regardless of which branch was used in the forked repository to
4269 create a pull request.
4273 .Xr git-repository 5 ,
4274 .Xr got-worktree 5 ,
4278 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
4279 .An Christian Weisgerber Aq Mt naddy@openbsd.org
4280 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
4281 .An Josh Rickmar Aq Mt jrick@zettaport.com
4282 .An Joshua Stein Aq Mt jcs@openbsd.org
4283 .An Klemens Nanni Aq Mt kn@openbsd.org
4284 .An Martin Pieuchot Aq Mt mpi@openbsd.org
4285 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
4286 .An Omar Polo Aq Mt op@openbsd.org
4287 .An Ori Bernstein Aq Mt ori@openbsd.org
4288 .An Sebastien Marie Aq Mt semarie@openbsd.org
4289 .An Stefan Sperling Aq Mt stsp@openbsd.org
4290 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
4291 .An Theo Buehler Aq Mt tb@openbsd.org
4292 .An Thomas Adam Aq Mt thomas@xteddy.org
4293 .An Tracey Emery Aq Mt tracey@traceyemery.net
4294 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
4301 were derived from code under copyright by:
4303 .An Caldera International
4304 .An Daniel Hartmeier
4309 .An Jean-Francois Brousseau
4315 .An Niklas Hallqvist
4320 .An Xavier Santolaria
4323 contains code contributed to the public domain by
4324 .An Austin Appleby .
4327 is a work-in-progress and some features remain to be implemented.
4329 At present, the user has to fall back on
4331 to perform some tasks.
4335 Writing to remote repositories over HTTP or HTTPS protocols requires
4338 The creation of merge commits with more than two parent commits requires
4341 In situations where files or directories were moved around
4343 will not automatically merge changes to new locations and
4345 will usually produce better results.