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.
2151 reference namespace, the branch may not be rebased.
2152 If the work tree is not yet fully updated to the tip commit of its
2153 branch, then the work tree must first be updated with
2155 If changes have been staged with
2157 these changes must first be committed with
2161 If the work tree contains local changes, these changes must first be
2168 contains changes to files outside of the work tree's path prefix,
2169 the work tree cannot be used to rebase this branch.
2175 commands will refuse to run while a rebase operation is in progress.
2176 Other commands which manipulate the work tree may be used for
2177 conflict resolution purposes.
2181 is already based on the work tree's current branch, then no commits
2182 need to be rebased and
2184 will simply switch the work tree to the specified
2186 and update files in the work tree accordingly.
2193 Abort an interrupted rebase operation.
2194 If this option is used, no other command-line arguments are allowed.
2196 Continue an interrupted rebase operation.
2197 If this option is used, no other command-line arguments are allowed.
2199 Show a list of past rebase operations, represented by references in the
2200 .Dq refs/got/backup/rebase
2201 reference namespace.
2203 Display the author, date, and log message of each backed up commit,
2204 the object ID of the corresponding post-rebase commit, and
2205 the object ID of their common ancestor commit.
2206 Given these object IDs,
2213 options can be used to examine the history of either version of the branch,
2218 option can be used to create a new branch from a pre-rebase state if desired.
2222 is specified, only show commits which at some point in time represented this
2224 Otherwise, list all backed up commits for any branches.
2226 If this option is used,
2228 does not require a work tree.
2229 None of the other options can be used together with
2232 Delete backups created by past rebase operations, represented by references
2234 .Dq refs/got/backup/rebase
2235 reference namespace.
2239 is specified, only delete backups which at some point in time represented
2241 Otherwise, delete all references found within
2242 .Dq refs/got/backup/rebase .
2244 Any commit, tree, tag, and blob objects belonging to deleted backups
2245 remain in the repository and may be removed separately with
2246 Git's garbage collector or
2247 .Cm gotadmin cleanup .
2249 If this option is used,
2251 does not require a work tree.
2252 None of the other options can be used together with
2259 .Op Fl F Ar histedit-script
2263 Edit commit history between the work tree's current base commit and
2264 the tip commit of the work tree's current branch.
2268 command requires the
2270 environment variable to be set,
2271 unless an author has been configured in
2277 configuration settings can be obtained from the repository's
2279 file or from Git's global
2285 operation, the work tree's current branch must be set with
2287 to the branch which should be edited, unless this branch is already the
2288 current branch of the work tree.
2289 The tip of this branch represents the upper bound (inclusive) of commits
2294 Furthermore, the work tree's base commit
2297 to a point in this branch's commit history where editing should begin.
2298 This commit represents the lower bound (non-inclusive) of commits touched
2303 Editing of commit history is controlled via a
2305 which can be written in an editor based on a template, passed on the
2306 command line, or generated with the
2312 The format of the histedit script is line-based.
2313 Each line in the script begins with a command name, followed by
2314 whitespace and an argument.
2315 For most commands, the expected argument is a commit ID SHA1 hash.
2316 Any remaining text on the line is ignored.
2317 Lines which begin with the
2319 character are ignored entirely.
2321 The available histedit script commands are as follows:
2322 .Bl -column YXZ pick-commit
2323 .It Cm pick Ar commit Ta Use the specified commit as it is.
2324 .It Cm edit Ar commit Ta Use the specified commit but once changes have been
2325 merged into the work tree interrupt the histedit operation for amending.
2326 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
2327 listed further below that will be used.
2328 .It Cm drop Ar commit Ta Remove this commit from the edited history.
2329 .It Cm mesg Oo Ar log-message Oc Ta Create a new log message for the commit of
2334 command on the previous line of the histedit script.
2337 argument provides a new single-line log message to use.
2340 argument is omitted, open an editor where a new log message can be written.
2343 Every commit in the history being edited must be mentioned in the script.
2344 Lines may be re-ordered to change the order of commits in the edited history.
2345 No commit may be listed more than once.
2347 Edited commits are accumulated on a temporary branch which the work tree
2348 will remain switched to throughout the entire histedit operation.
2349 Once history editing has completed successfully, the temporary branch becomes
2350 the new version of the work tree's branch and the work tree is automatically
2353 Old commits in their pre-histedit state are automatically backed up in the
2354 .Dq refs/got/backup/histedit
2355 reference namespace.
2356 As long as these references are not removed older versions of edited
2357 commits will remain in the repository and can be viewed with the
2360 Removal of these references makes objects which become unreachable via
2361 any reference subject to removal by Git's garbage collector or
2362 .Cm gotadmin cleanup .
2364 While merging commits, show the status of each affected file,
2365 using the following status codes:
2366 .Bl -column YXZ description
2367 .It G Ta file was merged
2368 .It C Ta file was merged and conflicts occurred during merge
2369 .It ! Ta changes destined for a missing file were not merged
2370 .It D Ta file was deleted
2371 .It d Ta file's deletion was prevented by local modifications
2372 .It A Ta new file was added
2373 .It \(a~ Ta changes destined for a non-regular file were not merged
2374 .It ? Ta changes destined for an unversioned file were not merged
2377 If merge conflicts occur, the histedit operation is interrupted and may
2378 be continued once conflicts have been resolved.
2379 If any files with destined changes are found to be missing or unversioned,
2380 or if files could not be deleted due to differences in deleted content,
2381 the histedit operation will be interrupted to prevent potentially incomplete
2382 changes from being committed to the repository without user intervention.
2383 The work tree may be modified as desired and the histedit operation can be
2384 continued once the changes present in the work tree are considered complete.
2385 Alternatively, the histedit operation may be aborted which will leave
2386 the work tree switched back to its original branch.
2388 If a merge conflict is resolved in a way which renders the merged
2389 change into a no-op change, the corresponding commit will be elided
2390 when the histedit operation continues.
2393 will refuse to run if certain preconditions are not met.
2394 If the work tree's current branch is not in the
2396 reference namespace, the history of the branch may not be edited.
2397 If the work tree contains multiple base commits, it must first be updated
2398 to a single base commit with
2400 If changes have been staged with
2402 these changes must first be committed with
2406 If the work tree contains local changes, these changes must first be
2411 If the edited history contains changes to files outside of the work tree's
2412 path prefix, the work tree cannot be used to edit the history of this branch.
2419 commands will refuse to run while a histedit operation is in progress.
2420 Other commands which manipulate the work tree may be used, and the
2422 command may be used to commit arbitrary changes to the temporary branch
2423 while the histedit operation is interrupted.
2430 Abort an interrupted histedit operation.
2431 If this option is used, no other command-line arguments are allowed.
2433 Continue an interrupted histedit operation.
2434 If this option is used, no other command-line arguments are allowed.
2436 Interrupt the histedit operation for editing after merging each commit.
2437 This option is a quick equivalent to a histedit script which uses the
2439 command for all commits.
2442 option can only be used when starting a new histedit operation.
2443 If this option is used, no other command-line arguments are allowed.
2444 .It Fl F Ar histedit-script
2447 instead of opening a temporary file in an editor where a histedit script
2450 Fold all commits into a single commit.
2451 This option is a quick equivalent to a histedit script which folds all
2452 commits, combining them all into one commit.
2455 option can only be used when starting a new histedit operation.
2456 If this option is used, no other command-line arguments are allowed.
2458 Show a list of past histedit operations, represented by references in the
2459 .Dq refs/got/backup/histedit
2460 reference namespace.
2462 Display the author, date, and log message of each backed up commit,
2463 the object ID of the corresponding post-histedit commit, and
2464 the object ID of their common ancestor commit.
2465 Given these object IDs,
2472 options can be used to examine the history of either version of the branch,
2477 option can be used to create a new branch from a pre-histedit state if desired.
2481 is specified, only show commits which at some point in time represented this
2483 Otherwise, list all backed up commits for any branches.
2485 If this option is used,
2487 does not require a work tree.
2488 None of the other options can be used together with
2491 Edit log messages only.
2492 This option is a quick equivalent to a histedit script which edits
2493 only log messages but otherwise leaves every picked commit as-is.
2496 option can only be used when starting a new histedit operation.
2497 If this option is used, no other command-line arguments are allowed.
2499 Delete backups created by past histedit operations, represented by references
2501 .Dq refs/got/backup/histedit
2502 reference namespace.
2506 is specified, only delete backups which at some point in time represented
2508 Otherwise, delete all references found within
2509 .Dq refs/got/backup/histedit .
2511 Any commit, tree, tag, and blob objects belonging to deleted backups
2512 remain in the repository and may be removed separately with
2513 Git's garbage collector or
2514 .Cm gotadmin cleanup .
2516 If this option is used,
2518 does not require a work tree.
2519 None of the other options can be used together with
2523 .It Cm integrate Ar branch
2525 Integrate the specified
2527 into the work tree's current branch.
2528 Files in the work tree are updated to match the contents on the integrated
2530 and the reference of the work tree's branch is changed to point at the
2531 head commit of the integrated
2534 Both branches can be considered equivalent after integration since they
2535 will be pointing at the same commit.
2536 Both branches remain available for future work, if desired.
2537 In case the integrated
2539 is no longer needed it may be deleted with
2542 Show the status of each affected file, using the following status codes:
2543 .Bl -column YXZ description
2544 .It U Ta file was updated
2545 .It D Ta file was deleted
2546 .It A Ta new file was added
2547 .It \(a~ Ta versioned file is obstructed by a non-regular file
2548 .It ! Ta a missing versioned file was restored
2552 will refuse to run if certain preconditions are not met.
2553 Most importantly, the
2555 must have been rebased onto the work tree's current branch with
2557 before it can be integrated, in order to linearize commit history and
2558 resolve merge conflicts.
2559 If the work tree contains multiple base commits, it must first be updated
2560 to a single base commit with
2562 If changes have been staged with
2564 these changes must first be committed with
2568 If the work tree contains local changes, these changes must first be
2580 Create a merge commit based on the current branch of the work tree and
2583 If a linear project history is desired, then use of
2585 should be preferred over
2587 However, even strictly linear projects may require merge commits in order
2588 to merge in new versions of third-party code stored on vendor branches
2592 Merge commits are commits based on multiple parent commits.
2593 The tip commit of the work tree's current branch, which must be set with
2597 operation, will be used as the first parent.
2598 The tip commit of the specified
2600 will be used as the second parent.
2602 No ancestral relationship between the two branches is required.
2603 If the two branches have already been merged previously, only new changes
2606 It is not possible to create merge commits with more than two parents.
2607 If more than one branch needs to be merged, then multiple merge commits
2608 with two parents each can be created in sequence.
2610 While merging changes found on the
2612 into the work tree, show the status of each affected file,
2613 using the following status codes:
2614 .Bl -column YXZ description
2615 .It G Ta file was merged
2616 .It C Ta file was merged and conflicts occurred during merge
2617 .It ! Ta changes destined for a missing file were not merged
2618 .It D Ta file was deleted
2619 .It d Ta file's deletion was prevented by local modifications
2620 .It A Ta new file was added
2621 .It \(a~ Ta changes destined for a non-regular file were not merged
2622 .It ? Ta changes destined for an unversioned file were not merged
2625 If merge conflicts occur, the merge operation is interrupted and conflicts
2626 must be resolved before the merge operation can continue.
2627 If any files with destined changes are found to be missing or unversioned,
2628 or if files could not be deleted due to differences in deleted content,
2629 the merge operation will be interrupted to prevent potentially incomplete
2630 changes from being committed to the repository without user intervention.
2631 The work tree may be modified as desired and the merge can be continued
2632 once the changes present in the work tree are considered complete.
2633 Alternatively, the merge operation may be aborted which will leave
2634 the work tree's current branch unmodified.
2636 If a merge conflict is resolved in a way which renders all merged
2637 changes into no-op changes, the merge operation cannot continue
2638 and must be aborted.
2641 will refuse to run if certain preconditions are not met.
2644 is based on the work tree's current branch, then no merge commit can
2647 may be used to integrate the
2650 If the work tree is not yet fully updated to the tip commit of its
2651 branch, then the work tree must first be updated with
2653 If the work tree contains multiple base commits, it must first be updated
2654 to a single base commit with
2656 If changes have been staged with
2658 these changes must first be committed with
2662 If the work tree contains local changes, these changes must first be
2669 contains changes to files outside of the work tree's path prefix,
2670 the work tree cannot be used to merge this branch.
2680 commands will refuse to run while a merge operation is in progress.
2681 Other commands which manipulate the work tree may be used for
2682 conflict resolution purposes.
2689 Abort an interrupted merge operation.
2690 If this option is used, no other command-line arguments are allowed.
2692 Continue an interrupted merge operation.
2693 If this option is used, no other command-line arguments are allowed.
2695 Merge changes into the work tree as usual but do not create a merge
2697 The merge result can be adjusted as desired before a merge commit is
2700 Alternatively, the merge may be aborted with
2707 .Op Fl F Ar response-script
2711 Stage local changes for inclusion in the next commit.
2714 is specified, stage all changes in the work tree.
2715 Otherwise, stage changes at or within the specified paths.
2716 Paths may be staged if they are added, modified, or deleted according to
2719 Show the status of each affected file, using the following status codes:
2720 .Bl -column YXZ description
2721 .It A Ta file addition has been staged
2722 .It M Ta file modification has been staged
2723 .It D Ta file deletion has been staged
2726 Staged file contents are saved in newly created blob objects in the repository.
2727 These blobs will be referred to by tree objects once staged changes have been
2730 Staged changes affect the behaviour of
2735 While paths with staged changes exist, the
2737 command will refuse to commit any paths which do not have staged changes.
2738 Local changes created on top of staged changes can only be committed if
2739 the path is staged again, or if the staged changes are committed first.
2742 command will show both local changes and staged changes.
2745 command is able to display local changes relative to staged changes,
2746 and to display staged changes relative to the repository.
2749 command cannot revert staged changes but may be used to revert
2750 local changes created on top of staged changes.
2756 .It Fl F Ar response-script
2764 responses line-by-line from the specified
2766 file instead of prompting interactively.
2768 Instead of staging new changes, list paths which are already staged,
2769 along with the IDs of staged blob objects and stage status codes.
2770 If paths were provided on the command line, show the staged paths
2771 among the specified paths.
2772 Otherwise, show all staged paths.
2774 Instead of staging the entire content of a changed file, interactively
2775 select or reject changes for staging based on
2779 (reject change), and
2781 (quit staging this file) responses.
2782 If a file is in modified status, individual patches derived from the
2783 modified file content can be staged.
2784 Files in added or deleted status may only be staged or rejected in
2787 Allow staging of symbolic links which point outside of the path space
2788 that is under version control.
2791 will reject such symbolic links due to safety concerns.
2794 may decide to represent such a symbolic link as a regular file which contains
2795 the link's target path, rather than creating an actual symbolic link which
2796 points outside of the work tree.
2797 Use of this option is discouraged because external mechanisms such as
2799 are better suited for managing symbolic links to paths not under
2804 will refuse to run if certain preconditions are not met.
2805 If a file contains merge conflicts, these conflicts must be resolved first.
2806 If a file is found to be out of date relative to the head commit on the
2807 work tree's current branch, the file must be updated with
2809 before it can be staged (however, this does not prevent the file from
2810 becoming out-of-date at some point after having been staged).
2817 commands will refuse to run while staged changes exist.
2818 If staged changes cannot be committed because a staged path
2819 is out of date, the path must be unstaged with
2821 before it can be updated with
2823 and may then be staged again if necessary.
2828 .Op Fl F Ar response-script
2832 Merge staged changes back into the work tree and put affected paths
2833 back into non-staged status.
2836 is specified, unstage all staged changes across the entire work tree.
2837 Otherwise, unstage changes at or within the specified paths.
2839 Show the status of each affected file, using the following status codes:
2840 .Bl -column YXZ description
2841 .It G Ta file was unstaged
2842 .It C Ta file was unstaged and conflicts occurred during merge
2843 .It ! Ta changes destined for a missing file were not merged
2844 .It D Ta file was staged as deleted and still is deleted
2845 .It d Ta file's deletion was prevented by local modifications
2846 .It \(a~ Ta changes destined for a non-regular file were not merged
2853 .It Fl F Ar response-script
2861 responses line-by-line from the specified
2863 file instead of prompting interactively.
2865 Instead of unstaging the entire content of a changed file, interactively
2866 select or reject changes for unstaging based on
2870 (keep change staged), and
2872 (quit unstaging this file) responses.
2873 If a file is staged in modified status, individual patches derived from the
2874 staged file content can be unstaged.
2875 Files staged in added or deleted status may only be unstaged in their entirety.
2881 .Op Fl r Ar repository-path
2884 Parse and print contents of objects to standard output in a line-based
2886 Content of commit, tree, and tag objects is printed in a way similar
2887 to the actual content stored in such objects.
2888 Blob object contents are printed as they would appear in files on disk.
2890 Attempt to interpret each argument as a reference, a tag name, or
2891 an object ID SHA1 hash.
2892 References will be resolved to an object ID.
2893 Tag names will resolved to a tag object.
2894 An abbreviated hash argument will be expanded to a full SHA1 hash
2895 automatically, provided the abbreviation is unique.
2897 If none of the above interpretations produce a valid result, or if the
2899 option is used, attempt to interpret the argument as a path which will
2900 be resolved to the ID of an object found at this path in the repository.
2907 Look up paths in the specified
2909 If this option is not used, paths are looked up in the commit resolved
2910 via the repository's HEAD reference.
2911 The expected argument is a commit ID SHA1 hash or an existing reference
2912 or tag name which will be resolved to a commit ID.
2913 An abbreviated hash argument will be expanded to a full SHA1 hash
2914 automatically, provided the abbreviation is unique.
2916 Interpret all arguments as paths only.
2917 This option can be used to resolve ambiguity in cases where paths
2918 look like tag names, reference names, or object IDs.
2919 .It Fl r Ar repository-path
2920 Use the repository at the specified path.
2921 If not specified, assume the repository is located at or above the current
2923 If this directory is a
2925 work tree, use the repository path associated with this work tree.
2927 .It Cm info Op Ar path ...
2928 Display meta-data stored in a work tree.
2933 The work tree to use is resolved implicitly by walking upwards from the
2934 current working directory.
2938 arguments are specified, show additional per-file information for tracked
2939 files located at or within these paths.
2942 argument corresponds to the work tree's root directory, display information
2943 for all tracked files.
2946 .Bl -tag -width GOT_IGNORE_GITCONFIG
2948 The author's name and email address, such as
2949 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
2959 may fail to parse commits without an email address in author data,
2963 environment variables with a missing email address.
2965 .Ev GOT_AUTHOR will be overridden by configuration settings in
2971 configuration settings in the repository's
2978 configuration settings contained in Git's global
2980 configuration file will only be used if neither
2984 environment variable provide author information.
2985 .It Ev VISUAL , EDITOR
2986 The editor spawned by
2994 text editor will be spawned in order to give
2996 the attention it deserves.
2997 .It Ev GOT_LOG_DEFAULT_LIMIT
2998 The default limit on the number of commits traversed by
3000 If set to zero, the limit is unbounded.
3001 This variable will be silently ignored if it is set to a non-numeric value.
3002 .It Ev GOT_IGNORE_GITCONFIG
3003 If this variable is set then any remote repository definitions or author
3004 information found in Git configuration files will be ignored.
3007 .Bl -tag -width packed-refs -compact
3009 Repository-wide configuration settings for
3013 configuration file located in the root directory of a Git repository
3014 supersedes any relevant settings in Git's
3018 .It Pa .got/got.conf
3019 Worktree-specific configuration settings for
3023 configuration file in the
3025 meta-data directory of a work tree supersedes any relevant settings in
3028 configuration file and Git's
3035 Enable tab-completion of
3040 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3042 Clone an existing Git repository for use with
3046 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3048 Use of HTTP URLs currently requires
3052 .Dl $ git clone --bare https://github.com/openbsd/src.git
3054 Alternatively, for quick and dirty local testing of
3056 a new Git repository could be created and populated with files,
3057 e.g. from a temporary CVS checkout located at
3060 .Dl $ gotadmin init /var/git/src.git
3061 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3063 Check out a work tree from the Git repository to /usr/src:
3065 .Dl $ got checkout /var/git/src.git /usr/src
3067 View local changes in a work tree directory:
3069 .Dl $ got diff | less
3071 In a work tree, display files in a potentially problematic state:
3073 .Dl $ got status -s 'C!~?'
3075 Interactively revert selected local changes in a work tree directory:
3077 .Dl $ got revert -p -R\ .
3079 In a work tree or a git repository directory, list all branch references:
3083 In a work tree or a git repository directory, create a new branch called
3084 .Dq unified-buffer-cache
3085 which is forked off the
3089 .Dl $ got branch -c master unified-buffer-cache
3091 Switch an existing work tree to the branch
3092 .Dq unified-buffer-cache .
3093 Local changes in the work tree will be preserved and merged if necessary:
3095 .Dl $ got update -b unified-buffer-cache
3097 Create a new commit from local changes in a work tree directory.
3098 This new commit will become the head commit of the work tree's current branch:
3102 In a work tree or a git repository directory, view changes committed in
3103 the 3 most recent commits to the work tree's branch, or the branch resolved
3104 via the repository's HEAD reference, respectively:
3106 .Dl $ got log -p -l 3
3108 As above, but display changes in the order in which
3110 could apply them in sequence:
3112 .Dl $ got log -p -l 3 -R
3114 In a work tree or a git repository directory, log the history of a subdirectory:
3116 .Dl $ got log sys/uvm
3118 While operating inside a work tree, paths are specified relative to the current
3119 working directory, so this command will log the subdirectory
3122 .Dl $ cd sys/uvm && got log\ .
3124 And this command has the same effect:
3126 .Dl $ cd sys/dev/usb && got log ../../uvm
3128 And this command displays work tree meta-data about all tracked files:
3131 .Dl $ got info\ . | less
3133 Add new files and remove obsolete files in a work tree directory:
3135 .Dl $ got add sys/uvm/uvm_ubc.c
3136 .Dl $ got remove sys/uvm/uvm_vnode.c
3138 Create a new commit from local changes in a work tree directory
3139 with a pre-defined log message.
3141 .Dl $ got commit -m 'unify the buffer cache'
3143 Alternatively, create a new commit from local changes in a work tree
3144 directory with a log message that has been prepared in the file
3147 .Dl $ got commit -F /tmp/msg
3149 Update any work tree checked out from the
3150 .Dq unified-buffer-cache
3151 branch to the latest commit on this branch:
3155 Roll file content on the unified-buffer-cache branch back by one commit,
3156 and then fetch the rolled-back change into the work tree as a local change
3157 to be amended and perhaps committed again:
3159 .Dl $ got backout unified-buffer-cache
3160 .Dl $ got commit -m 'roll back previous'
3161 .Dl $ # now back out the previous backout :-)
3162 .Dl $ got backout unified-buffer-cache
3164 Fetch new changes on the remote repository's
3166 branch, making them visible on the local repository's
3173 In a repository created with a HTTP URL and
3174 .Cm git clone --bare
3177 command must be used instead:
3179 .Dl $ cd /var/git/src.git
3180 .Dl $ git fetch origin master:refs/remotes/origin/master
3184 branch to merge the new changes that are now visible on the
3189 .Dl $ got update -b origin/master
3190 .Dl $ got rebase master
3193 .Dq unified-buffer-cache
3194 branch on top of the new head commit of the
3198 .Dl $ got update -b master
3199 .Dl $ got rebase unified-buffer-cache
3201 Create a patch from all changes on the unified-buffer-cache branch.
3202 The patch can be mailed out for review and applied to
3206 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
3208 Edit the entire commit history of the
3209 .Dq unified-buffer-cache
3212 .Dl $ got update -b unified-buffer-cache
3213 .Dl $ got update -c master
3216 Before working against existing branches in a repository cloned with
3217 .Cm git clone --bare
3222 must be configured to map all references in the remote repository
3225 namespace of the local repository.
3226 This can be achieved by setting Git's
3227 .Pa remote.origin.fetch
3228 configuration variable to the value
3229 .Dq +refs/heads/*:refs/remotes/origin/*
3234 .Dl $ cd /var/git/repo
3235 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
3239 option must be disabled:
3241 .Dl $ cd /var/git/repo
3242 .Dl $ git config remote.origin.mirror false
3244 Alternatively, the following
3246 configuration item can be added manually to the Git repository's
3250 .Dl [remote \&"origin\&"]
3252 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
3255 This configuration leaves the local repository's
3257 namespace free for use by local branches checked out with
3259 and, if needed, created with
3262 .Dq refs/remotes/origin
3263 namespace can now be updated with incoming changes from the remote
3268 without extra command line arguments.
3269 Newly fetched changes can be examined with
3272 Display changes on the remote repository's version of the
3274 branch, as of the last time
3278 .Dl $ got log -c origin/master | less
3280 As shown here, most commands accept abbreviated reference names such as
3283 .Dq refs/remotes/origin/master .
3284 The latter is only needed in case of ambiguity.
3287 must be used to merge changes which are visible on the
3292 This will also merge local changes, if any, with the incoming changes:
3294 .Dl $ got update -b origin/master
3295 .Dl $ got rebase master
3297 In order to make changes committed to the
3298 .Dq unified-buffer-cache
3302 .Dq unified-buffer-cache
3303 branch must first be rebased onto the
3307 .Dl $ got update -b master
3308 .Dl $ got rebase unified-buffer-cache
3311 .Dq unified-buffer-cache
3312 branch can now be made visible on the
3316 Because the rebase operation switched the work tree to the
3317 .Dq unified-buffer-cache
3318 branch, the work tree must be switched back to the
3322 .Dl $ got update -b master
3323 .Dl $ got integrate unified-buffer-cache
3327 branch, log messages for local changes can now be amended with
3329 by other developers and any other important new information:
3331 .Dl $ got update -c origin/master
3332 .Dl $ got histedit -m
3334 If the remote repository offers write access, local changes on the
3336 branch can be sent to the remote repository with
3340 can be run without further arguments.
3341 The arguments shown here match defaults, provided the work tree's
3342 current branch is the
3346 .Dl $ got send -b master origin
3348 If the remote repository requires the HTTPS protocol, the
3350 command must be used instead:
3352 .Dl $ cd /var/git/src.git
3353 .Dl $ git push origin master
3355 When making contributions to projects which use the
3357 workflow, SSH protocol repository access needs to be set up first.
3358 Once an account has been created on a Git hosting site it should
3359 be possible to upload a public SSH key for repository access
3364 workflow will usually involve two remote repositories.
3365 In the real-life example below, the
3367 repository was forked from the
3369 repository by using the Git hosting site's web interface.
3372 file in the local repository describes both remote repositories:
3373 .Bd -literal -offset indent
3374 # Jelmers's repository, which accepts pull requests
3376 server git@github.com
3378 repository "/jelmer/dulwich"
3382 # Stefan's fork, used as the default remote repository
3384 server git@github.com
3386 repository "/stspdotname/dulwich"
3391 With this configuration, Stefan can create commits on
3392 .Dq refs/heads/master
3393 and send them to the
3395 repository by running:
3397 .Dl $ got send -b master origin
3399 The changes can now be proposed to Jelmer by opening a pull request
3400 via the Git hosting site's web interface.
3401 If Jelmer requests further changes to be made, additional commits
3402 can be created on the
3404 branch and be added to the pull request by running
3408 If Jelmer prefers additional commits to be
3410 then the following commands can be used to achieve this:
3412 .Dl $ got update -b master
3413 .Dl $ got update -c origin/master
3414 .Dl $ got histedit -f
3415 .Dl $ got send -f -b master origin
3417 Once Jelmer has accepted the pull request, Stefan can fetch the
3418 merged changes, and possibly several other new changes, by running:
3420 .Dl $ got fetch upstream
3422 The merged changes will now be visible under the reference
3423 .Dq refs/remotes/upstream/master .
3426 branch can now be rebased on top of the latest changes
3429 .Dl $ got update -b upstream/master
3430 .Dl $ got rebase master
3432 As a final step, the forked repository's copy of the master branch needs
3433 to be kept in sync by sending the new changes there:
3435 .Dl $ got send -f -b master origin
3437 If multiple pull requests need to be managed in parallel, a separate branch
3438 must be created for each pull request with
3440 Each such branch can then be used as above, in place of
3441 .Dq refs/heads/master .
3442 Changes for any accepted pull requests will still appear under
3443 .Dq refs/remotes/upstream/master,
3444 regardless of which branch was used in the forked repository to
3445 create a pull request.
3449 .Xr git-repository 5 ,
3450 .Xr got-worktree 5 ,
3454 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
3455 .An Christian Weisgerber Aq Mt naddy@openbsd.org
3456 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
3457 .An Josh Rickmar Aq Mt jrick@zettaport.com
3458 .An Joshua Stein Aq Mt jcs@openbsd.org
3459 .An Klemens Nanni Aq Mt kn@openbsd.org
3460 .An Martin Pieuchot Aq Mt mpi@openbsd.org
3461 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
3462 .An Omar Polo Aq Mt op@openbsd.org
3463 .An Ori Bernstein Aq Mt ori@openbsd.org
3464 .An Sebastien Marie Aq Mt semarie@openbsd.org
3465 .An Stefan Sperling Aq Mt stsp@openbsd.org
3466 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
3467 .An Theo Buehler Aq Mt tb@openbsd.org
3468 .An Thomas Adam Aq Mt thomas@xteddy.org
3469 .An Tracey Emery Aq Mt tracey@traceyemery.net
3470 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
3477 were derived from code under copyright by:
3479 .An Caldera International
3480 .An Daniel Hartmeier
3485 .An Jean-Francois Brousseau
3491 .An Niklas Hallqvist
3496 .An Xavier Santolaria
3499 contains code contributed to the public domain by
3503 is a work-in-progress and some features remain to be implemented.
3505 At present, the user has to fall back on
3507 to perform some tasks.
3511 Reading from remote repositories over HTTP or HTTPS protocols requires
3516 Writing to remote repositories over HTTP or HTTPS protocols requires
3519 The creation of merge commits with more than two parent commits requires
3522 In situations where files or directories were moved around
3524 will not automatically merge changes to new locations and
3526 will usually produce better results.