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.
22 .Nd CVS-like Git client
30 is a Git-compatible version control system with a user interface
35 supports local and remote Git repositories.
36 The Git repository format is described in
37 .Xr git-repository 5 .
41 must be checked out from the repository for modification.
42 Checked out files are stored in a
44 which can be placed at an arbitrary directory in the filesystem hierarchy.
45 The on-disk format of this work tree is described in
49 provides global and command-specific options.
50 Global options must precede the command name, and are as follows:
51 .Bl -tag -width tenletters
53 Display usage information and exit immediately.
55 Display program version and exit immediately.
61 .Bl -tag -width checkout
68 .Op Fl r Ar repository-path
72 Create an initial commit in a repository from the file hierarchy
75 The created commit will not have any parent commits, i.e. it will be a
77 Also create a new reference which provides a branch name for the newly
79 Show the path of each imported file to indicate progress.
85 environment variable to be set,
86 unless an author has been configured in
92 configuration settings can be obtained from the repository's
94 file or from Git's global
105 If this option is not specified, a branch corresponding to the repository's
106 HEAD reference will be used.
107 Use of this option is required if the branch resolved via the repository's
108 HEAD reference already exists.
110 Ignore files or directories with a name which matches the specified
112 This option may be specified multiple times to build a list of ignore patterns.
115 follows the globbing rules documented in
117 Ignore patterns which end with a slash,
119 will only match directories.
121 Use the specified log message when creating the new commit.
126 opens a temporary file in an editor where a log message can be written.
127 .It Fl r Ar repository-path
128 Use the repository at the specified path.
129 If not specified, assume the repository is located at or above the current
137 .Op Fl R Ar reference
142 Clone a Git repository at the specified
148 is specified, the directory name will be derived from the name of the
151 will refuse to run if the
157 specifies a protocol scheme, a server hostname, an optional port number
158 separated from the hostname by a colon, and a path to the repository on
160 .Lk scheme://hostname:port/path/to/repository
162 The following protocol schemes are supported:
163 .Bl -tag -width git+ssh
165 The Git protocol as implemented by the
168 Use of this protocol is discouraged since it supports neither authentication
171 The Git protocol wrapped in an authenticated and encrypted
174 With this protocol the hostname may contain an embedded username for
179 Short alias for git+ssh.
182 Objects in the cloned repository are stored in a pack file which is downloaded
184 This pack file will then be indexed to facilitate access to the objects stored
186 If any objects in the pack file are stored in deltified form, all deltas will
187 be fully resolved in order to compute the ID of such objects.
188 This can take some time.
189 More details about the pack file format are documented in
190 .Xr git-repository 5 .
193 creates a remote repository entry in the
197 files of the cloned repository to store the
203 arguments for future use by
213 Fetch all branches from the remote repository's
215 reference namespace and set
216 .Cm fetch_all_branches
217 in the cloned repository's
219 file for future use by
221 If this option is not specified, a branch resolved via the remote
222 repository's HEAD reference will be fetched.
223 Cannot be used together with the
229 from the remote repository's
232 This option may be specified multiple times to build a list of branches
234 If the branch corresponding to the remote repository's HEAD reference is not
235 in this list, the cloned repository's HEAD reference will be set to the first
236 branch which was fetched.
237 If this option is not specified, a branch resolved via the remote
238 repository's HEAD reference will be fetched.
239 Cannot be used together with the
243 List branches and tags available for fetching from the remote repository
244 and exit immediately.
245 Cannot be used together with any of the other options except
250 Create the cloned repository as a mirror of the original repository.
251 This is useful if the cloned repository will not be used to store
252 locally created commits.
258 files will be set up with the
260 option enabled, such that
264 will write incoming changes directly to branches in the
266 reference namespace, rather than to branches in the
269 This avoids the usual requirement of having to run
275 in order to make incoming changes appear on branches in the
278 But maintaining custom changes in the cloned repository becomes difficult
279 since such changes will be at risk of being discarded whenever incoming
282 Suppress progress reporting output.
283 The same option will be passed to
286 .It Fl R Ar reference
287 In addition to the branches and tags that will be fetched, fetch an arbitrary
289 from the remote repository's
292 This option may be specified multiple times to build a list of additional
296 may either be a path to a specific reference, or a reference namespace
297 which will cause all references in this namespace to be fetched.
299 Each reference will be mapped into the cloned repository's
301 namespace, unless the
303 option is used to mirror references directly into the cloned repository's
308 will refuse to fetch references from the remote repository's
317 to print debugging messages to standard error output.
318 This option will be passed to
321 Multiple -v options increase the verbosity.
329 .Op Fl R Ar reference
330 .Op Fl r Ar repository-path
331 .Op Ar remote-repository
334 Fetch new changes from a remote repository.
336 .Ar remote-repository
340 The remote repository's URL is obtained from the corresponding entry in
344 file of the local repository, as created by
347 By default, any branches configured in
350 .Ar remote-repository
354 is invoked in a work tree then this work tree's current branch will be
355 fetched, too, provided it is present on the server.
356 If no branches to fetch can be found in
358 or via a work tree, or said branches are not found on the server, a branch
359 resolved via the remote repository's HEAD reference will be fetched.
360 Likewise, if a HEAD reference for the
361 .Ar remote-repository
362 exists but its target no longer matches the remote HEAD, then
363 the new target branch will be fetched.
364 This default behaviour can be overridden with the
370 New changes will be stored in a separate pack file downloaded from the server.
371 Optionally, separate pack files stored in the repository can be combined with
374 By default, branch references in the
376 reference namespace will be updated to point at the newly fetched commits.
381 command can then be used to make new changes visible on branches in the
383 namespace, merging incoming changes with the changes on those branches
386 If the repository was created as a mirror with
388 then all branches in the
390 namespace will be updated directly to match the corresponding branches in
391 the remote repository.
392 If those branches contained local commits, these commits will no longer be
393 reachable via a reference and will therefore be at risk of being discarded
394 by Git's garbage collector or
395 .Cm gotadmin cleanup .
396 Maintaining custom changes in a mirror repository is therefore discouraged.
398 In any case, references in the
400 namespace will always be fetched and mapped directly to local references
401 in the same namespace.
408 Fetch all branches from the remote repository's
411 This option can be enabled by default for specific repositories in
413 Cannot be used together with the
419 from the remote repository's
422 This option may be specified multiple times to build a list of branches
424 Cannot be used together with the
428 Delete branches and tags from the local repository which are no longer
429 present in the remote repository.
430 Only references are deleted.
431 Any commit, tree, tag, and blob objects belonging to deleted branches or
432 tags remain in the repository and may be removed separately with
433 Git's garbage collector or
434 .Cm gotadmin cleanup .
436 List branches and tags available for fetching from the remote repository
437 and exit immediately.
438 Cannot be used together with any of the other options except
444 Suppress progress reporting output.
445 The same option will be passed to
448 .It Fl R Ar reference
449 In addition to the branches and tags that will be fetched, fetch an arbitrary
451 from the remote repository's
454 This option may be specified multiple times to build a list of additional
458 may either be a path to a specific reference, or a reference namespace
459 which will cause all references in this namespace to be fetched.
461 Each reference will be mapped into the local repository's
463 namespace, unless the local repository was created as a mirror with
465 in which case references will be mapped directly into the local repository's
469 Once a reference has been fetched, a branch based on it can be created with
474 will refuse to fetch references from the remote repository's
479 .It Fl r Ar repository-path
480 Use the repository at the specified path.
481 If not specified, assume the repository is located at or above the current
483 If this directory is a
485 work tree, use the repository path associated with this work tree.
487 Allow existing references in the
489 namespace to be updated if they have changed on the server.
490 If not specified, only new tag references will be created.
495 to print debugging messages to standard error output.
496 The same option will be passed to
499 Multiple -v options increase the verbosity.
502 Delete all references which correspond to a particular
503 .Ar remote-repository
504 instead of fetching new changes.
505 This can be useful when a remote repository is being removed from
511 .Ar remote-repository
512 argument is mandatory and no other options except
519 Only references are deleted.
520 Any commit, tree, tag, and blob objects fetched from a remote repository
521 will generally be stored in pack files and may be removed separately with
523 and Git's garbage collector.
531 .Op Fl p Ar path-prefix
533 .Op Ar work-tree-path
536 Copy files from a repository into a new work tree.
537 Show the status of each affected file, using the following status codes:
538 .Bl -column YXZ description
539 .It A Ta new file was added
540 .It E Ta file already exists in work tree's meta-data
545 is not specified, either use the last component of
546 .Ar repository path ,
549 was specified use the last component of
557 Check out files from a commit on the specified
559 If this option is not specified, a branch resolved via the repository's HEAD
560 reference will be used.
562 Check out files from the specified
564 on the selected branch.
565 The expected argument is a commit ID SHA1 hash or an existing reference
566 or tag name which will be resolved to a commit ID.
567 An abbreviated hash argument will be expanded to a full SHA1 hash
568 automatically, provided the abbreviation is unique.
569 If this option is not specified, the most recent commit on the selected
574 is not contained in the selected branch, a different branch which contains
575 this commit must be specified with the
578 If no such branch is known, a new branch must be created for this
584 Checking out work trees with an unknown branch is intentionally not supported.
586 Proceed with the checkout operation even if the directory at
589 Existing files will be left intact.
590 .It Fl p Ar path-prefix
591 Restrict the work tree to a subset of the repository's tree hierarchy.
592 Only files beneath the specified
596 Silence progress output.
607 Update an existing work tree to a different
609 Change existing files in the work tree as necessary to match file contents
611 Preserve any local changes in the work tree and merge them with the
614 Files which already contain merge conflicts will not be updated to avoid
615 further complications.
616 Such files will be updated when
618 is run again after merge conflicts have been resolved.
619 If the conflicting changes are no longer needed, affected files can be
626 Show the status of each affected file, using the following status codes:
627 .Bl -column YXZ description
628 .It U Ta file was updated and contained no local changes
629 .It G Ta file was updated and local changes were merged cleanly
630 .It C Ta file was updated and conflicts occurred during merge
631 .It D Ta file was deleted
632 .It d Ta file's deletion was prevented by local modifications
633 .It A Ta new file was added
634 .It \(a~ Ta versioned file is obstructed by a non-regular file
635 .It ! Ta a missing versioned file was restored
636 .It # Ta file was not updated because it contains merge conflicts
637 .It ? Ta changes destined for an unversioned file were not merged
642 is specified, update the entire work tree.
643 Otherwise, restrict the update operation to files at or within the
645 Each path is required to exist in the update operation's target commit.
646 Files in the work tree outside specified paths will remain unchanged and
647 will retain their previously recorded base commit.
650 commands may refuse to run while the work tree contains files from
651 multiple base commits.
652 The base commit of such a work tree can be made consistent by running
654 across the entire work tree.
657 is incompatible with the
662 cannot update paths with staged changes.
663 If changes have been staged with
665 these changes must first be committed with
675 Switch the work tree's branch reference to the specified
677 before updating the work tree.
678 This option requires that all paths in the work tree are updated.
680 As usual, any local changes in the work tree will be preserved.
681 This can be useful when switching to a newly created branch in order
682 to commit existing local changes to this branch.
684 Any local changes must be dealt with separately in order to obtain a
685 work tree with pristine file contents corresponding exactly to the specified
687 Such changes could first be committed to a different branch with
689 or could be discarded with
692 Update the work tree to the specified
694 The expected argument is a commit ID SHA1 hash or an existing reference
695 or tag name which will be resolved to a commit ID.
696 An abbreviated hash argument will be expanded to a full SHA1 hash
697 automatically, provided the abbreviation is unique.
698 If this option is not specified, the most recent commit on the work tree's
701 Silence progress output.
707 .Op Fl S Ar status-codes
708 .Op Fl s Ar status-codes
712 Show the current modification status of files in a work tree,
713 using the following status codes:
714 .Bl -column YXZ description
715 .It M Ta modified file
716 .It A Ta file scheduled for addition in next commit
717 .It D Ta file scheduled for deletion in next commit
718 .It C Ta modified or added file which contains merge conflicts
719 .It ! Ta versioned file was expected on disk but is missing
720 .It \(a~ Ta versioned file is obstructed by a non-regular file
721 .It ? Ta unversioned item not tracked by
723 .It m Ta modified file modes (executable bit only)
724 .It N Ta non-existent
726 specified on the command line
731 is specified, show modifications in the entire work tree.
732 Otherwise, show modifications at or within the specified paths.
734 If changes have been staged with
736 staged changes are shown in the second output column, using the following
738 .Bl -column YXZ description
739 .It M Ta file modification is staged
740 .It A Ta file addition is staged
741 .It D Ta file deletion is staged
744 Changes created on top of staged changes are indicated in the first column:
745 .Bl -column YXZ description
746 .It MM Ta file was modified after earlier changes have been staged
747 .It MA Ta file was modified after having been staged for addition
755 Show unversioned files even if they match an ignore pattern.
756 .It Fl S Ar status-codes
757 Suppress the output of files with a modification status matching any of the
758 single-character status codes contained in the
761 Any combination of codes from the above list of possible status codes
763 For staged files, status codes displayed in either column will be matched.
764 Cannot be used together with the
767 .It Fl s Ar status-codes
768 Only show files with a modification status matching any of the
769 single-character status codes contained in the
772 Any combination of codes from the above list of possible status codes
774 For staged files, status codes displayed in either column will be matched.
775 Cannot be used together with the
780 For compatibility with
791 files in each traversed directory and will not display unversioned files
792 which match these patterns.
793 Ignore patterns which end with a slash,
795 will only match directories.
800 supports consecutive asterisks,
802 which will match an arbitrary amount of directories.
806 only supports a single ignore pattern per line.
810 does not support negated ignore patterns prefixed with
812 and gives no special significance to the location of path component separators,
821 .Op Fl r Ar repository-path
822 .Op Fl S Ar search-pattern
826 Display history of a repository.
829 is specified, show only commits which modified this path.
830 If invoked in a work tree, the
832 is interpreted relative to the current working directory,
833 and the work tree's path prefix is implicitly prepended.
834 Otherwise, the path is interpreted relative to the repository root.
841 Display individual commits which were merged into the current branch
845 shows the linear history of the current branch only.
847 Set the number of context lines shown in diffs with
849 By default, 3 lines of context are shown.
851 Start traversing history at the specified
853 The expected argument is a commit ID SHA1 hash or an existing reference
854 or tag name which will be resolved to a commit ID.
855 An abbreviated hash argument will be expanded to a full SHA1 hash
856 automatically, provided the abbreviation is unique.
857 If this option is not specified, default to the work tree's current branch
858 if invoked in a work tree, or to the repository's HEAD reference.
860 Display diffstat of changes introduced in each commit.
861 Cannot be used with the
865 Limit history traversal to a given number of commits.
866 If this option is not specified, a default limit value of zero is used,
867 which is treated as an unbounded limit.
869 .Ev GOT_LOG_DEFAULT_LIMIT
870 environment variable may be set to change this default value.
872 Display the list of file paths changed in each commit, using the following
874 .Bl -column YXZ description
875 .It M Ta modified file
876 .It D Ta file was deleted
877 .It A Ta new file was added
878 .It m Ta modified file modes (executable bit only)
881 Cannot be used with the
885 Display the patch of modifications made in each commit.
888 is specified, only show the patch of modifications at or within this path.
889 Cannot be used with the
893 Determine a set of commits to display as usual, but display these commits
895 .It Fl r Ar repository-path
896 Use the repository at the specified path.
897 If not specified, assume the repository is located at or above the current
899 If this directory is a
901 work tree, use the repository path associated with this work tree.
902 .It Fl S Ar search-pattern
903 If specified, show only commits with a log message, author name,
904 committer name, or ID SHA1 hash matched by the extended regular
907 Lines in committed patches will be matched if
910 File paths changed by a commit will be matched if
913 Regular expression syntax is documented in
916 Display a short one-line summary of each commit, instead of the default
918 Cannot be used together with the
924 Stop traversing commit history immediately after the specified
927 This option has no effect if the specified
937 .Op Fl r Ar repository-path
938 .Op Ar object1 Ar object2 | Ar path ...
941 When invoked within a work tree without any arguments, display all
942 local changes in the work tree.
945 arguments are specified, only show changes within the specified paths.
947 If two arguments are provided, treat each argument as a reference, a tag
948 name, or an object ID SHA1 hash, and display differences between the
949 corresponding objects.
950 Both objects must be of the same type (blobs, trees, or commits).
951 An abbreviated hash argument will be expanded to a full SHA1 hash
952 automatically, provided the abbreviation is unique.
953 If none of these interpretations produce a valid result or if the
958 is running in a work tree, attempt to interpret the two arguments as paths.
965 Treat file contents as ASCII text even if binary data is detected.
967 Set the number of context lines shown in the diff.
968 By default, 3 lines of context are shown.
970 Show differences between commits in the repository.
971 This option may be used up to two times.
972 When used only once, show differences between the specified
974 and its first parent commit.
975 When used twice, show differences between the two specified commits.
977 The expected argument is a commit ID SHA1 hash or an existing reference
978 or tag name which will be resolved to a commit ID.
979 An abbreviated hash argument will be expanded to a full SHA1 hash
980 automatically, provided the abbreviation is unique.
984 option is used, all non-option arguments will be interpreted as paths.
987 arguments are provided, only show differences for the specified paths.
989 Cannot be used together with the
993 Display diffstat of changes before the actual diff by annotating each file path
994 or blob hash being diffed with the total number of lines added and removed.
995 A summary line will display the total number of changes across all files.
997 Interpret all arguments as paths only.
998 This option can be used to resolve ambiguity in cases where paths
999 look like tag names, reference names, or object IDs.
1000 This option is only valid when
1002 is invoked in a work tree.
1003 .It Fl r Ar repository-path
1004 Use the repository at the specified path.
1005 If not specified, assume the repository is located at or above the current
1007 If this directory is a
1009 work tree, use the repository path associated with this work tree.
1011 Show changes staged with
1013 instead of showing local changes in the work tree.
1014 This option is only valid when
1016 is invoked in a work tree.
1018 Ignore whitespace-only changes.
1024 .Op Fl r Ar repository-path
1028 Display line-by-line history of a file at the specified path.
1035 Start traversing history at the specified
1037 The expected argument is a commit ID SHA1 hash or an existing reference
1038 or tag name which will be resolved to a commit ID.
1039 An abbreviated hash argument will be expanded to a full SHA1 hash
1040 automatically, provided the abbreviation is unique.
1041 .It Fl r Ar repository-path
1042 Use the repository at the specified path.
1043 If not specified, assume the repository is located at or above the current
1045 If this directory is a
1047 work tree, use the repository path associated with this work tree.
1054 .Op Fl r Ar repository-path
1058 Display a listing of files and directories at the specified
1059 directory path in the repository.
1060 Entries shown in this listing may carry one of the following trailing
1062 .Bl -column YXZ description
1063 .It @ Ta entry is a symbolic link
1064 .It / Ta entry is a directory
1065 .It * Ta entry is an executable file
1066 .It $ Ta entry is a Git submodule
1069 Symbolic link entries are also annotated with the target path of the link.
1073 is specified, list the repository path corresponding to the current
1074 directory of the work tree, or the root directory of the repository
1075 if there is no work tree.
1082 List files and directories as they appear in the specified
1084 The expected argument is a commit ID SHA1 hash or an existing reference
1085 or tag name which will be resolved to a commit ID.
1086 An abbreviated hash argument will be expanded to a full SHA1 hash
1087 automatically, provided the abbreviation is unique.
1089 Show object IDs of files (blob objects) and directories (tree objects).
1091 Recurse into sub-directories in the repository.
1092 .It Fl r Ar repository-path
1093 Use the repository at the specified path.
1094 If not specified, assume the repository is located at or above the current
1096 If this directory is a
1098 work tree, use the repository path associated with this work tree.
1104 .Op Fl r Ar repository-path
1105 .Op Fl s Ar reference
1108 Manage references in a repository.
1110 References may be listed, created, deleted, and changed.
1111 When creating, deleting, or changing a reference the specified
1113 must be an absolute reference name, i.e. it must begin with
1121 Create a reference or change an existing reference.
1122 The reference with the specified
1124 will point at the specified
1128 argument is a ID SHA1 hash or an existing reference or tag name which will
1129 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
1130 Cannot be used together with any other options except
1133 Delete the reference with the specified
1135 from the repository.
1136 Any commit, tree, tag, and blob objects belonging to deleted references
1137 remain in the repository and may be removed separately with
1138 Git's garbage collector or
1139 .Cm gotadmin cleanup .
1140 Cannot be used together with any other options except
1143 List references in the repository.
1146 is specified, list all existing references in the repository.
1149 is a reference namespace, list all references in this namespace.
1150 Otherwise, show only the reference with the given
1152 Cannot be used together with any other options except
1156 .It Fl r Ar repository-path
1157 Use the repository at the specified path.
1158 If not specified, assume the repository is located at or above the current
1160 If this directory is a
1162 work tree, use the repository path associated with this work tree.
1163 .It Fl s Ar reference
1164 Create a symbolic reference, or change an existing symbolic reference.
1165 The symbolic reference with the specified
1167 will point at the specified
1169 which must already exist in the repository.
1170 Care should be taken not to create loops between references when
1171 this option is used.
1172 Cannot be used together with any other options except
1175 Sort listed references by modification time (most recently modified first)
1176 instead of sorting by lexicographical order.
1177 Use of this option requires the
1179 option to be used as well.
1187 .Op Fl r Ar repository-path
1191 Create, list, or delete branches.
1193 Local branches are managed via references which live in the
1195 reference namespace.
1198 command creates references in this namespace only.
1200 When deleting branches, the specified
1204 reference namespace first.
1205 If no corresponding branch is found, the
1207 namespace will be searched next.
1209 If invoked in a work tree without any arguments, print the name of the
1210 work tree's current branch.
1214 argument is passed, attempt to create a branch reference with the given name.
1215 By default the new branch reference will point at the latest commit on the
1216 work tree's current branch if invoked in a work tree, and otherwise to a commit
1217 resolved via the repository's HEAD reference.
1219 If invoked in a work tree, once the branch was created successfully
1220 switch the work tree's head reference to the newly created branch and
1221 update files across the entire work tree, just like
1222 .Cm got update -b Ar name
1224 Show the status of each affected file, using the following status codes:
1225 .Bl -column YXZ description
1226 .It U Ta file was updated and contained no local changes
1227 .It G Ta file was updated and local changes were merged cleanly
1228 .It C Ta file was updated and conflicts occurred during merge
1229 .It D Ta file was deleted
1230 .It A Ta new file was added
1231 .It \(a~ Ta versioned file is obstructed by a non-regular file
1232 .It ! Ta a missing versioned file was restored
1240 Make a newly created branch reference point at the specified
1244 argument is a commit ID SHA1 hash or an existing reference
1245 or tag name which will be resolved to a commit ID.
1247 Delete the branch with the specified
1253 reference namespace.
1255 Only the branch reference is deleted.
1256 Any commit, tree, and blob objects belonging to the branch
1257 remain in the repository and may be removed separately with
1258 Git's garbage collector or
1259 .Cm gotadmin cleanup .
1261 List all existing branches in the repository, including copies of remote
1262 repositories' branches in the
1264 reference namespace.
1266 If invoked in a work tree, the work tree's current branch is shown
1267 with one of the following annotations:
1268 .Bl -column YXZ description
1269 .It * Ta work tree's base commit matches the branch tip
1270 .It \(a~ Ta work tree's base commit is out-of-date
1273 Do not switch and update the work tree after creating a new branch.
1274 .It Fl r Ar repository-path
1275 Use the repository at the specified path.
1276 If not specified, assume the repository is located at or above the current
1278 If this directory is a
1280 work tree, use the repository path associated with this work tree.
1282 Sort listed branches by modification time (most recently modified first)
1283 instead of sorting by lexicographical order.
1286 reference namespace are listed before branches in
1289 Use of this option requires the
1291 option to be used as well.
1298 .Op Fl r Ar repository-path
1299 .Op Fl s Ar signer-id
1302 Manage tags in a repository.
1304 Tags are managed via references which live in the
1306 reference namespace.
1309 command operates on references in this namespace only.
1310 References in this namespace point at tag objects which contain a pointer
1311 to another object, a tag message, as well as author and timestamp information.
1313 Attempt to create a tag with the given
1315 and make this tag point at the given
1317 If no commit is specified, default to the latest commit on the work tree's
1318 current branch if invoked in a work tree, and to a commit resolved via
1319 the repository's HEAD reference otherwise.
1326 Make the newly created tag reference point at the specified
1330 argument is a commit ID SHA1 hash or an existing reference or tag name which
1331 will be resolved to a commit ID.
1332 An abbreviated hash argument will be expanded to a full SHA1 hash
1333 automatically, provided the abbreviation is unique.
1335 List all existing tags in the repository instead of creating a new tag.
1338 argument is passed, show only the tag with the given
1341 Use the specified tag message when creating the new tag.
1346 opens a temporary file in an editor where a tag message can be written.
1347 .It Fl r Ar repository-path
1348 Use the repository at the specified path.
1349 If not specified, assume the repository is located at or above the current
1351 If this directory is a
1353 work tree, use the repository path associated with this work tree.
1354 .It Fl s Ar signer-id
1355 While creating a new tag, sign this tag with the identity given in
1358 For SSH-based signatures,
1360 is the path to a file which may refer to either a private SSH key,
1361 or a public SSH key with the private half available via
1364 will sign the tag object by invoking
1368 command, using the signature namespace
1370 for compatibility with
1373 Verify tag object signatures.
1376 is specified, show and verify the tag object with the provided name.
1377 Otherwise, list all tag objects and verify signatures where present.
1380 verifies SSH-based signatures by invoking
1383 .Fl Y Cm verify Fl f Ar allowed_signers .
1388 otherwise verification is impossible.
1391 During SSH signature creation and verification this option will be passed to
1393 Multiple -v options increase the verbosity.
1399 command will not delete tags or change existing tags.
1400 If a tag must be deleted, the
1402 command may be used to delete a tag's reference.
1403 This should only be done if the tag has not already been copied to
1410 Schedule unversioned files in a work tree for addition to the
1411 repository in the next commit.
1412 By default, files which match a
1414 ignore pattern will not be added.
1418 mentioned in the command line is not an unversioned file then
1421 To avoid unnecessary errors from paths picked up by file globbing patterns
1422 in the shell, paths in the argument list will be silently ignored if they
1425 at all, or if they are reported with one of the following status codes
1426 and do not have changes staged via
1428 .Bl -column YXZ description
1429 .It M Ta modified file
1430 .It A Ta file scheduled for addition in next commit
1431 .It C Ta modified or added file which contains merge conflicts
1432 .It m Ta modified file modes (executable bit only)
1440 Add files even if they match a
1444 Permit recursion into directories.
1445 If this option is not specified,
1447 will refuse to run if a specified
1455 .Op Fl s Ar status-codes
1459 Remove versioned files from a work tree and schedule them for deletion
1460 from the repository in the next commit.
1467 Perform the operation even if a file contains local modifications,
1468 and do not raise an error if a specified
1470 does not exist on disk.
1472 Keep affected files on disk.
1474 Permit recursion into directories.
1475 If this option is not specified,
1477 will refuse to run if a specified
1480 .It Fl s Ar status-codes
1481 Only delete files with a modification status matching one of the
1482 single-character status codes contained in the
1485 The following status codes may be specified:
1486 .Bl -column YXZ description
1487 .It M Ta modified file (this implies the
1490 .It ! Ta versioned file expected on disk but missing
1498 .Op Fl p Ar strip-count
1504 to files in a work tree.
1505 Files added or removed by a patch will be scheduled for addition or removal in
1508 The patch must be in the unified diff format as produced by
1515 diff when invoked with their
1520 argument is provided, read unified diff data from standard input instead.
1524 contains multiple patches, then attempt to apply each of them in sequence.
1526 Show the status of each affected file, using the following status codes:
1527 .Bl -column XYZ description
1528 .It M Ta file was modified
1529 .It G Ta file was merged using a merge-base found in the repository
1530 .It C Ta file was merged and conflicts occurred during merge
1531 .It D Ta file was deleted
1532 .It A Ta file was added
1533 .It # Ta failed to patch the file
1536 If a change does not match at its exact line number, attempt to
1537 apply it somewhere else in the file if a good spot can be found.
1538 Otherwise, the patch will fail to apply.
1542 will refuse to apply a patch if certain preconditions are not met.
1543 Files to be deleted must already be under version control, and must
1544 not have been scheduled for deletion already.
1545 Files to be added must not yet be under version control and must not
1546 already be present on disk.
1547 Files to be modified must already be under version control and may not
1548 contain conflict markers.
1550 If an error occurs, the
1552 operation will be aborted.
1553 Any changes made to the work tree up to this point will be left behind.
1554 Such changes can be viewed with
1556 and can be reverted with
1565 Attempt to locate files within the specified
1567 for use as a merge-base for 3-way merges.
1568 Ideally, the specified
1570 should contain versions of files which the changes contained in the
1573 Files will be located by path, relative to the repository root.
1576 option is used then leading path components will be stripped
1577 before paths are looked up in the repository.
1581 option is not used then
1583 will attempt to locate merge-bases via object IDs found in
1585 meta-data, such as produced by
1591 option is only recommended in the absence of such meta-data.
1593 In case no merge-base is available for a file, changes will be applied
1594 without doing a 3-way merge.
1595 Changes which do not apply cleanly may then be rejected entirely, rather
1596 than producing merge conflicts in the patched target file.
1598 Do not make any modifications to the work tree.
1599 This can be used to check whether a patch would apply without issues.
1602 contains diffs that affect the same file multiple times, the results
1603 displayed may be incorrect.
1604 .It Fl p Ar strip-count
1605 Specify the number of leading path components to strip from paths
1614 path prefixes generated by
1616 will be recognized and stripped automatically.
1618 Reverse the patch before applying it.
1624 .Op Fl F Ar response-script
1628 Revert any local changes in files at the specified paths in a work tree.
1629 File contents will be overwritten with those contained in the
1630 work tree's base commit.
1631 There is no way to bring discarded changes back after
1634 If a file was added with
1636 it will become an unversioned file again.
1637 If a file was deleted with
1639 it will be restored.
1645 .It Fl F Ar response-script
1653 responses line-by-line from the specified
1655 file instead of prompting interactively.
1657 Instead of reverting all changes in files, interactively select or reject
1658 changes to revert based on
1664 (quit reverting this file) responses.
1665 If a file is in modified status, individual patches derived from the
1666 modified file content can be reverted.
1667 Files in added or deleted status may only be reverted in their entirety.
1669 Permit recursion into directories.
1670 If this option is not specified,
1672 will refuse to run if a specified
1686 Create a new commit in the repository from changes in a work tree
1687 and use this commit as the new base commit for the work tree.
1690 is specified, commit all changes in the work tree.
1691 Otherwise, commit changes at or within the specified paths.
1693 If changes have been explicitly staged for commit with
1695 only commit staged changes and reject any specified paths which
1696 have not been staged.
1699 opens a temporary file in an editor where a log message can be written
1707 options are used together.
1709 Show the status of each affected file, using the following status codes:
1710 .Bl -column YXZ description
1711 .It M Ta modified file
1712 .It D Ta file was deleted
1713 .It A Ta new file was added
1714 .It m Ta modified file modes (executable bit only)
1717 Files which are not part of the new commit will retain their previously
1718 recorded base commit.
1721 commands may refuse to run while the work tree contains files from
1722 multiple base commits.
1723 The base commit of such a work tree can be made consistent by running
1725 across the entire work tree.
1729 command requires the
1731 environment variable to be set,
1732 unless an author has been configured in
1738 configuration settings can be
1739 obtained from the repository's
1741 file or from Git's global
1750 Set author information in the newly created commit to
1752 This is useful when committing changes on behalf of someone else.
1755 argument must use the same format as the
1757 environment variable.
1759 In addition to storing author information, the newly created commit
1762 information which is obtained, as usual, from the
1764 environment variable, or
1766 or Git configuration settings.
1768 Allow committing files in conflicted status.
1770 Committing files with conflict markers should generally be avoided.
1771 Cases where conflict markers must be stored in the repository for
1772 some legitimate reason should be very rare.
1773 There are usually ways to avoid storing conflict markers verbatim by
1774 applying appropriate programming tricks.
1776 Use the prepared log message stored in the file found at
1778 when creating the new commit.
1780 opens a temporary file in an editor where the prepared log message can be
1781 reviewed and edited further if needed.
1782 Cannot be used together with the
1786 Use the specified log message when creating the new commit.
1787 Cannot be used together with the
1791 This option prevents
1793 from opening the commit message in an editor.
1794 It has no effect unless it is used together with the
1796 option and is intended for non-interactive use such as scripting.
1798 This option prevents
1800 from generating a diff of the to-be-committed changes in a temporary file
1801 which can be viewed while editing a commit message.
1803 Allow the addition of symbolic links which point outside of the path space
1804 that is under version control.
1807 will reject such symbolic links due to safety concerns.
1810 may decide to represent such a symbolic link as a regular file which contains
1811 the link's target path, rather than creating an actual symbolic link which
1812 points outside of the work tree.
1813 Use of this option is discouraged because external mechanisms such as
1815 are better suited for managing symbolic links to paths not under
1820 will refuse to run if certain preconditions are not met.
1821 If the work tree's current branch is not in the
1823 reference namespace, new commits may not be created on this branch.
1824 Local changes may only be committed if they are based on file content
1825 found in the most recent commit on the work tree's branch.
1826 If a path is found to be out of date,
1828 must be used first in order to merge local changes with changes made
1836 .Op Fl r Ar repository-path
1838 .Op Ar remote-repository
1841 Send new changes to a remote repository.
1843 .Ar remote-repository
1847 The remote repository's URL is obtained from the corresponding entry in
1851 file of the local repository, as created by
1854 All objects corresponding to new changes will be written to a temporary
1855 pack file which is then uploaded to the server.
1856 Upon success, references in the
1858 reference namespace of the local repository will be updated to point at
1859 the commits which have been sent.
1861 By default, changes will only be sent if they are based on up-to-date
1862 copies of relevant branches in the remote repository.
1863 If any changes to be sent are based on out-of-date copies or would
1864 otherwise break linear history of existing branches, new changes must
1865 be fetched from the server with
1867 and local branches must be rebased with
1874 option can be used to make exceptions to these requirements.
1881 Send all branches from the local repository's
1883 reference namespace.
1886 option is equivalent to listing all branches with multiple
1889 Cannot be used together with the
1895 from the local repository's
1897 reference namespace.
1898 This option may be specified multiple times to build a list of branches
1900 If this option is not specified, default to the work tree's current branch
1901 if invoked in a work tree, or to the repository's HEAD reference.
1902 Cannot be used together with the
1906 Delete the specified
1908 from the remote repository's
1910 reference namespace.
1911 This option may be specified multiple times to build a list of branches
1914 Only references are deleted.
1915 Any commit, tree, tag, and blob objects belonging to deleted branches
1916 may become subject to deletion by Git's garbage collector running on
1919 Requesting deletion of branches results in an error if the server
1920 does not support this feature or disallows the deletion of branches
1921 based on its configuration.
1923 Attempt to force the server to overwrite existing branches or tags
1924 in the remote repository, even when
1930 would usually be required before changes can be sent.
1931 The server may reject forced requests regardless, depending on its
1934 Any commit, tree, tag, and blob objects belonging to overwritten branches
1935 or tags may become subject to deletion by Git's garbage collector running
1940 reference namespace is globally shared between all repositories.
1943 option to overwrite tags is discouraged because it can lead to
1944 inconsistencies between the tags present in different repositories.
1945 In general, creating a new tag with a different name is recommended
1946 instead of overwriting an existing tag.
1950 option is particularly discouraged if changes being sent are based
1951 on an out-of-date copy of a branch in the remote repository.
1952 Instead of using the
1954 option, new changes should
1957 and local branches should be rebased with
1961 followed by another attempt to send the changes.
1965 option should only be needed in situations where the remote repository's
1966 copy of a branch or tag is known to be out-of-date and is considered
1968 The risks of creating inconsistencies between different repositories
1969 should also be taken into account.
1971 Suppress progress reporting output.
1972 The same option will be passed to
1975 .It Fl r Ar repository-path
1976 Use the repository at the specified path.
1977 If not specified, assume the repository is located at or above the current
1979 If this directory is a
1981 work tree, use the repository path associated with this work tree.
1983 Attempt to send all tags from the local repository's
1985 reference namespace.
1988 option is equivalent to listing all tags with multiple
1991 Cannot be used together with the
1997 from the local repository's
1999 reference namespace, in addition to any branches that are being sent.
2002 option may be specified multiple times to build a list of tags to send.
2003 No tags will be sent if the
2007 Raise an error if the specified
2009 already exists in the remote repository, unless the
2011 option is used to overwrite the server's copy of the tag.
2012 In general, creating a new tag with a different name is recommended
2013 instead of overwriting an existing tag.
2015 Cannot be used together with the
2022 to print debugging messages to standard error output.
2023 The same option will be passed to
2026 Multiple -v options increase the verbosity.
2036 Merge changes from a single
2041 should be on a different branch than the work tree's base commit.
2042 The expected argument is a reference or a commit ID SHA1 hash.
2043 An abbreviated hash argument will be expanded to a full SHA1 hash
2044 automatically, provided the abbreviation is unique.
2046 Show the status of each affected file, using the following status codes:
2047 .Bl -column YXZ description
2048 .It G Ta file was merged
2049 .It C Ta file was merged and conflicts occurred during merge
2050 .It ! Ta changes destined for a missing file were not merged
2051 .It D Ta file was deleted
2052 .It d Ta file's deletion was prevented by local modifications
2053 .It A Ta new file was added
2054 .It \(a~ Ta changes destined for a non-regular file were not merged
2055 .It ? Ta changes destined for an unversioned file were not merged
2058 The merged changes will appear as local changes in the work tree, which
2061 amended manually or with further
2067 If invoked in a work tree where no
2072 operation is taking place,
2074 creates a record of commits which have been merged into the work tree.
2075 When a file changed by
2079 the log messages of relevant merged commits will then appear in the editor,
2080 where the messages should be further adjusted to convey the reasons for
2081 cherrypicking the changes.
2082 Upon exiting the editor, if the time stamp of the log message file
2083 is unchanged or the log message is empty,
2085 will fail with an unmodified or empty log message error.
2087 If all the changes in all files touched by a given commit are discarded,
2090 this commit's log message record will also disappear.
2093 will refuse to run if certain preconditions are not met.
2094 If the work tree contains multiple base commits, it must first be updated
2095 to a single base commit with
2097 If any relevant files already contain merge conflicts, these
2098 conflicts must be resolved first.
2106 Display a list of commit log messages recorded by cherrypick operations,
2107 represented by references in the
2108 .Dq refs/got/worktree
2109 reference namespace.
2112 is specified, only show the log message of the specified commit.
2114 If invoked in a work tree, only log messages recorded by cherrypick operations
2115 in the current work tree will be displayed.
2116 Otherwise, all commit log messages will be displayed irrespective of the
2117 work tree in which they were created.
2118 This option cannot be used with
2121 Delete log messages created by previous cherrypick operations, represented by
2123 .Dq refs/got/worktree
2124 reference namespace.
2127 is specified, only delete the log message of the specified commit.
2129 If invoked in a work tree, only log messages recorded by cherrypick operations
2130 in the current work tree will be deleted.
2131 Otherwise, all commit log messages will be deleted irrespective of the
2132 work tree in which they were created.
2133 This option cannot be used with
2144 Reverse-merge changes from a single
2149 should be on the same branch as the work tree's base commit.
2150 The expected argument is a reference or a commit ID SHA1 hash.
2151 An abbreviated hash argument will be expanded to a full SHA1 hash
2152 automatically, provided the abbreviation is unique.
2154 Show the status of each affected file, using the following status codes:
2155 .Bl -column YXZ description
2156 .It G Ta file was merged
2157 .It C Ta file was merged and conflicts occurred during merge
2158 .It ! Ta changes destined for a missing file were not merged
2159 .It D Ta file was deleted
2160 .It d Ta file's deletion was prevented by local modifications
2161 .It A Ta new file was added
2162 .It \(a~ Ta changes destined for a non-regular file were not merged
2163 .It ? Ta changes destined for an unversioned file were not merged
2166 The reverse-merged changes will appear as local changes in the work tree,
2167 which may be viewed with
2169 amended manually or with further
2175 If invoked in a work tree where no
2180 operation is taking place,
2182 creates a record of commits which have been reverse-merged into the work tree.
2183 When a file changed by
2187 the log messages of relevant reverse-merged commits will then appear in
2188 the editor, where the messages should be further adjusted to convey the
2189 reasons for backing out the changes.
2190 Upon exiting the editor, if the time stamp of the log message file
2191 is unchanged or the log message is empty,
2193 will fail with an unmodified or empty log message error.
2195 If all the changes in all files touched by a given commit are discarded,
2198 this commit's log message record will also disappear.
2201 will refuse to run if certain preconditions are not met.
2202 If the work tree contains multiple base commits, it must first be updated
2203 to a single base commit with
2205 If any relevant files already contain merge conflicts, these
2206 conflicts must be resolved first.
2214 Display a list of commit log messages recorded by backout operations,
2215 represented by references in the
2216 .Dq refs/got/worktree
2217 reference namespace.
2220 is specified, only show the log message of the specified commit.
2222 If invoked in a work tree, only log messages recorded by backout operations
2223 in the current work tree will be displayed.
2224 Otherwise, all commit log messages will be displayed irrespective of the
2225 work tree in which they were created.
2226 This option cannot be used with
2229 Delete log messages created by previous backout operations, represented by
2231 .Dq refs/got/worktree
2232 reference namespace.
2235 is specified, only delete the log message of the specified commit.
2237 If invoked in a work tree, only log messages recorded by backout operations
2238 in the current work tree will be deleted.
2239 Otherwise, all commit log messages will be deleted irrespective of the
2240 work tree in which they were created.
2241 This option cannot be used with
2252 Rebase commits on the specified
2254 onto the tip of the current branch of the work tree.
2257 must share common ancestry with the work tree's current branch.
2258 Rebasing begins with the first descendant commit of the youngest
2259 common ancestor commit shared by the specified
2261 and the work tree's current branch, and stops once the tip commit
2268 is used as intended, the specified
2270 represents a local commit history and may already contain changes
2271 that are not yet visible in any other repositories.
2272 The work tree's current branch, which must be set with
2276 operation, represents a branch from a remote repository which shares
2277 a common history with the specified
2279 but has progressed, and perhaps diverged, due to commits added to the
2282 Rebased commits are accumulated on a temporary branch which the work tree
2283 will remain switched to throughout the entire rebase operation.
2284 Commits on this branch represent the same changes with the same log
2285 messages as their counterparts on the original
2287 but with different commit IDs.
2288 Once rebasing has completed successfully, the temporary branch becomes
2289 the new version of the specified
2291 and the work tree is automatically switched to it.
2292 If author information is available via the
2294 environment variable,
2300 configuration settings, this author information will be used to identify
2305 Old commits in their pre-rebase state are automatically backed up in the
2306 .Dq refs/got/backup/rebase
2307 reference namespace.
2308 As long as these references are not removed older versions of rebased
2309 commits will remain in the repository and can be viewed with the
2312 Removal of these references makes objects which become unreachable via
2313 any reference subject to removal by Git's garbage collector or
2314 .Cm gotadmin cleanup .
2316 While rebasing commits, show the status of each affected file,
2317 using the following status codes:
2318 .Bl -column YXZ description
2319 .It G Ta file was merged
2320 .It C Ta file was merged and conflicts occurred during merge
2321 .It ! Ta changes destined for a missing file were not merged
2322 .It D Ta file was deleted
2323 .It d Ta file's deletion was prevented by local modifications
2324 .It A Ta new file was added
2325 .It \(a~ Ta changes destined for a non-regular file were not merged
2326 .It ? Ta changes destined for an unversioned file were not merged
2329 If merge conflicts occur, the rebase operation is interrupted and may
2330 be continued once conflicts have been resolved.
2331 If any files with destined changes are found to be missing or unversioned,
2332 or if files could not be deleted due to differences in deleted content,
2333 the rebase operation will be interrupted to prevent potentially incomplete
2334 changes from being committed to the repository without user intervention.
2335 The work tree may be modified as desired and the rebase operation can be
2336 continued once the changes present in the work tree are considered complete.
2337 Alternatively, the rebase operation may be aborted which will leave
2339 unmodified and the work tree switched back to its original branch.
2341 If a merge conflict is resolved in a way which renders the merged
2342 change into a no-op change, the corresponding commit will be elided
2343 when the rebase operation continues.
2346 will refuse to run if certain preconditions are not met.
2351 reference namespace, the branch may not be rebased.
2352 If the work tree is not yet fully updated to the tip commit of its
2353 branch, then the work tree must first be updated with
2355 If changes have been staged with
2357 these changes must first be committed with
2361 If the work tree contains local changes, these changes must first be
2368 contains changes to files outside of the work tree's path prefix,
2369 the work tree cannot be used to rebase this branch.
2378 commands will refuse to run while a rebase operation is in progress.
2379 Other commands which manipulate the work tree may be used for
2380 conflict resolution purposes.
2384 is already based on the work tree's current branch, then no commits
2385 need to be rebased and
2387 will simply switch the work tree to the specified
2389 and update files in the work tree accordingly.
2396 Abort an interrupted rebase operation.
2397 If this option is used, no other command-line arguments are allowed.
2399 Allow a rebase operation to continue with files in conflicted status.
2400 This option should generally be avoided, and can only be used with the
2404 Continue an interrupted rebase operation.
2405 If this option is used, no other command-line arguments are allowed except
2408 Show a list of past rebase operations, represented by references in the
2409 .Dq refs/got/backup/rebase
2410 reference namespace.
2412 Display the author, date, and log message of each backed up commit,
2413 the object ID of the corresponding post-rebase commit, and
2414 the object ID of their common ancestor commit.
2415 Given these object IDs,
2422 options can be used to examine the history of either version of the branch,
2427 option can be used to create a new branch from a pre-rebase state if desired.
2431 is specified, only show commits which at some point in time represented this
2433 Otherwise, list all backed up commits for any branches.
2435 If this option is used,
2437 does not require a work tree.
2438 None of the other options can be used together with
2441 Delete backups created by past rebase operations, represented by references
2443 .Dq refs/got/backup/rebase
2444 reference namespace.
2448 is specified, only delete backups which at some point in time represented
2450 Otherwise, delete all references found within
2451 .Dq refs/got/backup/rebase .
2453 Any commit, tree, tag, and blob objects belonging to deleted backups
2454 remain in the repository and may be removed separately with
2455 Git's garbage collector or
2456 .Cm gotadmin cleanup .
2458 If this option is used,
2460 does not require a work tree.
2461 None of the other options can be used together with
2468 .Op Fl F Ar histedit-script
2472 Edit commit history between the work tree's current base commit and
2473 the tip commit of the work tree's current branch.
2477 command requires the
2479 environment variable to be set,
2480 unless an author has been configured in
2486 configuration settings can be obtained from the repository's
2488 file or from Git's global
2494 operation, the work tree's current branch must be set with
2496 to the branch which should be edited, unless this branch is already the
2497 current branch of the work tree.
2498 The tip of this branch represents the upper bound (inclusive) of commits
2503 Furthermore, the work tree's base commit
2506 to a point in this branch's commit history where editing should begin.
2507 This commit represents the lower bound (non-inclusive) of commits touched
2512 Editing of commit history is controlled via a
2514 which can be written in an editor based on a template, passed on the
2515 command line, or generated with the
2523 The format of the histedit script is line-based.
2524 Each line in the script begins with a command name, followed by
2525 whitespace and an argument.
2526 For most commands, the expected argument is a commit ID SHA1 hash.
2527 Any remaining text on the line is ignored.
2528 Lines which begin with the
2530 character are ignored entirely.
2532 The available histedit script commands are as follows:
2533 .Bl -column YXZ pick-commit
2534 .It Cm pick Ar commit Ta Use the specified commit as it is.
2535 .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
2536 then interrupt the histedit operation for amending, without creating a commit.
2537 While the histedit operation is interrupted arbitrary files may be edited,
2538 and commands which manipulate the work tree can be used freely.
2543 commands can be used to add new files or remove existing ones.
2546 command can be used to eliminate arbitrary changes from files in the work tree.
2549 command may be used to prepare a subset of changes for inclusion in the
2553 command can be used to insert arbitrary commits into the edited history.
2554 Regular editing of history must eventually be resumed by running
2555 .Cm got histedit -c .
2556 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
2557 listed further below that will be used.
2558 .It Cm drop Ar commit Ta Remove this commit from the edited history.
2559 .It Cm mesg Oo Ar log-message Oc Ta Create a new log message for the commit of
2564 command on the previous line of the histedit script.
2567 argument provides a new single-line log message to use.
2570 argument is omitted, open an editor where a new log message can be written.
2573 Every commit in the history being edited must be mentioned in the script.
2574 Lines may be re-ordered to change the order of commits in the edited history.
2575 No commit may be listed more than once.
2577 Edited commits are accumulated on a temporary branch which the work tree
2578 will remain switched to throughout the entire histedit operation.
2579 Once history editing has completed successfully, the temporary branch becomes
2580 the new version of the work tree's branch and the work tree is automatically
2583 Old commits in their pre-histedit state are automatically backed up in the
2584 .Dq refs/got/backup/histedit
2585 reference namespace.
2586 As long as these references are not removed older versions of edited
2587 commits will remain in the repository and can be viewed with the
2590 Removal of these references makes objects which become unreachable via
2591 any reference subject to removal by Git's garbage collector or
2592 .Cm gotadmin cleanup .
2594 While merging commits, show the status of each affected file,
2595 using the following status codes:
2596 .Bl -column YXZ description
2597 .It G Ta file was merged
2598 .It C Ta file was merged and conflicts occurred during merge
2599 .It ! Ta changes destined for a missing file were not merged
2600 .It D Ta file was deleted
2601 .It d Ta file's deletion was prevented by local modifications
2602 .It A Ta new file was added
2603 .It \(a~ Ta changes destined for a non-regular file were not merged
2604 .It ? Ta changes destined for an unversioned file were not merged
2607 If merge conflicts occur, the histedit operation is interrupted and may
2608 be continued once conflicts have been resolved.
2609 If any files with destined changes are found to be missing or unversioned,
2610 or if files could not be deleted due to differences in deleted content,
2611 the histedit operation will be interrupted to prevent potentially incomplete
2612 changes from being committed to the repository without user intervention.
2613 The work tree may be modified as desired and the histedit operation can be
2614 continued once the changes present in the work tree are considered complete.
2615 Alternatively, the histedit operation may be aborted which will leave
2616 the work tree switched back to its original branch.
2618 If a merge conflict is resolved in a way which renders the merged
2619 change into a no-op change, the corresponding commit will be elided
2620 when the histedit operation continues.
2623 will refuse to run if certain preconditions are not met.
2624 If the work tree's current branch is not in the
2626 reference namespace, the history of the branch may not be edited.
2627 If the work tree contains multiple base commits, it must first be updated
2628 to a single base commit with
2630 If changes have been staged with
2632 these changes must first be committed with
2636 If the work tree contains local changes, these changes must first be
2641 If the edited history contains changes to files outside of the work tree's
2642 path prefix, the work tree cannot be used to edit the history of this branch.
2650 commands will refuse to run while a histedit operation is in progress.
2651 Other commands which manipulate the work tree may be used, and the
2653 command may be used to commit arbitrary changes to the temporary branch
2654 while the histedit operation is interrupted.
2661 Abort an interrupted histedit operation.
2662 If this option is used, no other command-line arguments are allowed.
2664 Allow a histedit operation to continue with files in conflicted status.
2665 This option should generally be avoided, and can only be used with the
2669 Continue an interrupted histedit operation.
2670 If this option is used, no other command-line arguments are allowed except
2674 This option is a quick equivalent to a histedit script which drops all
2678 option can only be used when starting a new histedit operation.
2679 If this option is used, no other command-line arguments are allowed.
2681 Interrupt the histedit operation for editing after merging each commit.
2682 This option is a quick equivalent to a histedit script which uses the
2684 command for all commits.
2687 option can only be used when starting a new histedit operation.
2688 If this option is used, no other command-line arguments are allowed.
2689 .It Fl F Ar histedit-script
2692 instead of opening a temporary file in an editor where a histedit script
2695 Fold all commits into a single commit.
2696 This option is a quick equivalent to a histedit script which folds all
2697 commits, combining them all into one commit.
2700 option can only be used when starting a new histedit operation.
2701 If this option is used, no other command-line arguments are allowed.
2703 Show a list of past histedit operations, represented by references in the
2704 .Dq refs/got/backup/histedit
2705 reference namespace.
2707 Display the author, date, and log message of each backed up commit,
2708 the object ID of the corresponding post-histedit commit, and
2709 the object ID of their common ancestor commit.
2710 Given these object IDs,
2717 options can be used to examine the history of either version of the branch,
2722 option can be used to create a new branch from a pre-histedit state if desired.
2726 is specified, only show commits which at some point in time represented this
2728 Otherwise, list all backed up commits for any branches.
2730 If this option is used,
2732 does not require a work tree.
2733 None of the other options can be used together with
2736 Edit log messages only.
2737 This option is a quick equivalent to a histedit script which edits
2738 only log messages but otherwise leaves every picked commit as-is.
2741 option can only be used when starting a new histedit operation.
2742 If this option is used, no other command-line arguments are allowed.
2744 Delete backups created by past histedit operations, represented by references
2746 .Dq refs/got/backup/histedit
2747 reference namespace.
2751 is specified, only delete backups which at some point in time represented
2753 Otherwise, delete all references found within
2754 .Dq refs/got/backup/histedit .
2756 Any commit, tree, tag, and blob objects belonging to deleted backups
2757 remain in the repository and may be removed separately with
2758 Git's garbage collector or
2759 .Cm gotadmin cleanup .
2761 If this option is used,
2763 does not require a work tree.
2764 None of the other options can be used together with
2768 .It Cm integrate Ar branch
2770 Integrate the specified
2772 into the work tree's current branch.
2773 Files in the work tree are updated to match the contents on the integrated
2775 and the reference of the work tree's branch is changed to point at the
2776 head commit of the integrated
2779 Both branches can be considered equivalent after integration since they
2780 will be pointing at the same commit.
2781 Both branches remain available for future work, if desired.
2782 In case the integrated
2784 is no longer needed it may be deleted with
2787 Show the status of each affected file, using the following status codes:
2788 .Bl -column YXZ description
2789 .It U Ta file was updated
2790 .It D Ta file was deleted
2791 .It A Ta new file was added
2792 .It \(a~ Ta versioned file is obstructed by a non-regular file
2793 .It ! Ta a missing versioned file was restored
2797 will refuse to run if certain preconditions are not met.
2798 Most importantly, the
2800 must have been rebased onto the work tree's current branch with
2802 before it can be integrated, in order to linearize commit history and
2803 resolve merge conflicts.
2804 If the work tree contains multiple base commits, it must first be updated
2805 to a single base commit with
2807 If changes have been staged with
2809 these changes must first be committed with
2813 If the work tree contains local changes, these changes must first be
2827 into the current branch of the work tree.
2828 If the branches have diverged, creates a merge commit.
2831 already includes all commits from the work tree's branch, updates the work
2832 tree's branch to be the same as
2834 without creating a commit, and updates the work tree to the most recent commit
2837 If a linear project history is desired, then use of
2839 should be preferred over
2841 However, even strictly linear projects may require merge commits in order
2842 to merge in new versions of third-party code stored on vendor branches
2846 Merge commits are commits based on multiple parent commits.
2847 The tip commit of the work tree's current branch, which must be in the
2849 reference namespace and must be set with
2853 operation, will be used as the first parent.
2854 The tip commit of the specified
2856 will be used as the second parent.
2858 No ancestral relationship between the two branches is required.
2859 If the two branches have already been merged previously, only new changes
2862 It is not possible to create merge commits with more than two parents.
2863 If more than one branch needs to be merged, then multiple merge commits
2864 with two parents each can be created in sequence.
2866 While merging changes found on the
2868 into the work tree, show the status of each affected file,
2869 using the following status codes:
2870 .Bl -column YXZ description
2871 .It G Ta file was merged
2872 .It C Ta file was merged and conflicts occurred during merge
2873 .It ! Ta changes destined for a missing file were not merged
2874 .It D Ta file was deleted
2875 .It d Ta file's deletion was prevented by local modifications
2876 .It A Ta new file was added
2877 .It \(a~ Ta changes destined for a non-regular file were not merged
2878 .It ? Ta changes destined for an unversioned file were not merged
2881 If merge conflicts occur, the merge operation is interrupted and conflicts
2882 must be resolved before the merge operation can continue.
2883 If any files with destined changes are found to be missing or unversioned,
2884 or if files could not be deleted due to differences in deleted content,
2885 the merge operation will be interrupted to prevent potentially incomplete
2886 changes from being committed to the repository without user intervention.
2887 The work tree may be modified as desired and the merge can be continued
2888 once the changes present in the work tree are considered complete.
2889 Alternatively, the merge operation may be aborted which will leave
2890 the work tree's current branch unmodified.
2893 will refuse to run if certain preconditions are not met.
2894 If the work tree's current branch is not in the
2896 reference namespace then the work tree must first be switched to a
2901 If the work tree is not yet fully updated to the tip commit of its
2902 branch, then the work tree must first be updated with
2904 If the work tree contains multiple base commits, it must first be updated
2905 to a single base commit with
2907 If changes have been staged with
2909 these changes must first be committed with
2913 If the work tree contains local changes, these changes must first be
2920 contains changes to files outside of the work tree's path prefix,
2921 the work tree cannot be used to merge this branch.
2931 commands will refuse to run while a merge operation is in progress.
2932 Other commands which manipulate the work tree may be used for
2933 conflict resolution purposes.
2940 Abort an interrupted merge operation.
2941 If this option is used, no other command-line arguments are allowed.
2943 Allow a merge operation to continue with files in conflicted status.
2944 This option should generally be avoided, and can only be used with the
2948 Continue an interrupted merge operation.
2949 If this option is used, no other command-line arguments are allowed except
2952 Create a merge commit even if the branches have not diverged.
2954 Merge changes into the work tree as usual but do not create a merge
2956 The merge result can be adjusted as desired before a merge commit is
2959 Alternatively, the merge may be aborted with
2966 .Op Fl F Ar response-script
2970 Stage local changes for inclusion in the next commit.
2973 is specified, stage all changes in the work tree.
2974 Otherwise, stage changes at or within the specified paths.
2975 Paths may be staged if they are added, modified, or deleted according to
2978 Show the status of each affected file, using the following status codes:
2979 .Bl -column YXZ description
2980 .It A Ta file addition has been staged
2981 .It M Ta file modification has been staged
2982 .It D Ta file deletion has been staged
2985 Staged file contents are saved in newly created blob objects in the repository.
2986 These blobs will be referred to by tree objects once staged changes have been
2989 Staged changes affect the behaviour of
2994 While paths with staged changes exist, the
2996 command will refuse to commit any paths which do not have staged changes.
2997 Local changes created on top of staged changes can only be committed if
2998 the path is staged again, or if the staged changes are committed first.
3001 command will show both local changes and staged changes.
3004 command is able to display local changes relative to staged changes,
3005 and to display staged changes relative to the repository.
3008 command cannot revert staged changes but may be used to revert
3009 local changes created on top of staged changes.
3015 .It Fl F Ar response-script
3023 responses line-by-line from the specified
3025 file instead of prompting interactively.
3027 Instead of staging new changes, list paths which are already staged,
3028 along with the IDs of staged blob objects and stage status codes.
3029 If paths were provided on the command line, show the staged paths
3030 among the specified paths.
3031 Otherwise, show all staged paths.
3033 Instead of staging the entire content of a changed file, interactively
3034 select or reject changes for staging based on
3038 (reject change), and
3040 (quit staging this file) responses.
3041 If a file is in modified status, individual patches derived from the
3042 modified file content can be staged.
3043 Files in added or deleted status may only be staged or rejected in
3046 Allow staging of symbolic links which point outside of the path space
3047 that is under version control.
3050 will reject such symbolic links due to safety concerns.
3053 may decide to represent such a symbolic link as a regular file which contains
3054 the link's target path, rather than creating an actual symbolic link which
3055 points outside of the work tree.
3056 Use of this option is discouraged because external mechanisms such as
3058 are better suited for managing symbolic links to paths not under
3063 will refuse to run if certain preconditions are not met.
3064 If a file contains merge conflicts, these conflicts must be resolved first.
3065 If a file is found to be out of date relative to the head commit on the
3066 work tree's current branch, the file must be updated with
3068 before it can be staged (however, this does not prevent the file from
3069 becoming out-of-date at some point after having been staged).
3077 commands will refuse to run while staged changes exist.
3078 If staged changes cannot be committed because a staged path
3079 is out of date, the path must be unstaged with
3081 before it can be updated with
3083 and may then be staged again if necessary.
3088 .Op Fl F Ar response-script
3092 Merge staged changes back into the work tree and put affected paths
3093 back into non-staged status.
3096 is specified, unstage all staged changes across the entire work tree.
3097 Otherwise, unstage changes at or within the specified paths.
3099 Show the status of each affected file, using the following status codes:
3100 .Bl -column YXZ description
3101 .It G Ta file was unstaged
3102 .It C Ta file was unstaged and conflicts occurred during merge
3103 .It ! Ta changes destined for a missing file were not merged
3104 .It D Ta file was staged as deleted and still is deleted
3105 .It d Ta file's deletion was prevented by local modifications
3106 .It \(a~ Ta changes destined for a non-regular file were not merged
3113 .It Fl F Ar response-script
3121 responses line-by-line from the specified
3123 file instead of prompting interactively.
3125 Instead of unstaging the entire content of a changed file, interactively
3126 select or reject changes for unstaging based on
3130 (keep change staged), and
3132 (quit unstaging this file) responses.
3133 If a file is staged in modified status, individual patches derived from the
3134 staged file content can be unstaged.
3135 Files staged in added or deleted status may only be unstaged in their entirety.
3141 .Op Fl r Ar repository-path
3144 Parse and print contents of objects to standard output in a line-based
3146 Content of commit, tree, and tag objects is printed in a way similar
3147 to the actual content stored in such objects.
3148 Blob object contents are printed as they would appear in files on disk.
3150 Attempt to interpret each argument as a reference, a tag name, or
3151 an object ID SHA1 hash.
3152 References will be resolved to an object ID.
3153 Tag names will resolved to a tag object.
3154 An abbreviated hash argument will be expanded to a full SHA1 hash
3155 automatically, provided the abbreviation is unique.
3157 If none of the above interpretations produce a valid result, or if the
3159 option is used, attempt to interpret the argument as a path which will
3160 be resolved to the ID of an object found at this path in the repository.
3167 Look up paths in the specified
3169 If this option is not used, paths are looked up in the commit resolved
3170 via the repository's HEAD reference.
3171 The expected argument is a commit ID SHA1 hash or an existing reference
3172 or tag name which will be resolved to a commit ID.
3173 An abbreviated hash argument will be expanded to a full SHA1 hash
3174 automatically, provided the abbreviation is unique.
3176 Interpret all arguments as paths only.
3177 This option can be used to resolve ambiguity in cases where paths
3178 look like tag names, reference names, or object IDs.
3179 .It Fl r Ar repository-path
3180 Use the repository at the specified path.
3181 If not specified, assume the repository is located at or above the current
3183 If this directory is a
3185 work tree, use the repository path associated with this work tree.
3187 .It Cm info Op Ar path ...
3188 Display meta-data stored in a work tree.
3193 The work tree to use is resolved implicitly by walking upwards from the
3194 current working directory.
3198 arguments are specified, show additional per-file information for tracked
3199 files located at or within these paths.
3202 argument corresponds to the work tree's root directory, display information
3203 for all tracked files.
3206 .Bl -tag -width GOT_IGNORE_GITCONFIG
3208 The author's name and email address, such as
3209 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3220 may fail to parse commits without an email address in author data,
3224 environment variables with a missing email address.
3226 .Ev GOT_AUTHOR will be overridden by configuration settings in
3232 configuration settings in the repository's
3239 configuration settings contained in Git's global
3241 configuration file will only be used if neither
3245 environment variable provide author information.
3246 .It Ev GOT_IGNORE_GITCONFIG
3247 If this variable is set then any remote repository definitions or author
3248 information found in Git configuration files will be ignored.
3249 .It Ev GOT_LOG_DEFAULT_LIMIT
3250 The default limit on the number of commits traversed by
3252 If set to zero, the limit is unbounded.
3253 This variable will be silently ignored if it is set to a non-numeric value.
3254 .It Ev VISUAL , EDITOR
3255 The editor spawned by
3263 text editor will be spawned.
3266 .Bl -tag -width packed-refs -compact
3268 Repository-wide configuration settings for
3272 configuration file located in the root directory of a Git repository
3273 supersedes any relevant settings in Git's
3277 .It Pa .got/got.conf
3278 Worktree-specific configuration settings for
3282 configuration file in the
3284 meta-data directory of a work tree supersedes any relevant settings in
3287 configuration file and Git's
3294 Enable tab-completion of
3299 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3301 Clone an existing Git repository for use with
3305 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3307 Unfortunately, many of the popular Git hosting sites do not offer anonymous
3309 Such sites will require an account to be created, and a public SSH key to be
3310 uploaded to this account, before repository access via ssh:// URLs will work.
3312 Use of HTTP URLs currently requires
3316 .Dl $ git clone --bare https://github.com/openbsd/src.git
3318 Alternatively, for quick and dirty local testing of
3320 a new Git repository could be created and populated with files,
3321 e.g. from a temporary CVS checkout located at
3324 .Dl $ gotadmin init /var/git/src.git
3325 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3327 Check out a work tree from the Git repository to /usr/src:
3329 .Dl $ got checkout /var/git/src.git /usr/src
3331 View local changes in a work tree directory:
3333 .Dl $ got diff | less
3335 In a work tree, display files in a potentially problematic state:
3337 .Dl $ got status -s 'C!~?'
3339 Interactively revert selected local changes in a work tree directory:
3341 .Dl $ got revert -p -R\ .
3343 In a work tree or a git repository directory, list all branch references:
3347 As above, but list the most recently modified branches only:
3349 .Dl $ got branch -lt | head
3351 In a work tree or a git repository directory, create a new branch called
3352 .Dq unified-buffer-cache
3353 which is forked off the
3357 .Dl $ got branch -c master unified-buffer-cache
3359 Switch an existing work tree to the branch
3360 .Dq unified-buffer-cache .
3361 Local changes in the work tree will be preserved and merged if necessary:
3363 .Dl $ got update -b unified-buffer-cache
3365 Create a new commit from local changes in a work tree directory.
3366 This new commit will become the head commit of the work tree's current branch:
3370 In a work tree or a git repository directory, view changes committed in
3371 the 3 most recent commits to the work tree's branch, or the branch resolved
3372 via the repository's HEAD reference, respectively:
3374 .Dl $ got log -p -l 3
3376 As above, but display changes in the order in which
3378 could apply them in sequence:
3380 .Dl $ got log -p -l 3 -R
3382 In a work tree or a git repository directory, log the history of a subdirectory:
3384 .Dl $ got log sys/uvm
3386 While operating inside a work tree, paths are specified relative to the current
3387 working directory, so this command will log the subdirectory
3390 .Dl $ cd sys/uvm && got log\ .
3392 And this command has the same effect:
3394 .Dl $ cd sys/dev/usb && got log ../../uvm
3396 And this command displays work tree meta-data about all tracked files:
3399 .Dl $ got info\ . | less
3401 Add new files and remove obsolete files in a work tree directory:
3403 .Dl $ got add sys/uvm/uvm_ubc.c
3404 .Dl $ got remove sys/uvm/uvm_vnode.c
3406 Create a new commit from local changes in a work tree directory
3407 with a pre-defined log message.
3409 .Dl $ got commit -m 'unify the buffer cache'
3411 Alternatively, create a new commit from local changes in a work tree
3412 directory with a log message that has been prepared in the file
3415 .Dl $ got commit -F /tmp/msg
3417 Update any work tree checked out from the
3418 .Dq unified-buffer-cache
3419 branch to the latest commit on this branch:
3423 Roll file content on the unified-buffer-cache branch back by one commit,
3424 and then fetch the rolled-back change into the work tree as a local change
3425 to be amended and perhaps committed again:
3427 .Dl $ got backout unified-buffer-cache
3428 .Dl $ got commit -m 'roll back previous'
3429 .Dl $ # now back out the previous backout :-)
3430 .Dl $ got backout unified-buffer-cache
3432 Fetch new changes on the remote repository's
3434 branch, making them visible on the local repository's
3441 In a repository created with a HTTP URL and
3442 .Cm git clone --bare
3445 command must be used instead:
3447 .Dl $ cd /var/git/src.git
3448 .Dl $ git fetch origin master:refs/remotes/origin/master
3452 branch to merge the new changes that are now visible on the
3457 .Dl $ got update -b origin/master
3458 .Dl $ got rebase master
3461 .Dq unified-buffer-cache
3462 branch on top of the new head commit of the
3466 .Dl $ got update -b master
3467 .Dl $ got rebase unified-buffer-cache
3469 Create a patch from all changes on the unified-buffer-cache branch.
3470 The patch can be mailed out for review and applied to
3474 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
3476 Edit the entire commit history of the
3477 .Dq unified-buffer-cache
3480 .Dl $ got update -b unified-buffer-cache
3481 .Dl $ got update -c master
3484 Before working against existing branches in a repository cloned with
3485 .Cm git clone --bare
3490 must be configured to map all references in the remote repository
3493 namespace of the local repository.
3494 This can be achieved by setting Git's
3495 .Pa remote.origin.fetch
3496 configuration variable to the value
3497 .Dq +refs/heads/*:refs/remotes/origin/*
3502 .Dl $ cd /var/git/repo
3503 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
3507 option must be disabled:
3509 .Dl $ cd /var/git/repo
3510 .Dl $ git config remote.origin.mirror false
3512 Alternatively, the following
3514 configuration item can be added manually to the Git repository's
3518 .Dl [remote \&"origin\&"]
3520 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
3523 This configuration leaves the local repository's
3525 namespace free for use by local branches checked out with
3527 and, if needed, created with
3530 .Dq refs/remotes/origin
3531 namespace can now be updated with incoming changes from the remote
3536 without extra command line arguments.
3537 Newly fetched changes can be examined with
3540 Display changes on the remote repository's version of the
3542 branch, as of the last time
3546 .Dl $ got log -c origin/master | less
3548 As shown here, most commands accept abbreviated reference names such as
3551 .Dq refs/remotes/origin/master .
3552 The latter is only needed in case of ambiguity.
3555 can be used to merge changes which are visible on the
3560 This will also merge local changes, if any, with the incoming changes:
3562 .Dl $ got update -b origin/master
3563 .Dl $ got rebase master
3565 In order to make changes committed to the
3566 .Dq unified-buffer-cache
3570 .Dq unified-buffer-cache
3571 branch can be rebased onto the
3575 .Dl $ got update -b master
3576 .Dl $ got rebase unified-buffer-cache
3579 .Dq unified-buffer-cache
3580 branch can now be made visible on the
3584 Because the rebase operation switched the work tree to the
3585 .Dq unified-buffer-cache
3586 branch, the work tree must be switched back to the
3590 .Dl $ got update -b master
3591 .Dl $ got integrate unified-buffer-cache
3595 branch, log messages for local changes can now be amended with
3597 by other developers and any other important new information:
3599 .Dl $ got update -c origin/master
3600 .Dl $ got histedit -m
3602 If the remote repository offers write access, local changes on the
3604 branch can be sent to the remote repository with
3608 can be run without further arguments.
3609 The arguments shown here match defaults, provided the work tree's
3610 current branch is the
3614 .Dl $ got send -b master origin
3616 If the remote repository requires the HTTPS protocol, the
3618 command must be used instead:
3620 .Dl $ cd /var/git/src.git
3621 .Dl $ git push origin master
3623 When making contributions to projects which use the
3625 workflow, SSH protocol repository access needs to be set up first.
3626 Once an account has been created on a Git hosting site it should
3627 be possible to upload a public SSH key for repository access
3632 workflow will usually involve two remote repositories.
3633 In the real-life example below, the
3635 repository was forked from the
3637 repository by using the Git hosting site's web interface.
3640 file in the local repository describes both remote repositories:
3641 .Bd -literal -offset indent
3642 # Jelmers's repository, which accepts pull requests
3644 server git@github.com
3646 repository "/jelmer/dulwich"
3650 # Stefan's fork, used as the default remote repository
3652 server git@github.com
3654 repository "/stspdotname/dulwich"
3659 With this configuration, Stefan can create commits on
3660 .Dq refs/heads/master
3661 and send them to the
3663 repository by running:
3665 .Dl $ got send -b master origin
3667 The changes can now be proposed to Jelmer by opening a pull request
3668 via the Git hosting site's web interface.
3669 If Jelmer requests further changes to be made, additional commits
3670 can be created on the
3672 branch and be added to the pull request by running
3676 If Jelmer prefers additional commits to be
3678 then the following commands can be used to achieve this:
3680 .Dl $ got update -b master
3681 .Dl $ got update -c origin/master
3682 .Dl $ got histedit -f
3683 .Dl $ got send -f -b master origin
3685 In addition to reviewing the pull request in the web user interface,
3686 Jelmer can fetch the pull request's branch into his local repository
3687 and create a local branch which contains the proposed changes:
3689 .Dl $ got fetch -R refs/pull/1046/head origin
3690 .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
3692 Once Jelmer has accepted the pull request, Stefan can fetch the
3693 merged changes, and possibly several other new changes, by running:
3695 .Dl $ got fetch upstream
3697 The merged changes will now be visible under the reference
3698 .Dq refs/remotes/upstream/master .
3701 branch can now be rebased on top of the latest changes
3704 .Dl $ got update -b upstream/master
3705 .Dl $ got rebase master
3707 As an alternative to
3709 branches can be merged with
3712 .Dl $ got update -b master
3713 .Dl $ got merge upstream/master
3715 The question of whether to rebase or merge branches is philosophical.
3716 When in doubt, refer to the software project's policies set by project
3719 As a final step, the forked repository's copy of the master branch needs
3720 to be kept in sync by sending the new changes there:
3722 .Dl $ got send -f -b master origin
3724 If multiple pull requests need to be managed in parallel, a separate branch
3725 must be created for each pull request with
3727 Each such branch can then be used as above, in place of
3728 .Dq refs/heads/master .
3729 Changes for any accepted pull requests will still appear under
3730 .Dq refs/remotes/upstream/master,
3731 regardless of which branch was used in the forked repository to
3732 create a pull request.
3736 .Xr git-repository 5 ,
3737 .Xr got-worktree 5 ,
3741 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
3742 .An Christian Weisgerber Aq Mt naddy@openbsd.org
3743 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
3744 .An Josh Rickmar Aq Mt jrick@zettaport.com
3745 .An Joshua Stein Aq Mt jcs@openbsd.org
3746 .An Klemens Nanni Aq Mt kn@openbsd.org
3747 .An Martin Pieuchot Aq Mt mpi@openbsd.org
3748 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
3749 .An Omar Polo Aq Mt op@openbsd.org
3750 .An Ori Bernstein Aq Mt ori@openbsd.org
3751 .An Sebastien Marie Aq Mt semarie@openbsd.org
3752 .An Stefan Sperling Aq Mt stsp@openbsd.org
3753 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
3754 .An Theo Buehler Aq Mt tb@openbsd.org
3755 .An Thomas Adam Aq Mt thomas@xteddy.org
3756 .An Tracey Emery Aq Mt tracey@traceyemery.net
3757 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
3764 were derived from code under copyright by:
3766 .An Caldera International
3767 .An Daniel Hartmeier
3772 .An Jean-Francois Brousseau
3778 .An Niklas Hallqvist
3783 .An Xavier Santolaria
3786 contains code contributed to the public domain by
3787 .An Austin Appleby .
3790 is a work-in-progress and some features remain to be implemented.
3792 At present, the user has to fall back on
3794 to perform some tasks.
3798 Reading from remote repositories over HTTP or HTTPS protocols requires
3803 Writing to remote repositories over HTTP or HTTPS protocols requires
3806 The creation of merge commits with more than two parent commits requires
3809 In situations where files or directories were moved around
3811 will not automatically merge changes to new locations and
3813 will usually produce better results.