2 .\" Copyright (c) 2017 Martin Pieuchot
3 .\" Copyright (c) 2018, 2019, 2020 Stefan Sperling
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
30 is a version control system which stores the history of tracked files
31 in a Git repository, as used by the Git version control system.
32 This repository format is described in
33 .Xr git-repository 5 .
38 version control system because every copy of a repository is writeable.
39 Modifications made to files can be synchronized between repositories
44 must be checked out from the repository for modification.
45 Checked out files are stored in a
47 which can be placed at an arbitrary directory in the filesystem hierarchy.
48 The on-disk format of this work tree is described in
52 provides global and command-specific options.
53 Global options must precede the command name, and are as follows:
54 .Bl -tag -width tenletters
56 Display usage information and exit immediately.
58 Display program version and exit immediately.
64 .Bl -tag -width checkout
71 .Op Fl r Ar repository-path
75 Create an initial commit in a repository from the file hierarchy
78 The created commit will not have any parent commits, i.e. it will be a
80 Also create a new reference which provides a branch name for the newly
82 Show the path of each imported file to indicate progress.
88 environment variable to be set,
89 unless an author has been configured in
95 configuration settings can be obtained from the repository's
97 file or from Git's global
108 If this option is not specified, a branch corresponding to the repository's
109 HEAD reference will be used.
110 Use of this option is required if the branch resolved via the repository's
111 HEAD reference already exists.
113 Ignore files or directories with a name which matches the specified
115 This option may be specified multiple times to build a list of ignore patterns.
118 follows the globbing rules documented in
120 Ignore patterns which end with a slash,
122 will only match directories.
124 Use the specified log message when creating the new commit.
129 opens a temporary file in an editor where a log message can be written.
130 .It Fl r Ar repository-path
131 Use the repository at the specified path.
132 If not specified, assume the repository is located at or above the current
140 .Op Fl R Ar reference
145 Clone a Git repository at the specified
151 is specified, the directory name will be derived from the name of the
154 will refuse to run if the
160 specifies a protocol scheme, a server hostname, an optional port number
161 separated from the hostname by a colon, and a path to the repository on
163 .Lk scheme://hostname:port/path/to/repository
165 The following protocol schemes are supported:
166 .Bl -tag -width git+ssh
168 The Git protocol as implemented by the
171 Use of this protocol is discouraged since it supports neither authentication
174 The Git protocol wrapped in an authenticated and encrypted
177 With this protocol the hostname may contain an embedded username for
182 Short alias for git+ssh.
185 Objects in the cloned repository are stored in a pack file which is downloaded
187 This pack file will then be indexed to facilitate access to the objects stored
189 If any objects in the pack file are stored in deltified form, all deltas will
190 be fully resolved in order to compute the ID of such objects.
191 This can take some time.
192 More details about the pack file format are documented in
193 .Xr git-repository 5 .
196 creates a remote repository entry in the
200 files of the cloned repository to store the
206 arguments for future use by
216 Fetch all branches from the remote repository's
218 reference namespace and set
219 .Cm fetch_all_branches
220 in the cloned repository's
222 file for future use by
224 If this option is not specified, a branch resolved via the remote
225 repository's HEAD reference will be fetched.
226 Cannot be used together with the
232 from the remote repository's
235 This option may be specified multiple times to build a list of branches
237 If the branch corresponding to the remote repository's HEAD reference is not
238 in this list, the cloned repository's HEAD reference will be set to the first
239 branch which was fetched.
240 If this option is not specified, a branch resolved via the remote
241 repository's HEAD reference will be fetched.
242 Cannot be used together with the
246 List branches and tags available for fetching from the remote repository
247 and exit immediately.
248 Cannot be used together with any of the other options except
253 Create the cloned repository as a mirror of the original repository.
254 This is useful if the cloned repository will not be used to store
255 locally created commits.
261 files will be set up with the
263 option enabled, such that
267 will write incoming changes directly to branches in the
269 reference namespace, rather than to branches in the
272 This avoids the usual requirement of having to run
276 in order to make incoming changes appear on branches in the
279 But maintaining custom changes in the cloned repository becomes difficult
280 since such changes will be at risk of being discarded whenever incoming
283 Suppress progress reporting output.
284 The same option will be passed to
287 .It Fl R Ar reference
288 In addition to the branches and tags that will be fetched, fetch an arbitrary
290 from the remote repository's
293 This option may be specified multiple times to build a list of additional
297 may either be a path to a specific reference, or a reference namespace
298 which will cause all references in this namespace to be fetched.
300 Each reference will be mapped into the cloned repository's
302 namespace, unless the
304 option is used to mirror references directly into the cloned repository's
309 will refuse to fetch references from the remote repository's
318 to print debugging messages to standard error output.
319 This option will be passed to
322 Multiple -v options increase the verbosity.
330 .Op Fl R Ar reference
331 .Op Fl r Ar repository-path
332 .Op Ar remote-repository
335 Fetch new changes from a remote repository.
337 .Ar remote-repository
341 The remote repository's URL is obtained from the corresponding entry in
345 file of the local repository, as created by
348 By default, any branches configured in
351 .Ar remote-repository
355 is invoked in a work tree then this work tree's current branch will be
356 fetched, too, provided it is present on the server.
357 If no branches to fetch can be found in
359 or via a work tree, or said branches are not found on the server, a branch
360 resolved via the remote repository's HEAD reference will be fetched.
361 Likewise, if a HEAD reference for the
362 .Ar remote-repository
363 exists but its target no longer matches the remote HEAD, then
364 the new target branch will be fetched.
365 This default behaviour can be overridden with the
371 New changes will be stored in a separate pack file downloaded from the server.
372 Optionally, separate pack files stored in the repository can be combined with
375 By default, branch references in the
377 reference namespace will be updated to point at the newly fetched commits.
380 command can then be used to make new changes visible on branches in the
382 namespace, merging incoming changes with the changes on those branches
385 If the repository was created as a mirror with
387 then all branches in the
389 namespace will be updated directly to match the corresponding branches in
390 the remote repository.
391 If those branches contained local commits, these commits will no longer be
392 reachable via a reference and will therefore be at risk of being discarded
393 by Git's garbage collector or
394 .Cm gotadmin cleanup .
395 Maintaining custom changes in a mirror repository is therefore discouraged.
397 In any case, references in the
399 namespace will always be fetched and mapped directly to local references
400 in the same namespace.
407 Fetch all branches from the remote repository's
410 This option can be enabled by default for specific repositories in
412 Cannot be used together with the
418 from the remote repository's
421 This option may be specified multiple times to build a list of branches
423 Cannot be used together with the
427 Delete branches and tags from the local repository which are no longer
428 present in the remote repository.
429 Only references are deleted.
430 Any commit, tree, tag, and blob objects belonging to deleted branches or
431 tags remain in the repository and may be removed separately with
432 Git's garbage collector or
433 .Cm gotadmin cleanup .
435 List branches and tags available for fetching from the remote repository
436 and exit immediately.
437 Cannot be used together with any of the other options except
443 Suppress progress reporting output.
444 The same option will be passed to
447 .It Fl R Ar reference
448 In addition to the branches and tags that will be fetched, fetch an arbitrary
450 from the remote repository's
453 This option may be specified multiple times to build a list of additional
457 may either be a path to a specific reference, or a reference namespace
458 which will cause all references in this namespace to be fetched.
460 Each reference will be mapped into the local repository's
462 namespace, unless the local repository was created as a mirror with
464 in which case references will be mapped directly into the local repository's
468 Once a reference has been fetched, a branch based on it can be created with
473 will refuse to fetch references from the remote repository's
478 .It Fl r Ar repository-path
479 Use the repository at the specified path.
480 If not specified, assume the repository is located at or above the current
482 If this directory is a
484 work tree, use the repository path associated with this work tree.
486 Allow existing references in the
488 namespace to be updated if they have changed on the server.
489 If not specified, only new tag references will be created.
494 to print debugging messages to standard error output.
495 The same option will be passed to
498 Multiple -v options increase the verbosity.
501 Delete all references which correspond to a particular
502 .Ar remote-repository
503 instead of fetching new changes.
504 This can be useful when a remote repository is being removed from
510 .Ar remote-repository
511 argument is mandatory and no other options except
518 Only references are deleted.
519 Any commit, tree, tag, and blob objects fetched from a remote repository
520 will generally be stored in pack files and may be removed separately with
522 and Git's garbage collector.
530 .Op Fl p Ar path-prefix
532 .Op Ar work-tree-path
535 Copy files from a repository into a new work tree.
536 Show the status of each affected file, using the following status codes:
537 .Bl -column YXZ description
538 .It A Ta new file was added
539 .It E Ta file already exists in work tree's meta-data
544 is not specified, either use the last component of
545 .Ar repository path ,
548 was specified use the last component of
556 Check out files from a commit on the specified
558 If this option is not specified, a branch resolved via the repository's HEAD
559 reference will be used.
561 Check out files from the specified
563 on the selected branch.
564 The expected argument is a commit ID SHA1 hash or an existing reference
565 or tag name which will be resolved to a commit ID.
566 An abbreviated hash argument will be expanded to a full SHA1 hash
567 automatically, provided the abbreviation is unique.
568 If this option is not specified, the most recent commit on the selected
573 is not contained in the selected branch, a different branch which contains
574 this commit must be specified with the
577 If no such branch is known, a new branch must be created for this
583 Checking out work trees with an unknown branch is intentionally not supported.
585 Proceed with the checkout operation even if the directory at
588 Existing files will be left intact.
589 .It Fl p Ar path-prefix
590 Restrict the work tree to a subset of the repository's tree hierarchy.
591 Only files beneath the specified
595 Silence progress output.
606 Update an existing work tree to a different
608 Change existing files in the work tree as necessary to match file contents
610 Preserve any local changes in the work tree and merge them with the
613 Files which already contain merge conflicts will not be updated to avoid
614 further complications.
615 Such files will be updated when
617 is run again after merge conflicts have been resolved.
618 If the conflicting changes are no longer needed, affected files can be
625 Show the status of each affected file, using the following status codes:
626 .Bl -column YXZ description
627 .It U Ta file was updated and contained no local changes
628 .It G Ta file was updated and local changes were merged cleanly
629 .It C Ta file was updated and conflicts occurred during merge
630 .It D Ta file was deleted
631 .It d Ta file's deletion was prevented by local modifications
632 .It A Ta new file was added
633 .It \(a~ Ta versioned file is obstructed by a non-regular file
634 .It ! Ta a missing versioned file was restored
635 .It # Ta file was not updated because it contains merge conflicts
636 .It ? Ta changes destined for an unversioned file were not merged
641 is specified, update the entire work tree.
642 Otherwise, restrict the update operation to files at or within the
644 Each path is required to exist in the update operation's target commit.
645 Files in the work tree outside specified paths will remain unchanged and
646 will retain their previously recorded base commit.
649 commands may refuse to run while the work tree contains files from
650 multiple base commits.
651 The base commit of such a work tree can be made consistent by running
653 across the entire work tree.
656 is incompatible with the
661 cannot update paths with staged changes.
662 If changes have been staged with
664 these changes must first be committed with
674 Switch the work tree's branch reference to the specified
676 before updating the work tree.
677 This option requires that all paths in the work tree are updated.
679 As usual, any local changes in the work tree will be preserved.
680 This can be useful when switching to a newly created branch in order
681 to commit existing local changes to this branch.
683 Any local changes must be dealt with separately in order to obtain a
684 work tree with pristine file contents corresponding exactly to the specified
686 Such changes could first be committed to a different branch with
688 or could be discarded with
691 Update the work tree to the specified
693 The expected argument is a commit ID SHA1 hash or an existing reference
694 or tag name which will be resolved to a commit ID.
695 An abbreviated hash argument will be expanded to a full SHA1 hash
696 automatically, provided the abbreviation is unique.
697 If this option is not specified, the most recent commit on the work tree's
700 Silence progress output.
706 .Op Fl S Ar status-codes
707 .Op Fl s Ar status-codes
711 Show the current modification status of files in a work tree,
712 using the following status codes:
713 .Bl -column YXZ description
714 .It M Ta modified file
715 .It A Ta file scheduled for addition in next commit
716 .It D Ta file scheduled for deletion in next commit
717 .It C Ta modified or added file which contains merge conflicts
718 .It ! Ta versioned file was expected on disk but is missing
719 .It \(a~ Ta versioned file is obstructed by a non-regular file
720 .It ? Ta unversioned item not tracked by
722 .It m Ta modified file modes (executable bit only)
723 .It N Ta non-existent
725 specified on the command line
730 is specified, show modifications in the entire work tree.
731 Otherwise, show modifications at or within the specified paths.
733 If changes have been staged with
735 staged changes are shown in the second output column, using the following
737 .Bl -column YXZ description
738 .It M Ta file modification is staged
739 .It A Ta file addition is staged
740 .It D Ta file deletion is staged
743 Changes created on top of staged changes are indicated in the first column:
744 .Bl -column YXZ description
745 .It MM Ta file was modified after earlier changes have been staged
746 .It MA Ta file was modified after having been staged for addition
754 Show unversioned files even if they match an ignore pattern.
755 .It Fl S Ar status-codes
756 Suppress the output of files with a modification status matching any of the
757 single-character status codes contained in the
760 Any combination of codes from the above list of possible status codes
762 For staged files, status codes displayed in either column will be matched.
763 Cannot be used together with the
766 .It Fl s Ar status-codes
767 Only show files with a modification status matching any of the
768 single-character status codes contained in the
771 Any combination of codes from the above list of possible status codes
773 For staged files, status codes displayed in either column will be matched.
774 Cannot be used together with the
779 For compatibility with
790 files in each traversed directory and will not display unversioned files
791 which match these patterns.
792 Ignore patterns which end with a slash,
794 will only match directories.
799 supports consecutive asterisks,
801 which will match an arbitrary amount of directories.
805 only supports a single ignore pattern per line.
809 does not support negated ignore patterns prefixed with
811 and gives no special significance to the location of path component separators,
820 .Op Fl r Ar repository-path
821 .Op Fl S Ar search-pattern
825 Display history of a repository.
828 is specified, show only commits which modified this path.
829 If invoked in a work tree, the
831 is interpreted relative to the current working directory,
832 and the work tree's path prefix is implicitly prepended.
833 Otherwise, the path is interpreted relative to the repository root.
840 Display individual commits which were merged into the current branch
844 shows the linear history of the current branch only.
846 Set the number of context lines shown in diffs with
848 By default, 3 lines of context are shown.
850 Start traversing history at the specified
852 The expected argument is a commit ID SHA1 hash or an existing reference
853 or tag name which will be resolved to a commit ID.
854 An abbreviated hash argument will be expanded to a full SHA1 hash
855 automatically, provided the abbreviation is unique.
856 If this option is not specified, default to the work tree's current branch
857 if invoked in a work tree, or to the repository's HEAD reference.
859 Display diffstat of changes introduced in each commit.
860 Cannot be used with the
864 Limit history traversal to a given number of commits.
865 If this option is not specified, a default limit value of zero is used,
866 which is treated as an unbounded limit.
868 .Ev GOT_LOG_DEFAULT_LIMIT
869 environment variable may be set to change this default value.
871 Display the list of file paths changed in each commit, using the following
873 .Bl -column YXZ description
874 .It M Ta modified file
875 .It D Ta file was deleted
876 .It A Ta new file was added
877 .It m Ta modified file modes (executable bit only)
880 Cannot be used with the
884 Display the patch of modifications made in each commit.
887 is specified, only show the patch of modifications at or within this path.
888 Cannot be used with the
892 Determine a set of commits to display as usual, but display these commits
894 .It Fl r Ar repository-path
895 Use the repository at the specified path.
896 If not specified, assume the repository is located at or above the current
898 If this directory is a
900 work tree, use the repository path associated with this work tree.
901 .It Fl S Ar search-pattern
902 If specified, show only commits with a log message, author name,
903 committer name, or ID SHA1 hash matched by the extended regular
906 Lines in committed patches will be matched if
909 File paths changed by a commit will be matched if
912 Regular expression syntax is documented in
915 Display a short one-line summary of each commit, instead of the default
917 Cannot be used together with the
923 Stop traversing commit history immediately after the specified
926 This option has no effect if the specified
936 .Op Fl r Ar repository-path
937 .Op Ar object1 Ar object2 | Ar path ...
940 When invoked within a work tree without any arguments, display all
941 local changes in the work tree.
944 arguments are specified, only show changes within the specified paths.
946 If two arguments are provided, treat each argument as a reference, a tag
947 name, or an object ID SHA1 hash, and display differences between the
948 corresponding objects.
949 Both objects must be of the same type (blobs, trees, or commits).
950 An abbreviated hash argument will be expanded to a full SHA1 hash
951 automatically, provided the abbreviation is unique.
952 If none of these interpretations produce a valid result or if the
957 is running in a work tree, attempt to interpret the two arguments as paths.
964 Treat file contents as ASCII text even if binary data is detected.
966 Set the number of context lines shown in the diff.
967 By default, 3 lines of context are shown.
969 Show differences between commits in the repository.
970 This option may be used up to two times.
971 When used only once, show differences between the specified
973 and its first parent commit.
974 When used twice, show differences between the two specified commits.
976 The expected argument is a commit ID SHA1 hash or an existing reference
977 or tag name which will be resolved to a commit ID.
978 An abbreviated hash argument will be expanded to a full SHA1 hash
979 automatically, provided the abbreviation is unique.
983 option is used, all non-option arguments will be interpreted as paths.
986 arguments are provided, only show differences for the specified paths.
988 Cannot be used together with the
992 Display diffstat of changes before the actual diff by annotating each file path
993 or blob hash being diffed with the total number of lines added and removed.
994 A summary line will display the total number of changes across all files.
996 Interpret all arguments as paths only.
997 This option can be used to resolve ambiguity in cases where paths
998 look like tag names, reference names, or object IDs.
999 This option is only valid when
1001 is invoked in a work tree.
1002 .It Fl r Ar repository-path
1003 Use the repository at the specified path.
1004 If not specified, assume the repository is located at or above the current
1006 If this directory is a
1008 work tree, use the repository path associated with this work tree.
1010 Show changes staged with
1012 instead of showing local changes in the work tree.
1013 This option is only valid when
1015 is invoked in a work tree.
1017 Ignore whitespace-only changes.
1023 .Op Fl r Ar repository-path
1027 Display line-by-line history of a file at the specified path.
1034 Start traversing history at the specified
1036 The expected argument is a commit ID SHA1 hash or an existing reference
1037 or tag name which will be resolved to a commit ID.
1038 An abbreviated hash argument will be expanded to a full SHA1 hash
1039 automatically, provided the abbreviation is unique.
1040 .It Fl r Ar repository-path
1041 Use the repository at the specified path.
1042 If not specified, assume the repository is located at or above the current
1044 If this directory is a
1046 work tree, use the repository path associated with this work tree.
1053 .Op Fl r Ar repository-path
1057 Display a listing of files and directories at the specified
1058 directory path in the repository.
1059 Entries shown in this listing may carry one of the following trailing
1061 .Bl -column YXZ description
1062 .It @ Ta entry is a symbolic link
1063 .It / Ta entry is a directory
1064 .It * Ta entry is an executable file
1065 .It $ Ta entry is a Git submodule
1068 Symbolic link entries are also annotated with the target path of the link.
1072 is specified, list the repository path corresponding to the current
1073 directory of the work tree, or the root directory of the repository
1074 if there is no work tree.
1081 List files and directories as they appear in the specified
1083 The expected argument is a commit ID SHA1 hash or an existing reference
1084 or tag name which will be resolved to a commit ID.
1085 An abbreviated hash argument will be expanded to a full SHA1 hash
1086 automatically, provided the abbreviation is unique.
1088 Show object IDs of files (blob objects) and directories (tree objects).
1090 Recurse into sub-directories in the repository.
1091 .It Fl r Ar repository-path
1092 Use the repository at the specified path.
1093 If not specified, assume the repository is located at or above the current
1095 If this directory is a
1097 work tree, use the repository path associated with this work tree.
1103 .Op Fl r Ar repository-path
1104 .Op Fl s Ar reference
1107 Manage references in a repository.
1109 References may be listed, created, deleted, and changed.
1110 When creating, deleting, or changing a reference the specified
1112 must be an absolute reference name, i.e. it must begin with
1120 Create a reference or change an existing reference.
1121 The reference with the specified
1123 will point at the specified
1127 argument is a ID SHA1 hash or an existing reference or tag name which will
1128 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
1129 Cannot be used together with any other options except
1132 Delete the reference with the specified
1134 from the repository.
1135 Any commit, tree, tag, and blob objects belonging to deleted references
1136 remain in the repository and may be removed separately with
1137 Git's garbage collector or
1138 .Cm gotadmin cleanup .
1139 Cannot be used together with any other options except
1142 List references in the repository.
1145 is specified, list all existing references in the repository.
1148 is a reference namespace, list all references in this namespace.
1149 Otherwise, show only the reference with the given
1151 Cannot be used together with any other options except
1155 .It Fl r Ar repository-path
1156 Use the repository at the specified path.
1157 If not specified, assume the repository is located at or above the current
1159 If this directory is a
1161 work tree, use the repository path associated with this work tree.
1162 .It Fl s Ar reference
1163 Create a symbolic reference, or change an existing symbolic reference.
1164 The symbolic reference with the specified
1166 will point at the specified
1168 which must already exist in the repository.
1169 Care should be taken not to create loops between references when
1170 this option is used.
1171 Cannot be used together with any other options except
1174 Sort listed references by modification time (most recently modified first)
1175 instead of sorting by lexicographical order.
1176 Use of this option requires the
1178 option to be used as well.
1186 .Op Fl r Ar repository-path
1190 Create, list, or delete branches.
1192 Local branches are managed via references which live in the
1194 reference namespace.
1197 command creates references in this namespace only.
1199 When deleting branches, the specified
1203 reference namespace first.
1204 If no corresponding branch is found, the
1206 namespace will be searched next.
1208 If invoked in a work tree without any arguments, print the name of the
1209 work tree's current branch.
1213 argument is passed, attempt to create a branch reference with the given name.
1214 By default the new branch reference will point at the latest commit on the
1215 work tree's current branch if invoked in a work tree, and otherwise to a commit
1216 resolved via the repository's HEAD reference.
1218 If invoked in a work tree, once the branch was created successfully
1219 switch the work tree's head reference to the newly created branch and
1220 update files across the entire work tree, just like
1221 .Cm got update -b Ar name
1223 Show the status of each affected file, using the following status codes:
1224 .Bl -column YXZ description
1225 .It U Ta file was updated and contained no local changes
1226 .It G Ta file was updated and local changes were merged cleanly
1227 .It C Ta file was updated and conflicts occurred during merge
1228 .It D Ta file was deleted
1229 .It A Ta new file was added
1230 .It \(a~ Ta versioned file is obstructed by a non-regular file
1231 .It ! Ta a missing versioned file was restored
1239 Make a newly created branch reference point at the specified
1243 argument is a commit ID SHA1 hash or an existing reference
1244 or tag name which will be resolved to a commit ID.
1246 Delete the branch with the specified
1252 reference namespace.
1254 Only the branch reference is deleted.
1255 Any commit, tree, and blob objects belonging to the branch
1256 remain in the repository and may be removed separately with
1257 Git's garbage collector or
1258 .Cm gotadmin cleanup .
1260 List all existing branches in the repository, including copies of remote
1261 repositories' branches in the
1263 reference namespace.
1265 If invoked in a work tree, the work tree's current branch is shown
1266 with one the following annotations:
1267 .Bl -column YXZ description
1268 .It * Ta work tree's base commit matches the branch tip
1269 .It \(a~ Ta work tree's base commit is out-of-date
1272 Do not switch and update the work tree after creating a new branch.
1273 .It Fl r Ar repository-path
1274 Use the repository at the specified path.
1275 If not specified, assume the repository is located at or above the current
1277 If this directory is a
1279 work tree, use the repository path associated with this work tree.
1281 Sort listed branches by modification time (most recently modified first)
1282 instead of sorting by lexicographical order.
1285 reference namespace are listed before branches in
1288 Use of this option requires the
1290 option to be used as well.
1297 .Op Fl r Ar repository-path
1298 .Op Fl s Ar signer-id
1301 Manage tags in a repository.
1303 Tags are managed via references which live in the
1305 reference namespace.
1308 command operates on references in this namespace only.
1309 References in this namespace point at tag objects which contain a pointer
1310 to another object, a tag message, as well as author and timestamp information.
1312 Attempt to create a tag with the given
1314 and make this tag point at the given
1316 If no commit is specified, default to the latest commit on the work tree's
1317 current branch if invoked in a work tree, and to a commit resolved via
1318 the repository's HEAD reference otherwise.
1325 Make the newly created tag reference point at the specified
1329 argument is a commit ID SHA1 hash or an existing reference or tag name which
1330 will be resolved to a commit ID.
1331 An abbreviated hash argument will be expanded to a full SHA1 hash
1332 automatically, provided the abbreviation is unique.
1334 List all existing tags in the repository instead of creating a new tag.
1337 argument is passed, show only the tag with the given
1340 Use the specified tag message when creating the new tag.
1345 opens a temporary file in an editor where a tag message can be written.
1346 .It Fl r Ar repository-path
1347 Use the repository at the specified path.
1348 If not specified, assume the repository is located at or above the current
1350 If this directory is a
1352 work tree, use the repository path associated with this work tree.
1353 .It Fl s Ar signer-id
1354 While creating a new tag, sign this tag with the identity given in
1357 For SSH-based signatures,
1359 is the path to a file which may refer to either a private SSH key,
1360 or a public SSH key with the private half available via
1363 will sign the tag object by invoking
1367 command, using the signature namespace
1369 for compatibility with
1372 Verify tag object signatures.
1375 is specified, show and verify the tag object with the provided name.
1376 Otherwise, list all tag objects and verify signatures where present.
1379 verifies SSH-based signatures by invoking
1382 .Fl Y Cm verify Fl f Ar allowed_signers .
1387 otherwise verification is impossible.
1390 During SSH signature creation and verification this option will be passed to
1392 Multiple -v options increase the verbosity.
1398 command will not delete tags or change existing tags.
1399 If a tag must be deleted, the
1401 command may be used to delete a tag's reference.
1402 This should only be done if the tag has not already been copied to
1409 Schedule unversioned files in a work tree for addition to the
1410 repository in the next commit.
1411 By default, files which match a
1413 ignore pattern will not be added.
1417 mentioned in the command line is not an unversioned file then
1420 To avoid unnecessary errors from paths picked up by file globbing patterns
1421 in the shell, paths in the argument list will be silently ignored if they
1424 at all, or if they are reported with one of the following status codes
1425 and do not have changes staged via
1427 .Bl -column YXZ description
1428 .It M Ta modified file
1429 .It A Ta file scheduled for addition in next commit
1430 .It C Ta modified or added file which contains merge conflicts
1431 .It m Ta modified file modes (executable bit only)
1439 Add files even if they match a
1443 Permit recursion into directories.
1444 If this option is not specified,
1446 will refuse to run if a specified
1454 .Op Fl s Ar status-codes
1458 Remove versioned files from a work tree and schedule them for deletion
1459 from the repository in the next commit.
1466 Perform the operation even if a file contains local modifications,
1467 and do not raise an error if a specified
1469 does not exist on disk.
1471 Keep affected files on disk.
1473 Permit recursion into directories.
1474 If this option is not specified,
1476 will refuse to run if a specified
1479 .It Fl s Ar status-codes
1480 Only delete files with a modification status matching one of the
1481 single-character status codes contained in the
1484 The following status codes may be specified:
1485 .Bl -column YXZ description
1486 .It M Ta modified file (this implies the
1489 .It ! Ta versioned file expected on disk but missing
1497 .Op Fl p Ar strip-count
1503 to files in a work tree.
1504 Files added or removed by a patch will be scheduled for addition or removal in
1507 The patch must be in the unified diff format as produced by
1514 diff when invoked with their
1519 argument is provided, read unified diff data from standard input instead.
1523 contains multiple patches, then attempt to apply each of them in sequence.
1525 Show the status of each affected file, using the following status codes:
1526 .Bl -column XYZ description
1527 .It M Ta file was modified
1528 .It G Ta file was merged using a merge-base found in the repository
1529 .It C Ta file was merged and conflicts occurred during merge
1530 .It D Ta file was deleted
1531 .It A Ta file was added
1532 .It # Ta failed to patch the file
1535 If a change does not match at its exact line number, attempt to
1536 apply it somewhere else in the file if a good spot can be found.
1537 Otherwise, the patch will fail to apply.
1541 will refuse to apply a patch if certain preconditions are not met.
1542 Files to be deleted must already be under version control, and must
1543 not have been scheduled for deletion already.
1544 Files to be added must not yet be under version control and must not
1545 already be present on disk.
1546 Files to be modified must already be under version control and may not
1547 contain conflict markers.
1549 If an error occurs, the
1551 operation will be aborted.
1552 Any changes made to the work tree up to this point will be left behind.
1553 Such changes can be viewed with
1555 and can be reverted with
1564 Attempt to locate files within the specified
1566 for use as a merge-base for 3-way merges.
1567 Ideally, the specified
1569 should contain versions of files which the changes contained in the
1572 Files will be located by path, relative to the repository root.
1575 option is used then leading path components will be stripped
1576 before paths are looked up in the repository.
1580 option is not used then
1582 will attempt to locate merge-bases via object IDs found in
1584 meta-data, such as produced by
1590 option is only recommended in the absence of such meta-data.
1592 In case no merge-base is available for a file, changes will be applied
1593 without doing a 3-way merge.
1594 Changes which do not apply cleanly may then be rejected entirely, rather
1595 than producing merge conflicts in the patched target file.
1597 Do not make any modifications to the work tree.
1598 This can be used to check whether a patch would apply without issues.
1601 contains diffs that affect the same file multiple times, the results
1602 displayed may be incorrect.
1603 .It Fl p Ar strip-count
1604 Specify the number of leading path components to strip from paths
1613 path prefixes generated by
1615 will be recognized and stripped automatically.
1617 Reverse the patch before applying it.
1623 .Op Fl F Ar response-script
1627 Revert any local changes in files at the specified paths in a work tree.
1628 File contents will be overwritten with those contained in the
1629 work tree's base commit.
1630 There is no way to bring discarded changes back after
1633 If a file was added with
1635 it will become an unversioned file again.
1636 If a file was deleted with
1638 it will be restored.
1644 .It Fl F Ar response-script
1652 responses line-by-line from the specified
1654 file instead of prompting interactively.
1656 Instead of reverting all changes in files, interactively select or reject
1657 changes to revert based on
1663 (quit reverting this file) responses.
1664 If a file is in modified status, individual patches derived from the
1665 modified file content can be reverted.
1666 Files in added or deleted status may only be reverted in their entirety.
1668 Permit recursion into directories.
1669 If this option is not specified,
1671 will refuse to run if a specified
1685 Create a new commit in the repository from changes in a work tree
1686 and use this commit as the new base commit for the work tree.
1689 is specified, commit all changes in the work tree.
1690 Otherwise, commit changes at or within the specified paths.
1692 If changes have been explicitly staged for commit with
1694 only commit staged changes and reject any specified paths which
1695 have not been staged.
1698 opens a temporary file in an editor where a log message can be written
1706 options are used together.
1708 Show the status of each affected file, using the following status codes:
1709 .Bl -column YXZ description
1710 .It M Ta modified file
1711 .It D Ta file was deleted
1712 .It A Ta new file was added
1713 .It m Ta modified file modes (executable bit only)
1716 Files which are not part of the new commit will retain their previously
1717 recorded base commit.
1720 commands may refuse to run while the work tree contains files from
1721 multiple base commits.
1722 The base commit of such a work tree can be made consistent by running
1724 across the entire work tree.
1728 command requires the
1730 environment variable to be set,
1731 unless an author has been configured in
1737 configuration settings can be
1738 obtained from the repository's
1740 file or from Git's global
1749 Set author information in the newly created commit to
1751 This is useful when committing changes on behalf of someone else.
1754 argument must use the same format as the
1756 environment variable.
1758 In addition to storing author information, the newly created commit
1761 information which is obtained, as usual, from the
1763 environment variable, or
1765 or Git configuration settings.
1767 Allow committing files in conflicted status.
1769 Committing files with conflict markers should generally be avoided.
1770 Cases where conflict markers must be stored in the repository for
1771 some legitimate reason should be very rare.
1772 There are usually ways to avoid storing conflict markers verbatim by
1773 applying appropriate programming tricks.
1775 Use the prepared log message stored in the file found at
1777 when creating the new commit.
1779 opens a temporary file in an editor where the prepared log message can be
1780 reviewed and edited further if needed.
1781 Cannot be used together with the
1785 Use the specified log message when creating the new commit.
1786 Cannot be used together with the
1790 This option prevents
1792 from opening the commit message in an editor.
1793 It has no effect unless it is used together with the
1795 option and is intended for non-interactive use such as scripting.
1797 This option prevents
1799 from generating a diff of the to-be-committed changes in a temporary file
1800 which can be viewed while editing a commit message.
1802 Allow the addition of symbolic links which point outside of the path space
1803 that is under version control.
1806 will reject such symbolic links due to safety concerns.
1809 may decide to represent such a symbolic link as a regular file which contains
1810 the link's target path, rather than creating an actual symbolic link which
1811 points outside of the work tree.
1812 Use of this option is discouraged because external mechanisms such as
1814 are better suited for managing symbolic links to paths not under
1819 will refuse to run if certain preconditions are not met.
1820 If the work tree's current branch is not in the
1822 reference namespace, new commits may not be created on this branch.
1823 Local changes may only be committed if they are based on file content
1824 found in the most recent commit on the work tree's branch.
1825 If a path is found to be out of date,
1827 must be used first in order to merge local changes with changes made
1835 .Op Fl r Ar repository-path
1837 .Op Ar remote-repository
1840 Send new changes to a remote repository.
1842 .Ar remote-repository
1846 The remote repository's URL is obtained from the corresponding entry in
1850 file of the local repository, as created by
1853 All objects corresponding to new changes will be written to a temporary
1854 pack file which is then uploaded to the server.
1855 Upon success, references in the
1857 reference namespace of the local repository will be updated to point at
1858 the commits which have been sent.
1860 By default, changes will only be sent if they are based on up-to-date
1861 copies of relevant branches in the remote repository.
1862 If any changes to be sent are based on out-of-date copies or would
1863 otherwise break linear history of existing branches, new changes must
1864 be fetched from the server with
1866 and local branches must be rebased with
1873 option can be used to make exceptions to these requirements.
1880 Send all branches from the local repository's
1882 reference namespace.
1885 option is equivalent to listing all branches with multiple
1888 Cannot be used together with the
1894 from the local repository's
1896 reference namespace.
1897 This option may be specified multiple times to build a list of branches
1899 If this option is not specified, default to the work tree's current branch
1900 if invoked in a work tree, or to the repository's HEAD reference.
1901 Cannot be used together with the
1905 Delete the specified
1907 from the remote repository's
1909 reference namespace.
1910 This option may be specified multiple times to build a list of branches
1913 Only references are deleted.
1914 Any commit, tree, tag, and blob objects belonging to deleted branches
1915 may become subject to deletion by Git's garbage collector running on
1918 Requesting deletion of branches results in an error if the server
1919 does not support this feature or disallows the deletion of branches
1920 based on its configuration.
1922 Attempt to force the server to overwrite existing branches or tags
1923 in the remote repository, even when
1927 would usually be required before changes can be sent.
1928 The server may reject forced requests regardless, depending on its
1931 Any commit, tree, tag, and blob objects belonging to overwritten branches
1932 or tags may become subject to deletion by Git's garbage collector running
1937 reference namespace is globally shared between all repositories.
1940 option to overwrite tags is discouraged because it can lead to
1941 inconsistencies between the tags present in different repositories.
1942 In general, creating a new tag with a different name is recommended
1943 instead of overwriting an existing tag.
1947 option is particularly discouraged if changes being sent are based
1948 on an out-of-date copy of a branch in the remote repository.
1949 Instead of using the
1951 option, new changes should
1954 and local branches should be rebased with
1956 followed by another attempt to send the changes.
1960 option should only be needed in situations where the remote repository's
1961 copy of a branch or tag is known to be out-of-date and is considered
1963 The risks of creating inconsistencies between different repositories
1964 should also be taken into account.
1966 Suppress progress reporting output.
1967 The same option will be passed to
1970 .It Fl r Ar repository-path
1971 Use the repository at the specified path.
1972 If not specified, assume the repository is located at or above the current
1974 If this directory is a
1976 work tree, use the repository path associated with this work tree.
1978 Attempt to send all tags from the local repository's
1980 reference namespace.
1983 option is equivalent to listing all tags with multiple
1986 Cannot be used together with the
1992 from the local repository's
1994 reference namespace, in addition to any branches that are being sent.
1997 option may be specified multiple times to build a list of tags to send.
1998 No tags will be sent if the
2002 Raise an error if the specified
2004 already exists in the remote repository, unless the
2006 option is used to overwrite the server's copy of the tag.
2007 In general, creating a new tag with a different name is recommended
2008 instead of overwriting an existing tag.
2010 Cannot be used together with the
2017 to print debugging messages to standard error output.
2018 The same option will be passed to
2021 Multiple -v options increase the verbosity.
2031 Merge changes from a single
2036 should be on a different branch than the work tree's base commit.
2037 The expected argument is a reference or a commit ID SHA1 hash.
2038 An abbreviated hash argument will be expanded to a full SHA1 hash
2039 automatically, provided the abbreviation is unique.
2041 Show the status of each affected file, using the following status codes:
2042 .Bl -column YXZ description
2043 .It G Ta file was merged
2044 .It C Ta file was merged and conflicts occurred during merge
2045 .It ! Ta changes destined for a missing file were not merged
2046 .It D Ta file was deleted
2047 .It d Ta file's deletion was prevented by local modifications
2048 .It A Ta new file was added
2049 .It \(a~ Ta changes destined for a non-regular file were not merged
2050 .It ? Ta changes destined for an unversioned file were not merged
2053 The merged changes will appear as local changes in the work tree, which
2056 amended manually or with further
2062 If invoked in a work tree where no
2067 operation is taking place,
2069 creates a record of commits which have been merged into the work tree.
2070 When a file changed by
2074 the log messages of relevant merged commits will then appear in the editor,
2075 where the messages should be further adjusted to convey the reasons for
2076 cherrypicking the changes.
2077 Upon exiting the editor, if the time stamp of the log message file
2078 is unchanged or the log message is empty,
2080 will fail with an unmodified or empty log message error.
2082 If all the changes in all files touched by a given commit are discarded,
2085 this commit's log message record will also disappear.
2088 will refuse to run if certain preconditions are not met.
2089 If the work tree contains multiple base commits, it must first be updated
2090 to a single base commit with
2092 If any relevant files already contain merge conflicts, these
2093 conflicts must be resolved first.
2101 Display a list of commit log messages recorded by cherrypick operations,
2102 represented by references in the
2103 .Dq refs/got/worktree
2104 reference namespace.
2107 is specified, only show the log message of the specified commit.
2109 If invoked in a work tree, only log messages recorded by cherrypick operations
2110 in the current work tree will be displayed.
2111 Otherwise, all commit log messages will be displayed irrespective of the
2112 work tree in which they were created.
2113 This option cannot be used with
2116 Delete log messages created by previous cherrypick operations, represented by
2118 .Dq refs/got/worktree
2119 reference namespace.
2122 is specified, only delete the log message of the specified commit.
2124 If invoked in a work tree, only log messages recorded by cherrypick operations
2125 in the current work tree will be deleted.
2126 Otherwise, all commit log messages will be deleted irrespective of the
2127 work tree in which they were created.
2128 This option cannot be used with
2139 Reverse-merge changes from a single
2144 should be on the same branch as the work tree's base commit.
2145 The expected argument is a reference or a commit ID SHA1 hash.
2146 An abbreviated hash argument will be expanded to a full SHA1 hash
2147 automatically, provided the abbreviation is unique.
2149 Show the status of each affected file, using the following status codes:
2150 .Bl -column YXZ description
2151 .It G Ta file was merged
2152 .It C Ta file was merged and conflicts occurred during merge
2153 .It ! Ta changes destined for a missing file were not merged
2154 .It D Ta file was deleted
2155 .It d Ta file's deletion was prevented by local modifications
2156 .It A Ta new file was added
2157 .It \(a~ Ta changes destined for a non-regular file were not merged
2158 .It ? Ta changes destined for an unversioned file were not merged
2161 The reverse-merged changes will appear as local changes in the work tree,
2162 which may be viewed with
2164 amended manually or with further
2170 If invoked in a work tree where no
2175 operation is taking place,
2177 creates a record of commits which have been reverse-merged into the work tree.
2178 When a file changed by
2182 the log messages of relevant reverse-merged commits will then appear in
2183 the editor, where the messages should be further adjusted to convey the
2184 reasons for backing out the changes.
2185 Upon exiting the editor, if the time stamp of the log message file
2186 is unchanged or the log message is empty,
2188 will fail with an unmodified or empty log message error.
2190 If all the changes in all files touched by a given commit are discarded,
2193 this commit's log message record will also disappear.
2196 will refuse to run if certain preconditions are not met.
2197 If the work tree contains multiple base commits, it must first be updated
2198 to a single base commit with
2200 If any relevant files already contain merge conflicts, these
2201 conflicts must be resolved first.
2209 Display a list of commit log messages recorded by backout operations,
2210 represented by references in the
2211 .Dq refs/got/worktree
2212 reference namespace.
2215 is specified, only show the log message of the specified commit.
2217 If invoked in a work tree, only log messages recorded by backout operations
2218 in the current work tree will be displayed.
2219 Otherwise, all commit log messages will be displayed irrespective of the
2220 work tree in which they were created.
2221 This option cannot be used with
2224 Delete log messages created by previous backout operations, represented by
2226 .Dq refs/got/worktree
2227 reference namespace.
2230 is specified, only delete the log message of the specified commit.
2232 If invoked in a work tree, only log messages recorded by backout operations
2233 in the current work tree will be deleted.
2234 Otherwise, all commit log messages will be deleted irrespective of the
2235 work tree in which they were created.
2236 This option cannot be used with
2247 Rebase commits on the specified
2249 onto the tip of the current branch of the work tree.
2252 must share common ancestry with the work tree's current branch.
2253 Rebasing begins with the first descendant commit of the youngest
2254 common ancestor commit shared by the specified
2256 and the work tree's current branch, and stops once the tip commit
2263 is used as intended, the specified
2265 represents a local commit history and may already contain changes
2266 that are not yet visible in any other repositories.
2267 The work tree's current branch, which must be set with
2271 operation, represents a branch from a remote repository which shares
2272 a common history with the specified
2274 but has progressed, and perhaps diverged, due to commits added to the
2277 Rebased commits are accumulated on a temporary branch which the work tree
2278 will remain switched to throughout the entire rebase operation.
2279 Commits on this branch represent the same changes with the same log
2280 messages as their counterparts on the original
2282 but with different commit IDs.
2283 Once rebasing has completed successfully, the temporary branch becomes
2284 the new version of the specified
2286 and the work tree is automatically switched to it.
2287 If author information is available via the
2289 environment variable,
2295 configuration settings, this author information will be used to identify
2300 Old commits in their pre-rebase state are automatically backed up in the
2301 .Dq refs/got/backup/rebase
2302 reference namespace.
2303 As long as these references are not removed older versions of rebased
2304 commits will remain in the repository and can be viewed with the
2307 Removal of these references makes objects which become unreachable via
2308 any reference subject to removal by Git's garbage collector or
2309 .Cm gotadmin cleanup .
2311 While rebasing commits, show the status of each affected file,
2312 using the following status codes:
2313 .Bl -column YXZ description
2314 .It G Ta file was merged
2315 .It C Ta file was merged and conflicts occurred during merge
2316 .It ! Ta changes destined for a missing file were not merged
2317 .It D Ta file was deleted
2318 .It d Ta file's deletion was prevented by local modifications
2319 .It A Ta new file was added
2320 .It \(a~ Ta changes destined for a non-regular file were not merged
2321 .It ? Ta changes destined for an unversioned file were not merged
2324 If merge conflicts occur, the rebase operation is interrupted and may
2325 be continued once conflicts have been resolved.
2326 If any files with destined changes are found to be missing or unversioned,
2327 or if files could not be deleted due to differences in deleted content,
2328 the rebase operation will be interrupted to prevent potentially incomplete
2329 changes from being committed to the repository without user intervention.
2330 The work tree may be modified as desired and the rebase operation can be
2331 continued once the changes present in the work tree are considered complete.
2332 Alternatively, the rebase operation may be aborted which will leave
2334 unmodified and the work tree switched back to its original branch.
2336 If a merge conflict is resolved in a way which renders the merged
2337 change into a no-op change, the corresponding commit will be elided
2338 when the rebase operation continues.
2341 will refuse to run if certain preconditions are not met.
2346 reference namespace, the branch may not be rebased.
2347 If the work tree is not yet fully updated to the tip commit of its
2348 branch, then the work tree must first be updated with
2350 If changes have been staged with
2352 these changes must first be committed with
2356 If the work tree contains local changes, these changes must first be
2363 contains changes to files outside of the work tree's path prefix,
2364 the work tree cannot be used to rebase this branch.
2373 commands will refuse to run while a rebase operation is in progress.
2374 Other commands which manipulate the work tree may be used for
2375 conflict resolution purposes.
2379 is already based on the work tree's current branch, then no commits
2380 need to be rebased and
2382 will simply switch the work tree to the specified
2384 and update files in the work tree accordingly.
2391 Abort an interrupted rebase operation.
2392 If this option is used, no other command-line arguments are allowed.
2394 Allow a rebase operation to continue with files in conflicted status.
2395 This option should generally be avoided, and can only be used with the
2399 Continue an interrupted rebase operation.
2400 If this option is used, no other command-line arguments are allowed.
2402 Show a list of past rebase operations, represented by references in the
2403 .Dq refs/got/backup/rebase
2404 reference namespace.
2406 Display the author, date, and log message of each backed up commit,
2407 the object ID of the corresponding post-rebase commit, and
2408 the object ID of their common ancestor commit.
2409 Given these object IDs,
2416 options can be used to examine the history of either version of the branch,
2421 option can be used to create a new branch from a pre-rebase state if desired.
2425 is specified, only show commits which at some point in time represented this
2427 Otherwise, list all backed up commits for any branches.
2429 If this option is used,
2431 does not require a work tree.
2432 None of the other options can be used together with
2435 Delete backups created by past rebase operations, represented by references
2437 .Dq refs/got/backup/rebase
2438 reference namespace.
2442 is specified, only delete backups which at some point in time represented
2444 Otherwise, delete all references found within
2445 .Dq refs/got/backup/rebase .
2447 Any commit, tree, tag, and blob objects belonging to deleted backups
2448 remain in the repository and may be removed separately with
2449 Git's garbage collector or
2450 .Cm gotadmin cleanup .
2452 If this option is used,
2454 does not require a work tree.
2455 None of the other options can be used together with
2462 .Op Fl F Ar histedit-script
2466 Edit commit history between the work tree's current base commit and
2467 the tip commit of the work tree's current branch.
2471 command requires the
2473 environment variable to be set,
2474 unless an author has been configured in
2480 configuration settings can be obtained from the repository's
2482 file or from Git's global
2488 operation, the work tree's current branch must be set with
2490 to the branch which should be edited, unless this branch is already the
2491 current branch of the work tree.
2492 The tip of this branch represents the upper bound (inclusive) of commits
2497 Furthermore, the work tree's base commit
2500 to a point in this branch's commit history where editing should begin.
2501 This commit represents the lower bound (non-inclusive) of commits touched
2506 Editing of commit history is controlled via a
2508 which can be written in an editor based on a template, passed on the
2509 command line, or generated with the
2517 The format of the histedit script is line-based.
2518 Each line in the script begins with a command name, followed by
2519 whitespace and an argument.
2520 For most commands, the expected argument is a commit ID SHA1 hash.
2521 Any remaining text on the line is ignored.
2522 Lines which begin with the
2524 character are ignored entirely.
2526 The available histedit script commands are as follows:
2527 .Bl -column YXZ pick-commit
2528 .It Cm pick Ar commit Ta Use the specified commit as it is.
2529 .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
2530 then interrupt the histedit operation for amending, without creating a commit.
2531 While the histedit operation is interrupted arbitrary files may be edited,
2532 and commands which manipulate the work tree can be used freely.
2537 commands can be used to add new files or remove existing ones.
2540 command can be used to eliminate arbitrary changes from files in the work tree.
2543 command may be used to prepare a subset of changes for inclusion in the
2547 command can be used to insert arbitrary commits into the edited history.
2548 Regular editing of history must eventually be resumed by running
2549 .Cm got histedit -c .
2550 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
2551 listed further below that will be used.
2552 .It Cm drop Ar commit Ta Remove this commit from the edited history.
2553 .It Cm mesg Oo Ar log-message Oc Ta Create a new log message for the commit of
2558 command on the previous line of the histedit script.
2561 argument provides a new single-line log message to use.
2564 argument is omitted, open an editor where a new log message can be written.
2567 Every commit in the history being edited must be mentioned in the script.
2568 Lines may be re-ordered to change the order of commits in the edited history.
2569 No commit may be listed more than once.
2571 Edited commits are accumulated on a temporary branch which the work tree
2572 will remain switched to throughout the entire histedit operation.
2573 Once history editing has completed successfully, the temporary branch becomes
2574 the new version of the work tree's branch and the work tree is automatically
2577 Old commits in their pre-histedit state are automatically backed up in the
2578 .Dq refs/got/backup/histedit
2579 reference namespace.
2580 As long as these references are not removed older versions of edited
2581 commits will remain in the repository and can be viewed with the
2584 Removal of these references makes objects which become unreachable via
2585 any reference subject to removal by Git's garbage collector or
2586 .Cm gotadmin cleanup .
2588 While merging commits, show the status of each affected file,
2589 using the following status codes:
2590 .Bl -column YXZ description
2591 .It G Ta file was merged
2592 .It C Ta file was merged and conflicts occurred during merge
2593 .It ! Ta changes destined for a missing file were not merged
2594 .It D Ta file was deleted
2595 .It d Ta file's deletion was prevented by local modifications
2596 .It A Ta new file was added
2597 .It \(a~ Ta changes destined for a non-regular file were not merged
2598 .It ? Ta changes destined for an unversioned file were not merged
2601 If merge conflicts occur, the histedit operation is interrupted and may
2602 be continued once conflicts have been resolved.
2603 If any files with destined changes are found to be missing or unversioned,
2604 or if files could not be deleted due to differences in deleted content,
2605 the histedit operation will be interrupted to prevent potentially incomplete
2606 changes from being committed to the repository without user intervention.
2607 The work tree may be modified as desired and the histedit operation can be
2608 continued once the changes present in the work tree are considered complete.
2609 Alternatively, the histedit operation may be aborted which will leave
2610 the work tree switched back to its original branch.
2612 If a merge conflict is resolved in a way which renders the merged
2613 change into a no-op change, the corresponding commit will be elided
2614 when the histedit operation continues.
2617 will refuse to run if certain preconditions are not met.
2618 If the work tree's current branch is not in the
2620 reference namespace, the history of the branch may not be edited.
2621 If the work tree contains multiple base commits, it must first be updated
2622 to a single base commit with
2624 If changes have been staged with
2626 these changes must first be committed with
2630 If the work tree contains local changes, these changes must first be
2635 If the edited history contains changes to files outside of the work tree's
2636 path prefix, the work tree cannot be used to edit the history of this branch.
2644 commands will refuse to run while a histedit operation is in progress.
2645 Other commands which manipulate the work tree may be used, and the
2647 command may be used to commit arbitrary changes to the temporary branch
2648 while the histedit operation is interrupted.
2655 Abort an interrupted histedit operation.
2656 If this option is used, no other command-line arguments are allowed.
2658 Allow a histedit operation to continue with files in conflicted status.
2659 This option should generally be avoided, and can only be used with the
2663 Continue an interrupted histedit operation.
2664 If this option is used, no other command-line arguments are allowed.
2667 This option is a quick equivalent to a histedit script which drops all
2671 option can only be used when starting a new histedit operation.
2672 If this option is used, no other command-line arguments are allowed.
2674 Interrupt the histedit operation for editing after merging each commit.
2675 This option is a quick equivalent to a histedit script which uses the
2677 command for all commits.
2680 option can only be used when starting a new histedit operation.
2681 If this option is used, no other command-line arguments are allowed.
2682 .It Fl F Ar histedit-script
2685 instead of opening a temporary file in an editor where a histedit script
2688 Fold all commits into a single commit.
2689 This option is a quick equivalent to a histedit script which folds all
2690 commits, combining them all into one commit.
2693 option can only be used when starting a new histedit operation.
2694 If this option is used, no other command-line arguments are allowed.
2696 Show a list of past histedit operations, represented by references in the
2697 .Dq refs/got/backup/histedit
2698 reference namespace.
2700 Display the author, date, and log message of each backed up commit,
2701 the object ID of the corresponding post-histedit commit, and
2702 the object ID of their common ancestor commit.
2703 Given these object IDs,
2710 options can be used to examine the history of either version of the branch,
2715 option can be used to create a new branch from a pre-histedit state if desired.
2719 is specified, only show commits which at some point in time represented this
2721 Otherwise, list all backed up commits for any branches.
2723 If this option is used,
2725 does not require a work tree.
2726 None of the other options can be used together with
2729 Edit log messages only.
2730 This option is a quick equivalent to a histedit script which edits
2731 only log messages but otherwise leaves every picked commit as-is.
2734 option can only be used when starting a new histedit operation.
2735 If this option is used, no other command-line arguments are allowed.
2737 Delete backups created by past histedit operations, represented by references
2739 .Dq refs/got/backup/histedit
2740 reference namespace.
2744 is specified, only delete backups which at some point in time represented
2746 Otherwise, delete all references found within
2747 .Dq refs/got/backup/histedit .
2749 Any commit, tree, tag, and blob objects belonging to deleted backups
2750 remain in the repository and may be removed separately with
2751 Git's garbage collector or
2752 .Cm gotadmin cleanup .
2754 If this option is used,
2756 does not require a work tree.
2757 None of the other options can be used together with
2761 .It Cm integrate Ar branch
2763 Integrate the specified
2765 into the work tree's current branch.
2766 Files in the work tree are updated to match the contents on the integrated
2768 and the reference of the work tree's branch is changed to point at the
2769 head commit of the integrated
2772 Both branches can be considered equivalent after integration since they
2773 will be pointing at the same commit.
2774 Both branches remain available for future work, if desired.
2775 In case the integrated
2777 is no longer needed it may be deleted with
2780 Show the status of each affected file, using the following status codes:
2781 .Bl -column YXZ description
2782 .It U Ta file was updated
2783 .It D Ta file was deleted
2784 .It A Ta new file was added
2785 .It \(a~ Ta versioned file is obstructed by a non-regular file
2786 .It ! Ta a missing versioned file was restored
2790 will refuse to run if certain preconditions are not met.
2791 Most importantly, the
2793 must have been rebased onto the work tree's current branch with
2795 before it can be integrated, in order to linearize commit history and
2796 resolve merge conflicts.
2797 If the work tree contains multiple base commits, it must first be updated
2798 to a single base commit with
2800 If changes have been staged with
2802 these changes must first be committed with
2806 If the work tree contains local changes, these changes must first be
2820 into the current branch of the work tree.
2821 If the branches have diverged, creates a merge commit.
2824 already includes all commits from the work tree's branch, updates the work
2825 tree's branch to be the same as
2827 without creating a commit, and updates the work tree to the most recent commit
2830 If a linear project history is desired, then use of
2832 should be preferred over
2834 However, even strictly linear projects may require merge commits in order
2835 to merge in new versions of third-party code stored on vendor branches
2839 Merge commits are commits based on multiple parent commits.
2840 The tip commit of the work tree's current branch, which must be in the
2842 reference namespace and must be set with
2846 operation, will be used as the first parent.
2847 The tip commit of the specified
2849 will be used as the second parent.
2851 No ancestral relationship between the two branches is required.
2852 If the two branches have already been merged previously, only new changes
2855 It is not possible to create merge commits with more than two parents.
2856 If more than one branch needs to be merged, then multiple merge commits
2857 with two parents each can be created in sequence.
2859 While merging changes found on the
2861 into the work tree, show the status of each affected file,
2862 using the following status codes:
2863 .Bl -column YXZ description
2864 .It G Ta file was merged
2865 .It C Ta file was merged and conflicts occurred during merge
2866 .It ! Ta changes destined for a missing file were not merged
2867 .It D Ta file was deleted
2868 .It d Ta file's deletion was prevented by local modifications
2869 .It A Ta new file was added
2870 .It \(a~ Ta changes destined for a non-regular file were not merged
2871 .It ? Ta changes destined for an unversioned file were not merged
2874 If merge conflicts occur, the merge operation is interrupted and conflicts
2875 must be resolved before the merge operation can continue.
2876 If any files with destined changes are found to be missing or unversioned,
2877 or if files could not be deleted due to differences in deleted content,
2878 the merge operation will be interrupted to prevent potentially incomplete
2879 changes from being committed to the repository without user intervention.
2880 The work tree may be modified as desired and the merge can be continued
2881 once the changes present in the work tree are considered complete.
2882 Alternatively, the merge operation may be aborted which will leave
2883 the work tree's current branch unmodified.
2886 will refuse to run if certain preconditions are not met.
2887 If the work tree's current branch is not in the
2889 reference namespace then the work tree must first be switched to a
2894 If the work tree is not yet fully updated to the tip commit of its
2895 branch, then the work tree must first be updated with
2897 If the work tree contains multiple base commits, it must first be updated
2898 to a single base commit with
2900 If changes have been staged with
2902 these changes must first be committed with
2906 If the work tree contains local changes, these changes must first be
2913 contains changes to files outside of the work tree's path prefix,
2914 the work tree cannot be used to merge this branch.
2924 commands will refuse to run while a merge operation is in progress.
2925 Other commands which manipulate the work tree may be used for
2926 conflict resolution purposes.
2933 Abort an interrupted merge operation.
2934 If this option is used, no other command-line arguments are allowed.
2936 Allow a merge operation to continue with files in conflicted status.
2937 This option should generally be avoided, and can only be used with the
2941 Continue an interrupted merge operation.
2942 If this option is used, no other command-line arguments are allowed.
2944 Merge changes into the work tree as usual but do not create a merge
2946 The merge result can be adjusted as desired before a merge commit is
2949 Alternatively, the merge may be aborted with
2956 .Op Fl F Ar response-script
2960 Stage local changes for inclusion in the next commit.
2963 is specified, stage all changes in the work tree.
2964 Otherwise, stage changes at or within the specified paths.
2965 Paths may be staged if they are added, modified, or deleted according to
2968 Show the status of each affected file, using the following status codes:
2969 .Bl -column YXZ description
2970 .It A Ta file addition has been staged
2971 .It M Ta file modification has been staged
2972 .It D Ta file deletion has been staged
2975 Staged file contents are saved in newly created blob objects in the repository.
2976 These blobs will be referred to by tree objects once staged changes have been
2979 Staged changes affect the behaviour of
2984 While paths with staged changes exist, the
2986 command will refuse to commit any paths which do not have staged changes.
2987 Local changes created on top of staged changes can only be committed if
2988 the path is staged again, or if the staged changes are committed first.
2991 command will show both local changes and staged changes.
2994 command is able to display local changes relative to staged changes,
2995 and to display staged changes relative to the repository.
2998 command cannot revert staged changes but may be used to revert
2999 local changes created on top of staged changes.
3005 .It Fl F Ar response-script
3013 responses line-by-line from the specified
3015 file instead of prompting interactively.
3017 Instead of staging new changes, list paths which are already staged,
3018 along with the IDs of staged blob objects and stage status codes.
3019 If paths were provided on the command line, show the staged paths
3020 among the specified paths.
3021 Otherwise, show all staged paths.
3023 Instead of staging the entire content of a changed file, interactively
3024 select or reject changes for staging based on
3028 (reject change), and
3030 (quit staging this file) responses.
3031 If a file is in modified status, individual patches derived from the
3032 modified file content can be staged.
3033 Files in added or deleted status may only be staged or rejected in
3036 Allow staging of symbolic links which point outside of the path space
3037 that is under version control.
3040 will reject such symbolic links due to safety concerns.
3043 may decide to represent such a symbolic link as a regular file which contains
3044 the link's target path, rather than creating an actual symbolic link which
3045 points outside of the work tree.
3046 Use of this option is discouraged because external mechanisms such as
3048 are better suited for managing symbolic links to paths not under
3053 will refuse to run if certain preconditions are not met.
3054 If a file contains merge conflicts, these conflicts must be resolved first.
3055 If a file is found to be out of date relative to the head commit on the
3056 work tree's current branch, the file must be updated with
3058 before it can be staged (however, this does not prevent the file from
3059 becoming out-of-date at some point after having been staged).
3066 commands will refuse to run while staged changes exist.
3067 If staged changes cannot be committed because a staged path
3068 is out of date, the path must be unstaged with
3070 before it can be updated with
3072 and may then be staged again if necessary.
3077 .Op Fl F Ar response-script
3081 Merge staged changes back into the work tree and put affected paths
3082 back into non-staged status.
3085 is specified, unstage all staged changes across the entire work tree.
3086 Otherwise, unstage changes at or within the specified paths.
3088 Show the status of each affected file, using the following status codes:
3089 .Bl -column YXZ description
3090 .It G Ta file was unstaged
3091 .It C Ta file was unstaged and conflicts occurred during merge
3092 .It ! Ta changes destined for a missing file were not merged
3093 .It D Ta file was staged as deleted and still is deleted
3094 .It d Ta file's deletion was prevented by local modifications
3095 .It \(a~ Ta changes destined for a non-regular file were not merged
3102 .It Fl F Ar response-script
3110 responses line-by-line from the specified
3112 file instead of prompting interactively.
3114 Instead of unstaging the entire content of a changed file, interactively
3115 select or reject changes for unstaging based on
3119 (keep change staged), and
3121 (quit unstaging this file) responses.
3122 If a file is staged in modified status, individual patches derived from the
3123 staged file content can be unstaged.
3124 Files staged in added or deleted status may only be unstaged in their entirety.
3130 .Op Fl r Ar repository-path
3133 Parse and print contents of objects to standard output in a line-based
3135 Content of commit, tree, and tag objects is printed in a way similar
3136 to the actual content stored in such objects.
3137 Blob object contents are printed as they would appear in files on disk.
3139 Attempt to interpret each argument as a reference, a tag name, or
3140 an object ID SHA1 hash.
3141 References will be resolved to an object ID.
3142 Tag names will resolved to a tag object.
3143 An abbreviated hash argument will be expanded to a full SHA1 hash
3144 automatically, provided the abbreviation is unique.
3146 If none of the above interpretations produce a valid result, or if the
3148 option is used, attempt to interpret the argument as a path which will
3149 be resolved to the ID of an object found at this path in the repository.
3156 Look up paths in the specified
3158 If this option is not used, paths are looked up in the commit resolved
3159 via the repository's HEAD reference.
3160 The expected argument is a commit ID SHA1 hash or an existing reference
3161 or tag name which will be resolved to a commit ID.
3162 An abbreviated hash argument will be expanded to a full SHA1 hash
3163 automatically, provided the abbreviation is unique.
3165 Interpret all arguments as paths only.
3166 This option can be used to resolve ambiguity in cases where paths
3167 look like tag names, reference names, or object IDs.
3168 .It Fl r Ar repository-path
3169 Use the repository at the specified path.
3170 If not specified, assume the repository is located at or above the current
3172 If this directory is a
3174 work tree, use the repository path associated with this work tree.
3176 .It Cm info Op Ar path ...
3177 Display meta-data stored in a work tree.
3182 The work tree to use is resolved implicitly by walking upwards from the
3183 current working directory.
3187 arguments are specified, show additional per-file information for tracked
3188 files located at or within these paths.
3191 argument corresponds to the work tree's root directory, display information
3192 for all tracked files.
3195 .Bl -tag -width GOT_IGNORE_GITCONFIG
3197 The author's name and email address, such as
3198 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3208 may fail to parse commits without an email address in author data,
3212 environment variables with a missing email address.
3214 .Ev GOT_AUTHOR will be overridden by configuration settings in
3220 configuration settings in the repository's
3227 configuration settings contained in Git's global
3229 configuration file will only be used if neither
3233 environment variable provide author information.
3234 .It Ev GOT_IGNORE_GITCONFIG
3235 If this variable is set then any remote repository definitions or author
3236 information found in Git configuration files will be ignored.
3237 .It Ev GOT_LOG_DEFAULT_LIMIT
3238 The default limit on the number of commits traversed by
3240 If set to zero, the limit is unbounded.
3241 This variable will be silently ignored if it is set to a non-numeric value.
3242 .It Ev VISUAL , EDITOR
3243 The editor spawned by
3251 text editor will be spawned.
3254 .Bl -tag -width packed-refs -compact
3256 Repository-wide configuration settings for
3260 configuration file located in the root directory of a Git repository
3261 supersedes any relevant settings in Git's
3265 .It Pa .got/got.conf
3266 Worktree-specific configuration settings for
3270 configuration file in the
3272 meta-data directory of a work tree supersedes any relevant settings in
3275 configuration file and Git's
3282 Enable tab-completion of
3287 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3289 Clone an existing Git repository for use with
3293 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3295 Unfortunately, many of the popular Git hosting sites do not offer anonymous
3297 Such sites will require an account to be created, and a public SSH key to be
3298 uploaded to this account, before repository access via ssh:// URLs will work.
3300 Use of HTTP URLs currently requires
3304 .Dl $ git clone --bare https://github.com/openbsd/src.git
3306 Alternatively, for quick and dirty local testing of
3308 a new Git repository could be created and populated with files,
3309 e.g. from a temporary CVS checkout located at
3312 .Dl $ gotadmin init /var/git/src.git
3313 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3315 Check out a work tree from the Git repository to /usr/src:
3317 .Dl $ got checkout /var/git/src.git /usr/src
3319 View local changes in a work tree directory:
3321 .Dl $ got diff | less
3323 In a work tree, display files in a potentially problematic state:
3325 .Dl $ got status -s 'C!~?'
3327 Interactively revert selected local changes in a work tree directory:
3329 .Dl $ got revert -p -R\ .
3331 In a work tree or a git repository directory, list all branch references:
3335 As above, but list the most recently modified branches only:
3337 .Dl $ got branch -lt | head
3339 In a work tree or a git repository directory, create a new branch called
3340 .Dq unified-buffer-cache
3341 which is forked off the
3345 .Dl $ got branch -c master unified-buffer-cache
3347 Switch an existing work tree to the branch
3348 .Dq unified-buffer-cache .
3349 Local changes in the work tree will be preserved and merged if necessary:
3351 .Dl $ got update -b unified-buffer-cache
3353 Create a new commit from local changes in a work tree directory.
3354 This new commit will become the head commit of the work tree's current branch:
3358 In a work tree or a git repository directory, view changes committed in
3359 the 3 most recent commits to the work tree's branch, or the branch resolved
3360 via the repository's HEAD reference, respectively:
3362 .Dl $ got log -p -l 3
3364 As above, but display changes in the order in which
3366 could apply them in sequence:
3368 .Dl $ got log -p -l 3 -R
3370 In a work tree or a git repository directory, log the history of a subdirectory:
3372 .Dl $ got log sys/uvm
3374 While operating inside a work tree, paths are specified relative to the current
3375 working directory, so this command will log the subdirectory
3378 .Dl $ cd sys/uvm && got log\ .
3380 And this command has the same effect:
3382 .Dl $ cd sys/dev/usb && got log ../../uvm
3384 And this command displays work tree meta-data about all tracked files:
3387 .Dl $ got info\ . | less
3389 Add new files and remove obsolete files in a work tree directory:
3391 .Dl $ got add sys/uvm/uvm_ubc.c
3392 .Dl $ got remove sys/uvm/uvm_vnode.c
3394 Create a new commit from local changes in a work tree directory
3395 with a pre-defined log message.
3397 .Dl $ got commit -m 'unify the buffer cache'
3399 Alternatively, create a new commit from local changes in a work tree
3400 directory with a log message that has been prepared in the file
3403 .Dl $ got commit -F /tmp/msg
3405 Update any work tree checked out from the
3406 .Dq unified-buffer-cache
3407 branch to the latest commit on this branch:
3411 Roll file content on the unified-buffer-cache branch back by one commit,
3412 and then fetch the rolled-back change into the work tree as a local change
3413 to be amended and perhaps committed again:
3415 .Dl $ got backout unified-buffer-cache
3416 .Dl $ got commit -m 'roll back previous'
3417 .Dl $ # now back out the previous backout :-)
3418 .Dl $ got backout unified-buffer-cache
3420 Fetch new changes on the remote repository's
3422 branch, making them visible on the local repository's
3429 In a repository created with a HTTP URL and
3430 .Cm git clone --bare
3433 command must be used instead:
3435 .Dl $ cd /var/git/src.git
3436 .Dl $ git fetch origin master:refs/remotes/origin/master
3440 branch to merge the new changes that are now visible on the
3445 .Dl $ got update -b origin/master
3446 .Dl $ got rebase master
3449 .Dq unified-buffer-cache
3450 branch on top of the new head commit of the
3454 .Dl $ got update -b master
3455 .Dl $ got rebase unified-buffer-cache
3457 Create a patch from all changes on the unified-buffer-cache branch.
3458 The patch can be mailed out for review and applied to
3462 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
3464 Edit the entire commit history of the
3465 .Dq unified-buffer-cache
3468 .Dl $ got update -b unified-buffer-cache
3469 .Dl $ got update -c master
3472 Before working against existing branches in a repository cloned with
3473 .Cm git clone --bare
3478 must be configured to map all references in the remote repository
3481 namespace of the local repository.
3482 This can be achieved by setting Git's
3483 .Pa remote.origin.fetch
3484 configuration variable to the value
3485 .Dq +refs/heads/*:refs/remotes/origin/*
3490 .Dl $ cd /var/git/repo
3491 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
3495 option must be disabled:
3497 .Dl $ cd /var/git/repo
3498 .Dl $ git config remote.origin.mirror false
3500 Alternatively, the following
3502 configuration item can be added manually to the Git repository's
3506 .Dl [remote \&"origin\&"]
3508 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
3511 This configuration leaves the local repository's
3513 namespace free for use by local branches checked out with
3515 and, if needed, created with
3518 .Dq refs/remotes/origin
3519 namespace can now be updated with incoming changes from the remote
3524 without extra command line arguments.
3525 Newly fetched changes can be examined with
3528 Display changes on the remote repository's version of the
3530 branch, as of the last time
3534 .Dl $ got log -c origin/master | less
3536 As shown here, most commands accept abbreviated reference names such as
3539 .Dq refs/remotes/origin/master .
3540 The latter is only needed in case of ambiguity.
3543 can be used to merge changes which are visible on the
3548 This will also merge local changes, if any, with the incoming changes:
3550 .Dl $ got update -b origin/master
3551 .Dl $ got rebase master
3553 In order to make changes committed to the
3554 .Dq unified-buffer-cache
3558 .Dq unified-buffer-cache
3559 branch can be rebased onto the
3563 .Dl $ got update -b master
3564 .Dl $ got rebase unified-buffer-cache
3567 .Dq unified-buffer-cache
3568 branch can now be made visible on the
3572 Because the rebase operation switched the work tree to the
3573 .Dq unified-buffer-cache
3574 branch, the work tree must be switched back to the
3578 .Dl $ got update -b master
3579 .Dl $ got integrate unified-buffer-cache
3583 branch, log messages for local changes can now be amended with
3585 by other developers and any other important new information:
3587 .Dl $ got update -c origin/master
3588 .Dl $ got histedit -m
3590 If the remote repository offers write access, local changes on the
3592 branch can be sent to the remote repository with
3596 can be run without further arguments.
3597 The arguments shown here match defaults, provided the work tree's
3598 current branch is the
3602 .Dl $ got send -b master origin
3604 If the remote repository requires the HTTPS protocol, the
3606 command must be used instead:
3608 .Dl $ cd /var/git/src.git
3609 .Dl $ git push origin master
3611 When making contributions to projects which use the
3613 workflow, SSH protocol repository access needs to be set up first.
3614 Once an account has been created on a Git hosting site it should
3615 be possible to upload a public SSH key for repository access
3620 workflow will usually involve two remote repositories.
3621 In the real-life example below, the
3623 repository was forked from the
3625 repository by using the Git hosting site's web interface.
3628 file in the local repository describes both remote repositories:
3629 .Bd -literal -offset indent
3630 # Jelmers's repository, which accepts pull requests
3632 server git@github.com
3634 repository "/jelmer/dulwich"
3638 # Stefan's fork, used as the default remote repository
3640 server git@github.com
3642 repository "/stspdotname/dulwich"
3647 With this configuration, Stefan can create commits on
3648 .Dq refs/heads/master
3649 and send them to the
3651 repository by running:
3653 .Dl $ got send -b master origin
3655 The changes can now be proposed to Jelmer by opening a pull request
3656 via the Git hosting site's web interface.
3657 If Jelmer requests further changes to be made, additional commits
3658 can be created on the
3660 branch and be added to the pull request by running
3664 If Jelmer prefers additional commits to be
3666 then the following commands can be used to achieve this:
3668 .Dl $ got update -b master
3669 .Dl $ got update -c origin/master
3670 .Dl $ got histedit -f
3671 .Dl $ got send -f -b master origin
3673 In addition to reviewing the pull request in the web user interface,
3674 Jelmer can fetch the pull request's branch into his local repository
3675 and create a local branch which contains the proposed changes:
3677 .Dl $ got fetch -R refs/pull/1046/head origin
3678 .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
3680 Once Jelmer has accepted the pull request, Stefan can fetch the
3681 merged changes, and possibly several other new changes, by running:
3683 .Dl $ got fetch upstream
3685 The merged changes will now be visible under the reference
3686 .Dq refs/remotes/upstream/master .
3689 branch can now be rebased on top of the latest changes
3692 .Dl $ got update -b upstream/master
3693 .Dl $ got rebase master
3695 As an alternative to
3697 branches can be merged with
3700 .Dl $ got update -b master
3701 .Dl $ got merge upstream/master
3703 The question of whether to rebase or merge branches is philosophical.
3704 When in doubt, refer to the software project's policies set by project
3707 As a final step, the forked repository's copy of the master branch needs
3708 to be kept in sync by sending the new changes there:
3710 .Dl $ got send -f -b master origin
3712 If multiple pull requests need to be managed in parallel, a separate branch
3713 must be created for each pull request with
3715 Each such branch can then be used as above, in place of
3716 .Dq refs/heads/master .
3717 Changes for any accepted pull requests will still appear under
3718 .Dq refs/remotes/upstream/master,
3719 regardless of which branch was used in the forked repository to
3720 create a pull request.
3724 .Xr git-repository 5 ,
3725 .Xr got-worktree 5 ,
3729 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
3730 .An Christian Weisgerber Aq Mt naddy@openbsd.org
3731 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
3732 .An Josh Rickmar Aq Mt jrick@zettaport.com
3733 .An Joshua Stein Aq Mt jcs@openbsd.org
3734 .An Klemens Nanni Aq Mt kn@openbsd.org
3735 .An Martin Pieuchot Aq Mt mpi@openbsd.org
3736 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
3737 .An Omar Polo Aq Mt op@openbsd.org
3738 .An Ori Bernstein Aq Mt ori@openbsd.org
3739 .An Sebastien Marie Aq Mt semarie@openbsd.org
3740 .An Stefan Sperling Aq Mt stsp@openbsd.org
3741 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
3742 .An Theo Buehler Aq Mt tb@openbsd.org
3743 .An Thomas Adam Aq Mt thomas@xteddy.org
3744 .An Tracey Emery Aq Mt tracey@traceyemery.net
3745 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
3752 were derived from code under copyright by:
3754 .An Caldera International
3755 .An Daniel Hartmeier
3760 .An Jean-Francois Brousseau
3766 .An Niklas Hallqvist
3771 .An Xavier Santolaria
3774 contains code contributed to the public domain by
3775 .An Austin Appleby .
3778 is a work-in-progress and some features remain to be implemented.
3780 At present, the user has to fall back on
3782 to perform some tasks.
3786 Reading from remote repositories over HTTP or HTTPS protocols requires
3791 Writing to remote repositories over HTTP or HTTPS protocols requires
3794 The creation of merge commits with more than two parent commits requires
3797 In situations where files or directories were moved around
3799 will not automatically merge changes to new locations and
3801 will usually produce better results.