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
121 Use the specified log message when creating the new commit.
126 opens a temporary file in an editor where a log message can be written.
127 .It Fl r Ar repository-path
128 Use the repository at the specified path.
129 If not specified, assume the repository is located at or above the current
137 .Op Fl R Ar reference
142 Clone a Git repository at the specified
148 is specified, the directory name will be derived from the name of the
151 will refuse to run if the
157 specifies a protocol scheme, a server hostname, an optional port number
158 separated from the hostname by a colon, and a path to the repository on
160 .Lk scheme://hostname:port/path/to/repository
162 The following protocol schemes are supported:
163 .Bl -tag -width git+ssh
165 The Git protocol as implemented by the
168 Use of this protocol is discouraged since it supports neither authentication
171 The Git protocol wrapped in an authenticated and encrypted
174 With this protocol the hostname may contain an embedded username for
179 Short alias for git+ssh.
182 Objects in the cloned repository are stored in a pack file which is downloaded
184 This pack file will then be indexed to facilitate access to the objects stored
186 If any objects in the pack file are stored in deltified form, all deltas will
187 be fully resolved in order to compute the ID of such objects.
188 This can take some time.
189 More details about the pack file format are documented in
190 .Xr git-repository 5 .
193 creates a remote repository entry in the
197 files of the cloned repository to store the
203 arguments for future use by
213 Fetch all branches from the remote repository's
215 reference namespace and set
216 .Cm fetch_all_branches
217 in the cloned repository's
219 file for future use by
221 If this option is not specified, a branch resolved via the remote
222 repository's HEAD reference will be fetched.
223 Cannot be used together with the
229 from the remote repository's
232 This option may be specified multiple times to build a list of branches
234 If the branch corresponding to the remote repository's HEAD reference is not
235 in this list, the cloned repository's HEAD reference will be set to the first
236 branch which was fetched.
237 If this option is not specified, a branch resolved via the remote
238 repository's HEAD reference will be fetched.
239 Cannot be used together with the
243 List branches and tags available for fetching from the remote repository
244 and exit immediately.
245 Cannot be used together with any of the other options except
250 Create the cloned repository as a mirror of the original repository.
251 This is useful if the cloned repository will not be used to store
252 locally created commits.
258 files will be set up with the
260 option enabled, such that
264 will write incoming changes directly to branches in the
266 reference namespace, rather than to branches in the
269 This avoids the usual requirement of having to run
273 in order to make incoming changes appear on branches in the
276 But maintaining custom changes in the cloned repository becomes difficult
277 since such changes will be at risk of being discarded whenever incoming
280 Suppress progress reporting output.
281 The same option will be passed to
284 .It Fl R Ar reference
285 In addition to the branches and tags that will be fetched, fetch an arbitrary
287 from the remote repository's
290 This option may be specified multiple times to build a list of additional
294 may either be a path to a specific reference, or a reference namespace
295 which will cause all references in this namespace to be fetched.
297 Each reference will be mapped into the cloned repository's
299 namespace, unless the
301 option is used to mirror references directly into the cloned repository's
306 will refuse to fetch references from the remote repository's
315 to print debugging messages to standard error output.
316 This option will be passed to
319 Multiple -v options increase the verbosity.
327 .Op Fl R Ar reference
328 .Op Fl r Ar repository-path
329 .Op Ar remote-repository
332 Fetch new changes from a remote repository.
334 .Ar remote-repository
338 The remote repository's URL is obtained from the corresponding entry in
342 file of the local repository, as created by
345 New changes will be stored in a separate pack file downloaded from the server.
346 Optionally, separate pack files stored in the repository can be combined with
349 By default, branch references in the
351 reference namespace will be updated to point at the newly fetched commits.
354 command can then be used to make new changes visible on branches in the
356 namespace, merging incoming changes with the changes on those branches
359 If the repository was created as a mirror with
361 then all branches in the
363 namespace will be updated directly to match the corresponding branches in
364 the remote repository.
365 If those branches contained local commits, these commits will no longer be
366 reachable via a reference and will therefore be at risk of being discarded
367 by Git's garbage collector or
368 .Cm gotadmin cleanup .
369 Maintaining custom changes in a mirror repository is therefore discouraged.
371 In any case, references in the
373 namespace will always be fetched and mapped directly to local references
374 in the same namespace.
381 Fetch all branches from the remote repository's
384 This option can be enabled by default for specific repositories in
386 If this option is not specified, a branch resolved via the remote
387 repository's HEAD reference will be fetched.
388 Cannot be used together with the
394 from the remote repository's
397 This option may be specified multiple times to build a list of branches
399 If this option is not specified, a branch resolved via the remote
400 repository's HEAD reference will be fetched.
401 Cannot be used together with the
405 Delete branches and tags from the local repository which are no longer
406 present in the remote repository.
407 Only references are deleted.
408 Any commit, tree, tag, and blob objects belonging to deleted branches or
409 tags remain in the repository and may be removed separately with
410 Git's garbage collector or
411 .Cm gotadmin cleanup .
413 List branches and tags available for fetching from the remote repository
414 and exit immediately.
415 Cannot be used together with any of the other options except
421 Suppress progress reporting output.
422 The same option will be passed to
425 .It Fl R Ar reference
426 In addition to the branches and tags that will be fetched, fetch an arbitrary
428 from the remote repository's
431 This option may be specified multiple times to build a list of additional
435 may either be a path to a specific reference, or a reference namespace
436 which will cause all references in this namespace to be fetched.
438 Each reference will be mapped into the local repository's
440 namespace, unless the local repository was created as a mirror with
442 in which case references will be mapped directly into the local repository's
446 Once a reference has been fetched, a branch based on it can be created with
451 will refuse to fetch references from the remote repository's
456 .It Fl r Ar repository-path
457 Use the repository at the specified path.
458 If not specified, assume the repository is located at or above the current
460 If this directory is a
462 work tree, use the repository path associated with this work tree.
464 Allow existing references in the
466 namespace to be updated if they have changed on the server.
467 If not specified, only new tag references will be created.
472 to print debugging messages to standard error output.
473 The same option will be passed to
476 Multiple -v options increase the verbosity.
479 Delete all references which correspond to a particular
480 .Ar remote-repository
481 instead of fetching new changes.
482 This can be useful when a remote repository is being removed from
488 .Ar remote-repository
489 argument is mandatory and no other options except
496 Only references are deleted.
497 Any commit, tree, tag, and blob objects fetched from a remote repository
498 will generally be stored in pack files and may be removed separately with
500 and Git's garbage collector.
508 .Op Fl p Ar path-prefix
510 .Op Ar work-tree-path
513 Copy files from a repository into a new work tree.
514 Show the status of each affected file, using the following status codes:
515 .Bl -column YXZ description
516 .It A Ta new file was added
517 .It E Ta file already exists in work tree's meta-data
522 is not specified, either use the last component of
523 .Ar repository path ,
526 was specified use the last component of
534 Check out files from a commit on the specified
536 If this option is not specified, a branch resolved via the repository's HEAD
537 reference will be used.
539 Check out files from the specified
541 on the selected branch.
542 The expected argument is a commit ID SHA1 hash or an existing reference
543 or tag name which will be resolved to a commit ID.
544 An abbreviated hash argument will be expanded to a full SHA1 hash
545 automatically, provided the abbreviation is unique.
546 If this option is not specified, the most recent commit on the selected
551 is not contained in the selected branch, a different branch which contains
552 this commit must be specified with the
555 If no such branch is known, a new branch must be created for this
561 Checking out work trees with an unknown branch is intentionally not supported.
563 Proceed with the checkout operation even if the directory at
566 Existing files will be left intact.
567 .It Fl p Ar path-prefix
568 Restrict the work tree to a subset of the repository's tree hierarchy.
569 Only files beneath the specified
573 Silence progress output.
584 Update an existing work tree to a different
586 Change existing files in the work tree as necessary to match file contents
588 Preserve any local changes in the work tree and merge them with the
591 Files which already contain merge conflicts will not be updated to avoid
592 further complications.
593 Such files will be updated when
595 is run again after merge conflicts have been resolved.
596 If the conflicting changes are no longer needed, affected files can be
603 Show the status of each affected file, using the following status codes:
604 .Bl -column YXZ description
605 .It U Ta file was updated and contained no local changes
606 .It G Ta file was updated and local changes were merged cleanly
607 .It C Ta file was updated and conflicts occurred during merge
608 .It D Ta file was deleted
609 .It A Ta new file was added
610 .It \(a~ Ta versioned file is obstructed by a non-regular file
611 .It ! Ta a missing versioned file was restored
612 .It # Ta file was not updated because it contains merge conflicts
613 .It ? Ta changes destined for an unversioned file were not merged
618 is specified, update the entire work tree.
619 Otherwise, restrict the update operation to files at or within the
621 Each path is required to exist in the update operation's target commit.
622 Files in the work tree outside specified paths will remain unchanged and
623 will retain their previously recorded base commit.
626 commands may refuse to run while the work tree contains files from
627 multiple base commits.
628 The base commit of such a work tree can be made consistent by running
630 across the entire work tree.
633 is incompatible with the
638 cannot update paths with staged changes.
639 If changes have been staged with
641 these changes must first be committed with
651 Switch the work tree's branch reference to the specified
653 before updating the work tree.
654 This option requires that all paths in the work tree are updated.
656 As usual, any local changes in the work tree will be preserved.
657 This can be useful when switching to a newly created branch in order
658 to commit existing local changes to this branch.
660 Any local changes must be dealt with separately in order to obtain a
661 work tree with pristine file contents corresponding exactly to the specified
663 Such changes could first be committed to a different branch with
665 or could be discarded with
668 Update the work tree to the specified
670 The expected argument is a commit ID SHA1 hash or an existing reference
671 or tag name which will be resolved to a commit ID.
672 An abbreviated hash argument will be expanded to a full SHA1 hash
673 automatically, provided the abbreviation is unique.
674 If this option is not specified, the most recent commit on the work tree's
677 Silence progress output.
683 .Op Fl S Ar status-codes
684 .Op Fl s Ar status-codes
688 Show the current modification status of files in a work tree,
689 using the following status codes:
690 .Bl -column YXZ description
691 .It M Ta modified file
692 .It A Ta file scheduled for addition in next commit
693 .It D Ta file scheduled for deletion in next commit
694 .It C Ta modified or added file which contains merge conflicts
695 .It ! Ta versioned file was expected on disk but is missing
696 .It \(a~ Ta versioned file is obstructed by a non-regular file
697 .It ? Ta unversioned item not tracked by
699 .It m Ta modified file modes (executable bit only)
700 .It N Ta non-existent
702 specified on the command line
707 is specified, show modifications in the entire work tree.
708 Otherwise, show modifications at or within the specified paths.
710 If changes have been staged with
712 staged changes are shown in the second output column, using the following
714 .Bl -column YXZ description
715 .It M Ta file modification is staged
716 .It A Ta file addition is staged
717 .It D Ta file deletion is staged
720 Changes created on top of staged changes are indicated in the first column:
721 .Bl -column YXZ description
722 .It MM Ta file was modified after earlier changes have been staged
723 .It MA Ta file was modified after having been staged for addition
731 Show unversioned files even if they match an ignore pattern.
732 .It Fl S Ar status-codes
733 Suppress the output of files with a modification status matching any of the
734 single-character status codes contained in the
737 Any combination of codes from the above list of possible status codes
739 For staged files, status codes displayed in either column will be matched.
740 Cannot be used together with the
743 .It Fl s Ar status-codes
744 Only show files with a modification status matching any of the
745 single-character status codes contained in the
748 Any combination of codes from the above list of possible status codes
750 For staged files, status codes displayed in either column will be matched.
751 Cannot be used together with the
756 For compatibility with
767 files in each traversed directory and will not display unversioned files
768 which match these patterns.
773 supports consecutive asterisks,
775 which will match an arbitrary amount of directories.
779 only supports a single ignore pattern per line.
783 does not support negated ignore patterns prefixed with
785 and gives no special significance to the location of path component separators,
794 .Op Fl r Ar repository-path
795 .Op Fl S Ar search-pattern
799 Display history of a repository.
802 is specified, show only commits which modified this path.
803 If invoked in a work tree, the
805 is interpreted relative to the current working directory,
806 and the work tree's path prefix is implicitly prepended.
807 Otherwise, the path is interpreted relative to the repository root.
814 Display individual commits which were merged into the current branch
818 shows the linear history of the current branch only.
820 Set the number of context lines shown in diffs with
822 By default, 3 lines of context are shown.
824 Start traversing history at the specified
826 The expected argument is a commit ID SHA1 hash or an existing reference
827 or tag name which will be resolved to a commit ID.
828 An abbreviated hash argument will be expanded to a full SHA1 hash
829 automatically, provided the abbreviation is unique.
830 If this option is not specified, default to the work tree's current branch
831 if invoked in a work tree, or to the repository's HEAD reference.
833 Limit history traversal to a given number of commits.
834 If this option is not specified, a default limit value of zero is used,
835 which is treated as an unbounded limit.
837 .Ev GOT_LOG_DEFAULT_LIMIT
838 environment variable may be set to change this default value.
840 Display the list of file paths changed in each commit, using the following
842 .Bl -column YXZ description
843 .It M Ta modified file
844 .It D Ta file was deleted
845 .It A Ta new file was added
846 .It m Ta modified file modes (executable bit only)
849 Cannot be used with the
853 Display the patch of modifications made in each commit.
856 is specified, only show the patch of modifications at or within this path.
857 Cannot be used with the
861 Determine a set of commits to display as usual, but display these commits
863 .It Fl r Ar repository-path
864 Use the repository at the specified path.
865 If not specified, assume the repository is located at or above the current
867 If this directory is a
869 work tree, use the repository path associated with this work tree.
870 .It Fl S Ar search-pattern
871 If specified, show only commits with a log message, author name,
872 committer name, or ID SHA1 hash matched by the extended regular
875 Lines in committed patches will be matched if
878 File paths changed by a commit will be matched if
881 Regular expression syntax is documented in
884 Display a short one-line summary of each commit, instead of the default
886 Cannot be used together with the
892 Stop traversing commit history immediately after the specified
895 This option has no effect if the specified
905 .Op Fl r Ar repository-path
906 .Op Ar object1 Ar object2 | Ar path ...
909 When invoked within a work tree without any arguments, display all
910 local changes in the work tree.
913 arguments are specified, only show changes within the specified paths.
915 If two arguments are provided, treat each argument as a reference, a tag
916 name, or an object ID SHA1 hash, and display differences between the
917 corresponding objects.
918 Both objects must be of the same type (blobs, trees, or commits).
919 An abbreviated hash argument will be expanded to a full SHA1 hash
920 automatically, provided the abbreviation is unique.
921 If none of these interpretations produce a valid result or if the
926 is running in a work tree, attempt to interpret the two arguments as paths.
933 Treat file contents as ASCII text even if binary data is detected.
935 Set the number of context lines shown in the diff.
936 By default, 3 lines of context are shown.
938 Show differences between commits in the repository.
939 This option may be used up to two times.
940 When used only once, show differences between the specified
942 and its first parent commit.
943 When used twice, show differences between the two specified commits.
945 The expected argument is a commit ID SHA1 hash or an existing reference
946 or tag name which will be resolved to a commit ID.
947 An abbreviated hash argument will be expanded to a full SHA1 hash
948 automatically, provided the abbreviation is unique.
952 option is used, all non-option arguments will be interpreted as paths.
955 arguments are provided, only show differences for the specified paths.
957 Cannot be used together with the
961 Interpret all arguments as paths only.
962 This option can be used to resolve ambiguity in cases where paths
963 look like tag names, reference names, or object IDs.
964 This option is only valid when
966 is invoked in a work tree.
967 .It Fl r Ar repository-path
968 Use the repository at the specified path.
969 If not specified, assume the repository is located at or above the current
971 If this directory is a
973 work tree, use the repository path associated with this work tree.
975 Show changes staged with
977 instead of showing local changes in the work tree.
978 This option is only valid when
980 is invoked in a work tree.
982 Ignore whitespace-only changes.
988 .Op Fl r Ar repository-path
992 Display line-by-line history of a file at the specified path.
999 Start traversing history at the specified
1001 The expected argument is a commit ID SHA1 hash or an existing reference
1002 or tag name which will be resolved to a commit ID.
1003 An abbreviated hash argument will be expanded to a full SHA1 hash
1004 automatically, provided the abbreviation is unique.
1005 .It Fl r Ar repository-path
1006 Use the repository at the specified path.
1007 If not specified, assume the repository is located at or above the current
1009 If this directory is a
1011 work tree, use the repository path associated with this work tree.
1018 .Op Fl r Ar repository-path
1022 Display a listing of files and directories at the specified
1023 directory path in the repository.
1024 Entries shown in this listing may carry one of the following trailing
1026 .Bl -column YXZ description
1027 .It @ Ta entry is a symbolic link
1028 .It / Ta entry is a directory
1029 .It * Ta entry is an executable file
1030 .It $ Ta entry is a Git submodule
1033 Symbolic link entries are also annotated with the target path of the link.
1037 is specified, list the repository path corresponding to the current
1038 directory of the work tree, or the root directory of the repository
1039 if there is no work tree.
1046 List files and directories as they appear in the specified
1048 The expected argument is a commit ID SHA1 hash or an existing reference
1049 or tag name which will be resolved to a commit ID.
1050 An abbreviated hash argument will be expanded to a full SHA1 hash
1051 automatically, provided the abbreviation is unique.
1053 Show object IDs of files (blob objects) and directories (tree objects).
1055 Recurse into sub-directories in the repository.
1056 .It Fl r Ar repository-path
1057 Use the repository at the specified path.
1058 If not specified, assume the repository is located at or above the current
1060 If this directory is a
1062 work tree, use the repository path associated with this work tree.
1068 .Op Fl r Ar repository-path
1069 .Op Fl s Ar reference
1072 Manage references in a repository.
1074 References may be listed, created, deleted, and changed.
1075 When creating, deleting, or changing a reference the specified
1077 must be an absolute reference name, i.e. it must begin with
1085 Create a reference or change an existing reference.
1086 The reference with the specified
1088 will point at the specified
1092 argument is a ID SHA1 hash or an existing reference or tag name which will
1093 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
1094 Cannot be used together with any other options except
1097 Delete the reference with the specified
1099 from the repository.
1100 Any commit, tree, tag, and blob objects belonging to deleted references
1101 remain in the repository and may be removed separately with
1102 Git's garbage collector or
1103 .Cm gotadmin cleanup .
1104 Cannot be used together with any other options except
1107 List references in the repository.
1110 is specified, list all existing references in the repository.
1113 is a reference namespace, list all references in this namespace.
1114 Otherwise, show only the reference with the given
1116 Cannot be used together with any other options except
1120 .It Fl r Ar repository-path
1121 Use the repository at the specified path.
1122 If not specified, assume the repository is located at or above the current
1124 If this directory is a
1126 work tree, use the repository path associated with this work tree.
1127 .It Fl s Ar reference
1128 Create a symbolic reference, or change an existing symbolic reference.
1129 The symbolic reference with the specified
1131 will point at the specified
1133 which must already exist in the repository.
1134 Care should be taken not to create loops between references when
1135 this option is used.
1136 Cannot be used together with any other options except
1139 Sort listed references by modification time (most recently modified first)
1140 instead of sorting by lexicographical order.
1141 Use of this option requires the
1143 option to be used as well.
1151 .Op Fl r Ar repository-path
1155 Create, list, or delete branches.
1157 Local branches are managed via references which live in the
1159 reference namespace.
1162 command creates references in this namespace only.
1164 When deleting branches, the specified
1168 reference namespace first.
1169 If no corresponding branch is found, the
1171 namespace will be searched next.
1173 If invoked in a work tree without any arguments, print the name of the
1174 work tree's current branch.
1178 argument is passed, attempt to create a branch reference with the given name.
1179 By default the new branch reference will point at the latest commit on the
1180 work tree's current branch if invoked in a work tree, and otherwise to a commit
1181 resolved via the repository's HEAD reference.
1183 If invoked in a work tree, once the branch was created successfully
1184 switch the work tree's head reference to the newly created branch and
1185 update files across the entire work tree, just like
1186 .Cm got update -b Ar name
1188 Show the status of each affected file, using the following status codes:
1189 .Bl -column YXZ description
1190 .It U Ta file was updated and contained no local changes
1191 .It G Ta file was updated and local changes were merged cleanly
1192 .It C Ta file was updated and conflicts occurred during merge
1193 .It D Ta file was deleted
1194 .It A Ta new file was added
1195 .It \(a~ Ta versioned file is obstructed by a non-regular file
1196 .It ! Ta a missing versioned file was restored
1204 Make a newly created branch reference point at the specified
1208 argument is a commit ID SHA1 hash or an existing reference
1209 or tag name which will be resolved to a commit ID.
1211 Delete the branch with the specified
1217 reference namespace.
1219 Only the branch reference is deleted.
1220 Any commit, tree, and blob objects belonging to the branch
1221 remain in the repository and may be removed separately with
1222 Git's garbage collector or
1223 .Cm gotadmin cleanup .
1225 List all existing branches in the repository, including copies of remote
1226 repositories' branches in the
1228 reference namespace.
1230 If invoked in a work tree, the work tree's current branch is shown
1231 with one the following annotations:
1232 .Bl -column YXZ description
1233 .It * Ta work tree's base commit matches the branch tip
1234 .It \(a~ Ta work tree's base commit is out-of-date
1237 Do not switch and update the work tree after creating a new branch.
1238 .It Fl r Ar repository-path
1239 Use the repository at the specified path.
1240 If not specified, assume the repository is located at or above the current
1242 If this directory is a
1244 work tree, use the repository path associated with this work tree.
1246 Sort listed branches by modification time (most recently modified first)
1247 instead of sorting by lexicographical order.
1250 reference namespace are listed before branches in
1253 Use of this option requires the
1255 option to be used as well.
1262 .Op Fl r Ar repository-path
1263 .Op Fl s Ar signer-id
1266 Manage tags in a repository.
1268 Tags are managed via references which live in the
1270 reference namespace.
1273 command operates on references in this namespace only.
1274 References in this namespace point at tag objects which contain a pointer
1275 to another object, a tag message, as well as author and timestamp information.
1277 Attempt to create a tag with the given
1279 and make this tag point at the given
1281 If no commit is specified, default to the latest commit on the work tree's
1282 current branch if invoked in a work tree, and to a commit resolved via
1283 the repository's HEAD reference otherwise.
1290 Make the newly created tag reference point at the specified
1294 argument is a commit ID SHA1 hash or an existing reference or tag name which
1295 will be resolved to a commit ID.
1296 An abbreviated hash argument will be expanded to a full SHA1 hash
1297 automatically, provided the abbreviation is unique.
1299 List all existing tags in the repository instead of creating a new tag.
1302 argument is passed, show only the tag with the given
1305 Use the specified tag message when creating the new tag.
1310 opens a temporary file in an editor where a tag message can be written.
1311 .It Fl r Ar repository-path
1312 Use the repository at the specified path.
1313 If not specified, assume the repository is located at or above the current
1315 If this directory is a
1317 work tree, use the repository path associated with this work tree.
1318 .It Fl s Ar signer-id
1319 While creating a new tag, sign this tag with the identity given in
1322 For SSH-based signatures,
1324 is the path to a file which may refer to either a private SSH key,
1325 or a public SSH key with the private half available via
1328 will sign the tag object by invoking
1332 command, using the signature namespace
1334 for compatibility with
1337 Verify tag object signatures.
1340 is specified, show and verify the tag object with the provided name.
1341 Otherwise, list all tag objects and verify signatures where present.
1344 verifies SSH-based signatures by invoking
1347 .Fl Y Cm verify Fl f Ar allowed_signers .
1352 otherwise verification is impossible.
1355 During SSH signature creation and verification this option will be passed to
1357 Multiple -v options increase the verbosity.
1363 command will not delete tags or change existing tags.
1364 If a tag must be deleted, the
1366 command may be used to delete a tag's reference.
1367 This should only be done if the tag has not already been copied to
1374 Schedule unversioned files in a work tree for addition to the
1375 repository in the next commit.
1376 By default, files which match a
1378 ignore pattern will not be added.
1385 Add files even if they match a
1389 Permit recursion into directories.
1390 If this option is not specified,
1392 will refuse to run if a specified
1400 .Op Fl s Ar status-codes
1404 Remove versioned files from a work tree and schedule them for deletion
1405 from the repository in the next commit.
1412 Perform the operation even if a file contains local modifications,
1413 and do not raise an error if a specified
1415 does not exist on disk.
1417 Keep affected files on disk.
1419 Permit recursion into directories.
1420 If this option is not specified,
1422 will refuse to run if a specified
1425 .It Fl s Ar status-codes
1426 Only delete files with a modification status matching one of the
1427 single-character status codes contained in the
1430 The following status codes may be specified:
1431 .Bl -column YXZ description
1432 .It M Ta modified file (this implies the
1435 .It ! Ta versioned file expected on disk but missing
1443 .Op Fl p Ar strip-count
1449 to files in a work tree.
1450 Files added or removed by a patch will be scheduled for addition or removal in
1453 The patch must be in the unified diff format as produced by
1460 diff when invoked with their
1465 argument is provided, read unified diff data from standard input instead.
1469 contains multiple patches, then attempt to apply each of them in sequence.
1471 Show the status of each affected file, using the following status codes:
1472 .Bl -column XYZ description
1473 .It M Ta file was modified
1474 .It G Ta file was merged using a merge-base found in the repository
1475 .It C Ta file was merged and conflicts occurred during merge
1476 .It D Ta file was deleted
1477 .It A Ta file was added
1478 .It # Ta failed to patch the file
1481 If a change does not match at its exact line number, attempt to
1482 apply it somewhere else in the file if a good spot can be found.
1483 Otherwise, the patch will fail to apply.
1487 will refuse to apply a patch if certain preconditions are not met.
1488 Files to be deleted must already be under version control, and must
1489 not have been scheduled for deletion already.
1490 Files to be added must not yet be under version control and must not
1491 already be present on disk.
1492 Files to be modified must already be under version control and may not
1493 contain conflict markers.
1495 If an error occurs, the
1497 operation will be aborted.
1498 Any changes made to the work tree up to this point will be left behind.
1499 Such changes can be viewed with
1501 and can be reverted with
1510 Attempt to locate files within the specified
1512 for use as a merge-base for 3-way merges.
1513 Ideally, the specified
1515 should contain versions of files which the changes contained in the
1518 Files will be located by path, relative to the repository root.
1521 option is used then leading path components will be stripped
1522 before paths are looked up in the repository.
1526 option is not used then
1528 will attempt to locate merge-bases via object IDs found in
1530 meta-data, such as produced by
1536 option is only recommended in the absence of such meta-data.
1538 In case no merge-base is available for a file, changes will be applied
1539 without doing a 3-way merge.
1540 Changes which do not apply cleanly may then be rejected entirely, rather
1541 than producing merge conflicts in the patched target file.
1543 Do not make any modifications to the work tree.
1544 This can be used to check whether a patch would apply without issues.
1547 contains diffs that affect the same file multiple times, the results
1548 displayed may be incorrect.
1549 .It Fl p Ar strip-count
1550 Specify the number of leading path components to strip from paths
1559 path prefixes generated by
1561 will be recognized and stripped automatically.
1563 Reverse the patch before applying it.
1569 .Op Fl F Ar response-script
1573 Revert any local changes in files at the specified paths in a work tree.
1574 File contents will be overwritten with those contained in the
1575 work tree's base commit.
1576 There is no way to bring discarded changes back after
1579 If a file was added with
1581 it will become an unversioned file again.
1582 If a file was deleted with
1584 it will be restored.
1590 .It Fl F Ar response-script
1598 responses line-by-line from the specified
1600 file instead of prompting interactively.
1602 Instead of reverting all changes in files, interactively select or reject
1603 changes to revert based on
1609 (quit reverting this file) responses.
1610 If a file is in modified status, individual patches derived from the
1611 modified file content can be reverted.
1612 Files in added or deleted status may only be reverted in their entirety.
1614 Permit recursion into directories.
1615 If this option is not specified,
1617 will refuse to run if a specified
1631 Create a new commit in the repository from changes in a work tree
1632 and use this commit as the new base commit for the work tree.
1635 is specified, commit all changes in the work tree.
1636 Otherwise, commit changes at or within the specified paths.
1638 If changes have been explicitly staged for commit with
1640 only commit staged changes and reject any specified paths which
1641 have not been staged.
1644 opens a temporary file in an editor where a log message can be written
1652 options are used together.
1654 Show the status of each affected file, using the following status codes:
1655 .Bl -column YXZ description
1656 .It M Ta modified file
1657 .It D Ta file was deleted
1658 .It A Ta new file was added
1659 .It m Ta modified file modes (executable bit only)
1662 Files which are not part of the new commit will retain their previously
1663 recorded base commit.
1666 commands may refuse to run while the work tree contains files from
1667 multiple base commits.
1668 The base commit of such a work tree can be made consistent by running
1670 across the entire work tree.
1674 command requires the
1676 environment variable to be set,
1677 unless an author has been configured in
1683 configuration settings can be
1684 obtained from the repository's
1686 file or from Git's global
1695 Set author information in the newly created commit to
1697 This is useful when committing changes which were written by someone
1701 argument must use the same format as the
1703 environment variable.
1705 In addition to storing author information, the newly created commit
1708 information which is obtained, as usual, from the
1710 environment variable, or
1712 or Git configuration settings.
1714 Use the prepared log message stored in the file found at
1716 when creating the new commit.
1718 opens a temporary file in an editor where the prepared log message can be
1719 reviewed and edited further if needed.
1720 Cannot be used together with the
1724 Use the specified log message when creating the new commit.
1725 Cannot be used together with the
1729 This option prevents
1731 from opening the commit message in an editor.
1732 It has no effect unless it is used together with the
1734 option and is intended for non-interactive use such as scripting.
1736 This option prevents
1738 from generating a diff of the to-be-committed changes in a temporary file
1739 which can be viewed while editing a commit message.
1741 Allow the addition of symbolic links which point outside of the path space
1742 that is under version control.
1745 will reject such symbolic links due to safety concerns.
1748 may decide to represent such a symbolic link as a regular file which contains
1749 the link's target path, rather than creating an actual symbolic link which
1750 points outside of the work tree.
1751 Use of this option is discouraged because external mechanisms such as
1753 are better suited for managing symbolic links to paths not under
1758 will refuse to run if certain preconditions are not met.
1759 If the work tree's current branch is not in the
1761 reference namespace, new commits may not be created on this branch.
1762 Local changes may only be committed if they are based on file content
1763 found in the most recent commit on the work tree's branch.
1764 If a path is found to be out of date,
1766 must be used first in order to merge local changes with changes made
1774 .Op Fl r Ar repository-path
1776 .Op Ar remote-repository
1779 Send new changes to a remote repository.
1781 .Ar remote-repository
1785 The remote repository's URL is obtained from the corresponding entry in
1789 file of the local repository, as created by
1792 All objects corresponding to new changes will be written to a temporary
1793 pack file which is then uploaded to the server.
1794 Upon success, references in the
1796 reference namespace of the local repository will be updated to point at
1797 the commits which have been sent.
1799 By default, changes will only be sent if they are based on up-to-date
1800 copies of relevant branches in the remote repository.
1801 If any changes to be sent are based on out-of-date copies or would
1802 otherwise break linear history of existing branches, new changes must
1803 be fetched from the server with
1805 and local branches must be rebased with
1812 option can be used to make exceptions to these requirements.
1819 Send all branches from the local repository's
1821 reference namespace.
1824 option is equivalent to listing all branches with multiple
1827 Cannot be used together with the
1833 from the local repository's
1835 reference namespace.
1836 This option may be specified multiple times to build a list of branches
1838 If this option is not specified, default to the work tree's current branch
1839 if invoked in a work tree, or to the repository's HEAD reference.
1840 Cannot be used together with the
1844 Delete the specified
1846 from the remote repository's
1848 reference namespace.
1849 This option may be specified multiple times to build a list of branches
1852 Only references are deleted.
1853 Any commit, tree, tag, and blob objects belonging to deleted branches
1854 may become subject to deletion by Git's garbage collector running on
1857 Requesting deletion of branches results in an error if the server
1858 does not support this feature or disallows the deletion of branches
1859 based on its configuration.
1861 Attempt to force the server to overwrite existing branches or tags
1862 in the remote repository, even when
1866 would usually be required before changes can be sent.
1867 The server may reject forced requests regardless, depending on its
1870 Any commit, tree, tag, and blob objects belonging to overwritten branches
1871 or tags may become subject to deletion by Git's garbage collector running
1876 reference namespace is globally shared between all repositories.
1879 option to overwrite tags is discouraged because it can lead to
1880 inconsistencies between the tags present in different repositories.
1881 In general, creating a new tag with a different name is recommended
1882 instead of overwriting an existing tag.
1886 option is particularly discouraged if changes being sent are based
1887 on an out-of-date copy of a branch in the remote repository.
1888 Instead of using the
1890 option, new changes should
1893 and local branches should be rebased with
1895 followed by another attempt to send the changes.
1899 option should only be needed in situations where the remote repository's
1900 copy of a branch or tag is known to be out-of-date and is considered
1902 The risks of creating inconsistencies between different repositories
1903 should also be taken into account.
1905 Suppress progress reporting output.
1906 The same option will be passed to
1909 .It Fl r Ar repository-path
1910 Use the repository at the specified path.
1911 If not specified, assume the repository is located at or above the current
1913 If this directory is a
1915 work tree, use the repository path associated with this work tree.
1917 Attempt to send all tags from the local repository's
1919 reference namespace.
1922 option is equivalent to listing all tags with multiple
1925 Cannot be used together with the
1931 from the local repository's
1933 reference namespace, in addition to any branches that are being sent.
1936 option may be specified multiple times to build a list of tags to send.
1937 No tags will be sent if the
1941 Raise an error if the specified
1943 already exists in the remote repository, unless the
1945 option is used to overwrite the server's copy of the tag.
1946 In general, creating a new tag with a different name is recommended
1947 instead of overwriting an existing tag.
1949 Cannot be used together with the
1956 to print debugging messages to standard error output.
1957 The same option will be passed to
1960 Multiple -v options increase the verbosity.
1964 .It Cm cherrypick Ar commit
1966 Merge changes from a single
1971 should be on a different branch than the work tree's base commit.
1972 The expected argument is a reference or a commit ID SHA1 hash.
1973 An abbreviated hash argument will be expanded to a full SHA1 hash
1974 automatically, provided the abbreviation is unique.
1976 Show the status of each affected file, using the following status codes:
1977 .Bl -column YXZ description
1978 .It G Ta file was merged
1979 .It C Ta file was merged and conflicts occurred during merge
1980 .It ! Ta changes destined for a missing file were not merged
1981 .It D Ta file was deleted
1982 .It d Ta file's deletion was prevented by local modifications
1983 .It A Ta new file was added
1984 .It \(a~ Ta changes destined for a non-regular file were not merged
1985 .It ? Ta changes destined for an unversioned file were not merged
1988 The merged changes will appear as local changes in the work tree, which
1991 amended manually or with further
1996 or discarded again with
2000 will refuse to run if certain preconditions are not met.
2001 If the work tree contains multiple base commits, it must first be updated
2002 to a single base commit with
2004 If any relevant files already contain merge conflicts, these
2005 conflicts must be resolved first.
2007 .It Cm backout Ar commit
2009 Reverse-merge changes from a single
2014 should be on the same branch as the work tree's base commit.
2015 The expected argument is a reference or a commit ID SHA1 hash.
2016 An abbreviated hash argument will be expanded to a full SHA1 hash
2017 automatically, provided the abbreviation is unique.
2019 Show the status of each affected file, using the following status codes:
2020 .Bl -column YXZ description
2021 .It G Ta file was merged
2022 .It C Ta file was merged and conflicts occurred during merge
2023 .It ! Ta changes destined for a missing file were not merged
2024 .It D Ta file was deleted
2025 .It d Ta file's deletion was prevented by local modifications
2026 .It A Ta new file was added
2027 .It \(a~ Ta changes destined for a non-regular file were not merged
2028 .It ? Ta changes destined for an unversioned file were not merged
2031 The reverse-merged changes will appear as local changes in the work tree,
2032 which may be viewed with
2034 amended manually or with further
2039 or discarded again with
2043 will refuse to run if certain preconditions are not met.
2044 If the work tree contains multiple base commits, it must first be updated
2045 to a single base commit with
2047 If any relevant files already contain merge conflicts, these
2048 conflicts must be resolved first.
2056 Rebase commits on the specified
2058 onto the tip of the current branch of the work tree.
2061 must share common ancestry with the work tree's current branch.
2062 Rebasing begins with the first descendant commit of the youngest
2063 common ancestor commit shared by the specified
2065 and the work tree's current branch, and stops once the tip commit
2072 is used as intended, the specified
2074 represents a local commit history and may already contain changes
2075 that are not yet visible in any other repositories.
2076 The work tree's current branch, which must be set with
2080 operation, represents a branch from a remote repository which shares
2081 a common history with the specified
2083 but has progressed, and perhaps diverged, due to commits added to the
2086 Rebased commits are accumulated on a temporary branch which the work tree
2087 will remain switched to throughout the entire rebase operation.
2088 Commits on this branch represent the same changes with the same log
2089 messages as their counterparts on the original
2091 but with different commit IDs.
2092 Once rebasing has completed successfully, the temporary branch becomes
2093 the new version of the specified
2095 and the work tree is automatically switched to it.
2096 If author information is available via the
2098 environment variable,
2104 configuration settings, this author information will be used to identify
2109 Old commits in their pre-rebase state are automatically backed up in the
2110 .Dq refs/got/backup/rebase
2111 reference namespace.
2112 As long as these references are not removed older versions of rebased
2113 commits will remain in the repository and can be viewed with the
2116 Removal of these references makes objects which become unreachable via
2117 any reference subject to removal by Git's garbage collector or
2118 .Cm gotadmin cleanup .
2120 While rebasing commits, show the status of each affected file,
2121 using the following status codes:
2122 .Bl -column YXZ description
2123 .It G Ta file was merged
2124 .It C Ta file was merged and conflicts occurred during merge
2125 .It ! Ta changes destined for a missing file were not merged
2126 .It D Ta file was deleted
2127 .It d Ta file's deletion was prevented by local modifications
2128 .It A Ta new file was added
2129 .It \(a~ Ta changes destined for a non-regular file were not merged
2130 .It ? Ta changes destined for an unversioned file were not merged
2133 If merge conflicts occur, the rebase operation is interrupted and may
2134 be continued once conflicts have been resolved.
2135 If any files with destined changes are found to be missing or unversioned,
2136 or if files could not be deleted due to differences in deleted content,
2137 the rebase operation will be interrupted to prevent potentially incomplete
2138 changes from being committed to the repository without user intervention.
2139 The work tree may be modified as desired and the rebase operation can be
2140 continued once the changes present in the work tree are considered complete.
2141 Alternatively, the rebase operation may be aborted which will leave
2143 unmodified and the work tree switched back to its original branch.
2145 If a merge conflict is resolved in a way which renders the merged
2146 change into a no-op change, the corresponding commit will be elided
2147 when the rebase operation continues.
2150 will refuse to run if certain preconditions are not met.
2155 reference namespace, the branch may not be rebased.
2156 If the work tree is not yet fully updated to the tip commit of its
2157 branch, then the work tree must first be updated with
2159 If changes have been staged with
2161 these changes must first be committed with
2165 If the work tree contains local changes, these changes must first be
2172 contains changes to files outside of the work tree's path prefix,
2173 the work tree cannot be used to rebase this branch.
2179 commands will refuse to run while a rebase operation is in progress.
2180 Other commands which manipulate the work tree may be used for
2181 conflict resolution purposes.
2185 is already based on the work tree's current branch, then no commits
2186 need to be rebased and
2188 will simply switch the work tree to the specified
2190 and update files in the work tree accordingly.
2197 Abort an interrupted rebase operation.
2198 If this option is used, no other command-line arguments are allowed.
2200 Continue an interrupted rebase operation.
2201 If this option is used, no other command-line arguments are allowed.
2203 Show a list of past rebase operations, represented by references in the
2204 .Dq refs/got/backup/rebase
2205 reference namespace.
2207 Display the author, date, and log message of each backed up commit,
2208 the object ID of the corresponding post-rebase commit, and
2209 the object ID of their common ancestor commit.
2210 Given these object IDs,
2217 options can be used to examine the history of either version of the branch,
2222 option can be used to create a new branch from a pre-rebase state if desired.
2226 is specified, only show commits which at some point in time represented this
2228 Otherwise, list all backed up commits for any branches.
2230 If this option is used,
2232 does not require a work tree.
2233 None of the other options can be used together with
2236 Delete backups created by past rebase operations, represented by references
2238 .Dq refs/got/backup/rebase
2239 reference namespace.
2243 is specified, only delete backups which at some point in time represented
2245 Otherwise, delete all references found within
2246 .Dq refs/got/backup/rebase .
2248 Any commit, tree, tag, and blob objects belonging to deleted backups
2249 remain in the repository and may be removed separately with
2250 Git's garbage collector or
2251 .Cm gotadmin cleanup .
2253 If this option is used,
2255 does not require a work tree.
2256 None of the other options can be used together with
2263 .Op Fl F Ar histedit-script
2267 Edit commit history between the work tree's current base commit and
2268 the tip commit of the work tree's current branch.
2272 command requires the
2274 environment variable to be set,
2275 unless an author has been configured in
2281 configuration settings can be obtained from the repository's
2283 file or from Git's global
2289 operation, the work tree's current branch must be set with
2291 to the branch which should be edited, unless this branch is already the
2292 current branch of the work tree.
2293 The tip of this branch represents the upper bound (inclusive) of commits
2298 Furthermore, the work tree's base commit
2301 to a point in this branch's commit history where editing should begin.
2302 This commit represents the lower bound (non-inclusive) of commits touched
2307 Editing of commit history is controlled via a
2309 which can be written in an editor based on a template, passed on the
2310 command line, or generated with the
2316 The format of the histedit script is line-based.
2317 Each line in the script begins with a command name, followed by
2318 whitespace and an argument.
2319 For most commands, the expected argument is a commit ID SHA1 hash.
2320 Any remaining text on the line is ignored.
2321 Lines which begin with the
2323 character are ignored entirely.
2325 The available histedit script commands are as follows:
2326 .Bl -column YXZ pick-commit
2327 .It Cm pick Ar commit Ta Use the specified commit as it is.
2328 .It Cm edit Ar commit Ta Use the specified commit but once changes have been
2329 merged into the work tree interrupt the histedit operation for amending.
2330 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
2331 listed further below that will be used.
2332 .It Cm drop Ar commit Ta Remove this commit from the edited history.
2333 .It Cm mesg Oo Ar log-message Oc Ta Create a new log message for the commit of
2338 command on the previous line of the histedit script.
2341 argument provides a new single-line log message to use.
2344 argument is omitted, open an editor where a new log message can be written.
2347 Every commit in the history being edited must be mentioned in the script.
2348 Lines may be re-ordered to change the order of commits in the edited history.
2349 No commit may be listed more than once.
2351 Edited commits are accumulated on a temporary branch which the work tree
2352 will remain switched to throughout the entire histedit operation.
2353 Once history editing has completed successfully, the temporary branch becomes
2354 the new version of the work tree's branch and the work tree is automatically
2357 Old commits in their pre-histedit state are automatically backed up in the
2358 .Dq refs/got/backup/histedit
2359 reference namespace.
2360 As long as these references are not removed older versions of edited
2361 commits will remain in the repository and can be viewed with the
2364 Removal of these references makes objects which become unreachable via
2365 any reference subject to removal by Git's garbage collector or
2366 .Cm gotadmin cleanup .
2368 While merging commits, show the status of each affected file,
2369 using the following status codes:
2370 .Bl -column YXZ description
2371 .It G Ta file was merged
2372 .It C Ta file was merged and conflicts occurred during merge
2373 .It ! Ta changes destined for a missing file were not merged
2374 .It D Ta file was deleted
2375 .It d Ta file's deletion was prevented by local modifications
2376 .It A Ta new file was added
2377 .It \(a~ Ta changes destined for a non-regular file were not merged
2378 .It ? Ta changes destined for an unversioned file were not merged
2381 If merge conflicts occur, the histedit operation is interrupted and may
2382 be continued once conflicts have been resolved.
2383 If any files with destined changes are found to be missing or unversioned,
2384 or if files could not be deleted due to differences in deleted content,
2385 the histedit operation will be interrupted to prevent potentially incomplete
2386 changes from being committed to the repository without user intervention.
2387 The work tree may be modified as desired and the histedit operation can be
2388 continued once the changes present in the work tree are considered complete.
2389 Alternatively, the histedit operation may be aborted which will leave
2390 the work tree switched back to its original branch.
2392 If a merge conflict is resolved in a way which renders the merged
2393 change into a no-op change, the corresponding commit will be elided
2394 when the histedit operation continues.
2397 will refuse to run if certain preconditions are not met.
2398 If the work tree's current branch is not in the
2400 reference namespace, the history of the branch may not be edited.
2401 If the work tree contains multiple base commits, it must first be updated
2402 to a single base commit with
2404 If changes have been staged with
2406 these changes must first be committed with
2410 If the work tree contains local changes, these changes must first be
2415 If the edited history contains changes to files outside of the work tree's
2416 path prefix, the work tree cannot be used to edit the history of this branch.
2423 commands will refuse to run while a histedit operation is in progress.
2424 Other commands which manipulate the work tree may be used, and the
2426 command may be used to commit arbitrary changes to the temporary branch
2427 while the histedit operation is interrupted.
2434 Abort an interrupted histedit operation.
2435 If this option is used, no other command-line arguments are allowed.
2437 Continue an interrupted histedit operation.
2438 If this option is used, no other command-line arguments are allowed.
2440 Interrupt the histedit operation for editing after merging each commit.
2441 This option is a quick equivalent to a histedit script which uses the
2443 command for all commits.
2446 option can only be used when starting a new histedit operation.
2447 If this option is used, no other command-line arguments are allowed.
2448 .It Fl F Ar histedit-script
2451 instead of opening a temporary file in an editor where a histedit script
2454 Fold all commits into a single commit.
2455 This option is a quick equivalent to a histedit script which folds all
2456 commits, combining them all into one commit.
2459 option can only be used when starting a new histedit operation.
2460 If this option is used, no other command-line arguments are allowed.
2462 Show a list of past histedit operations, represented by references in the
2463 .Dq refs/got/backup/histedit
2464 reference namespace.
2466 Display the author, date, and log message of each backed up commit,
2467 the object ID of the corresponding post-histedit commit, and
2468 the object ID of their common ancestor commit.
2469 Given these object IDs,
2476 options can be used to examine the history of either version of the branch,
2481 option can be used to create a new branch from a pre-histedit state if desired.
2485 is specified, only show commits which at some point in time represented this
2487 Otherwise, list all backed up commits for any branches.
2489 If this option is used,
2491 does not require a work tree.
2492 None of the other options can be used together with
2495 Edit log messages only.
2496 This option is a quick equivalent to a histedit script which edits
2497 only log messages but otherwise leaves every picked commit as-is.
2500 option can only be used when starting a new histedit operation.
2501 If this option is used, no other command-line arguments are allowed.
2503 Delete backups created by past histedit operations, represented by references
2505 .Dq refs/got/backup/histedit
2506 reference namespace.
2510 is specified, only delete backups which at some point in time represented
2512 Otherwise, delete all references found within
2513 .Dq refs/got/backup/histedit .
2515 Any commit, tree, tag, and blob objects belonging to deleted backups
2516 remain in the repository and may be removed separately with
2517 Git's garbage collector or
2518 .Cm gotadmin cleanup .
2520 If this option is used,
2522 does not require a work tree.
2523 None of the other options can be used together with
2527 .It Cm integrate Ar branch
2529 Integrate the specified
2531 into the work tree's current branch.
2532 Files in the work tree are updated to match the contents on the integrated
2534 and the reference of the work tree's branch is changed to point at the
2535 head commit of the integrated
2538 Both branches can be considered equivalent after integration since they
2539 will be pointing at the same commit.
2540 Both branches remain available for future work, if desired.
2541 In case the integrated
2543 is no longer needed it may be deleted with
2546 Show the status of each affected file, using the following status codes:
2547 .Bl -column YXZ description
2548 .It U Ta file was updated
2549 .It D Ta file was deleted
2550 .It A Ta new file was added
2551 .It \(a~ Ta versioned file is obstructed by a non-regular file
2552 .It ! Ta a missing versioned file was restored
2556 will refuse to run if certain preconditions are not met.
2557 Most importantly, the
2559 must have been rebased onto the work tree's current branch with
2561 before it can be integrated, in order to linearize commit history and
2562 resolve merge conflicts.
2563 If the work tree contains multiple base commits, it must first be updated
2564 to a single base commit with
2566 If changes have been staged with
2568 these changes must first be committed with
2572 If the work tree contains local changes, these changes must first be
2584 Create a merge commit based on the current branch of the work tree and
2587 If a linear project history is desired, then use of
2589 should be preferred over
2591 However, even strictly linear projects may require merge commits in order
2592 to merge in new versions of third-party code stored on vendor branches
2596 Merge commits are commits based on multiple parent commits.
2597 The tip commit of the work tree's current branch, which must be set with
2601 operation, will be used as the first parent.
2602 The tip commit of the specified
2604 will be used as the second parent.
2606 No ancestral relationship between the two branches is required.
2607 If the two branches have already been merged previously, only new changes
2610 It is not possible to create merge commits with more than two parents.
2611 If more than one branch needs to be merged, then multiple merge commits
2612 with two parents each can be created in sequence.
2614 While merging changes found on the
2616 into the work tree, show the status of each affected file,
2617 using the following status codes:
2618 .Bl -column YXZ description
2619 .It G Ta file was merged
2620 .It C Ta file was merged and conflicts occurred during merge
2621 .It ! Ta changes destined for a missing file were not merged
2622 .It D Ta file was deleted
2623 .It d Ta file's deletion was prevented by local modifications
2624 .It A Ta new file was added
2625 .It \(a~ Ta changes destined for a non-regular file were not merged
2626 .It ? Ta changes destined for an unversioned file were not merged
2629 If merge conflicts occur, the merge operation is interrupted and conflicts
2630 must be resolved before the merge operation can continue.
2631 If any files with destined changes are found to be missing or unversioned,
2632 or if files could not be deleted due to differences in deleted content,
2633 the merge operation will be interrupted to prevent potentially incomplete
2634 changes from being committed to the repository without user intervention.
2635 The work tree may be modified as desired and the merge can be continued
2636 once the changes present in the work tree are considered complete.
2637 Alternatively, the merge operation may be aborted which will leave
2638 the work tree's current branch unmodified.
2640 If a merge conflict is resolved in a way which renders all merged
2641 changes into no-op changes, the merge operation cannot continue
2642 and must be aborted.
2645 will refuse to run if certain preconditions are not met.
2648 is based on the work tree's current branch, then no merge commit can
2651 may be used to integrate the
2654 If the work tree is not yet fully updated to the tip commit of its
2655 branch, then the work tree must first be updated with
2657 If the work tree contains multiple base commits, it must first be updated
2658 to a single base commit with
2660 If changes have been staged with
2662 these changes must first be committed with
2666 If the work tree contains local changes, these changes must first be
2673 contains changes to files outside of the work tree's path prefix,
2674 the work tree cannot be used to merge this branch.
2684 commands will refuse to run while a merge operation is in progress.
2685 Other commands which manipulate the work tree may be used for
2686 conflict resolution purposes.
2693 Abort an interrupted merge operation.
2694 If this option is used, no other command-line arguments are allowed.
2696 Continue an interrupted merge operation.
2697 If this option is used, no other command-line arguments are allowed.
2699 Merge changes into the work tree as usual but do not create a merge
2701 The merge result can be adjusted as desired before a merge commit is
2704 Alternatively, the merge may be aborted with
2711 .Op Fl F Ar response-script
2715 Stage local changes for inclusion in the next commit.
2718 is specified, stage all changes in the work tree.
2719 Otherwise, stage changes at or within the specified paths.
2720 Paths may be staged if they are added, modified, or deleted according to
2723 Show the status of each affected file, using the following status codes:
2724 .Bl -column YXZ description
2725 .It A Ta file addition has been staged
2726 .It M Ta file modification has been staged
2727 .It D Ta file deletion has been staged
2730 Staged file contents are saved in newly created blob objects in the repository.
2731 These blobs will be referred to by tree objects once staged changes have been
2734 Staged changes affect the behaviour of
2739 While paths with staged changes exist, the
2741 command will refuse to commit any paths which do not have staged changes.
2742 Local changes created on top of staged changes can only be committed if
2743 the path is staged again, or if the staged changes are committed first.
2746 command will show both local changes and staged changes.
2749 command is able to display local changes relative to staged changes,
2750 and to display staged changes relative to the repository.
2753 command cannot revert staged changes but may be used to revert
2754 local changes created on top of staged changes.
2760 .It Fl F Ar response-script
2768 responses line-by-line from the specified
2770 file instead of prompting interactively.
2772 Instead of staging new changes, list paths which are already staged,
2773 along with the IDs of staged blob objects and stage status codes.
2774 If paths were provided on the command line, show the staged paths
2775 among the specified paths.
2776 Otherwise, show all staged paths.
2778 Instead of staging the entire content of a changed file, interactively
2779 select or reject changes for staging based on
2783 (reject change), and
2785 (quit staging this file) responses.
2786 If a file is in modified status, individual patches derived from the
2787 modified file content can be staged.
2788 Files in added or deleted status may only be staged or rejected in
2791 Allow staging of symbolic links which point outside of the path space
2792 that is under version control.
2795 will reject such symbolic links due to safety concerns.
2798 may decide to represent such a symbolic link as a regular file which contains
2799 the link's target path, rather than creating an actual symbolic link which
2800 points outside of the work tree.
2801 Use of this option is discouraged because external mechanisms such as
2803 are better suited for managing symbolic links to paths not under
2808 will refuse to run if certain preconditions are not met.
2809 If a file contains merge conflicts, these conflicts must be resolved first.
2810 If a file is found to be out of date relative to the head commit on the
2811 work tree's current branch, the file must be updated with
2813 before it can be staged (however, this does not prevent the file from
2814 becoming out-of-date at some point after having been staged).
2821 commands will refuse to run while staged changes exist.
2822 If staged changes cannot be committed because a staged path
2823 is out of date, the path must be unstaged with
2825 before it can be updated with
2827 and may then be staged again if necessary.
2832 .Op Fl F Ar response-script
2836 Merge staged changes back into the work tree and put affected paths
2837 back into non-staged status.
2840 is specified, unstage all staged changes across the entire work tree.
2841 Otherwise, unstage changes at or within the specified paths.
2843 Show the status of each affected file, using the following status codes:
2844 .Bl -column YXZ description
2845 .It G Ta file was unstaged
2846 .It C Ta file was unstaged and conflicts occurred during merge
2847 .It ! Ta changes destined for a missing file were not merged
2848 .It D Ta file was staged as deleted and still is deleted
2849 .It d Ta file's deletion was prevented by local modifications
2850 .It \(a~ Ta changes destined for a non-regular file were not merged
2857 .It Fl F Ar response-script
2865 responses line-by-line from the specified
2867 file instead of prompting interactively.
2869 Instead of unstaging the entire content of a changed file, interactively
2870 select or reject changes for unstaging based on
2874 (keep change staged), and
2876 (quit unstaging this file) responses.
2877 If a file is staged in modified status, individual patches derived from the
2878 staged file content can be unstaged.
2879 Files staged in added or deleted status may only be unstaged in their entirety.
2885 .Op Fl r Ar repository-path
2888 Parse and print contents of objects to standard output in a line-based
2890 Content of commit, tree, and tag objects is printed in a way similar
2891 to the actual content stored in such objects.
2892 Blob object contents are printed as they would appear in files on disk.
2894 Attempt to interpret each argument as a reference, a tag name, or
2895 an object ID SHA1 hash.
2896 References will be resolved to an object ID.
2897 Tag names will resolved to a tag object.
2898 An abbreviated hash argument will be expanded to a full SHA1 hash
2899 automatically, provided the abbreviation is unique.
2901 If none of the above interpretations produce a valid result, or if the
2903 option is used, attempt to interpret the argument as a path which will
2904 be resolved to the ID of an object found at this path in the repository.
2911 Look up paths in the specified
2913 If this option is not used, paths are looked up in the commit resolved
2914 via the repository's HEAD reference.
2915 The expected argument is a commit ID SHA1 hash or an existing reference
2916 or tag name which will be resolved to a commit ID.
2917 An abbreviated hash argument will be expanded to a full SHA1 hash
2918 automatically, provided the abbreviation is unique.
2920 Interpret all arguments as paths only.
2921 This option can be used to resolve ambiguity in cases where paths
2922 look like tag names, reference names, or object IDs.
2923 .It Fl r Ar repository-path
2924 Use the repository at the specified path.
2925 If not specified, assume the repository is located at or above the current
2927 If this directory is a
2929 work tree, use the repository path associated with this work tree.
2931 .It Cm info Op Ar path ...
2932 Display meta-data stored in a work tree.
2937 The work tree to use is resolved implicitly by walking upwards from the
2938 current working directory.
2942 arguments are specified, show additional per-file information for tracked
2943 files located at or within these paths.
2946 argument corresponds to the work tree's root directory, display information
2947 for all tracked files.
2950 .Bl -tag -width GOT_IGNORE_GITCONFIG
2952 The author's name and email address, such as
2953 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
2963 may fail to parse commits without an email address in author data,
2967 environment variables with a missing email address.
2969 .Ev GOT_AUTHOR will be overridden by configuration settings in
2975 configuration settings in the repository's
2982 configuration settings contained in Git's global
2984 configuration file will only be used if neither
2988 environment variable provide author information.
2989 .It Ev VISUAL , EDITOR
2990 The editor spawned by
2998 text editor will be spawned in order to give
3000 the attention it deserves.
3001 .It Ev GOT_LOG_DEFAULT_LIMIT
3002 The default limit on the number of commits traversed by
3004 If set to zero, the limit is unbounded.
3005 This variable will be silently ignored if it is set to a non-numeric value.
3006 .It Ev GOT_IGNORE_GITCONFIG
3007 If this variable is set then any remote repository definitions or author
3008 information found in Git configuration files will be ignored.
3011 .Bl -tag -width packed-refs -compact
3013 Repository-wide configuration settings for
3017 configuration file located in the root directory of a Git repository
3018 supersedes any relevant settings in Git's
3022 .It Pa .got/got.conf
3023 Worktree-specific configuration settings for
3027 configuration file in the
3029 meta-data directory of a work tree supersedes any relevant settings in
3032 configuration file and Git's
3039 Enable tab-completion of
3044 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3046 Clone an existing Git repository for use with
3050 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3052 Use of HTTP URLs currently requires
3056 .Dl $ git clone --bare https://github.com/openbsd/src.git
3058 Alternatively, for quick and dirty local testing of
3060 a new Git repository could be created and populated with files,
3061 e.g. from a temporary CVS checkout located at
3064 .Dl $ gotadmin init /var/git/src.git
3065 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3067 Check out a work tree from the Git repository to /usr/src:
3069 .Dl $ got checkout /var/git/src.git /usr/src
3071 View local changes in a work tree directory:
3073 .Dl $ got diff | less
3075 In a work tree, display files in a potentially problematic state:
3077 .Dl $ got status -s 'C!~?'
3079 Interactively revert selected local changes in a work tree directory:
3081 .Dl $ got revert -p -R\ .
3083 In a work tree or a git repository directory, list all branch references:
3087 In a work tree or a git repository directory, create a new branch called
3088 .Dq unified-buffer-cache
3089 which is forked off the
3093 .Dl $ got branch -c master unified-buffer-cache
3095 Switch an existing work tree to the branch
3096 .Dq unified-buffer-cache .
3097 Local changes in the work tree will be preserved and merged if necessary:
3099 .Dl $ got update -b unified-buffer-cache
3101 Create a new commit from local changes in a work tree directory.
3102 This new commit will become the head commit of the work tree's current branch:
3106 In a work tree or a git repository directory, view changes committed in
3107 the 3 most recent commits to the work tree's branch, or the branch resolved
3108 via the repository's HEAD reference, respectively:
3110 .Dl $ got log -p -l 3
3112 As above, but display changes in the order in which
3114 could apply them in sequence:
3116 .Dl $ got log -p -l 3 -R
3118 In a work tree or a git repository directory, log the history of a subdirectory:
3120 .Dl $ got log sys/uvm
3122 While operating inside a work tree, paths are specified relative to the current
3123 working directory, so this command will log the subdirectory
3126 .Dl $ cd sys/uvm && got log\ .
3128 And this command has the same effect:
3130 .Dl $ cd sys/dev/usb && got log ../../uvm
3132 And this command displays work tree meta-data about all tracked files:
3135 .Dl $ got info\ . | less
3137 Add new files and remove obsolete files in a work tree directory:
3139 .Dl $ got add sys/uvm/uvm_ubc.c
3140 .Dl $ got remove sys/uvm/uvm_vnode.c
3142 Create a new commit from local changes in a work tree directory
3143 with a pre-defined log message.
3145 .Dl $ got commit -m 'unify the buffer cache'
3147 Alternatively, create a new commit from local changes in a work tree
3148 directory with a log message that has been prepared in the file
3151 .Dl $ got commit -F /tmp/msg
3153 Update any work tree checked out from the
3154 .Dq unified-buffer-cache
3155 branch to the latest commit on this branch:
3159 Roll file content on the unified-buffer-cache branch back by one commit,
3160 and then fetch the rolled-back change into the work tree as a local change
3161 to be amended and perhaps committed again:
3163 .Dl $ got backout unified-buffer-cache
3164 .Dl $ got commit -m 'roll back previous'
3165 .Dl $ # now back out the previous backout :-)
3166 .Dl $ got backout unified-buffer-cache
3168 Fetch new changes on the remote repository's
3170 branch, making them visible on the local repository's
3177 In a repository created with a HTTP URL and
3178 .Cm git clone --bare
3181 command must be used instead:
3183 .Dl $ cd /var/git/src.git
3184 .Dl $ git fetch origin master:refs/remotes/origin/master
3188 branch to merge the new changes that are now visible on the
3193 .Dl $ got update -b origin/master
3194 .Dl $ got rebase master
3197 .Dq unified-buffer-cache
3198 branch on top of the new head commit of the
3202 .Dl $ got update -b master
3203 .Dl $ got rebase unified-buffer-cache
3205 Create a patch from all changes on the unified-buffer-cache branch.
3206 The patch can be mailed out for review and applied to
3210 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
3212 Edit the entire commit history of the
3213 .Dq unified-buffer-cache
3216 .Dl $ got update -b unified-buffer-cache
3217 .Dl $ got update -c master
3220 Before working against existing branches in a repository cloned with
3221 .Cm git clone --bare
3226 must be configured to map all references in the remote repository
3229 namespace of the local repository.
3230 This can be achieved by setting Git's
3231 .Pa remote.origin.fetch
3232 configuration variable to the value
3233 .Dq +refs/heads/*:refs/remotes/origin/*
3238 .Dl $ cd /var/git/repo
3239 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
3243 option must be disabled:
3245 .Dl $ cd /var/git/repo
3246 .Dl $ git config remote.origin.mirror false
3248 Alternatively, the following
3250 configuration item can be added manually to the Git repository's
3254 .Dl [remote \&"origin\&"]
3256 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
3259 This configuration leaves the local repository's
3261 namespace free for use by local branches checked out with
3263 and, if needed, created with
3266 .Dq refs/remotes/origin
3267 namespace can now be updated with incoming changes from the remote
3272 without extra command line arguments.
3273 Newly fetched changes can be examined with
3276 Display changes on the remote repository's version of the
3278 branch, as of the last time
3282 .Dl $ got log -c origin/master | less
3284 As shown here, most commands accept abbreviated reference names such as
3287 .Dq refs/remotes/origin/master .
3288 The latter is only needed in case of ambiguity.
3291 must be used to merge changes which are visible on the
3296 This will also merge local changes, if any, with the incoming changes:
3298 .Dl $ got update -b origin/master
3299 .Dl $ got rebase master
3301 In order to make changes committed to the
3302 .Dq unified-buffer-cache
3306 .Dq unified-buffer-cache
3307 branch must first be rebased onto the
3311 .Dl $ got update -b master
3312 .Dl $ got rebase unified-buffer-cache
3315 .Dq unified-buffer-cache
3316 branch can now be made visible on the
3320 Because the rebase operation switched the work tree to the
3321 .Dq unified-buffer-cache
3322 branch, the work tree must be switched back to the
3326 .Dl $ got update -b master
3327 .Dl $ got integrate unified-buffer-cache
3331 branch, log messages for local changes can now be amended with
3333 by other developers and any other important new information:
3335 .Dl $ got update -c origin/master
3336 .Dl $ got histedit -m
3338 If the remote repository offers write access, local changes on the
3340 branch can be sent to the remote repository with
3344 can be run without further arguments.
3345 The arguments shown here match defaults, provided the work tree's
3346 current branch is the
3350 .Dl $ got send -b master origin
3352 If the remote repository requires the HTTPS protocol, the
3354 command must be used instead:
3356 .Dl $ cd /var/git/src.git
3357 .Dl $ git push origin master
3359 When making contributions to projects which use the
3361 workflow, SSH protocol repository access needs to be set up first.
3362 Once an account has been created on a Git hosting site it should
3363 be possible to upload a public SSH key for repository access
3368 workflow will usually involve two remote repositories.
3369 In the real-life example below, the
3371 repository was forked from the
3373 repository by using the Git hosting site's web interface.
3376 file in the local repository describes both remote repositories:
3377 .Bd -literal -offset indent
3378 # Jelmers's repository, which accepts pull requests
3380 server git@github.com
3382 repository "/jelmer/dulwich"
3386 # Stefan's fork, used as the default remote repository
3388 server git@github.com
3390 repository "/stspdotname/dulwich"
3395 With this configuration, Stefan can create commits on
3396 .Dq refs/heads/master
3397 and send them to the
3399 repository by running:
3401 .Dl $ got send -b master origin
3403 The changes can now be proposed to Jelmer by opening a pull request
3404 via the Git hosting site's web interface.
3405 If Jelmer requests further changes to be made, additional commits
3406 can be created on the
3408 branch and be added to the pull request by running
3412 If Jelmer prefers additional commits to be
3414 then the following commands can be used to achieve this:
3416 .Dl $ got update -b master
3417 .Dl $ got update -c origin/master
3418 .Dl $ got histedit -f
3419 .Dl $ got send -f -b master origin
3421 Once Jelmer has accepted the pull request, Stefan can fetch the
3422 merged changes, and possibly several other new changes, by running:
3424 .Dl $ got fetch upstream
3426 The merged changes will now be visible under the reference
3427 .Dq refs/remotes/upstream/master .
3430 branch can now be rebased on top of the latest changes
3433 .Dl $ got update -b upstream/master
3434 .Dl $ got rebase master
3436 As a final step, the forked repository's copy of the master branch needs
3437 to be kept in sync by sending the new changes there:
3439 .Dl $ got send -f -b master origin
3441 If multiple pull requests need to be managed in parallel, a separate branch
3442 must be created for each pull request with
3444 Each such branch can then be used as above, in place of
3445 .Dq refs/heads/master .
3446 Changes for any accepted pull requests will still appear under
3447 .Dq refs/remotes/upstream/master,
3448 regardless of which branch was used in the forked repository to
3449 create a pull request.
3453 .Xr git-repository 5 ,
3454 .Xr got-worktree 5 ,
3458 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
3459 .An Christian Weisgerber Aq Mt naddy@openbsd.org
3460 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
3461 .An Josh Rickmar Aq Mt jrick@zettaport.com
3462 .An Joshua Stein Aq Mt jcs@openbsd.org
3463 .An Klemens Nanni Aq Mt kn@openbsd.org
3464 .An Martin Pieuchot Aq Mt mpi@openbsd.org
3465 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
3466 .An Omar Polo Aq Mt op@openbsd.org
3467 .An Ori Bernstein Aq Mt ori@openbsd.org
3468 .An Sebastien Marie Aq Mt semarie@openbsd.org
3469 .An Stefan Sperling Aq Mt stsp@openbsd.org
3470 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
3471 .An Theo Buehler Aq Mt tb@openbsd.org
3472 .An Thomas Adam Aq Mt thomas@xteddy.org
3473 .An Tracey Emery Aq Mt tracey@traceyemery.net
3474 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
3481 were derived from code under copyright by:
3483 .An Caldera International
3484 .An Daniel Hartmeier
3489 .An Jean-Francois Brousseau
3495 .An Niklas Hallqvist
3500 .An Xavier Santolaria
3503 contains code contributed to the public domain by
3507 is a work-in-progress and some features remain to be implemented.
3509 At present, the user has to fall back on
3511 to perform some tasks.
3515 Reading from remote repositories over HTTP or HTTPS protocols requires
3520 Writing to remote repositories over HTTP or HTTPS protocols requires
3523 The creation of merge commits with more than two parent commits requires
3526 In situations where files or directories were moved around
3528 will not automatically merge changes to new locations and
3530 will usually produce better results.