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 instead of creating the default branch
110 Use of this option is required if the
112 branch already exists.
114 Ignore files or directories with a name which matches the specified
116 This option may be specified multiple times to build a list of ignore patterns.
119 follows the globbing rules documented in
122 Use the specified log message when creating the new commit.
127 opens a temporary file in an editor where a log message can be written.
128 .It Fl r Ar repository-path
129 Use the repository at the specified path.
130 If not specified, assume the repository is located at or above the current
138 .Op Fl R Ar reference
143 Clone a Git repository at the specified
149 is specified, the directory name will be derived from the name of the
152 will refuse to run if the
158 specifies a protocol scheme, a server hostname, an optional port number
159 separated from the hostname by a colon, and a path to the repository on
161 .Lk scheme://hostname:port/path/to/repository
163 The following protocol schemes are supported:
164 .Bl -tag -width git+ssh
166 The Git protocol as implemented by the
169 Use of this protocol is discouraged since it supports neither authentication
172 The Git protocol wrapped in an authenticated and encrypted
175 With this protocol the hostname may contain an embedded username for
180 Short alias for git+ssh.
183 Objects in the cloned repository are stored in a pack file which is downloaded
185 This pack file will then be indexed to facilitate access to the objects stored
187 If any objects in the pack file are stored in deltified form, all deltas will
188 be fully resolved in order to compute the ID of such objects.
189 This can take some time.
190 More details about the pack file format are documented in
191 .Xr git-repository 5 .
194 creates a remote repository entry in the
198 files of the cloned repository to store the
204 arguments for future use by
214 Fetch all branches from the remote repository's
216 reference namespace and set
217 .Cm fetch_all_branches
218 in the cloned repository's
220 file for future use by
222 If this option is not specified, a branch resolved via the remote
223 repository's HEAD reference will be fetched.
224 Cannot be used together with the
230 from the remote repository's
233 This option may be specified multiple times to build a list of branches
235 If the branch corresponding to the remote repository's HEAD reference is not
236 in this list, the cloned repository's HEAD reference will be set to the first
237 branch which was fetched.
238 If this option is not specified, a branch resolved via the remote
239 repository's HEAD reference will be fetched.
240 Cannot be used together with the
244 List branches and tags available for fetching from the remote repository
245 and exit immediately.
246 Cannot be used together with any of the other options except
251 Create the cloned repository as a mirror of the original repository.
252 This is useful if the cloned repository will not be used to store
253 locally created commits.
259 files will be set up with the
261 option enabled, such that
265 will write incoming changes directly to branches in the
267 reference namespace, rather than to branches in the
270 This avoids the usual requirement of having to run
274 in order to make incoming changes appear on branches in the
277 But maintaining custom changes in the cloned repository becomes difficult
278 since such changes will be at risk of being discarded whenever incoming
281 Suppress progress reporting output.
282 The same option will be passed to
285 .It Fl R Ar reference
286 In addition to the branches and tags that will be fetched, fetch an arbitrary
288 from the remote repository's
291 This option may be specified multiple times to build a list of additional
295 may either be a path to a specific reference, or a reference namespace
296 which will cause all references in this namespace to be fetched.
298 Each reference will be mapped into the cloned repository's
300 namespace, unless the
302 option is used to mirror references directly into the cloned repository's
307 will refuse to fetch references from the remote repository's
316 to print debugging messages to standard error output.
317 This option will be passed to
320 Multiple -v options increase the verbosity.
328 .Op Fl R Ar reference
329 .Op Fl r Ar repository-path
330 .Op Ar remote-repository
333 Fetch new changes from a remote repository.
335 .Ar remote-repository
339 The remote repository's URL is obtained from the corresponding entry in
343 file of the local repository, as created by
346 New changes will be stored in a separate pack file downloaded from the server.
347 Optionally, separate pack files stored in the repository can be combined with
350 By default, branch references in the
352 reference namespace will be updated to point at the newly fetched commits.
355 command can then be used to make new changes visible on branches in the
357 namespace, merging incoming changes with the changes on those branches
360 If the repository was created as a mirror with
362 then all branches in the
364 namespace will be updated directly to match the corresponding branches in
365 the remote repository.
366 If those branches contained local commits, these commits will no longer be
367 reachable via a reference and will therefore be at risk of being discarded
368 by Git's garbage collector or
369 .Cm gotadmin cleanup .
370 Maintaining custom changes in a mirror repository is therefore discouraged.
372 In any case, references in the
374 namespace will always be fetched and mapped directly to local references
375 in the same namespace.
382 Fetch all branches from the remote repository's
385 This option can be enabled by default for specific repositories in
387 If this option is not specified, a branch resolved via the remote
388 repository's HEAD reference will be fetched.
389 Cannot be used together with the
395 from the remote repository's
398 This option may be specified multiple times to build a list of branches
400 If this option is not specified, a branch resolved via the remote
401 repository's HEAD reference will be fetched.
402 Cannot be used together with the
406 Delete branches and tags from the local repository which are no longer
407 present in the remote repository.
408 Only references are deleted.
409 Any commit, tree, tag, and blob objects belonging to deleted branches or
410 tags remain in the repository and may be removed separately with
411 Git's garbage collector or
412 .Cm gotadmin cleanup .
414 List branches and tags available for fetching from the remote repository
415 and exit immediately.
416 Cannot be used together with any of the other options except
422 Suppress progress reporting output.
423 The same option will be passed to
426 .It Fl R Ar reference
427 In addition to the branches and tags that will be fetched, fetch an arbitrary
429 from the remote repository's
432 This option may be specified multiple times to build a list of additional
436 may either be a path to a specific reference, or a reference namespace
437 which will cause all references in this namespace to be fetched.
439 Each reference will be mapped into the local repository's
441 namespace, unless the local repository was created as a mirror with
443 in which case references will be mapped directly into the local repository's
447 Once a reference has been fetched, a branch based on it can be created with
452 will refuse to fetch references from the remote repository's
457 .It Fl r Ar repository-path
458 Use the repository at the specified path.
459 If not specified, assume the repository is located at or above the current
461 If this directory is a
463 work tree, use the repository path associated with this work tree.
465 Allow existing references in the
467 namespace to be updated if they have changed on the server.
468 If not specified, only new tag references will be created.
473 to print debugging messages to standard error output.
474 The same option will be passed to
477 Multiple -v options increase the verbosity.
480 Delete all references which correspond to a particular
481 .Ar remote-repository
482 instead of fetching new changes.
483 This can be useful when a remote repository is being removed from
489 .Ar remote-repository
490 argument is mandatory and no other options except
497 Only references are deleted.
498 Any commit, tree, tag, and blob objects fetched from a remote repository
499 will generally be stored in pack files and may be removed separately with
501 and Git's garbage collector.
509 .Op Fl p Ar path-prefix
511 .Op Ar work-tree-path
514 Copy files from a repository into a new work tree.
515 Show the status of each affected file, using the following status codes:
516 .Bl -column YXZ description
517 .It A Ta new file was added
518 .It E Ta file already exists in work tree's meta-data
523 is not specified, either use the last component of
524 .Ar repository path ,
527 was specified use the last component of
535 Check out files from a commit on the specified
537 If this option is not specified, a branch resolved via the repository's HEAD
538 reference will be used.
540 Check out files from the specified
542 on the selected branch.
543 The expected argument is a commit ID SHA1 hash or an existing reference
544 or tag name which will be resolved to a commit ID.
545 An abbreviated hash argument will be expanded to a full SHA1 hash
546 automatically, provided the abbreviation is unique.
547 If this option is not specified, the most recent commit on the selected
552 is not contained in the selected branch, a different branch which contains
553 this commit must be specified with the
556 If no such branch is known, a new branch must be created for this
562 Checking out work trees with an unknown branch is intentionally not supported.
564 Proceed with the checkout operation even if the directory at
567 Existing files will be left intact.
568 .It Fl p Ar path-prefix
569 Restrict the work tree to a subset of the repository's tree hierarchy.
570 Only files beneath the specified
574 Silence progress output.
585 Update an existing work tree to a different
587 Change existing files in the work tree as necessary to match file contents
589 Preserve any local changes in the work tree and merge them with the
592 Files which already contain merge conflicts will not be updated to avoid
593 further complications.
594 Such files will be updated when
596 is run again after merge conflicts have been resolved.
597 If the conflicting changes are no longer needed, affected files can be
604 Show the status of each affected file, using the following status codes:
605 .Bl -column YXZ description
606 .It U Ta file was updated and contained no local changes
607 .It G Ta file was updated and local changes were merged cleanly
608 .It C Ta file was updated and conflicts occurred during merge
609 .It D Ta file was deleted
610 .It A Ta new file was added
611 .It \(a~ Ta versioned file is obstructed by a non-regular file
612 .It ! Ta a missing versioned file was restored
613 .It # Ta file was not updated because it contains merge conflicts
614 .It ? Ta changes destined for an unversioned file were not merged
619 is specified, update the entire work tree.
620 Otherwise, restrict the update operation to files at or within the
622 Each path is required to exist in the update operation's target commit.
623 Files in the work tree outside specified paths will remain unchanged and
624 will retain their previously recorded base commit.
627 commands may refuse to run while the work tree contains files from
628 multiple base commits.
629 The base commit of such a work tree can be made consistent by running
631 across the entire work tree.
634 is incompatible with the
639 cannot update paths with staged changes.
640 If changes have been staged with
642 these changes must first be committed with
652 Switch the work tree's branch reference to the specified
654 before updating the work tree.
655 This option requires that all paths in the work tree are updated.
657 As usual, any local changes in the work tree will be preserved.
658 This can be useful when switching to a newly created branch in order
659 to commit existing local changes to this branch.
661 Any local changes must be dealt with separately in order to obtain a
662 work tree with pristine file contents corresponding exactly to the specified
664 Such changes could first be committed to a different branch with
666 or could be discarded with
669 Update the work tree to the specified
671 The expected argument is a commit ID SHA1 hash or an existing reference
672 or tag name which will be resolved to a commit ID.
673 An abbreviated hash argument will be expanded to a full SHA1 hash
674 automatically, provided the abbreviation is unique.
675 If this option is not specified, the most recent commit on the work tree's
678 Silence progress output.
684 .Op Fl S Ar status-codes
685 .Op Fl s Ar status-codes
689 Show the current modification status of files in a work tree,
690 using the following status codes:
691 .Bl -column YXZ description
692 .It M Ta modified file
693 .It A Ta file scheduled for addition in next commit
694 .It D Ta file scheduled for deletion in next commit
695 .It C Ta modified or added file which contains merge conflicts
696 .It ! Ta versioned file was expected on disk but is missing
697 .It \(a~ Ta versioned file is obstructed by a non-regular file
698 .It ? Ta unversioned item not tracked by
700 .It m Ta modified file modes (executable bit only)
701 .It N Ta non-existent
703 specified on the command line
708 is specified, show modifications in the entire work tree.
709 Otherwise, show modifications at or within the specified paths.
711 If changes have been staged with
713 staged changes are shown in the second output column, using the following
715 .Bl -column YXZ description
716 .It M Ta file modification is staged
717 .It A Ta file addition is staged
718 .It D Ta file deletion is staged
721 Changes created on top of staged changes are indicated in the first column:
722 .Bl -column YXZ description
723 .It MM Ta file was modified after earlier changes have been staged
724 .It MA Ta file was modified after having been staged for addition
732 Show unversioned files even if they match an ignore pattern.
733 .It Fl S Ar status-codes
734 Suppress the output of files with a modification status matching any of the
735 single-character status codes contained in the
738 Any combination of codes from the above list of possible status codes
740 For staged files, status codes displayed in either column will be matched.
741 Cannot be used together with the
744 .It Fl s Ar status-codes
745 Only show files with a modification status matching any of the
746 single-character status codes contained in the
749 Any combination of codes from the above list of possible status codes
751 For staged files, status codes displayed in either column will be matched.
752 Cannot be used together with the
757 For compatibility with
768 files in each traversed directory and will not display unversioned files
769 which match these patterns.
774 supports consecutive asterisks,
776 which will match an arbitrary amount of directories.
780 only supports a single ignore pattern per line.
784 does not support negated ignore patterns prefixed with
786 and gives no special significance to the location of path component separators,
795 .Op Fl r Ar repository-path
796 .Op Fl S Ar search-pattern
800 Display history of a repository.
803 is specified, show only commits which modified this path.
804 If invoked in a work tree, the
806 is interpreted relative to the current working directory,
807 and the work tree's path prefix is implicitly prepended.
808 Otherwise, the path is interpreted relative to the repository root.
815 Display individual commits which were merged into the current branch
819 shows the linear history of the current branch only.
821 Set the number of context lines shown in diffs with
823 By default, 3 lines of context are shown.
825 Start traversing history at the specified
827 The expected argument is a commit ID SHA1 hash or an existing reference
828 or tag name which will be resolved to a commit ID.
829 An abbreviated hash argument will be expanded to a full SHA1 hash
830 automatically, provided the abbreviation is unique.
831 If this option is not specified, default to the work tree's current branch
832 if invoked in a work tree, or to the repository's HEAD reference.
834 Limit history traversal to a given number of commits.
835 If this option is not specified, a default limit value of zero is used,
836 which is treated as an unbounded limit.
838 .Ev GOT_LOG_DEFAULT_LIMIT
839 environment variable may be set to change this default value.
841 Display the list of file paths changed in each commit, using the following
843 .Bl -column YXZ description
844 .It M Ta modified file
845 .It D Ta file was deleted
846 .It A Ta new file was added
847 .It m Ta modified file modes (executable bit only)
850 Cannot be used with the
854 Display the patch of modifications made in each commit.
857 is specified, only show the patch of modifications at or within this path.
858 Cannot be used with the
862 Determine a set of commits to display as usual, but display these commits
864 .It Fl r Ar repository-path
865 Use the repository at the specified path.
866 If not specified, assume the repository is located at or above the current
868 If this directory is a
870 work tree, use the repository path associated with this work tree.
871 .It Fl S Ar search-pattern
872 If specified, show only commits with a log message, author name,
873 committer name, or ID SHA1 hash matched by the extended regular
876 Lines in committed patches will be matched if
879 File paths changed by a commit will be matched if
882 Regular expression syntax is documented in
885 Display a short one-line summary of each commit, instead of the default
887 Cannot be used together with the
893 Stop traversing commit history immediately after the specified
896 This option has no effect if the specified
906 .Op Fl r Ar repository-path
907 .Op Ar object1 Ar object2 | Ar path ...
910 When invoked within a work tree without any arguments, display all
911 local changes in the work tree.
914 arguments are specified, only show changes within the specified paths.
916 If two arguments are provided, treat each argument as a reference, a tag
917 name, or an object ID SHA1 hash, and display differences between the
918 corresponding objects.
919 Both objects must be of the same type (blobs, trees, or commits).
920 An abbreviated hash argument will be expanded to a full SHA1 hash
921 automatically, provided the abbreviation is unique.
922 If none of these interpretations produce a valid result or if the
927 is running in a work tree, attempt to interpret the two arguments as paths.
934 Treat file contents as ASCII text even if binary data is detected.
936 Set the number of context lines shown in the diff.
937 By default, 3 lines of context are shown.
939 Show differences between commits in the repository.
940 This option may be used up to two times.
941 When used only once, show differences between the specified
943 and its first parent commit.
944 When used twice, show differences between the two specified commits.
946 The expected argument is a commit ID SHA1 hash or an existing reference
947 or tag name which will be resolved to a commit ID.
948 An abbreviated hash argument will be expanded to a full SHA1 hash
949 automatically, provided the abbreviation is unique.
953 option is used, all non-option arguments will be interpreted as paths.
956 arguments are provided, only show differences for the specified paths.
958 Cannot be used together with the
962 Interpret all arguments as paths only.
963 This option can be used to resolve ambiguity in cases where paths
964 look like tag names, reference names, or object IDs.
965 This option is only valid when
967 is invoked in a work tree.
968 .It Fl r Ar repository-path
969 Use the repository at the specified path.
970 If not specified, assume the repository is located at or above the current
972 If this directory is a
974 work tree, use the repository path associated with this work tree.
976 Show changes staged with
978 instead of showing local changes in the work tree.
979 This option is only valid when
981 is invoked in a work tree.
983 Ignore whitespace-only changes.
989 .Op Fl r Ar repository-path
993 Display line-by-line history of a file at the specified path.
1000 Start traversing history at the specified
1002 The expected argument is a commit ID SHA1 hash or an existing reference
1003 or tag name which will be resolved to a commit ID.
1004 An abbreviated hash argument will be expanded to a full SHA1 hash
1005 automatically, provided the abbreviation is unique.
1006 .It Fl r Ar repository-path
1007 Use the repository at the specified path.
1008 If not specified, assume the repository is located at or above the current
1010 If this directory is a
1012 work tree, use the repository path associated with this work tree.
1019 .Op Fl r Ar repository-path
1023 Display a listing of files and directories at the specified
1024 directory path in the repository.
1025 Entries shown in this listing may carry one of the following trailing
1027 .Bl -column YXZ description
1028 .It @ Ta entry is a symbolic link
1029 .It / Ta entry is a directory
1030 .It * Ta entry is an executable file
1031 .It $ Ta entry is a Git submodule
1034 Symbolic link entries are also annotated with the target path of the link.
1038 is specified, list the repository path corresponding to the current
1039 directory of the work tree, or the root directory of the repository
1040 if there is no work tree.
1047 List files and directories as they appear in the specified
1049 The expected argument is a commit ID SHA1 hash or an existing reference
1050 or tag name which will be resolved to a commit ID.
1051 An abbreviated hash argument will be expanded to a full SHA1 hash
1052 automatically, provided the abbreviation is unique.
1054 Show object IDs of files (blob objects) and directories (tree objects).
1056 Recurse into sub-directories in the repository.
1057 .It Fl r Ar repository-path
1058 Use the repository at the specified path.
1059 If not specified, assume the repository is located at or above the current
1061 If this directory is a
1063 work tree, use the repository path associated with this work tree.
1069 .Op Fl r Ar repository-path
1070 .Op Fl s Ar reference
1073 Manage references in a repository.
1075 References may be listed, created, deleted, and changed.
1076 When creating, deleting, or changing a reference the specified
1078 must be an absolute reference name, i.e. it must begin with
1086 Create a reference or change an existing reference.
1087 The reference with the specified
1089 will point at the specified
1093 argument is a ID SHA1 hash or an existing reference or tag name which will
1094 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
1095 Cannot be used together with any other options except
1098 Delete the reference with the specified
1100 from the repository.
1101 Any commit, tree, tag, and blob objects belonging to deleted references
1102 remain in the repository and may be removed separately with
1103 Git's garbage collector or
1104 .Cm gotadmin cleanup .
1105 Cannot be used together with any other options except
1108 List references in the repository.
1111 is specified, list all existing references in the repository.
1114 is a reference namespace, list all references in this namespace.
1115 Otherwise, show only the reference with the given
1117 Cannot be used together with any other options except
1121 .It Fl r Ar repository-path
1122 Use the repository at the specified path.
1123 If not specified, assume the repository is located at or above the current
1125 If this directory is a
1127 work tree, use the repository path associated with this work tree.
1128 .It Fl s Ar reference
1129 Create a symbolic reference, or change an existing symbolic reference.
1130 The symbolic reference with the specified
1132 will point at the specified
1134 which must already exist in the repository.
1135 Care should be taken not to create loops between references when
1136 this option is used.
1137 Cannot be used together with any other options except
1140 Sort listed references by modification time (most recently modified first)
1141 instead of sorting by lexicographical order.
1142 Use of this option requires the
1144 option to be used as well.
1152 .Op Fl r Ar repository-path
1156 Create, list, or delete branches.
1158 Local branches are managed via references which live in the
1160 reference namespace.
1163 command creates references in this namespace only.
1165 When deleting branches, the specified
1169 reference namespace first.
1170 If no corresponding branch is found, the
1172 namespace will be searched next.
1174 If invoked in a work tree without any arguments, print the name of the
1175 work tree's current branch.
1179 argument is passed, attempt to create a branch reference with the given name.
1180 By default the new branch reference will point at the latest commit on the
1181 work tree's current branch if invoked in a work tree, and otherwise to a commit
1182 resolved via the repository's HEAD reference.
1184 If invoked in a work tree, once the branch was created successfully
1185 switch the work tree's head reference to the newly created branch and
1186 update files across the entire work tree, just like
1187 .Cm got update -b Ar name
1189 Show the status of each affected file, using the following status codes:
1190 .Bl -column YXZ description
1191 .It U Ta file was updated and contained no local changes
1192 .It G Ta file was updated and local changes were merged cleanly
1193 .It C Ta file was updated and conflicts occurred during merge
1194 .It D Ta file was deleted
1195 .It A Ta new file was added
1196 .It \(a~ Ta versioned file is obstructed by a non-regular file
1197 .It ! Ta a missing versioned file was restored
1205 Make a newly created branch reference point at the specified
1209 argument is a commit ID SHA1 hash or an existing reference
1210 or tag name which will be resolved to a commit ID.
1212 Delete the branch with the specified
1218 reference namespace.
1220 Only the branch reference is deleted.
1221 Any commit, tree, and blob objects belonging to the branch
1222 remain in the repository and may be removed separately with
1223 Git's garbage collector or
1224 .Cm gotadmin cleanup .
1226 List all existing branches in the repository, including copies of remote
1227 repositories' branches in the
1229 reference namespace.
1231 If invoked in a work tree, the work tree's current branch is shown
1232 with one the following annotations:
1233 .Bl -column YXZ description
1234 .It * Ta work tree's base commit matches the branch tip
1235 .It \(a~ Ta work tree's base commit is out-of-date
1238 Do not switch and update the work tree after creating a new branch.
1239 .It Fl r Ar repository-path
1240 Use the repository at the specified path.
1241 If not specified, assume the repository is located at or above the current
1243 If this directory is a
1245 work tree, use the repository path associated with this work tree.
1247 Sort listed branches by modification time (most recently modified first)
1248 instead of sorting by lexicographical order.
1251 reference namespace are listed before branches in
1254 Use of this option requires the
1256 option to be used as well.
1263 .Op Fl r Ar repository-path
1264 .Op Fl s Ar signer-id
1267 Manage tags in a repository.
1269 Tags are managed via references which live in the
1271 reference namespace.
1274 command operates on references in this namespace only.
1275 References in this namespace point at tag objects which contain a pointer
1276 to another object, a tag message, as well as author and timestamp information.
1278 Attempt to create a tag with the given
1280 and make this tag point at the given
1282 If no commit is specified, default to the latest commit on the work tree's
1283 current branch if invoked in a work tree, and to a commit resolved via
1284 the repository's HEAD reference otherwise.
1291 Make the newly created tag reference point at the specified
1295 argument is a commit ID SHA1 hash or an existing reference or tag name which
1296 will be resolved to a commit ID.
1297 An abbreviated hash argument will be expanded to a full SHA1 hash
1298 automatically, provided the abbreviation is unique.
1300 List all existing tags in the repository instead of creating a new tag.
1303 argument is passed, show only the tag with the given
1306 Use the specified tag message when creating the new tag.
1311 opens a temporary file in an editor where a tag message can be written.
1312 .It Fl r Ar repository-path
1313 Use the repository at the specified path.
1314 If not specified, assume the repository is located at or above the current
1316 If this directory is a
1318 work tree, use the repository path associated with this work tree.
1319 .It Fl s Ar signer-id
1320 While creating a new tag, sign this tag with the identity given in
1323 For SSH-based signatures,
1325 is the path to a file which may refer to either a private SSH key,
1326 or a public SSH key with the private half available via
1329 will sign the tag object by invoking
1333 command, using the signature namespace
1335 for compatibility with
1338 Verify tag object signatures.
1341 is specified, show and verify the tag object with the provided name.
1342 Otherwise, list all tag objects and verify signatures where present.
1345 verifies SSH-based signatures by invoking
1348 .Fl Y Cm verify Fl f Ar allowed_signers .
1353 otherwise verification is impossible.
1356 During SSH signature creation and verification this option will be passed to
1358 Multiple -v options increase the verbosity.
1364 command will not delete tags or change existing tags.
1365 If a tag must be deleted, the
1367 command may be used to delete a tag's reference.
1368 This should only be done if the tag has not already been copied to
1375 Schedule unversioned files in a work tree for addition to the
1376 repository in the next commit.
1377 By default, files which match a
1379 ignore pattern will not be added.
1386 Add files even if they match a
1390 Permit recursion into directories.
1391 If this option is not specified,
1393 will refuse to run if a specified
1401 .Op Fl s Ar status-codes
1405 Remove versioned files from a work tree and schedule them for deletion
1406 from the repository in the next commit.
1413 Perform the operation even if a file contains local modifications,
1414 and do not raise an error if a specified
1416 does not exist on disk.
1418 Keep affected files on disk.
1420 Permit recursion into directories.
1421 If this option is not specified,
1423 will refuse to run if a specified
1426 .It Fl s Ar status-codes
1427 Only delete files with a modification status matching one of the
1428 single-character status codes contained in the
1431 The following status codes may be specified:
1432 .Bl -column YXZ description
1433 .It M Ta modified file (this implies the
1436 .It ! Ta versioned file expected on disk but missing
1444 .Op Fl p Ar strip-count
1450 to files in a work tree.
1451 Files added or removed by a patch will be scheduled for addition or removal in
1454 The patch must be in the unified diff format as produced by
1461 diff when invoked with their
1466 argument is provided, read unified diff data from standard input instead.
1470 contains multiple patches, then attempt to apply each of them in sequence.
1472 Show the status of each affected file, using the following status codes:
1473 .Bl -column XYZ description
1474 .It M Ta file was modified
1475 .It G Ta file was merged using a merge-base found in the repository
1476 .It C Ta file was merged and conflicts occurred during merge
1477 .It D Ta file was deleted
1478 .It A Ta file was added
1479 .It # Ta failed to patch the file
1482 If a change does not match at its exact line number, attempt to
1483 apply it somewhere else in the file if a good spot can be found.
1484 Otherwise, the patch will fail to apply.
1488 will refuse to apply a patch if certain preconditions are not met.
1489 Files to be deleted must already be under version control, and must
1490 not have been scheduled for deletion already.
1491 Files to be added must not yet be under version control and must not
1492 already be present on disk.
1493 Files to be modified must already be under version control and may not
1494 contain conflict markers.
1496 If an error occurs, the
1498 operation will be aborted.
1499 Any changes made to the work tree up to this point will be left behind.
1500 Such changes can be viewed with
1502 and can be reverted with
1511 Attempt to locate files within the specified
1513 for use as a merge-base for 3-way merges.
1514 Ideally, the specified
1516 should contain versions of files which the changes contained in the
1519 Files will be located by path, relative to the repository root.
1522 option is used then leading path components will be stripped
1523 before paths are looked up in the repository.
1527 option is not used then
1529 will attempt to locate merge-bases via object IDs found in
1531 meta-data, such as produced by
1537 option is only recommended in the absence of such meta-data.
1539 In case no merge-base is available for a file, changes will be applied
1540 without doing a 3-way merge.
1541 Changes which do not apply cleanly may then be rejected entirely, rather
1542 than producing merge conflicts in the patched target file.
1544 Do not make any modifications to the work tree.
1545 This can be used to check whether a patch would apply without issues.
1548 contains diffs that affect the same file multiple times, the results
1549 displayed may be incorrect.
1550 .It Fl p Ar strip-count
1551 Specify the number of leading path components to strip from paths
1560 path prefixes generated by
1562 will be recognized and stripped automatically.
1564 Reverse the patch before applying it.
1570 .Op Fl F Ar response-script
1574 Revert any local changes in files at the specified paths in a work tree.
1575 File contents will be overwritten with those contained in the
1576 work tree's base commit.
1577 There is no way to bring discarded changes back after
1580 If a file was added with
1582 it will become an unversioned file again.
1583 If a file was deleted with
1585 it will be restored.
1591 .It Fl F Ar response-script
1599 responses line-by-line from the specified
1601 file instead of prompting interactively.
1603 Instead of reverting all changes in files, interactively select or reject
1604 changes to revert based on
1610 (quit reverting this file) responses.
1611 If a file is in modified status, individual patches derived from the
1612 modified file content can be reverted.
1613 Files in added or deleted status may only be reverted in their entirety.
1615 Permit recursion into directories.
1616 If this option is not specified,
1618 will refuse to run if a specified
1632 Create a new commit in the repository from changes in a work tree
1633 and use this commit as the new base commit for the work tree.
1636 is specified, commit all changes in the work tree.
1637 Otherwise, commit changes at or within the specified paths.
1639 If changes have been explicitly staged for commit with
1641 only commit staged changes and reject any specified paths which
1642 have not been staged.
1645 opens a temporary file in an editor where a log message can be written
1653 options are used together.
1655 Show the status of each affected file, using the following status codes:
1656 .Bl -column YXZ description
1657 .It M Ta modified file
1658 .It D Ta file was deleted
1659 .It A Ta new file was added
1660 .It m Ta modified file modes (executable bit only)
1663 Files which are not part of the new commit will retain their previously
1664 recorded base commit.
1667 commands may refuse to run while the work tree contains files from
1668 multiple base commits.
1669 The base commit of such a work tree can be made consistent by running
1671 across the entire work tree.
1675 command requires the
1677 environment variable to be set,
1678 unless an author has been configured in
1684 configuration settings can be
1685 obtained from the repository's
1687 file or from Git's global
1696 Set author information in the newly created commit to
1698 This is useful when committing changes which were written by someone
1702 argument must use the same format as the
1704 environment variable.
1706 In addition to storing author information, the newly created commit
1709 information which is obtained, as usual, from the
1711 environment variable, or
1713 or Git configuration settings.
1715 Use the prepared log message stored in the file found at
1717 when creating the new commit.
1719 opens a temporary file in an editor where the prepared log message can be
1720 reviewed and edited further if needed.
1721 Cannot be used together with the
1725 Use the specified log message when creating the new commit.
1726 Cannot be used together with the
1730 This option prevents
1732 from opening the commit message in an editor.
1733 It has no effect unless it is used together with the
1735 option and is intended for non-interactive use such as scripting.
1737 Allow the addition of symbolic links which point outside of the path space
1738 that is under version control.
1741 will reject such symbolic links due to safety concerns.
1744 may decide to represent such a symbolic link as a regular file which contains
1745 the link's target path, rather than creating an actual symbolic link which
1746 points outside of the work tree.
1747 Use of this option is discouraged because external mechanisms such as
1749 are better suited for managing symbolic links to paths not under
1754 will refuse to run if certain preconditions are not met.
1755 If the work tree's current branch is not in the
1757 reference namespace, new commits may not be created on this branch.
1758 Local changes may only be committed if they are based on file content
1759 found in the most recent commit on the work tree's branch.
1760 If a path is found to be out of date,
1762 must be used first in order to merge local changes with changes made
1770 .Op Fl r Ar repository-path
1772 .Op Ar remote-repository
1775 Send new changes to a remote repository.
1777 .Ar remote-repository
1781 The remote repository's URL is obtained from the corresponding entry in
1785 file of the local repository, as created by
1788 All objects corresponding to new changes will be written to a temporary
1789 pack file which is then uploaded to the server.
1790 Upon success, references in the
1792 reference namespace of the local repository will be updated to point at
1793 the commits which have been sent.
1795 By default, changes will only be sent if they are based on up-to-date
1796 copies of relevant branches in the remote repository.
1797 If any changes to be sent are based on out-of-date copies or would
1798 otherwise break linear history of existing branches, new changes must
1799 be fetched from the server with
1801 and local branches must be rebased with
1808 option can be used to make exceptions to these requirements.
1815 Send all branches from the local repository's
1817 reference namespace.
1820 option is equivalent to listing all branches with multiple
1823 Cannot be used together with the
1829 from the local repository's
1831 reference namespace.
1832 This option may be specified multiple times to build a list of branches
1834 If this option is not specified, default to the work tree's current branch
1835 if invoked in a work tree, or to the repository's HEAD reference.
1836 Cannot be used together with the
1840 Delete the specified
1842 from the remote repository's
1844 reference namespace.
1845 This option may be specified multiple times to build a list of branches
1848 Only references are deleted.
1849 Any commit, tree, tag, and blob objects belonging to deleted branches
1850 may become subject to deletion by Git's garbage collector running on
1853 Requesting deletion of branches results in an error if the server
1854 does not support this feature or disallows the deletion of branches
1855 based on its configuration.
1857 Attempt to force the server to overwrite existing branches or tags
1858 in the remote repository, even when
1862 would usually be required before changes can be sent.
1863 The server may reject forced requests regardless, depending on its
1866 Any commit, tree, tag, and blob objects belonging to overwritten branches
1867 or tags may become subject to deletion by Git's garbage collector running
1872 reference namespace is globally shared between all repositories.
1875 option to overwrite tags is discouraged because it can lead to
1876 inconsistencies between the tags present in different repositories.
1877 In general, creating a new tag with a different name is recommended
1878 instead of overwriting an existing tag.
1882 option is particularly discouraged if changes being sent are based
1883 on an out-of-date copy of a branch in the remote repository.
1884 Instead of using the
1886 option, new changes should
1889 and local branches should be rebased with
1891 followed by another attempt to send the changes.
1895 option should only be needed in situations where the remote repository's
1896 copy of a branch or tag is known to be out-of-date and is considered
1898 The risks of creating inconsistencies between different repositories
1899 should also be taken into account.
1901 Suppress progress reporting output.
1902 The same option will be passed to
1905 .It Fl r Ar repository-path
1906 Use the repository at the specified path.
1907 If not specified, assume the repository is located at or above the current
1909 If this directory is a
1911 work tree, use the repository path associated with this work tree.
1913 Attempt to send all tags from the local repository's
1915 reference namespace.
1918 option is equivalent to listing all tags with multiple
1921 Cannot be used together with the
1927 from the local repository's
1929 reference namespace, in addition to any branches that are being sent.
1932 option may be specified multiple times to build a list of tags to send.
1933 No tags will be sent if the
1937 Raise an error if the specified
1939 already exists in the remote repository, unless the
1941 option is used to overwrite the server's copy of the tag.
1942 In general, creating a new tag with a different name is recommended
1943 instead of overwriting an existing tag.
1945 Cannot be used together with the
1952 to print debugging messages to standard error output.
1953 The same option will be passed to
1956 Multiple -v options increase the verbosity.
1960 .It Cm cherrypick Ar commit
1962 Merge changes from a single
1967 should be on a different branch than the work tree's base commit.
1968 The expected argument is a reference or a commit ID SHA1 hash.
1969 An abbreviated hash argument will be expanded to a full SHA1 hash
1970 automatically, provided the abbreviation is unique.
1972 Show the status of each affected file, using the following status codes:
1973 .Bl -column YXZ description
1974 .It G Ta file was merged
1975 .It C Ta file was merged and conflicts occurred during merge
1976 .It ! Ta changes destined for a missing file were not merged
1977 .It D Ta file was deleted
1978 .It d Ta file's deletion was prevented by local modifications
1979 .It A Ta new file was added
1980 .It \(a~ Ta changes destined for a non-regular file were not merged
1981 .It ? Ta changes destined for an unversioned file were not merged
1984 The merged changes will appear as local changes in the work tree, which
1987 amended manually or with further
1992 or discarded again with
1996 will refuse to run if certain preconditions are not met.
1997 If the work tree contains multiple base commits, it must first be updated
1998 to a single base commit with
2000 If any relevant files already contain merge conflicts, these
2001 conflicts must be resolved first.
2003 .It Cm backout Ar commit
2005 Reverse-merge changes from a single
2010 should be on the same branch as the work tree's base commit.
2011 The expected argument is a reference or a commit ID SHA1 hash.
2012 An abbreviated hash argument will be expanded to a full SHA1 hash
2013 automatically, provided the abbreviation is unique.
2015 Show the status of each affected file, using the following status codes:
2016 .Bl -column YXZ description
2017 .It G Ta file was merged
2018 .It C Ta file was merged and conflicts occurred during merge
2019 .It ! Ta changes destined for a missing file were not merged
2020 .It D Ta file was deleted
2021 .It d Ta file's deletion was prevented by local modifications
2022 .It A Ta new file was added
2023 .It \(a~ Ta changes destined for a non-regular file were not merged
2024 .It ? Ta changes destined for an unversioned file were not merged
2027 The reverse-merged changes will appear as local changes in the work tree,
2028 which may be viewed with
2030 amended manually or with further
2035 or discarded again with
2039 will refuse to run if certain preconditions are not met.
2040 If the work tree contains multiple base commits, it must first be updated
2041 to a single base commit with
2043 If any relevant files already contain merge conflicts, these
2044 conflicts must be resolved first.
2052 Rebase commits on the specified
2054 onto the tip of the current branch of the work tree.
2057 must share common ancestry with the work tree's current branch.
2058 Rebasing begins with the first descendant commit of the youngest
2059 common ancestor commit shared by the specified
2061 and the work tree's current branch, and stops once the tip commit
2068 is used as intended, the specified
2070 represents a local commit history and may already contain changes
2071 that are not yet visible in any other repositories.
2072 The work tree's current branch, which must be set with
2076 operation, represents a branch from a remote repository which shares
2077 a common history with the specified
2079 but has progressed, and perhaps diverged, due to commits added to the
2082 Rebased commits are accumulated on a temporary branch which the work tree
2083 will remain switched to throughout the entire rebase operation.
2084 Commits on this branch represent the same changes with the same log
2085 messages as their counterparts on the original
2087 but with different commit IDs.
2088 Once rebasing has completed successfully, the temporary branch becomes
2089 the new version of the specified
2091 and the work tree is automatically switched to it.
2092 If author information is available via the
2094 environment variable,
2100 configuration settings, this author information will be used to identify
2105 Old commits in their pre-rebase state are automatically backed up in the
2106 .Dq refs/got/backup/rebase
2107 reference namespace.
2108 As long as these references are not removed older versions of rebased
2109 commits will remain in the repository and can be viewed with the
2112 Removal of these references makes objects which become unreachable via
2113 any reference subject to removal by Git's garbage collector or
2114 .Cm gotadmin cleanup .
2116 While rebasing commits, show the status of each affected file,
2117 using the following status codes:
2118 .Bl -column YXZ description
2119 .It G Ta file was merged
2120 .It C Ta file was merged and conflicts occurred during merge
2121 .It ! Ta changes destined for a missing file were not merged
2122 .It D Ta file was deleted
2123 .It d Ta file's deletion was prevented by local modifications
2124 .It A Ta new file was added
2125 .It \(a~ Ta changes destined for a non-regular file were not merged
2126 .It ? Ta changes destined for an unversioned file were not merged
2129 If merge conflicts occur, the rebase operation is interrupted and may
2130 be continued once conflicts have been resolved.
2131 If any files with destined changes are found to be missing or unversioned,
2132 or if files could not be deleted due to differences in deleted content,
2133 the rebase operation will be interrupted to prevent potentially incomplete
2134 changes from being committed to the repository without user intervention.
2135 The work tree may be modified as desired and the rebase operation can be
2136 continued once the changes present in the work tree are considered complete.
2137 Alternatively, the rebase operation may be aborted which will leave
2139 unmodified and the work tree switched back to its original branch.
2141 If a merge conflict is resolved in a way which renders the merged
2142 change into a no-op change, the corresponding commit will be elided
2143 when the rebase operation continues.
2146 will refuse to run if certain preconditions are not met.
2147 If the work tree is not yet fully updated to the tip commit of its
2148 branch, then the work tree must first be updated with
2150 If changes have been staged with
2152 these changes must first be committed with
2156 If the work tree contains local changes, these changes must first be
2163 contains changes to files outside of the work tree's path prefix,
2164 the work tree cannot be used to rebase this branch.
2170 commands will refuse to run while a rebase operation is in progress.
2171 Other commands which manipulate the work tree may be used for
2172 conflict resolution purposes.
2176 is already based on the work tree's current branch, then no commits
2177 need to be rebased and
2179 will simply switch the work tree to the specified
2181 and update files in the work tree accordingly.
2188 Abort an interrupted rebase operation.
2189 If this option is used, no other command-line arguments are allowed.
2191 Continue an interrupted rebase operation.
2192 If this option is used, no other command-line arguments are allowed.
2194 Show a list of past rebase operations, represented by references in the
2195 .Dq refs/got/backup/rebase
2196 reference namespace.
2198 Display the author, date, and log message of each backed up commit,
2199 the object ID of the corresponding post-rebase commit, and
2200 the object ID of their common ancestor commit.
2201 Given these object IDs,
2208 options can be used to examine the history of either version of the branch,
2213 option can be used to create a new branch from a pre-rebase state if desired.
2217 is specified, only show commits which at some point in time represented this
2219 Otherwise, list all backed up commits for any branches.
2221 If this option is used,
2223 does not require a work tree.
2224 None of the other options can be used together with
2227 Delete backups created by past rebase operations, represented by references
2229 .Dq refs/got/backup/rebase
2230 reference namespace.
2234 is specified, only delete backups which at some point in time represented
2236 Otherwise, delete all references found within
2237 .Dq refs/got/backup/rebase .
2239 Any commit, tree, tag, and blob objects belonging to deleted backups
2240 remain in the repository and may be removed separately with
2241 Git's garbage collector or
2242 .Cm gotadmin cleanup .
2244 If this option is used,
2246 does not require a work tree.
2247 None of the other options can be used together with
2254 .Op Fl F Ar histedit-script
2258 Edit commit history between the work tree's current base commit and
2259 the tip commit of the work tree's current branch.
2263 command requires the
2265 environment variable to be set,
2266 unless an author has been configured in
2272 configuration settings can be obtained from the repository's
2274 file or from Git's global
2280 operation, the work tree's current branch must be set with
2282 to the branch which should be edited, unless this branch is already the
2283 current branch of the work tree.
2284 The tip of this branch represents the upper bound (inclusive) of commits
2289 Furthermore, the work tree's base commit
2292 to a point in this branch's commit history where editing should begin.
2293 This commit represents the lower bound (non-inclusive) of commits touched
2298 Editing of commit history is controlled via a
2300 which can be written in an editor based on a template, passed on the
2301 command line, or generated with the
2307 The format of the histedit script is line-based.
2308 Each line in the script begins with a command name, followed by
2309 whitespace and an argument.
2310 For most commands, the expected argument is a commit ID SHA1 hash.
2311 Any remaining text on the line is ignored.
2312 Lines which begin with the
2314 character are ignored entirely.
2316 The available histedit script commands are as follows:
2317 .Bl -column YXZ pick-commit
2318 .It Cm pick Ar commit Ta Use the specified commit as it is.
2319 .It Cm edit Ar commit Ta Use the specified commit but once changes have been
2320 merged into the work tree interrupt the histedit operation for amending.
2321 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
2322 listed further below that will be used.
2323 .It Cm drop Ar commit Ta Remove this commit from the edited history.
2324 .It Cm mesg Oo Ar log-message Oc Ta Create a new log message for the commit of
2329 command on the previous line of the histedit script.
2332 argument provides a new single-line log message to use.
2335 argument is omitted, open an editor where a new log message can be written.
2338 Every commit in the history being edited must be mentioned in the script.
2339 Lines may be re-ordered to change the order of commits in the edited history.
2340 No commit may be listed more than once.
2342 Edited commits are accumulated on a temporary branch which the work tree
2343 will remain switched to throughout the entire histedit operation.
2344 Once history editing has completed successfully, the temporary branch becomes
2345 the new version of the work tree's branch and the work tree is automatically
2348 Old commits in their pre-histedit state are automatically backed up in the
2349 .Dq refs/got/backup/histedit
2350 reference namespace.
2351 As long as these references are not removed older versions of edited
2352 commits will remain in the repository and can be viewed with the
2355 Removal of these references makes objects which become unreachable via
2356 any reference subject to removal by Git's garbage collector or
2357 .Cm gotadmin cleanup .
2359 While merging commits, show the status of each affected file,
2360 using the following status codes:
2361 .Bl -column YXZ description
2362 .It G Ta file was merged
2363 .It C Ta file was merged and conflicts occurred during merge
2364 .It ! Ta changes destined for a missing file were not merged
2365 .It D Ta file was deleted
2366 .It d Ta file's deletion was prevented by local modifications
2367 .It A Ta new file was added
2368 .It \(a~ Ta changes destined for a non-regular file were not merged
2369 .It ? Ta changes destined for an unversioned file were not merged
2372 If merge conflicts occur, the histedit operation is interrupted and may
2373 be continued once conflicts have been resolved.
2374 If any files with destined changes are found to be missing or unversioned,
2375 or if files could not be deleted due to differences in deleted content,
2376 the histedit operation will be interrupted to prevent potentially incomplete
2377 changes from being committed to the repository without user intervention.
2378 The work tree may be modified as desired and the histedit operation can be
2379 continued once the changes present in the work tree are considered complete.
2380 Alternatively, the histedit operation may be aborted which will leave
2381 the work tree switched back to its original branch.
2383 If a merge conflict is resolved in a way which renders the merged
2384 change into a no-op change, the corresponding commit will be elided
2385 when the histedit operation continues.
2388 will refuse to run if certain preconditions are not met.
2389 If the work tree's current branch is not in the
2391 reference namespace, the history of the branch may not be edited.
2392 If the work tree contains multiple base commits, it must first be updated
2393 to a single base commit with
2395 If changes have been staged with
2397 these changes must first be committed with
2401 If the work tree contains local changes, these changes must first be
2406 If the edited history contains changes to files outside of the work tree's
2407 path prefix, the work tree cannot be used to edit the history of this branch.
2414 commands will refuse to run while a histedit operation is in progress.
2415 Other commands which manipulate the work tree may be used, and the
2417 command may be used to commit arbitrary changes to the temporary branch
2418 while the histedit operation is interrupted.
2425 Abort an interrupted histedit operation.
2426 If this option is used, no other command-line arguments are allowed.
2428 Continue an interrupted histedit operation.
2429 If this option is used, no other command-line arguments are allowed.
2431 Interrupt the histedit operation for editing after merging each commit.
2432 This option is a quick equivalent to a histedit script which uses the
2434 command for all commits.
2437 option can only be used when starting a new histedit operation.
2438 If this option is used, no other command-line arguments are allowed.
2439 .It Fl F Ar histedit-script
2442 instead of opening a temporary file in an editor where a histedit script
2445 Fold all commits into a single commit.
2446 This option is a quick equivalent to a histedit script which folds all
2447 commits, combining them all into one commit.
2450 option can only be used when starting a new histedit operation.
2451 If this option is used, no other command-line arguments are allowed.
2453 Show a list of past histedit operations, represented by references in the
2454 .Dq refs/got/backup/histedit
2455 reference namespace.
2457 Display the author, date, and log message of each backed up commit,
2458 the object ID of the corresponding post-histedit commit, and
2459 the object ID of their common ancestor commit.
2460 Given these object IDs,
2467 options can be used to examine the history of either version of the branch,
2472 option can be used to create a new branch from a pre-histedit state if desired.
2476 is specified, only show commits which at some point in time represented this
2478 Otherwise, list all backed up commits for any branches.
2480 If this option is used,
2482 does not require a work tree.
2483 None of the other options can be used together with
2486 Edit log messages only.
2487 This option is a quick equivalent to a histedit script which edits
2488 only log messages but otherwise leaves every picked commit as-is.
2491 option can only be used when starting a new histedit operation.
2492 If this option is used, no other command-line arguments are allowed.
2494 Delete backups created by past histedit operations, represented by references
2496 .Dq refs/got/backup/histedit
2497 reference namespace.
2501 is specified, only delete backups which at some point in time represented
2503 Otherwise, delete all references found within
2504 .Dq refs/got/backup/histedit .
2506 Any commit, tree, tag, and blob objects belonging to deleted backups
2507 remain in the repository and may be removed separately with
2508 Git's garbage collector or
2509 .Cm gotadmin cleanup .
2511 If this option is used,
2513 does not require a work tree.
2514 None of the other options can be used together with
2518 .It Cm integrate Ar branch
2520 Integrate the specified
2522 into the work tree's current branch.
2523 Files in the work tree are updated to match the contents on the integrated
2525 and the reference of the work tree's branch is changed to point at the
2526 head commit of the integrated
2529 Both branches can be considered equivalent after integration since they
2530 will be pointing at the same commit.
2531 Both branches remain available for future work, if desired.
2532 In case the integrated
2534 is no longer needed it may be deleted with
2537 Show the status of each affected file, using the following status codes:
2538 .Bl -column YXZ description
2539 .It U Ta file was updated
2540 .It D Ta file was deleted
2541 .It A Ta new file was added
2542 .It \(a~ Ta versioned file is obstructed by a non-regular file
2543 .It ! Ta a missing versioned file was restored
2547 will refuse to run if certain preconditions are not met.
2548 Most importantly, the
2550 must have been rebased onto the work tree's current branch with
2552 before it can be integrated, in order to linearize commit history and
2553 resolve merge conflicts.
2554 If the work tree contains multiple base commits, it must first be updated
2555 to a single base commit with
2557 If changes have been staged with
2559 these changes must first be committed with
2563 If the work tree contains local changes, these changes must first be
2575 Create a merge commit based on the current branch of the work tree and
2578 If a linear project history is desired, then use of
2580 should be preferred over
2582 However, even strictly linear projects may require merge commits in order
2583 to merge in new versions of third-party code stored on vendor branches
2587 Merge commits are commits based on multiple parent commits.
2588 The tip commit of the work tree's current branch, which must be set with
2592 operation, will be used as the first parent.
2593 The tip commit of the specified
2595 will be used as the second parent.
2597 No ancestral relationship between the two branches is required.
2598 If the two branches have already been merged previously, only new changes
2601 It is not possible to create merge commits with more than two parents.
2602 If more than one branch needs to be merged, then multiple merge commits
2603 with two parents each can be created in sequence.
2605 While merging changes found on the
2607 into the work tree, show the status of each affected file,
2608 using the following status codes:
2609 .Bl -column YXZ description
2610 .It G Ta file was merged
2611 .It C Ta file was merged and conflicts occurred during merge
2612 .It ! Ta changes destined for a missing file were not merged
2613 .It D Ta file was deleted
2614 .It d Ta file's deletion was prevented by local modifications
2615 .It A Ta new file was added
2616 .It \(a~ Ta changes destined for a non-regular file were not merged
2617 .It ? Ta changes destined for an unversioned file were not merged
2620 If merge conflicts occur, the merge operation is interrupted and conflicts
2621 must be resolved before the merge operation can continue.
2622 If any files with destined changes are found to be missing or unversioned,
2623 or if files could not be deleted due to differences in deleted content,
2624 the merge operation will be interrupted to prevent potentially incomplete
2625 changes from being committed to the repository without user intervention.
2626 The work tree may be modified as desired and the merge can be continued
2627 once the changes present in the work tree are considered complete.
2628 Alternatively, the merge operation may be aborted which will leave
2629 the work tree's current branch unmodified.
2631 If a merge conflict is resolved in a way which renders all merged
2632 changes into no-op changes, the merge operation cannot continue
2633 and must be aborted.
2636 will refuse to run if certain preconditions are not met.
2639 is based on the work tree's current branch, then no merge commit can
2642 may be used to integrate the
2645 If the work tree is not yet fully updated to the tip commit of its
2646 branch, then the work tree must first be updated with
2648 If the work tree contains multiple base commits, it must first be updated
2649 to a single base commit with
2651 If changes have been staged with
2653 these changes must first be committed with
2657 If the work tree contains local changes, these changes must first be
2664 contains changes to files outside of the work tree's path prefix,
2665 the work tree cannot be used to merge this branch.
2675 commands will refuse to run while a merge operation is in progress.
2676 Other commands which manipulate the work tree may be used for
2677 conflict resolution purposes.
2684 Abort an interrupted merge operation.
2685 If this option is used, no other command-line arguments are allowed.
2687 Continue an interrupted merge operation.
2688 If this option is used, no other command-line arguments are allowed.
2690 Merge changes into the work tree as usual but do not create a merge
2692 The merge result can be adjusted as desired before a merge commit is
2695 Alternatively, the merge may be aborted with
2702 .Op Fl F Ar response-script
2706 Stage local changes for inclusion in the next commit.
2709 is specified, stage all changes in the work tree.
2710 Otherwise, stage changes at or within the specified paths.
2711 Paths may be staged if they are added, modified, or deleted according to
2714 Show the status of each affected file, using the following status codes:
2715 .Bl -column YXZ description
2716 .It A Ta file addition has been staged
2717 .It M Ta file modification has been staged
2718 .It D Ta file deletion has been staged
2721 Staged file contents are saved in newly created blob objects in the repository.
2722 These blobs will be referred to by tree objects once staged changes have been
2725 Staged changes affect the behaviour of
2730 While paths with staged changes exist, the
2732 command will refuse to commit any paths which do not have staged changes.
2733 Local changes created on top of staged changes can only be committed if
2734 the path is staged again, or if the staged changes are committed first.
2737 command will show both local changes and staged changes.
2740 command is able to display local changes relative to staged changes,
2741 and to display staged changes relative to the repository.
2744 command cannot revert staged changes but may be used to revert
2745 local changes created on top of staged changes.
2751 .It Fl F Ar response-script
2759 responses line-by-line from the specified
2761 file instead of prompting interactively.
2763 Instead of staging new changes, list paths which are already staged,
2764 along with the IDs of staged blob objects and stage status codes.
2765 If paths were provided on the command line, show the staged paths
2766 among the specified paths.
2767 Otherwise, show all staged paths.
2769 Instead of staging the entire content of a changed file, interactively
2770 select or reject changes for staging based on
2774 (reject change), and
2776 (quit staging this file) responses.
2777 If a file is in modified status, individual patches derived from the
2778 modified file content can be staged.
2779 Files in added or deleted status may only be staged or rejected in
2782 Allow staging of symbolic links which point outside of the path space
2783 that is under version control.
2786 will reject such symbolic links due to safety concerns.
2789 may decide to represent such a symbolic link as a regular file which contains
2790 the link's target path, rather than creating an actual symbolic link which
2791 points outside of the work tree.
2792 Use of this option is discouraged because external mechanisms such as
2794 are better suited for managing symbolic links to paths not under
2799 will refuse to run if certain preconditions are not met.
2800 If a file contains merge conflicts, these conflicts must be resolved first.
2801 If a file is found to be out of date relative to the head commit on the
2802 work tree's current branch, the file must be updated with
2804 before it can be staged (however, this does not prevent the file from
2805 becoming out-of-date at some point after having been staged).
2812 commands will refuse to run while staged changes exist.
2813 If staged changes cannot be committed because a staged path
2814 is out of date, the path must be unstaged with
2816 before it can be updated with
2818 and may then be staged again if necessary.
2823 .Op Fl F Ar response-script
2827 Merge staged changes back into the work tree and put affected paths
2828 back into non-staged status.
2831 is specified, unstage all staged changes across the entire work tree.
2832 Otherwise, unstage changes at or within the specified paths.
2834 Show the status of each affected file, using the following status codes:
2835 .Bl -column YXZ description
2836 .It G Ta file was unstaged
2837 .It C Ta file was unstaged and conflicts occurred during merge
2838 .It ! Ta changes destined for a missing file were not merged
2839 .It D Ta file was staged as deleted and still is deleted
2840 .It d Ta file's deletion was prevented by local modifications
2841 .It \(a~ Ta changes destined for a non-regular file were not merged
2848 .It Fl F Ar response-script
2856 responses line-by-line from the specified
2858 file instead of prompting interactively.
2860 Instead of unstaging the entire content of a changed file, interactively
2861 select or reject changes for unstaging based on
2865 (keep change staged), and
2867 (quit unstaging this file) responses.
2868 If a file is staged in modified status, individual patches derived from the
2869 staged file content can be unstaged.
2870 Files staged in added or deleted status may only be unstaged in their entirety.
2876 .Op Fl r Ar repository-path
2879 Parse and print contents of objects to standard output in a line-based
2881 Content of commit, tree, and tag objects is printed in a way similar
2882 to the actual content stored in such objects.
2883 Blob object contents are printed as they would appear in files on disk.
2885 Attempt to interpret each argument as a reference, a tag name, or
2886 an object ID SHA1 hash.
2887 References will be resolved to an object ID.
2888 Tag names will resolved to a tag object.
2889 An abbreviated hash argument will be expanded to a full SHA1 hash
2890 automatically, provided the abbreviation is unique.
2892 If none of the above interpretations produce a valid result, or if the
2894 option is used, attempt to interpret the argument as a path which will
2895 be resolved to the ID of an object found at this path in the repository.
2902 Look up paths in the specified
2904 If this option is not used, paths are looked up in the commit resolved
2905 via the repository's HEAD reference.
2906 The expected argument is a commit ID SHA1 hash or an existing reference
2907 or tag name which will be resolved to a commit ID.
2908 An abbreviated hash argument will be expanded to a full SHA1 hash
2909 automatically, provided the abbreviation is unique.
2911 Interpret all arguments as paths only.
2912 This option can be used to resolve ambiguity in cases where paths
2913 look like tag names, reference names, or object IDs.
2914 .It Fl r Ar repository-path
2915 Use the repository at the specified path.
2916 If not specified, assume the repository is located at or above the current
2918 If this directory is a
2920 work tree, use the repository path associated with this work tree.
2922 .It Cm info Op Ar path ...
2923 Display meta-data stored in a work tree.
2928 The work tree to use is resolved implicitly by walking upwards from the
2929 current working directory.
2933 arguments are specified, show additional per-file information for tracked
2934 files located at or within these paths.
2937 argument corresponds to the work tree's root directory, display information
2938 for all tracked files.
2941 .Bl -tag -width GOT_IGNORE_GITCONFIG
2943 The author's name and email address, such as
2944 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
2954 may fail to parse commits without an email address in author data,
2958 environment variables with a missing email address.
2960 .Ev GOT_AUTHOR will be overridden by configuration settings in
2966 configuration settings in the repository's
2973 configuration settings contained in Git's global
2975 configuration file will only be used if neither
2979 environment variable provide author information.
2980 .It Ev VISUAL , EDITOR
2981 The editor spawned by
2989 text editor will be spawned in order to give
2991 the attention it deserves.
2992 .It Ev GOT_LOG_DEFAULT_LIMIT
2993 The default limit on the number of commits traversed by
2995 If set to zero, the limit is unbounded.
2996 This variable will be silently ignored if it is set to a non-numeric value.
2997 .It Ev GOT_IGNORE_GITCONFIG
2998 If this variable is set then any remote repository definitions or author
2999 information found in Git configuration files will be ignored.
3002 .Bl -tag -width packed-refs -compact
3004 Repository-wide configuration settings for
3008 configuration file located in the root directory of a Git repository
3009 supersedes any relevant settings in Git's
3013 .It Pa .got/got.conf
3014 Worktree-specific configuration settings for
3018 configuration file in the
3020 meta-data directory of a work tree supersedes any relevant settings in
3023 configuration file and Git's
3030 Enable tab-completion of
3035 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3037 Clone an existing Git repository for use with
3041 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3043 Use of HTTP URLs currently requires
3047 .Dl $ git clone --bare https://github.com/openbsd/src.git
3049 Alternatively, for quick and dirty local testing of
3051 a new Git repository could be created and populated with files,
3052 e.g. from a temporary CVS checkout located at
3055 .Dl $ gotadmin init /var/git/src.git
3056 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3058 Check out a work tree from the Git repository to /usr/src:
3060 .Dl $ got checkout /var/git/src.git /usr/src
3062 View local changes in a work tree directory:
3064 .Dl $ got diff | less
3066 In a work tree, display files in a potentially problematic state:
3068 .Dl $ got status -s 'C!~?'
3070 Interactively revert selected local changes in a work tree directory:
3072 .Dl $ got revert -p -R\ .
3074 In a work tree or a git repository directory, list all branch references:
3078 In a work tree or a git repository directory, create a new branch called
3079 .Dq unified-buffer-cache
3080 which is forked off the
3084 .Dl $ got branch -c master unified-buffer-cache
3086 Switch an existing work tree to the branch
3087 .Dq unified-buffer-cache .
3088 Local changes in the work tree will be preserved and merged if necessary:
3090 .Dl $ got update -b unified-buffer-cache
3092 Create a new commit from local changes in a work tree directory.
3093 This new commit will become the head commit of the work tree's current branch:
3097 In a work tree or a git repository directory, view changes committed in
3098 the 3 most recent commits to the work tree's branch, or the branch resolved
3099 via the repository's HEAD reference, respectively:
3101 .Dl $ got log -p -l 3
3103 As above, but display changes in the order in which
3105 could apply them in sequence:
3107 .Dl $ got log -p -l 3 -R
3109 In a work tree or a git repository directory, log the history of a subdirectory:
3111 .Dl $ got log sys/uvm
3113 While operating inside a work tree, paths are specified relative to the current
3114 working directory, so this command will log the subdirectory
3117 .Dl $ cd sys/uvm && got log\ .
3119 And this command has the same effect:
3121 .Dl $ cd sys/dev/usb && got log ../../uvm
3123 And this command displays work tree meta-data about all tracked files:
3126 .Dl $ got info\ . | less
3128 Add new files and remove obsolete files in a work tree directory:
3130 .Dl $ got add sys/uvm/uvm_ubc.c
3131 .Dl $ got remove sys/uvm/uvm_vnode.c
3133 Create a new commit from local changes in a work tree directory
3134 with a pre-defined log message.
3136 .Dl $ got commit -m 'unify the buffer cache'
3138 Alternatively, create a new commit from local changes in a work tree
3139 directory with a log message that has been prepared in the file
3142 .Dl $ got commit -F /tmp/msg
3144 Update any work tree checked out from the
3145 .Dq unified-buffer-cache
3146 branch to the latest commit on this branch:
3150 Roll file content on the unified-buffer-cache branch back by one commit,
3151 and then fetch the rolled-back change into the work tree as a local change
3152 to be amended and perhaps committed again:
3154 .Dl $ got backout unified-buffer-cache
3155 .Dl $ got commit -m 'roll back previous'
3156 .Dl $ # now back out the previous backout :-)
3157 .Dl $ got backout unified-buffer-cache
3159 Fetch new changes on the remote repository's
3161 branch, making them visible on the local repository's
3168 In a repository created with a HTTP URL and
3169 .Cm git clone --bare
3172 command must be used instead:
3174 .Dl $ cd /var/git/src.git
3175 .Dl $ git fetch origin master:refs/remotes/origin/master
3179 branch to merge the new changes that are now visible on the
3184 .Dl $ got update -b origin/master
3185 .Dl $ got rebase master
3188 .Dq unified-buffer-cache
3189 branch on top of the new head commit of the
3193 .Dl $ got update -b master
3194 .Dl $ got rebase unified-buffer-cache
3196 Create a patch from all changes on the unified-buffer-cache branch.
3197 The patch can be mailed out for review and applied to
3201 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
3203 Edit the entire commit history of the
3204 .Dq unified-buffer-cache
3207 .Dl $ got update -b unified-buffer-cache
3208 .Dl $ got update -c master
3211 Before working against existing branches in a repository cloned with
3212 .Cm git clone --bare
3217 must be configured to map all references in the remote repository
3220 namespace of the local repository.
3221 This can be achieved by setting Git's
3222 .Pa remote.origin.fetch
3223 configuration variable to the value
3224 .Dq +refs/heads/*:refs/remotes/origin/*
3229 .Dl $ cd /var/git/repo
3230 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
3234 option must be disabled:
3236 .Dl $ cd /var/git/repo
3237 .Dl $ git config remote.origin.mirror false
3239 Alternatively, the following
3241 configuration item can be added manually to the Git repository's
3245 .Dl [remote \&"origin\&"]
3247 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
3250 This configuration leaves the local repository's
3252 namespace free for use by local branches checked out with
3254 and, if needed, created with
3257 .Dq refs/remotes/origin
3258 namespace can now be updated with incoming changes from the remote
3263 without extra command line arguments.
3264 Newly fetched changes can be examined with
3267 Display changes on the remote repository's version of the
3269 branch, as of the last time
3273 .Dl $ got log -c origin/master | less
3275 As shown here, most commands accept abbreviated reference names such as
3278 .Dq refs/remotes/origin/master .
3279 The latter is only needed in case of ambiguity.
3282 must be used to merge changes which are visible on the
3287 This will also merge local changes, if any, with the incoming changes:
3289 .Dl $ got update -b origin/master
3290 .Dl $ got rebase master
3292 In order to make changes committed to the
3293 .Dq unified-buffer-cache
3297 .Dq unified-buffer-cache
3298 branch must first be rebased onto the
3302 .Dl $ got update -b master
3303 .Dl $ got rebase unified-buffer-cache
3306 .Dq unified-buffer-cache
3307 branch can now be made visible on the
3311 Because the rebase operation switched the work tree to the
3312 .Dq unified-buffer-cache
3313 branch, the work tree must be switched back to the
3317 .Dl $ got update -b master
3318 .Dl $ got integrate unified-buffer-cache
3322 branch, log messages for local changes can now be amended with
3324 by other developers and any other important new information:
3326 .Dl $ got update -c origin/master
3327 .Dl $ got histedit -m
3329 If the remote repository offers write access, local changes on the
3331 branch can be sent to the remote repository with
3335 can be run without further arguments.
3336 The arguments shown here match defaults, provided the work tree's
3337 current branch is the
3341 .Dl $ got send -b master origin
3343 If the remote repository requires the HTTPS protocol, the
3345 command must be used instead:
3347 .Dl $ cd /var/git/src.git
3348 .Dl $ git push origin master
3350 When making contributions to projects which use the
3352 workflow, SSH protocol repository access needs to be set up first.
3353 Once an account has been created on a Git hosting site it should
3354 be possible to upload a public SSH key for repository access
3359 workflow will usually involve two remote repositories.
3360 In the real-life example below, the
3362 repository was forked from the
3364 repository by using the Git hosting site's web interface.
3367 file in the local repository describes both remote repositories:
3368 .Bd -literal -offset indent
3369 # Jelmers's repository, which accepts pull requests
3371 server git@github.com
3373 repository "/jelmer/dulwich"
3377 # Stefan's fork, used as the default remote repository
3379 server git@github.com
3381 repository "/stspdotname/dulwich"
3386 With this configuration, Stefan can create commits on
3387 .Dq refs/heads/master
3388 and send them to the
3390 repository by running:
3392 .Dl $ got send -b master origin
3394 The changes can now be proposed to Jelmer by opening a pull request
3395 via the Git hosting site's web interface.
3396 If Jelmer requests further changes to be made, additional commits
3397 can be created on the
3399 branch and be added to the pull request by running
3403 If Jelmer prefers additional commits to be
3405 then the following commands can be used to achieve this:
3407 .Dl $ got update -b master
3408 .Dl $ got update -c origin/master
3409 .Dl $ got histedit -f
3410 .Dl $ got send -f -b master origin
3412 Once Jelmer has accepted the pull request, Stefan can fetch the
3413 merged changes, and possibly several other new changes, by running:
3415 .Dl $ got fetch upstream
3417 The merged changes will now be visible under the reference
3418 .Dq refs/remotes/upstream/master .
3421 branch can now be rebased on top of the latest changes
3424 .Dl $ got update -b upstream/master
3425 .Dl $ got rebase master
3427 As a final step, the forked repository's copy of the master branch needs
3428 to be kept in sync by sending the new changes there:
3430 .Dl $ got send -f -b master origin
3432 If multiple pull requests need to be managed in parallel, a separate branch
3433 must be created for each pull request with
3435 Each such branch can then be used as above, in place of
3436 .Dq refs/heads/master .
3437 Changes for any accepted pull requests will still appear under
3438 .Dq refs/remotes/upstream/master,
3439 regardless of which branch was used in the forked repository to
3440 create a pull request.
3444 .Xr git-repository 5 ,
3445 .Xr got-worktree 5 ,
3449 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
3450 .An Christian Weisgerber Aq Mt naddy@openbsd.org
3451 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
3452 .An Josh Rickmar Aq Mt jrick@zettaport.com
3453 .An Joshua Stein Aq Mt jcs@openbsd.org
3454 .An Klemens Nanni Aq Mt kn@openbsd.org
3455 .An Martin Pieuchot Aq Mt mpi@openbsd.org
3456 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
3457 .An Omar Polo Aq Mt op@openbsd.org
3458 .An Ori Bernstein Aq Mt ori@openbsd.org
3459 .An Sebastien Marie Aq Mt semarie@openbsd.org
3460 .An Stefan Sperling Aq Mt stsp@openbsd.org
3461 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
3462 .An Theo Buehler Aq Mt tb@openbsd.org
3463 .An Thomas Adam Aq Mt thomas@xteddy.org
3464 .An Tracey Emery Aq Mt tracey@traceyemery.net
3465 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
3472 were derived from code under copyright by:
3474 .An Caldera International
3475 .An Daniel Hartmeier
3480 .An Jean-Francois Brousseau
3486 .An Niklas Hallqvist
3491 .An Xavier Santolaria
3494 contains code contributed to the public domain by
3498 is a work-in-progress and some features remain to be implemented.
3500 At present, the user has to fall back on
3502 to perform some tasks.
3506 Reading from remote repositories over HTTP or HTTPS protocols requires
3511 Writing to remote repositories over HTTP or HTTPS protocols requires
3514 The creation of merge commits with more than two parent commits requires
3517 In situations where files or directories were moved around
3519 will not automatically merge changes to new locations and
3521 will usually produce better results.