2 .\" Copyright (c) 2017 Martin Pieuchot
3 .\" Copyright (c) 2018, 2019, 2020 Stefan Sperling
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
30 is a version control system which stores the history of tracked files
31 in a Git repository, as used by the Git version control system.
32 This repository format is described in
33 .Xr git-repository 5 .
38 version control system because every copy of a repository is writeable.
39 Modifications made to files can be synchronized between repositories
44 must be checked out from the repository for modification.
45 Checked out files are stored in a
47 which can be placed at an arbitrary directory in the filesystem hierarchy.
48 The on-disk format of this work tree is described in
52 provides global and command-specific options.
53 Global options must precede the command name, and are as follows:
54 .Bl -tag -width tenletters
56 Display usage information and exit immediately.
58 Display program version and exit immediately.
64 .Bl -tag -width checkout
71 .Op Fl r Ar repository-path
75 Create an initial commit in a repository from the file hierarchy
78 The created commit will not have any parent commits, i.e. it will be a
80 Also create a new reference which provides a branch name for the newly
82 Show the path of each imported file to indicate progress.
88 environment variable to be set,
89 unless an author has been configured in
95 configuration settings can be obtained from the repository's
97 file or from Git's global
108 If this option is not specified, a branch corresponding to the repository's
109 HEAD reference will be used.
110 Use of this option is required if the branch resolved via the repository's
111 HEAD reference already exists.
113 Ignore files or directories with a name which matches the specified
115 This option may be specified multiple times to build a list of ignore patterns.
118 follows the globbing rules documented in
120 Ignore patterns which end with a slash,
122 will only match directories.
124 Use the specified log message when creating the new commit.
129 opens a temporary file in an editor where a log message can be written.
130 Quitting the editor without saving the file will abort the import operation.
131 .It Fl r Ar repository-path
132 Use the repository at the specified path.
133 If not specified, assume the repository is located at or above the current
141 .Op Fl R Ar reference
146 Clone a Git repository at the specified
152 is specified, the directory name will be derived from the name of the
155 will refuse to run if the
161 specifies a protocol scheme, a server hostname, an optional port number
162 separated from the hostname by a colon, and a path to the repository on
164 .Lk scheme://hostname:port/path/to/repository
166 The following protocol schemes are supported:
167 .Bl -tag -width git+ssh
169 The Git protocol as implemented by the
172 Use of this protocol is discouraged since it supports neither authentication
175 The Git protocol wrapped in an authenticated and encrypted
178 With this protocol the hostname may contain an embedded username for
183 Short alias for git+ssh.
194 Not compatible with Git HTTP servers using the
197 Use of this protocol is discouraged since it supports neither authentication
202 Git HTTP protocol wrapped in SSL/TLS.
205 Objects in the cloned repository are stored in a pack file which is downloaded
207 This pack file will then be indexed to facilitate access to the objects stored
209 If any objects in the pack file are stored in deltified form, all deltas will
210 be fully resolved in order to compute the ID of such objects.
211 This can take some time.
212 More details about the pack file format are documented in
213 .Xr git-repository 5 .
216 creates a remote repository entry in the
220 files of the cloned repository to store the
226 arguments for future use by
236 Fetch all branches from the remote repository's
238 reference namespace and set
239 .Cm fetch_all_branches
240 in the cloned repository's
242 file for future use by
244 If this option is not specified, a branch resolved via the remote
245 repository's HEAD reference will be fetched.
246 Cannot be used together with the
252 from the remote repository's
255 This option may be specified multiple times to build a list of branches
257 If the branch corresponding to the remote repository's HEAD reference is not
258 in this list, the cloned repository's HEAD reference will be set to the first
259 branch which was fetched.
260 If this option is not specified, a branch resolved via the remote
261 repository's HEAD reference will be fetched.
262 Cannot be used together with the
266 List branches and tags available for fetching from the remote repository
267 and exit immediately.
268 Cannot be used together with any of the other options except
273 Create the cloned repository as a mirror of the original repository.
274 This is useful if the cloned repository will not be used to store
275 locally created commits.
281 files will be set up with the
283 option enabled, such that
287 will write incoming changes directly to branches in the
289 reference namespace, rather than to branches in the
292 This avoids the usual requirement of having to run
298 in order to make incoming changes appear on branches in the
301 But maintaining custom changes in the cloned repository becomes difficult
302 since such changes will be at risk of being discarded whenever incoming
305 Suppress progress reporting output.
306 The same option will be passed to
309 .It Fl R Ar reference
310 In addition to the branches and tags that will be fetched, fetch an arbitrary
312 from the remote repository's
315 This option may be specified multiple times to build a list of additional
319 may either be a path to a specific reference, or a reference namespace
320 which will cause all references in this namespace to be fetched.
322 Each reference will be mapped into the cloned repository's
324 namespace, unless the
326 option is used to mirror references directly into the cloned repository's
331 will refuse to fetch references from the remote repository's
340 to print debugging messages to standard error output.
341 This option will be passed to
344 Multiple -v options increase the verbosity.
352 .Op Fl R Ar reference
353 .Op Fl r Ar repository-path
354 .Op Ar remote-repository
357 Fetch new changes from a remote repository.
359 .Ar remote-repository
363 The remote repository's URL is obtained from the corresponding entry in
367 file of the local repository, as created by
370 By default, any branches configured in
373 .Ar remote-repository
377 is invoked in a work tree then this work tree's current branch will be
378 fetched, too, provided it is present on the server.
379 If no branches to fetch can be found in
381 or via a work tree, or said branches are not found on the server, a branch
382 resolved via the remote repository's HEAD reference will be fetched.
383 Likewise, if a HEAD reference for the
384 .Ar remote-repository
385 exists but its target no longer matches the remote HEAD, then
386 the new target branch will be fetched.
387 This default behaviour can be overridden with the
393 New changes will be stored in a separate pack file downloaded from the server.
394 Optionally, separate pack files stored in the repository can be combined with
397 By default, branch references in the
399 reference namespace will be updated to point at the newly fetched commits.
404 command can then be used to make new changes visible on branches in the
406 namespace, merging incoming changes with the changes on those branches
409 If the repository was created as a mirror with
411 then all branches in the
413 namespace will be updated directly to match the corresponding branches in
414 the remote repository.
415 If those branches contained local commits, these commits will no longer be
416 reachable via a reference and will therefore be at risk of being discarded
417 by Git's garbage collector or
418 .Cm gotadmin cleanup .
419 Maintaining custom changes in a mirror repository is therefore discouraged.
421 In any case, references in the
423 namespace will always be fetched and mapped directly to local references
424 in the same namespace.
431 Fetch all branches from the remote repository's
434 This option can be enabled by default for specific repositories in
436 Cannot be used together with the
442 from the remote repository's
445 This option may be specified multiple times to build a list of branches
447 Cannot be used together with the
451 Delete branches and tags from the local repository which are no longer
452 present in the remote repository.
453 Only references are deleted.
454 Any commit, tree, tag, and blob objects belonging to deleted branches or
455 tags remain in the repository and may be removed separately with
456 Git's garbage collector or
457 .Cm gotadmin cleanup .
459 List branches and tags available for fetching from the remote repository
460 and exit immediately.
461 Cannot be used together with any of the other options except
467 Suppress progress reporting output.
468 The same option will be passed to
471 .It Fl R Ar reference
472 In addition to the branches and tags that will be fetched, fetch an arbitrary
474 from the remote repository's
477 This option may be specified multiple times to build a list of additional
481 may either be a path to a specific reference, or a reference namespace
482 which will cause all references in this namespace to be fetched.
484 Each reference will be mapped into the local repository's
486 namespace, unless the local repository was created as a mirror with
488 in which case references will be mapped directly into the local repository's
492 Once a reference has been fetched, a branch based on it can be created with
497 will refuse to fetch references from the remote repository's
502 .It Fl r Ar repository-path
503 Use the repository at the specified path.
504 If not specified, assume the repository is located at or above the current
506 If this directory is a
508 work tree, use the repository path associated with this work tree.
510 Allow existing references in the
512 namespace to be updated if they have changed on the server.
513 If not specified, only new tag references will be created.
518 to print debugging messages to standard error output.
519 The same option will be passed to
522 Multiple -v options increase the verbosity.
525 Delete all references which correspond to a particular
526 .Ar remote-repository
527 instead of fetching new changes.
528 This can be useful when a remote repository is being removed from
534 .Ar remote-repository
535 argument is mandatory and no other options except
542 Only references are deleted.
543 Any commit, tree, tag, and blob objects fetched from a remote repository
544 will generally be stored in pack files and may be removed separately with
546 and Git's garbage collector.
554 .Op Fl p Ar path-prefix
556 .Op Ar work-tree-path
559 Copy files from a repository into a new work tree.
560 Show the status of each affected file, using the following status codes:
561 .Bl -column YXZ description
562 .It A Ta new file was added
563 .It E Ta file already exists in work tree's meta-data
568 is not specified, either use the last component of
569 .Ar repository path ,
572 was specified use the last component of
580 Check out files from a commit on the specified
582 If this option is not specified, a branch resolved via the repository's HEAD
583 reference will be used.
585 Check out files from the specified
587 on the selected branch.
588 If this option is not specified, the most recent commit on the selected
593 argument is a commit ID SHA1 hash, or a reference name or a keyword
594 which will be resolved to a commit ID.
595 An abbreviated hash argument will be expanded to a full SHA1 hash
596 automatically, provided the abbreviation is unique.
601 resolve to the repository's HEAD reference, or, if the
603 option is used, the head of the checked-out
605 Keywords and reference names may be appended with
609 modifiers and an optional integer N to denote the
610 Nth descendant or antecedent by first parent traversal, respectively;
613 denotes the work tree branch head's 2nd generation ancestor, and
615 will denote the 3rd generation ancestor of the commit resolved by the
618 If an integer does not follow the
624 is implicitly appended
633 is not contained in the selected branch, a different branch which contains
634 this commit must be specified with the
637 If no such branch is known, a new branch must be created for this
643 Checking out work trees with an unknown branch is intentionally not supported.
645 Proceed with the checkout operation even if the directory at
648 Existing files will be left intact.
649 .It Fl p Ar path-prefix
650 Restrict the work tree to a subset of the repository's tree hierarchy.
651 Only files beneath the specified
655 Silence progress output.
666 Update an existing work tree to a different
668 Change existing files in the work tree as necessary to match file contents
670 Preserve any local changes in the work tree and merge them with the
673 Files which already contain merge conflicts will not be updated to avoid
674 further complications.
675 Such files will be updated when
677 is run again after merge conflicts have been resolved.
678 If the conflicting changes are no longer needed, affected files can be
685 Show the status of each affected file, using the following status codes:
686 .Bl -column YXZ description
687 .It U Ta file was updated and contained no local changes
688 .It G Ta file was updated and local changes were merged cleanly
689 .It C Ta file was updated and conflicts occurred during merge
690 .It D Ta file was deleted
691 .It d Ta file's deletion was prevented by local modifications
692 .It A Ta new file was added
693 .It \(a~ Ta versioned file is obstructed by a non-regular file
694 .It ! Ta a missing versioned file was restored
695 .It # Ta file was not updated because it contains merge conflicts
696 .It ? Ta changes destined for an unversioned file were not merged
701 is specified, update the entire work tree.
702 Otherwise, restrict the update operation to files at or within the
704 Each path is required to exist in the update operation's target commit.
705 Files in the work tree outside specified paths will remain unchanged and
706 will retain their previously recorded base commit.
709 commands may refuse to run while the work tree contains files from
710 multiple base commits.
711 The base commit of such a work tree can be made consistent by running
713 across the entire work tree.
716 is incompatible with the
721 cannot update paths with staged changes.
722 If changes have been staged with
724 these changes must first be committed with
734 Switch the work tree's branch reference to the specified
736 before updating the work tree.
737 This option requires that all paths in the work tree are updated.
739 As usual, any local changes in the work tree will be preserved.
740 This can be useful when switching to a newly created branch in order
741 to commit existing local changes to this branch.
743 Any local changes must be dealt with separately in order to obtain a
744 work tree with pristine file contents corresponding exactly to the specified
746 Such changes could first be committed to a different branch with
748 or could be discarded with
751 Update the work tree to the specified
753 If this option is not specified, the most recent commit on the work tree's
758 argument is a commit ID SHA1 hash, or a reference name or a keyword
759 which will be resolved to a commit ID.
760 An abbreviated hash argument will be expanded to a full SHA1 hash
761 automatically, provided the abbreviation is unique.
766 resolve to the work tree's base commit and branch head, respectively.
767 Keywords and reference names may be appended with
771 modifiers and an optional integer N to denote the
772 Nth descendant or antecedent, respectively, by first parent traversal;
775 denotes the work tree branch head's 2nd generation ancestor, and
777 denotes the 4th generation descendant of the work tree's base commit.
780 will denote the 3rd generation ancestor of the commit resolved by the
783 If an integer does not follow the
789 is implicitly appended
796 Silence progress output.
802 .Op Fl S Ar status-codes
803 .Op Fl s Ar status-codes
807 Show the current modification status of files in a work tree,
808 using the following status codes:
809 .Bl -column YXZ description
810 .It M Ta modified file
811 .It A Ta file scheduled for addition in next commit
812 .It D Ta file scheduled for deletion in next commit
813 .It C Ta modified or added file which contains merge conflicts
814 .It ! Ta versioned file was expected on disk but is missing
815 .It \(a~ Ta versioned file is obstructed by a non-regular file
816 .It ? Ta unversioned item not tracked by
818 .It m Ta modified file modes (executable bit only)
819 .It N Ta non-existent
821 specified on the command line
826 is specified, show modifications in the entire work tree.
827 Otherwise, show modifications at or within the specified paths.
829 If changes have been staged with
831 staged changes are shown in the second output column, using the following
833 .Bl -column YXZ description
834 .It M Ta file modification is staged
835 .It A Ta file addition is staged
836 .It D Ta file deletion is staged
839 Changes created on top of staged changes are indicated in the first column:
840 .Bl -column YXZ description
841 .It MM Ta file was modified after earlier changes have been staged
842 .It MA Ta file was modified after having been staged for addition
845 If the work tree contains the results of an interrupted
850 operation then display a message which shows the branches involved.
857 Show unversioned files even if they match an ignore pattern.
858 .It Fl S Ar status-codes
859 Suppress the output of files with a modification status matching any of the
860 single-character status codes contained in the
863 Any combination of codes from the above list of possible status codes
865 For staged files, status codes displayed in either column will be matched.
866 Cannot be used together with the
869 .It Fl s Ar status-codes
870 Only show files with a modification status matching any of the
871 single-character status codes contained in the
874 Any combination of codes from the above list of possible status codes
876 For staged files, status codes displayed in either column will be matched.
877 Cannot be used together with the
882 For compatibility with
893 files in each traversed directory and will not display unversioned files
894 which match these patterns.
895 Ignore patterns which end with a slash,
897 will only match directories.
902 supports consecutive asterisks,
904 which will match an arbitrary amount of directories.
908 only supports a single ignore pattern per line.
912 does not support negated ignore patterns prefixed with
914 and gives no special significance to the location of path component separators,
923 .Op Fl r Ar repository-path
924 .Op Fl S Ar search-pattern
928 Display history of a repository.
931 is specified, show only commits which modified this path.
932 If invoked in a work tree, the
934 is interpreted relative to the current working directory,
935 and the work tree's path prefix is implicitly prepended.
936 Otherwise, the path is interpreted relative to the repository root.
943 Display individual commits which were merged into the current branch
947 shows the linear history of the current branch only.
949 Set the number of context lines shown in diffs with
951 By default, 3 lines of context are shown.
953 Start traversing history at the specified
955 If this option is not specified, default to the work tree's current branch
956 if invoked in a work tree, or to the repository's HEAD reference.
960 argument is a commit ID SHA1 hash, or a reference name or a keyword
961 which will be resolved to a commit ID.
962 An abbreviated hash argument will be expanded to a full SHA1 hash
963 automatically, provided the abbreviation is unique.
968 resolve to the work tree's base commit and branch head, respectively.
969 The former is only valid if invoked in a work tree, while the latter will
970 resolve to the tip of the work tree's current branch if invoked in a
971 work tree, otherwise it will resolve to the repository's HEAD reference.
972 Keywords and references may be appended with
976 modifiers and an optional integer N to denote the
977 Nth descendant or antecedent, respectively, by first parent traversal;
980 denotes the HEAD reference's 2nd generation ancestor, and
982 denotes the 4th generation descendant of the work tree's base commit.
985 will denote the 3rd generation descendant of the commit resolved by the
992 modifier without a trailing integer has an implicit
1001 Display diffstat of changes introduced in each commit.
1002 Cannot be used with the
1007 option (diffstat displays a list of changed paths).
1009 Limit history traversal to a given number of commits.
1010 If this option is not specified, a default limit value of zero is used,
1011 which is treated as an unbounded limit.
1013 .Ev GOT_LOG_DEFAULT_LIMIT
1014 environment variable may be set to change this default value.
1016 Display the list of file paths changed in each commit, using the following
1018 .Bl -column YXZ description
1019 .It M Ta modified file
1020 .It D Ta file was deleted
1021 .It A Ta new file was added
1022 .It m Ta modified file modes (executable bit only)
1025 Cannot be used with the
1029 Display the patch of modifications made in each commit.
1032 is specified, only show the patch of modifications at or within this path.
1033 Cannot be used with the
1037 Determine a set of commits to display as usual, but display these commits
1039 .It Fl r Ar repository-path
1040 Use the repository at the specified path.
1041 If not specified, assume the repository is located at or above the current
1043 If this directory is a
1045 work tree, use the repository path associated with this work tree.
1046 .It Fl S Ar search-pattern
1047 If specified, show only commits with a log message, author name,
1048 committer name, or ID SHA1 hash matched by the extended regular
1050 .Ar search-pattern .
1051 Lines in committed patches will be matched if
1054 File paths changed by a commit will be matched if
1057 Regular expression syntax is documented in
1060 Display a short one-line summary of each commit, instead of the default
1062 Cannot be used together with the
1068 Display commits in topological order.
1069 This option has no effect without the
1071 option because a linear history is sorted in topological order by definition.
1072 Topological sorting is disabled by default because the present implementation
1073 requires that commit history is fully traversed before any output can be shown.
1075 Stop traversing commit history immediately after the specified
1082 argument is a commit ID SHA1 hash, or a reference name or a keyword
1083 which will be resolved to a commit ID.
1084 This option has no effect if the specified
1094 .Op Fl r Ar repository-path
1095 .Op Ar object1 Ar object2 | Ar path ...
1098 When invoked within a work tree without any arguments, display all
1099 local changes in the work tree.
1102 arguments are specified, only show changes within the specified paths.
1104 If two arguments are provided, treat each argument as a reference, a tag
1105 name, or an object ID SHA1 hash, and display differences between the
1106 corresponding objects.
1107 Both objects must be of the same type (blobs, trees, or commits).
1108 An abbreviated hash argument will be expanded to a full SHA1 hash
1109 automatically, provided the abbreviation is unique.
1110 If none of these interpretations produce a valid result or if the
1115 is running in a work tree, attempt to interpret the two arguments as paths.
1122 Treat file contents as ASCII text even if binary data is detected.
1124 Set the number of context lines shown in the diff.
1125 By default, 3 lines of context are shown.
1127 Show differences between commits in the repository.
1128 This option may be used up to two times.
1129 When used only once, show differences between the specified
1131 and its first parent commit.
1132 When used twice, show differences between the two specified commits.
1136 option is used, all non-option arguments will be interpreted as paths.
1139 arguments are provided, only show differences for the specified paths.
1143 argument is a commit ID SHA1 hash, or a reference name or a keyword
1144 which will be resolved to a commit ID.
1145 An abbreviated hash argument will be expanded to a full SHA1 hash
1146 automatically, provided the abbreviation is unique.
1151 resolve to the work tree's base commit and branch head, respectively.
1152 The former is only valid if invoked in a work tree, while the latter will
1153 resolve to the tip of the work tree's current branch if invoked in a
1154 work tree, otherwise it will resolve to the repository's HEAD reference.
1155 Keywords and references may be appended with
1159 modifiers and an optional integer N to denote the
1160 Nth descendant or antecedent, respectively, by first parent traversal;
1163 denotes the HEAD reference's 2nd generation ancestor, and
1165 denotes the 4th generation descendant of the work tree's base commit.
1168 will denote the 8th generation descendant of the commit resolved by the
1171 If an integer does not follow the
1177 is implicitly appended
1184 Cannot be used together with the
1188 Display diffstat of changes before the actual diff by annotating each file path
1189 or blob hash being diffed with the total number of lines added and removed.
1190 A summary line will display the total number of changes across all files.
1192 Interpret all arguments as paths only.
1193 This option can be used to resolve ambiguity in cases where paths
1194 look like tag names, reference names, or object IDs.
1195 This option is only valid when
1197 is invoked in a work tree.
1198 .It Fl r Ar repository-path
1199 Use the repository at the specified path.
1200 If not specified, assume the repository is located at or above the current
1202 If this directory is a
1204 work tree, use the repository path associated with this work tree.
1206 Show changes staged with
1208 instead of showing local changes in the work tree.
1209 This option is only valid when
1211 is invoked in a work tree.
1213 Ignore whitespace-only changes.
1219 .Op Fl r Ar repository-path
1223 Display line-by-line history of a file at the specified path.
1230 Start traversing history at the specified
1232 The expected argument is a commit ID SHA1 hash, or a reference name
1233 or a keyword which will be resolved to a commit ID.
1234 An abbreviated hash argument will be expanded to a full SHA1 hash
1235 automatically, provided the abbreviation is unique.
1240 resolve to the work tree's base commit and branch head, respectively.
1241 The former is only valid if invoked in a work tree, while the latter will
1242 resolve to the tip of the work tree's current branch if invoked in a
1243 work tree, otherwise it will resolve to the repository's HEAD reference.
1244 Keywords and references may be appended with
1248 modifiers and an optional integer N to denote the
1249 Nth descendant or antecedent by first parent traversal, respectively;
1252 denotes the work tree branch head's 2nd generation ancestor, and
1254 denotes the 4th generation descendant of the work tree's base commit.
1257 will denote the 5th generation ancestor of the commit resolved by the
1264 modifier without a trailing integer has an implicit
1272 .It Fl r Ar repository-path
1273 Use the repository at the specified path.
1274 If not specified, assume the repository is located at or above the current
1276 If this directory is a
1278 work tree, use the repository path associated with this work tree.
1285 .Op Fl r Ar repository-path
1289 Display a listing of files and directories at the specified
1290 directory path in the repository.
1291 Entries shown in this listing may carry one of the following trailing
1293 .Bl -column YXZ description
1294 .It @ Ta entry is a symbolic link
1295 .It / Ta entry is a directory
1296 .It * Ta entry is an executable file
1297 .It $ Ta entry is a Git submodule
1300 Symbolic link entries are also annotated with the target path of the link.
1304 is specified, list the repository path corresponding to the current
1305 directory of the work tree, or the root directory of the repository
1306 if there is no work tree.
1313 List files and directories as they appear in the specified
1316 The expected argument is a commit ID SHA1 hash, or a reference name
1317 or a keyword which will be resolved to a commit ID.
1318 An abbreviated hash argument will be expanded to a full SHA1 hash
1319 automatically, provided the abbreviation is unique.
1324 resolve to the work tree's base commit and branch head, respectively.
1325 The former is only valid if invoked in a work tree, while the latter will
1326 resolve to the tip of the work tree's current branch if invoked in a
1327 work tree, otherwise it will resolve to the repository's HEAD reference.
1328 Keywords and references may be appended with
1332 modifiers and an optional integer N to denote the
1333 Nth descendant or antecedent by first parent traversal, respectively;
1336 denotes the work tree branch head's 2nd generation ancestor, and
1338 denotes the 4th generation descendant of the work tree's base commit.
1341 will denote the 3rd generation ancestor of the commit resolved by the
1348 modifier without a trailing integer has an implicit
1357 Show object IDs of files (blob objects) and directories (tree objects).
1359 Recurse into sub-directories in the repository.
1360 .It Fl r Ar repository-path
1361 Use the repository at the specified path.
1362 If not specified, assume the repository is located at or above the current
1364 If this directory is a
1366 work tree, use the repository path associated with this work tree.
1372 .Op Fl r Ar repository-path
1373 .Op Fl s Ar reference
1376 Manage references in a repository.
1378 References may be listed, created, deleted, and changed.
1379 When creating, deleting, or changing a reference the specified
1381 must be an absolute reference name, i.e. it must begin with
1389 Create a reference or change an existing reference.
1390 The reference with the specified
1392 will point at the specified
1397 argument is an ID SHA1 hash or an existing reference or tag name
1398 or a keyword which will be resolved to the ID of a corresponding commit,
1399 tree, tag, or blob object.
1400 An abbreviated hash argument will be expanded to a full SHA1 hash
1401 automatically, provided the abbreviation is unique.
1406 resolve to the work tree's base commit and branch head, respectively.
1407 The former is only valid if invoked in a work tree, while the latter will
1408 resolve to the tip of the work tree's current branch if invoked in a
1409 work tree, otherwise it will resolve to the repository's HEAD reference.
1410 Keywords and reference names may be appended with
1414 modifiers and an optional integer N to denote the
1415 Nth descendant or antecedent by first parent traversal, respectively;
1418 denotes the work tree branch head's 2nd generation ancestor, and
1420 will denote the 3rd generation ancestor of the commit resolved by the
1423 If an integer does not follow the
1429 is implicitly appended
1436 Cannot be used together with any other options except
1439 Delete the reference with the specified
1441 from the repository.
1442 Any commit, tree, tag, and blob objects belonging to deleted references
1443 remain in the repository and may be removed separately with
1444 Git's garbage collector or
1445 .Cm gotadmin cleanup .
1446 Cannot be used together with any other options except
1449 List references in the repository.
1452 is specified, list all existing references in the repository.
1455 is a reference namespace, list all references in this namespace.
1456 Otherwise, show only the reference with the given
1458 Cannot be used together with any other options except
1462 .It Fl r Ar repository-path
1463 Use the repository at the specified path.
1464 If not specified, assume the repository is located at or above the current
1466 If this directory is a
1468 work tree, use the repository path associated with this work tree.
1469 .It Fl s Ar reference
1470 Create a symbolic reference, or change an existing symbolic reference.
1471 The symbolic reference with the specified
1473 will point at the specified
1475 which must already exist in the repository.
1476 Care should be taken not to create loops between references when
1477 this option is used.
1478 Cannot be used together with any other options except
1481 Sort listed references by modification time (most recently modified first)
1482 instead of sorting by lexicographical order.
1483 Use of this option requires the
1485 option to be used as well.
1493 .Op Fl r Ar repository-path
1497 Create, list, or delete branches.
1499 Local branches are managed via references which live in the
1501 reference namespace.
1504 command creates references in this namespace only.
1506 When deleting branches, the specified
1510 reference namespace first.
1511 If no corresponding branch is found, the
1513 namespace will be searched next.
1515 If invoked in a work tree without any arguments, print the name of the
1516 work tree's current branch.
1520 argument is passed, attempt to create a branch reference with the given name.
1521 By default the new branch reference will point at the latest commit on the
1522 work tree's current branch if invoked in a work tree, and otherwise to a commit
1523 resolved via the repository's HEAD reference.
1525 If invoked in a work tree, once the branch was created successfully
1526 switch the work tree's head reference to the newly created branch and
1527 update files across the entire work tree, just like
1528 .Cm got update -b Ar name
1530 Show the status of each affected file, using the following status codes:
1531 .Bl -column YXZ description
1532 .It U Ta file was updated and contained no local changes
1533 .It G Ta file was updated and local changes were merged cleanly
1534 .It C Ta file was updated and conflicts occurred during merge
1535 .It D Ta file was deleted
1536 .It A Ta new file was added
1537 .It \(a~ Ta versioned file is obstructed by a non-regular file
1538 .It ! Ta a missing versioned file was restored
1546 Make a newly created branch reference point at the specified
1548 The expected argument is a commit ID SHA1 hash, or a reference name or keyword
1549 which will be resolved to a commit ID.
1550 An abbreviated hash argument will be expanded to a full SHA1 hash
1551 automatically, provided the abbreviation is unique.
1556 resolve to the work tree's base commit and branch head, respectively.
1557 The former is only valid if invoked in a work tree, while the latter will
1558 resolve to the tip of the work tree's current branch if invoked in a
1559 work tree, otherwise it will resolve to the repository's HEAD reference.
1560 Keywords and references may be appended with
1564 modifiers and an optional integer N to denote the
1565 Nth descendant or antecedent by first parent traversal, respectively;
1568 denotes the work tree branch head's 2nd generation ancestor, and
1570 denotes the 4th generation descendant of the work tree's base commit.
1573 will denote the 3rd generation descendant of the commit resolved by the
1580 modifier without a trailing integer has an implicit
1589 Delete the branch with the specified
1595 reference namespace.
1597 Only the branch reference is deleted.
1598 Any commit, tree, and blob objects belonging to the branch
1599 remain in the repository and may be removed separately with
1600 Git's garbage collector or
1601 .Cm gotadmin cleanup .
1603 List all existing branches in the repository, including copies of remote
1604 repositories' branches in the
1606 reference namespace.
1608 If invoked in a work tree, the work tree's current branch is shown
1609 with one of the following annotations:
1610 .Bl -column YXZ description
1611 .It * Ta work tree's base commit and the base commit of all tracked files
1612 matches the branch tip
1613 .It \(a~ Ta work tree comprises mixed commits or its base commit is out-of-date
1616 Do not switch and update the work tree after creating a new branch.
1617 .It Fl r Ar repository-path
1618 Use the repository at the specified path.
1619 If not specified, assume the repository is located at or above the current
1621 If this directory is a
1623 work tree, use the repository path associated with this work tree.
1625 Sort listed branches by modification time (most recently modified first)
1626 instead of sorting by lexicographical order.
1629 reference namespace are listed before branches in
1632 Use of this option requires the
1634 option to be used as well.
1641 .Op Fl r Ar repository-path
1642 .Op Fl s Ar signer-id
1645 Manage tags in a repository.
1647 Tags are managed via references which live in the
1649 reference namespace.
1652 command operates on references in this namespace only.
1653 References in this namespace point at tag objects which contain a pointer
1654 to another object, a tag message, as well as author and timestamp information.
1656 Attempt to create a tag with the given
1658 and make this tag point at the given
1660 If no commit is specified, default to the latest commit on the work tree's
1661 current branch if invoked in a work tree, and to a commit resolved via
1662 the repository's HEAD reference otherwise.
1669 Make the newly created tag reference point at the specified
1673 argument is a commit ID SHA1 hash, or a reference or keyword
1674 which will be resolved to a commit ID.
1675 An abbreviated hash argument will be expanded to a full SHA1 hash
1676 automatically, provided the abbreviation is unique.
1681 resolve to the work tree's base commit and branch head, respectively.
1682 The former is only valid if invoked in a work tree, while the latter will
1683 resolve to the tip of the work tree's current branch if invoked in a
1684 work tree, otherwise it will resolve to the repository's HEAD reference.
1685 Keywords and references may be appended with
1689 modifiers and an optional integer N to denote the
1690 Nth descendant or antecedent by first parent traversal, respectively;
1693 denotes the work tree branch head's 2nd generation ancestor, and
1695 denotes the 4th generation descendant of the work tree's base commit.
1698 will denote the 3rd generation ancestor of the commit resolved by the
1705 modifier without a trailing integer has an implicit
1714 List all existing tags in the repository instead of creating a new tag.
1717 argument is passed, show only the tag with the given
1720 Use the specified tag message when creating the new tag.
1725 opens a temporary file in an editor where a tag message can be written.
1726 Quitting the editor without saving the file will abort the tag operation.
1727 .It Fl r Ar repository-path
1728 Use the repository at the specified path.
1729 If not specified, assume the repository is located at or above the current
1731 If this directory is a
1733 work tree, use the repository path associated with this work tree.
1734 .It Fl s Ar signer-id
1735 While creating a new tag, sign this tag with the identity given in
1738 For SSH-based signatures,
1740 is the path to a file which may refer to either a private SSH key,
1741 or a public SSH key with the private half available via
1744 will sign the tag object by invoking
1748 command, using the signature namespace
1750 for compatibility with
1753 Verify tag object signatures.
1756 is specified, show and verify the tag object with the provided name.
1757 Otherwise, list all tag objects and verify signatures where present.
1760 verifies SSH-based signatures by invoking
1763 .Fl Y Cm verify Fl f Ar allowed_signers .
1768 otherwise verification is impossible.
1771 During SSH signature creation and verification this option will be passed to
1773 Multiple -v options increase the verbosity.
1779 command will not delete tags or change existing tags.
1780 If a tag must be deleted, the
1782 command may be used to delete a tag's reference.
1783 This should only be done if the tag has not already been copied to
1790 Schedule unversioned files in a work tree for addition to the
1791 repository in the next commit.
1792 By default, files which match a
1794 ignore pattern will not be added.
1798 mentioned in the command line is not an unversioned file then
1801 To avoid unnecessary errors from paths picked up by file globbing patterns
1802 in the shell, paths in the argument list will be silently ignored if they
1805 at all, or if they are reported with one of the following status codes
1806 and do not have changes staged via
1808 .Bl -column YXZ description
1809 .It M Ta modified file
1810 .It A Ta file scheduled for addition in next commit
1811 .It C Ta modified or added file which contains merge conflicts
1812 .It m Ta modified file modes (executable bit only)
1820 Add files even if they match a
1824 Permit recursion into directories.
1825 If this option is not specified,
1827 will refuse to run if a specified
1835 .Op Fl s Ar status-codes
1839 Remove versioned files from a work tree and schedule them for deletion
1840 from the repository in the next commit.
1847 Perform the operation even if a file contains local modifications,
1848 and do not raise an error if a specified
1850 does not exist on disk.
1852 Keep affected files on disk.
1854 Permit recursion into directories.
1855 If this option is not specified,
1857 will refuse to run if a specified
1860 .It Fl s Ar status-codes
1861 Only delete files with a modification status matching one of the
1862 single-character status codes contained in the
1865 The following status codes may be specified:
1866 .Bl -column YXZ description
1867 .It M Ta modified file (this implies the
1870 .It ! Ta versioned file expected on disk but missing
1878 .Op Fl p Ar strip-count
1884 to files in a work tree.
1885 Files added or removed by a patch will be scheduled for addition or removal in
1888 The patch must be in the unified diff format as produced by
1895 diff when invoked with their
1900 argument is provided, read unified diff data from standard input instead.
1904 contains multiple patches, then attempt to apply each of them in sequence.
1906 Show the status of each affected file, using the following status codes:
1907 .Bl -column XYZ description
1908 .It M Ta file was modified
1909 .It G Ta file was merged using a merge-base found in the repository
1910 .It C Ta file was merged and conflicts occurred during merge
1911 .It D Ta file was deleted
1912 .It A Ta file was added
1913 .It # Ta failed to patch the file
1916 If a change does not match at its exact line number, attempt to
1917 apply it somewhere else in the file if a good spot can be found.
1918 Otherwise, the patch will fail to apply.
1922 will refuse to apply a patch if certain preconditions are not met.
1923 Files to be deleted must already be under version control, and must
1924 not have been scheduled for deletion already.
1925 Files to be added must not yet be under version control and must not
1926 already be present on disk.
1927 Files to be modified must already be under version control and may not
1928 contain conflict markers.
1930 If an error occurs, the
1932 operation will be aborted.
1933 Any changes made to the work tree up to this point will be left behind.
1934 Such changes can be viewed with
1936 and can be reverted with
1945 Attempt to locate files within the specified
1947 for use as a merge-base for 3-way merges.
1951 option is not used then
1953 will attempt to locate merge-bases via object IDs found in
1955 meta-data, such as produced by
1961 option is only recommended in the absence of such meta-data.
1963 Ideally, the specified
1965 should contain versions of files which the changes contained in the
1968 Files will be located by path, relative to the repository root.
1971 option is used then leading path components will be stripped
1972 before paths are looked up in the repository.
1974 In case no merge-base is available for a file, changes will be applied
1975 without doing a 3-way merge.
1976 Changes which do not apply cleanly may then be rejected entirely, rather
1977 than producing merge conflicts in the patched target file.
1981 argument is a commit ID SHA1 hash, or a reference name or a keyword
1982 which will be resolved to a commit ID.
1983 An abbreviated hash argument will be expanded to a full SHA1 hash
1984 automatically, provided the abbreviation is unique.
1989 resolve to the work tree's base commit and branch head, respectively.
1990 Keywords and references may be appended with
1994 modifiers and an optional integer N to denote the
1995 Nth descendant or antecedent by first parent traversal, respectively;
1998 denotes the work tree branch head's 2nd generation ancestor, and
2000 denotes the 4th generation descendant of the work tree's base commit.
2003 will denote the 3rd generation descendant of the commit resolved by the
2010 modifier without a trailing integer has an implicit
2019 Do not make any modifications to the work tree.
2020 This can be used to check whether a patch would apply without issues.
2023 contains diffs that affect the same file multiple times, the results
2024 displayed may be incorrect.
2025 .It Fl p Ar strip-count
2026 Specify the number of leading path components to strip from paths
2035 path prefixes generated by
2037 will be recognized and stripped automatically.
2039 Reverse the patch before applying it.
2045 .Op Fl F Ar response-script
2049 Revert any local changes in files at the specified paths in a work tree.
2050 File contents will be overwritten with those contained in the
2051 work tree's base commit.
2052 There is no way to bring discarded changes back after
2055 If a file was added with
2057 it will become an unversioned file again.
2058 If a file was deleted with
2060 it will be restored.
2066 .It Fl F Ar response-script
2074 responses line-by-line from the specified
2076 file instead of prompting interactively.
2078 Instead of reverting all changes in files, interactively select or reject
2079 changes to revert based on
2085 (quit reverting this file) responses.
2086 If a file is in modified status, individual patches derived from the
2087 modified file content can be reverted.
2088 Files in added or deleted status may only be reverted in their entirety.
2090 Permit recursion into directories.
2091 If this option is not specified,
2093 will refuse to run if a specified
2107 Create a new commit in the repository from changes in a work tree
2108 and use this commit as the new base commit for the work tree.
2111 is specified, commit all changes in the work tree.
2112 Otherwise, commit changes at or within the specified paths.
2114 If changes have been explicitly staged for commit with
2116 only commit staged changes and reject any specified paths which
2117 have not been staged.
2120 opens a temporary file in an editor where a log message can be written
2128 options are used together.
2129 Quitting the editor without saving the file will abort the commit operation.
2131 Show the status of each affected file, using the following status codes:
2132 .Bl -column YXZ description
2133 .It M Ta modified file
2134 .It D Ta file was deleted
2135 .It A Ta new file was added
2136 .It m Ta modified file modes (executable bit only)
2139 Files which are not part of the new commit will retain their previously
2140 recorded base commit.
2143 commands may refuse to run while the work tree contains files from
2144 multiple base commits.
2145 The base commit of such a work tree can be made consistent by running
2147 across the entire work tree.
2151 command requires the
2153 environment variable to be set,
2154 unless an author has been configured in
2160 configuration settings can be
2161 obtained from the repository's
2163 file or from Git's global
2172 Set author information in the newly created commit to
2174 This is useful when committing changes on behalf of someone else.
2177 argument must use the same format as the
2179 environment variable.
2181 In addition to storing author information, the newly created commit
2184 information which is obtained, as usual, from the
2186 environment variable, or
2188 or Git configuration settings.
2190 Allow committing files in conflicted status.
2192 Committing files with conflict markers should generally be avoided.
2193 Cases where conflict markers must be stored in the repository for
2194 some legitimate reason should be very rare.
2195 There are usually ways to avoid storing conflict markers verbatim by
2196 applying appropriate programming tricks.
2198 Use the prepared log message stored in the file found at
2200 when creating the new commit.
2202 opens a temporary file in an editor where the prepared log message can be
2203 reviewed and edited further if needed.
2204 Cannot be used together with the
2208 Use the specified log message when creating the new commit.
2209 Cannot be used together with the
2213 This option prevents
2215 from opening the commit message in an editor.
2216 It has no effect unless it is used together with the
2218 option and is intended for non-interactive use such as scripting.
2220 This option prevents
2222 from generating a diff of the to-be-committed changes in a temporary file
2223 which can be viewed while editing a commit message.
2225 Allow the addition of symbolic links which point outside of the path space
2226 that is under version control.
2229 will reject such symbolic links due to safety concerns.
2232 may decide to represent such a symbolic link as a regular file which contains
2233 the link's target path, rather than creating an actual symbolic link which
2234 points outside of the work tree.
2235 Use of this option is discouraged because external mechanisms such as
2237 are better suited for managing symbolic links to paths not under
2242 will refuse to run if certain preconditions are not met.
2243 If the work tree's current branch is not in the
2245 reference namespace, new commits may not be created on this branch.
2246 Local changes may only be committed if they are based on file content
2247 found in the most recent commit on the work tree's branch.
2248 If a path is found to be out of date,
2250 must be used first in order to merge local changes with changes made
2258 .Op Fl r Ar repository-path
2260 .Op Ar remote-repository
2263 Send new changes to a remote repository.
2265 .Ar remote-repository
2269 The remote repository's URL is obtained from the corresponding entry in
2273 file of the local repository, as created by
2276 All objects corresponding to new changes will be written to a temporary
2277 pack file which is then uploaded to the server.
2278 Upon success, references in the
2280 reference namespace of the local repository will be updated to point at
2281 the commits which have been sent.
2283 By default, changes will only be sent if they are based on up-to-date
2284 copies of relevant branches in the remote repository.
2285 If any changes to be sent are based on out-of-date copies or would
2286 otherwise break linear history of existing branches, new changes must
2287 be fetched from the server with
2289 and local branches must be rebased with
2296 option can be used to make exceptions to these requirements.
2303 Send all branches from the local repository's
2305 reference namespace.
2308 option is equivalent to listing all branches with multiple
2311 Cannot be used together with the
2317 from the local repository's
2319 reference namespace.
2320 This option may be specified multiple times to build a list of branches
2322 If this option is not specified, default to the work tree's current branch
2323 if invoked in a work tree, or to the repository's HEAD reference.
2324 Cannot be used together with the
2328 Delete the specified
2330 from the remote repository's
2332 reference namespace.
2333 This option may be specified multiple times to build a list of branches
2336 Only references are deleted.
2337 Any commit, tree, tag, and blob objects belonging to deleted branches
2338 may become subject to deletion by Git's garbage collector running on
2341 Requesting deletion of branches results in an error if the server
2342 does not support this feature or disallows the deletion of branches
2343 based on its configuration.
2345 Attempt to force the server to overwrite existing branches or tags
2346 in the remote repository, even when
2352 would usually be required before changes can be sent.
2353 The server may reject forced requests regardless, depending on its
2356 Any commit, tree, tag, and blob objects belonging to overwritten branches
2357 or tags may become subject to deletion by Git's garbage collector running
2362 reference namespace is globally shared between all repositories.
2365 option to overwrite tags is discouraged because it can lead to
2366 inconsistencies between the tags present in different repositories.
2367 In general, creating a new tag with a different name is recommended
2368 instead of overwriting an existing tag.
2372 option is particularly discouraged if changes being sent are based
2373 on an out-of-date copy of a branch in the remote repository.
2374 Instead of using the
2376 option, new changes should
2379 and local branches should be rebased with
2383 followed by another attempt to send the changes.
2387 option should only be needed in situations where the remote repository's
2388 copy of a branch or tag is known to be out-of-date and is considered
2390 The risks of creating inconsistencies between different repositories
2391 should also be taken into account.
2393 Suppress progress reporting output.
2394 The same option will be passed to
2397 .It Fl r Ar repository-path
2398 Use the repository at the specified path.
2399 If not specified, assume the repository is located at or above the current
2401 If this directory is a
2403 work tree, use the repository path associated with this work tree.
2405 Attempt to send all tags from the local repository's
2407 reference namespace.
2410 option is equivalent to listing all tags with multiple
2413 Cannot be used together with the
2419 from the local repository's
2421 reference namespace, in addition to any branches that are being sent.
2424 option may be specified multiple times to build a list of tags to send.
2425 No tags will be sent if the
2429 Raise an error if the specified
2431 already exists in the remote repository, unless the
2433 option is used to overwrite the server's copy of the tag.
2434 In general, creating a new tag with a different name is recommended
2435 instead of overwriting an existing tag.
2437 Cannot be used together with the
2444 to print debugging messages to standard error output.
2445 The same option will be passed to
2448 Multiple -v options increase the verbosity.
2458 Merge changes from a single
2463 should be on a different branch than the work tree's base commit.
2465 The expected argument is a commit ID SHA1 hash, or a reference name or
2466 keyword which will be resolved to a commit ID.
2467 An abbreviated hash argument will be expanded to a full SHA1 hash
2468 automatically, provided the abbreviation is unique.
2473 resolve to the work tree's base commit and branch head, respectively.
2474 Keywords and references may be appended with
2478 modifiers and an optional integer N to denote the
2479 Nth descendant or antecedent by first parent traversal, respectively;
2482 denotes the work tree branch head's 2nd generation ancestor, and
2484 denotes the 4th generation descendant of the work tree's base commit.
2487 will denote the 3rd generation descendant of the commit resolved by the
2494 modifier without a trailing integer has an implicit
2503 Show the status of each affected file, using the following status codes:
2504 .Bl -column YXZ description
2505 .It G Ta file was merged
2506 .It C Ta file was merged and conflicts occurred during merge
2507 .It ! Ta changes destined for a missing file were not merged
2508 .It D Ta file was deleted
2509 .It d Ta file's deletion was prevented by local modifications
2510 .It A Ta new file was added
2511 .It \(a~ Ta changes destined for a non-regular file were not merged
2512 .It ? Ta changes destined for an unversioned file were not merged
2515 The merged changes will appear as local changes in the work tree, which
2518 amended manually or with further
2524 If invoked in a work tree where no
2529 operation is taking place,
2531 creates a record of commits which have been merged into the work tree.
2532 When a file changed by
2536 the log messages of relevant merged commits will then appear in the editor,
2537 where the messages should be further adjusted to convey the reasons for
2538 cherrypicking the changes.
2539 Upon exiting the editor, if the time stamp of the log message file
2540 is unchanged or the log message is empty,
2542 will fail with an unmodified or empty log message error.
2544 If all the changes in all files touched by a given commit are discarded,
2547 this commit's log message record will also disappear.
2550 will refuse to run if certain preconditions are not met.
2551 If the work tree contains multiple base commits, it must first be updated
2552 to a single base commit with
2554 If any relevant files already contain merge conflicts, these
2555 conflicts must be resolved first.
2563 Display a list of commit log messages recorded by cherrypick operations,
2564 represented by references in the
2565 .Dq refs/got/worktree
2566 reference namespace.
2569 is specified, only show the log message of the specified commit.
2571 If invoked in a work tree, only log messages recorded by cherrypick operations
2572 in the current work tree will be displayed.
2573 Otherwise, all commit log messages will be displayed irrespective of the
2574 work tree in which they were created.
2575 This option cannot be used with
2578 Delete log messages created by previous cherrypick operations, represented by
2580 .Dq refs/got/worktree
2581 reference namespace.
2584 is specified, only delete the log message of the specified commit.
2586 If invoked in a work tree, only log messages recorded by cherrypick operations
2587 in the current work tree will be deleted.
2588 Otherwise, all commit log messages will be deleted irrespective of the
2589 work tree in which they were created.
2590 This option cannot be used with
2601 Reverse-merge changes from a single
2606 should be on the same branch as the work tree's base commit.
2608 The expected argument is a commit ID SHA1 hash, or a reference name
2609 or keyword which will be resolved to a commit ID.
2610 An abbreviated hash argument will be expanded to a full SHA1 hash
2611 automatically, provided the abbreviation is unique.
2616 resolve to the work tree's base commit and branch head, respectively.
2617 Keywords and references may be appended with
2621 modifiers and an optional integer N to denote the
2622 Nth descendant or antecedent by first parent traversal, respectively;
2625 denotes the work tree branch head's 2nd generation ancestor, and
2627 denotes the 4th generation descendant of the work tree's base commit.
2630 will denote the 5th generation descendant of the commit resolved by the
2637 modifier without a trailing integer has an implicit
2646 Show the status of each affected file, using the following status codes:
2647 .Bl -column YXZ description
2648 .It G Ta file was merged
2649 .It C Ta file was merged and conflicts occurred during merge
2650 .It ! Ta changes destined for a missing file were not merged
2651 .It D Ta file was deleted
2652 .It d Ta file's deletion was prevented by local modifications
2653 .It A Ta new file was added
2654 .It \(a~ Ta changes destined for a non-regular file were not merged
2655 .It ? Ta changes destined for an unversioned file were not merged
2658 The reverse-merged changes will appear as local changes in the work tree,
2659 which may be viewed with
2661 amended manually or with further
2667 If invoked in a work tree where no
2672 operation is taking place,
2674 creates a record of commits which have been reverse-merged into the work tree.
2675 When a file changed by
2679 the log messages of relevant reverse-merged commits will then appear in
2680 the editor, where the messages should be further adjusted to convey the
2681 reasons for backing out the changes.
2682 Upon exiting the editor, if the time stamp of the log message file
2683 is unchanged or the log message is empty,
2685 will fail with an unmodified or empty log message error.
2687 If all the changes in all files touched by a given commit are discarded,
2690 this commit's log message record will also disappear.
2693 will refuse to run if certain preconditions are not met.
2694 If the work tree contains multiple base commits, it must first be updated
2695 to a single base commit with
2697 If any relevant files already contain merge conflicts, these
2698 conflicts must be resolved first.
2706 Display a list of commit log messages recorded by backout operations,
2707 represented by references in the
2708 .Dq refs/got/worktree
2709 reference namespace.
2712 is specified, only show the log message of the specified commit.
2714 If invoked in a work tree, only log messages recorded by backout operations
2715 in the current work tree will be displayed.
2716 Otherwise, all commit log messages will be displayed irrespective of the
2717 work tree in which they were created.
2718 This option cannot be used with
2721 Delete log messages created by previous backout operations, represented by
2723 .Dq refs/got/worktree
2724 reference namespace.
2727 is specified, only delete the log message of the specified commit.
2729 If invoked in a work tree, only log messages recorded by backout operations
2730 in the current work tree will be deleted.
2731 Otherwise, all commit log messages will be deleted irrespective of the
2732 work tree in which they were created.
2733 This option cannot be used with
2744 Rebase commits on the specified
2746 onto the tip of the current branch of the work tree.
2749 must share common ancestry with the work tree's current branch.
2750 Rebasing begins with the first descendant commit of the youngest
2751 common ancestor commit shared by the specified
2753 and the work tree's current branch, and stops once the tip commit
2760 is used as intended, the specified
2762 represents a local commit history and may already contain changes
2763 that are not yet visible in any other repositories.
2764 The work tree's current branch, which must be set with
2768 operation, represents a branch from a remote repository which shares
2769 a common history with the specified
2771 but has progressed, and perhaps diverged, due to commits added to the
2774 Rebased commits are accumulated on a temporary branch which the work tree
2775 will remain switched to throughout the entire rebase operation.
2776 Commits on this branch represent the same changes with the same log
2777 messages as their counterparts on the original
2779 but with different commit IDs.
2780 Once rebasing has completed successfully, the temporary branch becomes
2781 the new version of the specified
2783 and the work tree is automatically switched to it.
2784 If author information is available via the
2786 environment variable,
2792 configuration settings, this author information will be used to identify
2797 Old commits in their pre-rebase state are automatically backed up in the
2798 .Dq refs/got/backup/rebase
2799 reference namespace.
2800 As long as these references are not removed older versions of rebased
2801 commits will remain in the repository and can be viewed with the
2804 Removal of these references makes objects which become unreachable via
2805 any reference subject to removal by Git's garbage collector or
2806 .Cm gotadmin cleanup .
2808 While rebasing commits, show the status of each affected file,
2809 using the following status codes:
2810 .Bl -column YXZ description
2811 .It G Ta file was merged
2812 .It C Ta file was merged and conflicts occurred during merge
2813 .It ! Ta changes destined for a missing file were not merged
2814 .It D Ta file was deleted
2815 .It d Ta file's deletion was prevented by local modifications
2816 .It A Ta new file was added
2817 .It \(a~ Ta changes destined for a non-regular file were not merged
2818 .It ? Ta changes destined for an unversioned file were not merged
2821 If merge conflicts occur, the rebase operation is interrupted and may
2822 be continued once conflicts have been resolved.
2823 If any files with destined changes are found to be missing or unversioned,
2824 or if files could not be deleted due to differences in deleted content,
2825 the rebase operation will be interrupted to prevent potentially incomplete
2826 changes from being committed to the repository without user intervention.
2827 The work tree may be modified as desired and the rebase operation can be
2828 continued once the changes present in the work tree are considered complete.
2829 Alternatively, the rebase operation may be aborted which will leave
2831 unmodified and the work tree switched back to its original branch.
2833 If a merge conflict is resolved in a way which renders the merged
2834 change into a no-op change, the corresponding commit will be elided
2835 when the rebase operation continues.
2838 will refuse to run if certain preconditions are not met.
2843 reference namespace, the branch may not be rebased.
2844 If the work tree is not yet fully updated to the tip commit of its
2845 branch, then the work tree must first be updated with
2847 If changes have been staged with
2849 these changes must first be committed with
2853 If the work tree contains local changes, these changes must first be
2860 contains changes to files outside of the work tree's path prefix,
2861 the work tree cannot be used to rebase this branch.
2870 commands will refuse to run while a rebase operation is in progress.
2871 Other commands which manipulate the work tree may be used for
2872 conflict resolution purposes.
2876 is already based on the work tree's current branch, then no commits
2877 need to be rebased and
2879 will simply switch the work tree to the specified
2881 and update files in the work tree accordingly.
2888 Abort an interrupted rebase operation.
2889 If this option is used, no other command-line arguments are allowed.
2891 Allow a rebase operation to continue with files in conflicted status.
2892 This option should generally be avoided, and can only be used with the
2896 Continue an interrupted rebase operation.
2897 If this option is used, no other command-line arguments are allowed except
2900 Show a list of past rebase operations, represented by references in the
2901 .Dq refs/got/backup/rebase
2902 reference namespace.
2904 Display the author, date, and log message of each backed up commit,
2905 the object ID of the corresponding post-rebase commit, and
2906 the object ID of their common ancestor commit.
2907 Given these object IDs,
2914 options can be used to examine the history of either version of the branch,
2919 option can be used to create a new branch from a pre-rebase state if desired.
2923 is specified, only show commits which at some point in time represented this
2925 Otherwise, list all backed up commits for any branches.
2927 If this option is used,
2929 does not require a work tree.
2930 None of the other options can be used together with
2933 Delete backups created by past rebase operations, represented by references
2935 .Dq refs/got/backup/rebase
2936 reference namespace.
2940 is specified, only delete backups which at some point in time represented
2942 Otherwise, delete all references found within
2943 .Dq refs/got/backup/rebase .
2945 Any commit, tree, tag, and blob objects belonging to deleted backups
2946 remain in the repository and may be removed separately with
2947 Git's garbage collector or
2948 .Cm gotadmin cleanup .
2950 If this option is used,
2952 does not require a work tree.
2953 None of the other options can be used together with
2960 .Op Fl F Ar histedit-script
2964 Edit commit history between the work tree's current base commit and
2965 the tip commit of the work tree's current branch.
2969 command requires the
2971 environment variable to be set,
2972 unless an author has been configured in
2978 configuration settings can be obtained from the repository's
2980 file or from Git's global
2986 operation, the work tree's current branch must be set with
2988 to the branch which should be edited, unless this branch is already the
2989 current branch of the work tree.
2990 The tip of this branch represents the upper bound (inclusive) of commits
2995 Furthermore, the work tree's base commit
2998 to a point in this branch's commit history where editing should begin.
2999 This commit represents the lower bound (non-inclusive) of commits touched
3004 Editing of commit history is controlled via a
3006 which can be written in an editor based on a template, passed on the
3007 command line, or generated with the
3014 Quitting the editor without saving the file will abort the histedit operation.
3016 The format of the histedit script is line-based.
3017 Each line in the script begins with a command name, followed by
3018 whitespace and an argument.
3019 For most commands, the expected argument is a commit ID SHA1 hash.
3020 Any remaining text on the line is ignored.
3021 Lines which begin with the
3023 character are ignored entirely.
3025 The available histedit script commands are as follows:
3026 .Bl -column YXZ pick-commit
3027 .It Cm pick Ar commit Ta Use the specified commit as it is.
3028 .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
3029 then interrupt the histedit operation for amending, without creating a commit.
3030 While the histedit operation is interrupted arbitrary files may be edited,
3031 and commands which manipulate the work tree can be used freely.
3036 commands can be used to add new files or remove existing ones.
3039 command can be used to eliminate arbitrary changes from files in the work tree.
3042 command may be used to prepare a subset of changes for inclusion in the
3046 command can be used to insert arbitrary commits into the edited history.
3047 Regular editing of history must eventually be resumed by running
3048 .Cm got histedit -c .
3049 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
3050 listed further below that will be used.
3051 .It Cm drop Ar commit Ta Remove this commit from the edited history.
3052 .It Cm mesg Ar commit Ta Open an editor to create a new log message for this
3056 Every commit in the history being edited must be mentioned in the script.
3057 Lines may be re-ordered to change the order of commits in the edited history.
3058 No commit may be listed more than once.
3060 Edited commits are accumulated on a temporary branch which the work tree
3061 will remain switched to throughout the entire histedit operation.
3062 Once history editing has completed successfully, the temporary branch becomes
3063 the new version of the work tree's branch and the work tree is automatically
3066 Old commits in their pre-histedit state are automatically backed up in the
3067 .Dq refs/got/backup/histedit
3068 reference namespace.
3069 As long as these references are not removed older versions of edited
3070 commits will remain in the repository and can be viewed with the
3073 Removal of these references makes objects which become unreachable via
3074 any reference subject to removal by Git's garbage collector or
3075 .Cm gotadmin cleanup .
3077 While merging commits, show the status of each affected file,
3078 using the following status codes:
3079 .Bl -column YXZ description
3080 .It G Ta file was merged
3081 .It C Ta file was merged and conflicts occurred during merge
3082 .It ! Ta changes destined for a missing file were not merged
3083 .It D Ta file was deleted
3084 .It d Ta file's deletion was prevented by local modifications
3085 .It A Ta new file was added
3086 .It \(a~ Ta changes destined for a non-regular file were not merged
3087 .It ? Ta changes destined for an unversioned file were not merged
3090 If merge conflicts occur, the histedit operation is interrupted and may
3091 be continued once conflicts have been resolved.
3092 If any files with destined changes are found to be missing or unversioned,
3093 or if files could not be deleted due to differences in deleted content,
3094 the histedit operation will be interrupted to prevent potentially incomplete
3095 changes from being committed to the repository without user intervention.
3096 The work tree may be modified as desired and the histedit operation can be
3097 continued once the changes present in the work tree are considered complete.
3098 Alternatively, the histedit operation may be aborted which will leave
3099 the work tree switched back to its original branch.
3101 If a merge conflict is resolved in a way which renders the merged
3102 change into a no-op change, the corresponding commit will be elided
3103 when the histedit operation continues.
3106 will refuse to run if certain preconditions are not met.
3107 If the work tree's current branch is not in the
3109 reference namespace, the history of the branch may not be edited.
3110 If the work tree contains multiple base commits, it must first be updated
3111 to a single base commit with
3113 If changes have been staged with
3115 these changes must first be committed with
3119 If the work tree contains local changes, these changes must first be
3124 If the edited history contains changes to files outside of the work tree's
3125 path prefix, the work tree cannot be used to edit the history of this branch.
3133 commands will refuse to run while a histedit operation is in progress.
3134 Other commands which manipulate the work tree may be used, and the
3136 command may be used to commit arbitrary changes to the temporary branch
3137 while the histedit operation is interrupted.
3144 Abort an interrupted histedit operation.
3145 If this option is used, no other command-line arguments are allowed.
3147 Allow a histedit operation to continue with files in conflicted status.
3148 This option should generally be avoided, and can only be used with the
3152 Continue an interrupted histedit operation.
3153 If this option is used, no other command-line arguments are allowed except
3157 This option is a quick equivalent to a histedit script which drops all
3161 option can only be used when starting a new histedit operation.
3162 If this option is used, no other command-line arguments are allowed.
3164 Interrupt the histedit operation for editing after merging each commit.
3165 This option is a quick equivalent to a histedit script which uses the
3167 command for all commits.
3170 option can only be used when starting a new histedit operation.
3171 If this option is used, no other command-line arguments are allowed.
3172 .It Fl F Ar histedit-script
3175 instead of opening a temporary file in an editor where a histedit script
3178 Fold all commits into a single commit.
3179 This option is a quick equivalent to a histedit script which folds all
3180 commits, combining them all into one commit.
3183 option can only be used when starting a new histedit operation.
3184 If this option is used, no other command-line arguments are allowed.
3186 Show a list of past histedit operations, represented by references in the
3187 .Dq refs/got/backup/histedit
3188 reference namespace.
3190 Display the author, date, and log message of each backed up commit,
3191 the object ID of the corresponding post-histedit commit, and
3192 the object ID of their common ancestor commit.
3193 Given these object IDs,
3200 options can be used to examine the history of either version of the branch,
3205 option can be used to create a new branch from a pre-histedit state if desired.
3209 is specified, only show commits which at some point in time represented this
3211 Otherwise, list all backed up commits for any branches.
3213 If this option is used,
3215 does not require a work tree.
3216 None of the other options can be used together with
3219 Edit log messages only.
3220 This option is a quick equivalent to a histedit script which edits
3221 only log messages but otherwise leaves every picked commit as-is.
3224 option can only be used when starting a new histedit operation.
3225 If this option is used, no other command-line arguments are allowed.
3227 Delete backups created by past histedit operations, represented by references
3229 .Dq refs/got/backup/histedit
3230 reference namespace.
3234 is specified, only delete backups which at some point in time represented
3236 Otherwise, delete all references found within
3237 .Dq refs/got/backup/histedit .
3239 Any commit, tree, tag, and blob objects belonging to deleted backups
3240 remain in the repository and may be removed separately with
3241 Git's garbage collector or
3242 .Cm gotadmin cleanup .
3244 If this option is used,
3246 does not require a work tree.
3247 None of the other options can be used together with
3251 .It Cm integrate Ar branch
3253 Integrate the specified
3255 into the work tree's current branch.
3256 Files in the work tree are updated to match the contents on the integrated
3258 and the reference of the work tree's branch is changed to point at the
3259 head commit of the integrated
3262 Both branches can be considered equivalent after integration since they
3263 will be pointing at the same commit.
3264 Both branches remain available for future work, if desired.
3265 In case the integrated
3267 is no longer needed it may be deleted with
3270 Show the status of each affected file, using the following status codes:
3271 .Bl -column YXZ description
3272 .It U Ta file was updated
3273 .It D Ta file was deleted
3274 .It A Ta new file was added
3275 .It \(a~ Ta versioned file is obstructed by a non-regular file
3276 .It ! Ta a missing versioned file was restored
3280 will refuse to run if certain preconditions are not met.
3281 Most importantly, the
3283 must have been rebased onto the work tree's current branch with
3285 before it can be integrated, in order to linearize commit history and
3286 resolve merge conflicts.
3287 If the work tree contains multiple base commits, it must first be updated
3288 to a single base commit with
3290 If changes have been staged with
3292 these changes must first be committed with
3296 If the work tree contains local changes, these changes must first be
3310 into the current branch of the work tree.
3311 If the branches have diverged, merge changes into the work tree
3312 and create a merge commit.
3313 Otherwise, if the specified
3315 is already based on the work tree's current branch, make the work tree's
3316 current branch equivalent to the specified
3318 and update files in the work tree accordingly.
3320 Merge commits are commits based on multiple parent commits.
3321 The tip commit of the work tree's current branch will be used as the
3323 The tip commit of the specified
3325 will be used as the second parent.
3326 The work tree's current branch
3329 reference namespace and can be set with
3335 No ancestral relationship between the two branches is required.
3336 If the two branches have already been merged previously, only new changes
3339 It is not possible to create merge commits with more than two parents.
3340 If more than one branch needs to be merged, then multiple merge commits
3341 with two parents each can be created in sequence.
3343 If a linear project history is desired, then use of
3345 should generally be preferred over
3347 However, even strictly linear projects may require occasional merge commits,
3348 for example in order to merge in new versions of third-party code stored
3351 branches created with
3354 While merging changes found on the
3356 into the work tree, show the status of each affected file,
3357 using the following status codes:
3358 .Bl -column YXZ description
3359 .It G Ta file was merged
3360 .It C Ta file was merged and conflicts occurred during merge
3361 .It ! Ta changes destined for a missing file were not merged
3362 .It D Ta file was deleted
3363 .It d Ta file's deletion was prevented by local modifications
3364 .It A Ta new file was added
3365 .It \(a~ Ta changes destined for a non-regular file were not merged
3366 .It ? Ta changes destined for an unversioned file were not merged
3369 If merge conflicts occur, the merge operation is interrupted and conflicts
3370 must be resolved before the merge operation can continue.
3371 If any files with destined changes are found to be missing or unversioned,
3372 or if files could not be deleted due to differences in deleted content,
3373 the merge operation will be interrupted to prevent potentially incomplete
3374 changes from being committed to the repository without user intervention.
3375 The work tree may be modified as desired and the merge can be continued
3376 once the changes present in the work tree are considered complete.
3377 Alternatively, the merge operation may be aborted which will leave
3378 the work tree's current branch unmodified.
3381 will refuse to run if certain preconditions are not met.
3382 If the work tree's current branch is not in the
3384 reference namespace then the work tree must first be switched to a
3389 If the work tree is not yet fully updated to the tip commit of its
3390 branch, then the work tree must first be updated with
3392 If the work tree contains multiple base commits, it must first be updated
3393 to a single base commit with
3395 If changes have been staged with
3397 these changes must first be committed with
3401 If the work tree contains local changes, these changes must first be
3408 contains changes to files outside of the work tree's path prefix,
3409 the work tree cannot be used to merge this branch.
3419 commands will refuse to run while a merge operation is in progress.
3420 Other commands which manipulate the work tree may be used for
3421 conflict resolution purposes.
3428 Abort an interrupted merge operation.
3429 If this option is used, no other command-line arguments are allowed.
3431 Allow a merge operation to continue with files in conflicted status.
3432 This option should generally be avoided, and can only be used with the
3436 Continue an interrupted merge operation.
3437 If this option is used, no other command-line arguments are allowed except
3440 Create a merge commit even if the branches have not diverged.
3442 Merge changes into the work tree as usual but do not create a merge
3444 The merge result can be adjusted as desired before a merge commit is
3447 Alternatively, the merge may be aborted with
3454 .Op Fl F Ar response-script
3458 Stage local changes for inclusion in the next commit.
3461 is specified, stage all changes in the work tree.
3462 Otherwise, stage changes at or within the specified paths.
3463 Paths may be staged if they are added, modified, or deleted according to
3466 Show the status of each affected file, using the following status codes:
3467 .Bl -column YXZ description
3468 .It A Ta file addition has been staged
3469 .It M Ta file modification has been staged
3470 .It D Ta file deletion has been staged
3473 Staged file contents are saved in newly created blob objects in the repository.
3474 These blobs will be referred to by tree objects once staged changes have been
3477 Staged changes affect the behaviour of
3482 While paths with staged changes exist, the
3484 command will refuse to commit any paths which do not have staged changes.
3485 Local changes created on top of staged changes can only be committed if
3486 the path is staged again, or if the staged changes are committed first.
3489 command will show both local changes and staged changes.
3492 command is able to display local changes relative to staged changes,
3493 and to display staged changes relative to the repository.
3496 command cannot revert staged changes but may be used to revert
3497 local changes created on top of staged changes.
3503 .It Fl F Ar response-script
3511 responses line-by-line from the specified
3513 file instead of prompting interactively.
3515 Instead of staging new changes, list paths which are already staged,
3516 along with the IDs of staged blob objects and stage status codes.
3517 If paths were provided on the command line, show the staged paths
3518 among the specified paths.
3519 Otherwise, show all staged paths.
3521 Instead of staging the entire content of a changed file, interactively
3522 select or reject changes for staging based on
3526 (reject change), and
3528 (quit staging this file) responses.
3529 If a file is in modified status, individual patches derived from the
3530 modified file content can be staged.
3531 Files in added or deleted status may only be staged or rejected in
3534 Allow staging of symbolic links which point outside of the path space
3535 that is under version control.
3538 will reject such symbolic links due to safety concerns.
3541 may decide to represent such a symbolic link as a regular file which contains
3542 the link's target path, rather than creating an actual symbolic link which
3543 points outside of the work tree.
3544 Use of this option is discouraged because external mechanisms such as
3546 are better suited for managing symbolic links to paths not under
3551 will refuse to run if certain preconditions are not met.
3552 If a file contains merge conflicts, these conflicts must be resolved first.
3553 If a file is found to be out of date relative to the head commit on the
3554 work tree's current branch, the file must be updated with
3556 before it can be staged (however, this does not prevent the file from
3557 becoming out-of-date at some point after having been staged).
3565 commands will refuse to run while staged changes exist.
3566 If staged changes cannot be committed because a staged path
3567 is out of date, the path must be unstaged with
3569 before it can be updated with
3571 and may then be staged again if necessary.
3576 .Op Fl F Ar response-script
3580 Merge staged changes back into the work tree and put affected paths
3581 back into non-staged status.
3584 is specified, unstage all staged changes across the entire work tree.
3585 Otherwise, unstage changes at or within the specified paths.
3587 Show the status of each affected file, using the following status codes:
3588 .Bl -column YXZ description
3589 .It G Ta file was unstaged
3590 .It C Ta file was unstaged and conflicts occurred during merge
3591 .It ! Ta changes destined for a missing file were not merged
3592 .It D Ta file was staged as deleted and still is deleted
3593 .It d Ta file's deletion was prevented by local modifications
3594 .It \(a~ Ta changes destined for a non-regular file were not merged
3601 .It Fl F Ar response-script
3609 responses line-by-line from the specified
3611 file instead of prompting interactively.
3613 Instead of unstaging the entire content of a changed file, interactively
3614 select or reject changes for unstaging based on
3618 (keep change staged), and
3620 (quit unstaging this file) responses.
3621 If a file is staged in modified status, individual patches derived from the
3622 staged file content can be unstaged.
3623 Files staged in added or deleted status may only be unstaged in their entirety.
3629 .Op Fl r Ar repository-path
3632 Parse and print contents of objects to standard output in a line-based
3634 Content of commit, tree, and tag objects is printed in a way similar
3635 to the actual content stored in such objects.
3636 Blob object contents are printed as they would appear in files on disk.
3638 Attempt to interpret each argument as a reference, a tag name, or
3639 an object ID SHA1 hash.
3640 References will be resolved to an object ID.
3641 Tag names will resolved to a tag object.
3642 An abbreviated hash argument will be expanded to a full SHA1 hash
3643 automatically, provided the abbreviation is unique.
3645 If none of the above interpretations produce a valid result, or if the
3647 option is used, attempt to interpret the argument as a path which will
3648 be resolved to the ID of an object found at this path in the repository.
3655 Look up paths in the specified
3657 If this option is not used, paths are looked up in the commit resolved
3658 via the repository's HEAD reference.
3660 The expected argument is a commit ID SHA1 hash, or a reference name
3661 or keyword which will be resolved to a commit ID.
3662 An abbreviated hash argument will be expanded to a full SHA1 hash
3663 automatically, provided the abbreviation is unique.
3668 resolve to the work tree's base commit and branch head, respectively.
3669 The former is only valid if invoked in a work tree, while the latter will
3670 resolve to the tip of the work tree's current branch if invoked in a
3671 work tree, otherwise it will resolve to the repository's HEAD reference.
3672 Keywords and references may be appended with
3676 modifiers and an optional integer N to denote the
3677 Nth descendant or antecedent by first parent traversal, respectively;
3680 denotes the work tree branch head's 2nd generation ancestor, and
3682 denotes the 4th generation descendant of the work tree's base commit.
3685 will denote the 8th generation ancestor of the commit resolved by the
3692 modifier without a trailing integer has an implicit
3701 Interpret all arguments as paths only.
3702 This option can be used to resolve ambiguity in cases where paths
3703 look like tag names, reference names, or object IDs.
3704 .It Fl r Ar repository-path
3705 Use the repository at the specified path.
3706 If not specified, assume the repository is located at or above the current
3708 If this directory is a
3710 work tree, use the repository path associated with this work tree.
3712 .It Cm info Op Ar path ...
3713 Display meta-data stored in a work tree.
3718 The work tree to use is resolved implicitly by walking upwards from the
3719 current working directory.
3723 arguments are specified, show additional per-file information for tracked
3724 files located at or within these paths.
3727 argument corresponds to the work tree's root directory, display information
3728 for all tracked files.
3731 .Bl -tag -width GOT_IGNORE_GITCONFIG
3733 The author's name and email address, such as
3734 .Qq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3745 may fail to parse commits without an email address in author data,
3749 environment variables with a missing email address.
3751 .Ev GOT_AUTHOR will be overridden by configuration settings in
3757 configuration settings in the repository's
3764 configuration settings contained in Git's global
3766 configuration file will only be used if neither
3770 environment variable provide author information.
3771 .It Ev GOT_IGNORE_GITCONFIG
3772 If this variable is set then any remote repository definitions or author
3773 information found in Git configuration files will be ignored.
3774 .It Ev GOT_LOG_DEFAULT_LIMIT
3775 The default limit on the number of commits traversed by
3777 If set to zero, the limit is unbounded.
3778 This variable will be silently ignored if it is set to a non-numeric value.
3779 .It Ev VISUAL , EDITOR
3780 The editor spawned by
3788 text editor will be spawned.
3791 .Bl -tag -width packed-refs -compact
3793 Repository-wide configuration settings for
3797 configuration file located in the root directory of a Git repository
3798 supersedes any relevant settings in Git's
3802 .It Pa .got/got.conf
3803 Worktree-specific configuration settings for
3807 configuration file in the
3809 meta-data directory of a work tree supersedes any relevant settings in
3812 configuration file and Git's
3819 Enable tab-completion of
3824 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3826 Clone an existing Git repository for use with
3830 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3832 Unfortunately, many of the popular Git hosting sites do not offer anonymous
3834 Such sites will require an account to be created, and a public SSH key to be
3835 uploaded to this account, before repository access via ssh:// URLs will work.
3837 Most sites offer anonymous repository access via HTTPS:
3840 .Dl $ got clone https://github.com/openbsd/src.git
3842 Alternatively, for quick and dirty local testing of
3844 a new Git repository could be created and populated with files,
3845 e.g. from a temporary CVS checkout located at
3848 .Dl $ gotadmin init /var/git/src.git
3849 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3851 Check out a work tree from the Git repository to /usr/src:
3853 .Dl $ got checkout /var/git/src.git /usr/src
3855 View local changes in a work tree directory:
3857 .Dl $ got diff | less
3859 In a work tree, display files in a potentially problematic state:
3861 .Dl $ got status -s 'C!~?'
3863 Interactively revert selected local changes in a work tree directory:
3865 .Dl $ got revert -p -R\ .
3867 In a work tree or a git repository directory, list all branch references:
3871 As above, but list the most recently modified branches only:
3873 .Dl $ got branch -lt | head
3875 In a work tree or a git repository directory, create a new branch called
3876 .Dq unified-buffer-cache
3877 which is forked off the
3881 .Dl $ got branch -c master unified-buffer-cache
3883 Switch an existing work tree to the branch
3884 .Dq unified-buffer-cache .
3885 Local changes in the work tree will be preserved and merged if necessary:
3887 .Dl $ got update -b unified-buffer-cache
3889 Create a new commit from local changes in a work tree directory.
3890 This new commit will become the head commit of the work tree's current branch:
3894 In a work tree or a git repository directory, view changes committed in
3895 the 3 most recent commits to the work tree's branch, or the branch resolved
3896 via the repository's HEAD reference, respectively:
3898 .Dl $ got log -p -l 3
3900 As above, but display changes in the order in which
3902 could apply them in sequence:
3904 .Dl $ got log -p -l 3 -R
3906 In a work tree or a git repository directory, log the history of a subdirectory:
3908 .Dl $ got log sys/uvm
3910 While operating inside a work tree, paths are specified relative to the current
3911 working directory, so this command will log the subdirectory
3914 .Dl $ cd sys/uvm && got log\ .
3916 And this command has the same effect:
3918 .Dl $ cd sys/dev/usb && got log ../../uvm
3920 And this command displays work tree meta-data about all tracked files:
3923 .Dl $ got info\ . | less
3925 Add new files and remove obsolete files in a work tree directory:
3927 .Dl $ got add sys/uvm/uvm_ubc.c
3928 .Dl $ got remove sys/uvm/uvm_vnode.c
3930 Create a new commit from local changes in a work tree directory
3931 with a pre-defined log message.
3933 .Dl $ got commit -m 'unify the buffer cache'
3935 Alternatively, create a new commit from local changes in a work tree
3936 directory with a log message that has been prepared in the file
3939 .Dl $ got commit -F /tmp/msg
3941 Update any work tree checked out from the
3942 .Dq unified-buffer-cache
3943 branch to the latest commit on this branch:
3947 Roll file content on the unified-buffer-cache branch back by one commit,
3948 and then fetch the rolled-back change into the work tree as a local change
3949 to be amended and perhaps committed again:
3951 .Dl $ got backout unified-buffer-cache
3952 .Dl $ got commit -m 'roll back previous'
3953 .Dl $ # now back out the previous backout :-)
3954 .Dl $ got backout unified-buffer-cache
3956 Fetch new changes on the remote repository's
3958 branch, making them visible on the local repository's
3967 branch to merge the new changes that are now visible on the
3972 .Dl $ got update -b origin/master
3973 .Dl $ got rebase master
3976 .Dq unified-buffer-cache
3977 branch on top of the new head commit of the
3981 .Dl $ got update -b master
3982 .Dl $ got rebase unified-buffer-cache
3984 Create a patch from all changes on the unified-buffer-cache branch.
3985 The patch can be mailed out for review and applied to
3989 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
3991 Edit the entire commit history of the
3992 .Dq unified-buffer-cache
3995 .Dl $ got update -b unified-buffer-cache
3996 .Dl $ got update -c master
3999 Before working against existing branches in a repository cloned with
4000 .Cm git clone --bare
4005 must be configured to map all references in the remote repository
4008 namespace of the local repository.
4009 This can be achieved by setting Git's
4010 .Pa remote.origin.fetch
4011 configuration variable to the value
4012 .Dq +refs/heads/*:refs/remotes/origin/*
4017 .Dl $ cd /var/git/repo
4018 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
4022 option must be disabled:
4024 .Dl $ cd /var/git/repo
4025 .Dl $ git config remote.origin.mirror false
4027 Alternatively, the following
4029 configuration item can be added manually to the Git repository's
4033 .Dl [remote \&"origin\&"]
4035 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
4038 This configuration leaves the local repository's
4040 namespace free for use by local branches checked out with
4042 and, if needed, created with
4045 .Dq refs/remotes/origin
4046 namespace can now be updated with incoming changes from the remote
4051 without extra command line arguments.
4052 Newly fetched changes can be examined with
4055 Display changes on the remote repository's version of the
4057 branch, as of the last time
4061 .Dl $ got log -c origin/master | less
4063 As shown here, most commands accept abbreviated reference names such as
4066 .Dq refs/remotes/origin/master .
4067 The latter is only needed in case of ambiguity.
4070 can be used to merge changes which are visible on the
4075 This will also merge local changes, if any, with the incoming changes:
4077 .Dl $ got update -b origin/master
4078 .Dl $ got rebase master
4080 In order to make changes committed to the
4081 .Dq unified-buffer-cache
4085 .Dq unified-buffer-cache
4086 branch can be rebased onto the
4090 .Dl $ got update -b master
4091 .Dl $ got rebase unified-buffer-cache
4094 .Dq unified-buffer-cache
4095 branch can now be made visible on the
4099 Because the rebase operation switched the work tree to the
4100 .Dq unified-buffer-cache
4101 branch, the work tree must be switched back to the
4105 .Dl $ got update -b master
4106 .Dl $ got integrate unified-buffer-cache
4110 branch, log messages for local changes can now be amended with
4112 by other developers and any other important new information:
4114 .Dl $ got update -c origin/master
4115 .Dl $ got histedit -m
4117 If the remote repository offers write access, local changes on the
4119 branch can be sent to the remote repository with
4123 can be run without further arguments.
4124 The arguments shown here match defaults, provided the work tree's
4125 current branch is the
4129 .Dl $ got send -b master origin
4131 If the remote repository requires the HTTPS protocol, the
4133 command must be used instead:
4135 .Dl $ cd /var/git/src.git
4136 .Dl $ git push origin master
4138 When making contributions to projects which use the
4140 workflow, SSH protocol repository access needs to be set up first.
4141 Once an account has been created on a Git hosting site it should
4142 be possible to upload a public SSH key for repository access
4147 workflow will usually involve two remote repositories.
4148 In the real-life example below, the
4150 repository was forked from the
4152 repository by using the Git hosting site's web interface.
4155 file in the local repository describes both remote repositories:
4156 .Bd -literal -offset indent
4157 # Jelmers's repository, which accepts pull requests
4159 server git@github.com
4161 repository "/jelmer/dulwich"
4165 # Stefan's fork, used as the default remote repository
4167 server git@github.com
4169 repository "/stspdotname/dulwich"
4174 With this configuration, Stefan can create commits on
4175 .Dq refs/heads/master
4176 and send them to the
4178 repository by running:
4180 .Dl $ got send -b master origin
4182 The changes can now be proposed to Jelmer by opening a pull request
4183 via the Git hosting site's web interface.
4184 If Jelmer requests further changes to be made, additional commits
4185 can be created on the
4187 branch and be added to the pull request by running
4191 If Jelmer prefers additional commits to be
4193 then the following commands can be used to achieve this:
4195 .Dl $ got update -b master
4196 .Dl $ got update -c origin/master
4197 .Dl $ got histedit -f
4198 .Dl $ got send -f -b master origin
4200 In addition to reviewing the pull request in the web user interface,
4201 Jelmer can fetch the pull request's branch into his local repository
4202 and create a local branch which contains the proposed changes:
4204 .Dl $ got fetch -R refs/pull/1046/head origin
4205 .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
4207 Once Jelmer has accepted the pull request, Stefan can fetch the
4208 merged changes, and possibly several other new changes, by running:
4210 .Dl $ got fetch upstream
4212 The merged changes will now be visible under the reference
4213 .Dq refs/remotes/upstream/master .
4216 branch can now be rebased on top of the latest changes
4219 .Dl $ got update -b upstream/master
4220 .Dl $ got rebase master
4222 As an alternative to
4224 branches can be merged with
4227 .Dl $ got update -b master
4228 .Dl $ got merge upstream/master
4230 The question of whether to rebase or merge branches is philosophical.
4231 When in doubt, refer to the software project's policies set by project
4234 As a final step, the forked repository's copy of the master branch needs
4235 to be kept in sync by sending the new changes there:
4237 .Dl $ got send -f -b master origin
4239 If multiple pull requests need to be managed in parallel, a separate branch
4240 must be created for each pull request with
4242 Each such branch can then be used as above, in place of
4243 .Dq refs/heads/master .
4244 Changes for any accepted pull requests will still appear under
4245 .Dq refs/remotes/upstream/master,
4246 regardless of which branch was used in the forked repository to
4247 create a pull request.
4251 .Xr git-repository 5 ,
4252 .Xr got-worktree 5 ,
4256 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
4257 .An Christian Weisgerber Aq Mt naddy@openbsd.org
4258 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
4259 .An Josh Rickmar Aq Mt jrick@zettaport.com
4260 .An Joshua Stein Aq Mt jcs@openbsd.org
4261 .An Klemens Nanni Aq Mt kn@openbsd.org
4262 .An Martin Pieuchot Aq Mt mpi@openbsd.org
4263 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
4264 .An Omar Polo Aq Mt op@openbsd.org
4265 .An Ori Bernstein Aq Mt ori@openbsd.org
4266 .An Sebastien Marie Aq Mt semarie@openbsd.org
4267 .An Stefan Sperling Aq Mt stsp@openbsd.org
4268 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
4269 .An Theo Buehler Aq Mt tb@openbsd.org
4270 .An Thomas Adam Aq Mt thomas@xteddy.org
4271 .An Tracey Emery Aq Mt tracey@traceyemery.net
4272 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
4279 were derived from code under copyright by:
4281 .An Caldera International
4282 .An Daniel Hartmeier
4287 .An Jean-Francois Brousseau
4293 .An Niklas Hallqvist
4298 .An Xavier Santolaria
4301 contains code contributed to the public domain by
4302 .An Austin Appleby .
4305 is a work-in-progress and some features remain to be implemented.
4307 At present, the user has to fall back on
4309 to perform some tasks.
4313 Writing to remote repositories over HTTP or HTTPS protocols requires
4316 The creation of merge commits with more than two parent commits requires
4319 In situations where files or directories were moved around
4321 will not automatically merge changes to new locations and
4323 will usually produce better results.