2 .\" Copyright (c) 2017 Martin Pieuchot
3 .\" Copyright (c) 2018, 2019, 2020 Stefan Sperling
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
30 is a version control system which stores the history of tracked files
31 in a Git repository, as used by the Git version control system.
32 This repository format is described in
33 .Xr git-repository 5 .
38 version control system because every copy of a repository is writeable.
39 Modifications made to files can be synchronized between repositories
44 must be checked out from the repository for modification.
45 Checked out files are stored in a
47 which can be placed at an arbitrary directory in the filesystem hierarchy.
48 The on-disk format of this work tree is described in
52 provides global and command-specific options.
53 Global options must precede the command name, and are as follows:
54 .Bl -tag -width tenletters
56 Display usage information and exit immediately.
58 Display program version and exit immediately.
64 .Bl -tag -width checkout
71 .Op Fl r Ar repository-path
75 Create an initial commit in a repository from the file hierarchy
78 The created commit will not have any parent commits, i.e. it will be a
80 Also create a new reference which provides a branch name for the newly
82 Show the path of each imported file to indicate progress.
88 environment variable to be set,
89 unless an author has been configured in
95 configuration settings can be obtained from the repository's
97 file or from Git's global
108 If this option is not specified, a branch corresponding to the repository's
109 HEAD reference will be used.
110 Use of this option is required if the branch resolved via the repository's
111 HEAD reference already exists.
113 Ignore files or directories with a name which matches the specified
115 This option may be specified multiple times to build a list of ignore patterns.
118 follows the globbing rules documented in
120 Ignore patterns which end with a slash,
122 will only match directories.
124 Use the specified log message when creating the new commit.
129 opens a temporary file in an editor where a log message can be written.
130 Quitting the editor without saving the file will abort the import operation.
131 .It Fl r Ar repository-path
132 Use the repository at the specified path.
133 If not specified, assume the repository is located at or above the current
141 .Op Fl R Ar reference
146 Clone a Git repository at the specified
152 is specified, the directory name will be derived from the name of the
155 will refuse to run if the
161 specifies a protocol scheme, a server hostname, an optional port number
162 separated from the hostname by a colon, and a path to the repository on
164 .Lk scheme://hostname:port/path/to/repository
166 The following protocol schemes are supported:
167 .Bl -tag -width git+ssh
169 The Git protocol as implemented by the
172 Use of this protocol is discouraged since it supports neither authentication
175 The Git protocol wrapped in an authenticated and encrypted
178 With this protocol the hostname may contain an embedded username for
183 Short alias for git+ssh.
186 Objects in the cloned repository are stored in a pack file which is downloaded
188 This pack file will then be indexed to facilitate access to the objects stored
190 If any objects in the pack file are stored in deltified form, all deltas will
191 be fully resolved in order to compute the ID of such objects.
192 This can take some time.
193 More details about the pack file format are documented in
194 .Xr git-repository 5 .
197 creates a remote repository entry in the
201 files of the cloned repository to store the
207 arguments for future use by
217 Fetch all branches from the remote repository's
219 reference namespace and set
220 .Cm fetch_all_branches
221 in the cloned repository's
223 file for future use by
225 If this option is not specified, a branch resolved via the remote
226 repository's HEAD reference will be fetched.
227 Cannot be used together with the
233 from the remote repository's
236 This option may be specified multiple times to build a list of branches
238 If the branch corresponding to the remote repository's HEAD reference is not
239 in this list, the cloned repository's HEAD reference will be set to the first
240 branch which was fetched.
241 If this option is not specified, a branch resolved via the remote
242 repository's HEAD reference will be fetched.
243 Cannot be used together with the
247 List branches and tags available for fetching from the remote repository
248 and exit immediately.
249 Cannot be used together with any of the other options except
254 Create the cloned repository as a mirror of the original repository.
255 This is useful if the cloned repository will not be used to store
256 locally created commits.
262 files will be set up with the
264 option enabled, such that
268 will write incoming changes directly to branches in the
270 reference namespace, rather than to branches in the
273 This avoids the usual requirement of having to run
279 in order to make incoming changes appear on branches in the
282 But maintaining custom changes in the cloned repository becomes difficult
283 since such changes will be at risk of being discarded whenever incoming
286 Suppress progress reporting output.
287 The same option will be passed to
290 .It Fl R Ar reference
291 In addition to the branches and tags that will be fetched, fetch an arbitrary
293 from the remote repository's
296 This option may be specified multiple times to build a list of additional
300 may either be a path to a specific reference, or a reference namespace
301 which will cause all references in this namespace to be fetched.
303 Each reference will be mapped into the cloned repository's
305 namespace, unless the
307 option is used to mirror references directly into the cloned repository's
312 will refuse to fetch references from the remote repository's
321 to print debugging messages to standard error output.
322 This option will be passed to
325 Multiple -v options increase the verbosity.
333 .Op Fl R Ar reference
334 .Op Fl r Ar repository-path
335 .Op Ar remote-repository
338 Fetch new changes from a remote repository.
340 .Ar remote-repository
344 The remote repository's URL is obtained from the corresponding entry in
348 file of the local repository, as created by
351 By default, any branches configured in
354 .Ar remote-repository
358 is invoked in a work tree then this work tree's current branch will be
359 fetched, too, provided it is present on the server.
360 If no branches to fetch can be found in
362 or via a work tree, or said branches are not found on the server, a branch
363 resolved via the remote repository's HEAD reference will be fetched.
364 Likewise, if a HEAD reference for the
365 .Ar remote-repository
366 exists but its target no longer matches the remote HEAD, then
367 the new target branch will be fetched.
368 This default behaviour can be overridden with the
374 New changes will be stored in a separate pack file downloaded from the server.
375 Optionally, separate pack files stored in the repository can be combined with
378 By default, branch references in the
380 reference namespace will be updated to point at the newly fetched commits.
385 command can then be used to make new changes visible on branches in the
387 namespace, merging incoming changes with the changes on those branches
390 If the repository was created as a mirror with
392 then all branches in the
394 namespace will be updated directly to match the corresponding branches in
395 the remote repository.
396 If those branches contained local commits, these commits will no longer be
397 reachable via a reference and will therefore be at risk of being discarded
398 by Git's garbage collector or
399 .Cm gotadmin cleanup .
400 Maintaining custom changes in a mirror repository is therefore discouraged.
402 In any case, references in the
404 namespace will always be fetched and mapped directly to local references
405 in the same namespace.
412 Fetch all branches from the remote repository's
415 This option can be enabled by default for specific repositories in
417 Cannot be used together with the
423 from the remote repository's
426 This option may be specified multiple times to build a list of branches
428 Cannot be used together with the
432 Delete branches and tags from the local repository which are no longer
433 present in the remote repository.
434 Only references are deleted.
435 Any commit, tree, tag, and blob objects belonging to deleted branches or
436 tags remain in the repository and may be removed separately with
437 Git's garbage collector or
438 .Cm gotadmin cleanup .
440 List branches and tags available for fetching from the remote repository
441 and exit immediately.
442 Cannot be used together with any of the other options except
448 Suppress progress reporting output.
449 The same option will be passed to
452 .It Fl R Ar reference
453 In addition to the branches and tags that will be fetched, fetch an arbitrary
455 from the remote repository's
458 This option may be specified multiple times to build a list of additional
462 may either be a path to a specific reference, or a reference namespace
463 which will cause all references in this namespace to be fetched.
465 Each reference will be mapped into the local repository's
467 namespace, unless the local repository was created as a mirror with
469 in which case references will be mapped directly into the local repository's
473 Once a reference has been fetched, a branch based on it can be created with
478 will refuse to fetch references from the remote repository's
483 .It Fl r Ar repository-path
484 Use the repository at the specified path.
485 If not specified, assume the repository is located at or above the current
487 If this directory is a
489 work tree, use the repository path associated with this work tree.
491 Allow existing references in the
493 namespace to be updated if they have changed on the server.
494 If not specified, only new tag references will be created.
499 to print debugging messages to standard error output.
500 The same option will be passed to
503 Multiple -v options increase the verbosity.
506 Delete all references which correspond to a particular
507 .Ar remote-repository
508 instead of fetching new changes.
509 This can be useful when a remote repository is being removed from
515 .Ar remote-repository
516 argument is mandatory and no other options except
523 Only references are deleted.
524 Any commit, tree, tag, and blob objects fetched from a remote repository
525 will generally be stored in pack files and may be removed separately with
527 and Git's garbage collector.
535 .Op Fl p Ar path-prefix
537 .Op Ar work-tree-path
540 Copy files from a repository into a new work tree.
541 Show the status of each affected file, using the following status codes:
542 .Bl -column YXZ description
543 .It A Ta new file was added
544 .It E Ta file already exists in work tree's meta-data
549 is not specified, either use the last component of
550 .Ar repository path ,
553 was specified use the last component of
561 Check out files from a commit on the specified
563 If this option is not specified, a branch resolved via the repository's HEAD
564 reference will be used.
566 Check out files from the specified
568 on the selected branch.
569 The expected argument is a commit ID SHA1 hash or an existing reference
570 or tag name which will be resolved to a commit ID.
571 An abbreviated hash argument will be expanded to a full SHA1 hash
572 automatically, provided the abbreviation is unique.
580 can also be used, with both resolving to the
581 repository's HEAD reference, or, if the
583 option is used, the head of the checked-out
585 Keywords and reference names may be appended with
589 modifiers and an optional integer N to denote the
590 Nth descendant or antecedent by first parent traversal, respectively;
593 denotes the work tree branch head's 2nd generation ancestor, and
595 will denote the 3rd generation ancestor of the commit resolved by the
598 If an integer does not follow the
604 is implicitly appended
610 If this option is not specified, the most recent commit on the selected
615 is not contained in the selected branch, a different branch which contains
616 this commit must be specified with the
619 If no such branch is known, a new branch must be created for this
625 Checking out work trees with an unknown branch is intentionally not supported.
627 Proceed with the checkout operation even if the directory at
630 Existing files will be left intact.
631 .It Fl p Ar path-prefix
632 Restrict the work tree to a subset of the repository's tree hierarchy.
633 Only files beneath the specified
637 Silence progress output.
648 Update an existing work tree to a different
650 Change existing files in the work tree as necessary to match file contents
652 Preserve any local changes in the work tree and merge them with the
655 Files which already contain merge conflicts will not be updated to avoid
656 further complications.
657 Such files will be updated when
659 is run again after merge conflicts have been resolved.
660 If the conflicting changes are no longer needed, affected files can be
667 Show the status of each affected file, using the following status codes:
668 .Bl -column YXZ description
669 .It U Ta file was updated and contained no local changes
670 .It G Ta file was updated and local changes were merged cleanly
671 .It C Ta file was updated and conflicts occurred during merge
672 .It D Ta file was deleted
673 .It d Ta file's deletion was prevented by local modifications
674 .It A Ta new file was added
675 .It \(a~ Ta versioned file is obstructed by a non-regular file
676 .It ! Ta a missing versioned file was restored
677 .It # Ta file was not updated because it contains merge conflicts
678 .It ? Ta changes destined for an unversioned file were not merged
683 is specified, update the entire work tree.
684 Otherwise, restrict the update operation to files at or within the
686 Each path is required to exist in the update operation's target commit.
687 Files in the work tree outside specified paths will remain unchanged and
688 will retain their previously recorded base commit.
691 commands may refuse to run while the work tree contains files from
692 multiple base commits.
693 The base commit of such a work tree can be made consistent by running
695 across the entire work tree.
698 is incompatible with the
703 cannot update paths with staged changes.
704 If changes have been staged with
706 these changes must first be committed with
716 Switch the work tree's branch reference to the specified
718 before updating the work tree.
719 This option requires that all paths in the work tree are updated.
721 As usual, any local changes in the work tree will be preserved.
722 This can be useful when switching to a newly created branch in order
723 to commit existing local changes to this branch.
725 Any local changes must be dealt with separately in order to obtain a
726 work tree with pristine file contents corresponding exactly to the specified
728 Such changes could first be committed to a different branch with
730 or could be discarded with
733 Update the work tree to the specified
735 The expected argument is a commit ID SHA1 hash or an existing reference
736 or tag name which will be resolved to a commit ID.
737 An abbreviated hash argument will be expanded to a full SHA1 hash
738 automatically, provided the abbreviation is unique.
746 can also be used to represent the work tree's base commit
747 and branch head, respectively.
748 Keywords and reference names may be appended with
752 modifiers and an optional integer N to denote the
753 Nth descendant or antecedent, respectively, by first parent traversal;
756 denotes the work tree branch head's 2nd generation ancestor, and
758 denotes the 4th generation descendant of the work tree's base commit.
761 will denote the 3rd generation ancestor of the commit resolved by the
764 If an integer does not follow the
770 is implicitly appended
776 If this option is not specified, the most recent commit on the work tree's
779 Silence progress output.
785 .Op Fl S Ar status-codes
786 .Op Fl s Ar status-codes
790 Show the current modification status of files in a work tree,
791 using the following status codes:
792 .Bl -column YXZ description
793 .It M Ta modified file
794 .It A Ta file scheduled for addition in next commit
795 .It D Ta file scheduled for deletion in next commit
796 .It C Ta modified or added file which contains merge conflicts
797 .It ! Ta versioned file was expected on disk but is missing
798 .It \(a~ Ta versioned file is obstructed by a non-regular file
799 .It ? Ta unversioned item not tracked by
801 .It m Ta modified file modes (executable bit only)
802 .It N Ta non-existent
804 specified on the command line
809 is specified, show modifications in the entire work tree.
810 Otherwise, show modifications at or within the specified paths.
812 If changes have been staged with
814 staged changes are shown in the second output column, using the following
816 .Bl -column YXZ description
817 .It M Ta file modification is staged
818 .It A Ta file addition is staged
819 .It D Ta file deletion is staged
822 Changes created on top of staged changes are indicated in the first column:
823 .Bl -column YXZ description
824 .It MM Ta file was modified after earlier changes have been staged
825 .It MA Ta file was modified after having been staged for addition
833 Show unversioned files even if they match an ignore pattern.
834 .It Fl S Ar status-codes
835 Suppress the output of files with a modification status matching any of the
836 single-character status codes contained in the
839 Any combination of codes from the above list of possible status codes
841 For staged files, status codes displayed in either column will be matched.
842 Cannot be used together with the
845 .It Fl s Ar status-codes
846 Only show files with a modification status matching any of the
847 single-character status codes contained in the
850 Any combination of codes from the above list of possible status codes
852 For staged files, status codes displayed in either column will be matched.
853 Cannot be used together with the
858 For compatibility with
869 files in each traversed directory and will not display unversioned files
870 which match these patterns.
871 Ignore patterns which end with a slash,
873 will only match directories.
878 supports consecutive asterisks,
880 which will match an arbitrary amount of directories.
884 only supports a single ignore pattern per line.
888 does not support negated ignore patterns prefixed with
890 and gives no special significance to the location of path component separators,
899 .Op Fl r Ar repository-path
900 .Op Fl S Ar search-pattern
904 Display history of a repository.
907 is specified, show only commits which modified this path.
908 If invoked in a work tree, the
910 is interpreted relative to the current working directory,
911 and the work tree's path prefix is implicitly prepended.
912 Otherwise, the path is interpreted relative to the repository root.
919 Display individual commits which were merged into the current branch
923 shows the linear history of the current branch only.
925 Set the number of context lines shown in diffs with
927 By default, 3 lines of context are shown.
929 Start traversing history at the specified
931 The expected argument is a commit ID SHA1 hash or an existing reference
932 or tag name which will be resolved to a commit ID.
933 An abbreviated hash argument will be expanded to a full SHA1 hash
934 automatically, provided the abbreviation is unique.
942 can also be used to represent the work tree's base commit
943 and branch head, respectively.
944 The former is only valid if invoked in a work tree, while the latter will
945 resolve to the tip of the work tree's current branch if invoked in a
946 work tree, otherwise it will resolve to the repository's HEAD reference.
947 Keywords and references may be appended with
951 modifiers and an optional integer N to denote the
952 Nth descendant or antecedent, respectively, by first parent traversal;
955 denotes the HEAD reference's 2nd generation ancestor, and
957 denotes the 4th generation descendant of the work tree's base commit.
960 will denote the 3rd generation descendant of the commit resolved by the
967 modifier without a trailing integer has an implicit
975 If this option is not specified, default to the work tree's current branch
976 if invoked in a work tree, or to the repository's HEAD reference.
978 Display diffstat of changes introduced in each commit.
979 Cannot be used with the
983 Limit history traversal to a given number of commits.
984 If this option is not specified, a default limit value of zero is used,
985 which is treated as an unbounded limit.
987 .Ev GOT_LOG_DEFAULT_LIMIT
988 environment variable may be set to change this default value.
990 Display the list of file paths changed in each commit, using the following
992 .Bl -column YXZ description
993 .It M Ta modified file
994 .It D Ta file was deleted
995 .It A Ta new file was added
996 .It m Ta modified file modes (executable bit only)
999 Cannot be used with the
1003 Display the patch of modifications made in each commit.
1006 is specified, only show the patch of modifications at or within this path.
1007 Cannot be used with the
1011 Determine a set of commits to display as usual, but display these commits
1013 .It Fl r Ar repository-path
1014 Use the repository at the specified path.
1015 If not specified, assume the repository is located at or above the current
1017 If this directory is a
1019 work tree, use the repository path associated with this work tree.
1020 .It Fl S Ar search-pattern
1021 If specified, show only commits with a log message, author name,
1022 committer name, or ID SHA1 hash matched by the extended regular
1024 .Ar search-pattern .
1025 Lines in committed patches will be matched if
1028 File paths changed by a commit will be matched if
1031 Regular expression syntax is documented in
1034 Display a short one-line summary of each commit, instead of the default
1036 Cannot be used together with the
1042 Stop traversing commit history immediately after the specified
1045 This option has no effect if the specified
1055 .Op Fl r Ar repository-path
1056 .Op Ar object1 Ar object2 | Ar path ...
1059 When invoked within a work tree without any arguments, display all
1060 local changes in the work tree.
1063 arguments are specified, only show changes within the specified paths.
1065 If two arguments are provided, treat each argument as a reference, a tag
1066 name, or an object ID SHA1 hash, and display differences between the
1067 corresponding objects.
1068 Both objects must be of the same type (blobs, trees, or commits).
1069 An abbreviated hash argument will be expanded to a full SHA1 hash
1070 automatically, provided the abbreviation is unique.
1071 If none of these interpretations produce a valid result or if the
1076 is running in a work tree, attempt to interpret the two arguments as paths.
1083 Treat file contents as ASCII text even if binary data is detected.
1085 Set the number of context lines shown in the diff.
1086 By default, 3 lines of context are shown.
1088 Show differences between commits in the repository.
1089 This option may be used up to two times.
1090 When used only once, show differences between the specified
1092 and its first parent commit.
1093 When used twice, show differences between the two specified commits.
1095 The expected argument is a commit ID SHA1 hash or an existing reference
1096 or tag name which will be resolved to a commit ID.
1097 An abbreviated hash argument will be expanded to a full SHA1 hash
1098 automatically, provided the abbreviation is unique.
1106 can also be used to represent the work tree's base commit
1107 and branch head, respectively.
1108 The former is only valid if invoked in a work tree, while the latter will
1109 resolve to the tip of the work tree's current branch if invoked in a
1110 work tree, otherwise it will resolve to the repository's HEAD reference.
1111 Keywords and references may be appended with
1115 modifiers and an optional integer N to denote the
1116 Nth descendant or antecedent, respectively, by first parent traversal;
1119 denotes the HEAD reference's 2nd generation ancestor, and
1121 denotes the 4th generation descendant of the work tree's base commit.
1124 will denote the 8th generation descendant of the commit resolved by the
1127 If an integer does not follow the
1133 is implicitly appended
1142 option is used, all non-option arguments will be interpreted as paths.
1145 arguments are provided, only show differences for the specified paths.
1147 Cannot be used together with the
1151 Display diffstat of changes before the actual diff by annotating each file path
1152 or blob hash being diffed with the total number of lines added and removed.
1153 A summary line will display the total number of changes across all files.
1155 Interpret all arguments as paths only.
1156 This option can be used to resolve ambiguity in cases where paths
1157 look like tag names, reference names, or object IDs.
1158 This option is only valid when
1160 is invoked in a work tree.
1161 .It Fl r Ar repository-path
1162 Use the repository at the specified path.
1163 If not specified, assume the repository is located at or above the current
1165 If this directory is a
1167 work tree, use the repository path associated with this work tree.
1169 Show changes staged with
1171 instead of showing local changes in the work tree.
1172 This option is only valid when
1174 is invoked in a work tree.
1176 Ignore whitespace-only changes.
1182 .Op Fl r Ar repository-path
1186 Display line-by-line history of a file at the specified path.
1193 Start traversing history at the specified
1195 The expected argument is a commit ID SHA1 hash or an existing reference
1196 or tag name which will be resolved to a commit ID.
1197 An abbreviated hash argument will be expanded to a full SHA1 hash
1198 automatically, provided the abbreviation is unique.
1199 .It Fl r Ar repository-path
1200 Use the repository at the specified path.
1201 If not specified, assume the repository is located at or above the current
1203 If this directory is a
1205 work tree, use the repository path associated with this work tree.
1212 .Op Fl r Ar repository-path
1216 Display a listing of files and directories at the specified
1217 directory path in the repository.
1218 Entries shown in this listing may carry one of the following trailing
1220 .Bl -column YXZ description
1221 .It @ Ta entry is a symbolic link
1222 .It / Ta entry is a directory
1223 .It * Ta entry is an executable file
1224 .It $ Ta entry is a Git submodule
1227 Symbolic link entries are also annotated with the target path of the link.
1231 is specified, list the repository path corresponding to the current
1232 directory of the work tree, or the root directory of the repository
1233 if there is no work tree.
1240 List files and directories as they appear in the specified
1242 The expected argument is a commit ID SHA1 hash or an existing reference
1243 or tag name which will be resolved to a commit ID.
1244 An abbreviated hash argument will be expanded to a full SHA1 hash
1245 automatically, provided the abbreviation is unique.
1247 Show object IDs of files (blob objects) and directories (tree objects).
1249 Recurse into sub-directories in the repository.
1250 .It Fl r Ar repository-path
1251 Use the repository at the specified path.
1252 If not specified, assume the repository is located at or above the current
1254 If this directory is a
1256 work tree, use the repository path associated with this work tree.
1262 .Op Fl r Ar repository-path
1263 .Op Fl s Ar reference
1266 Manage references in a repository.
1268 References may be listed, created, deleted, and changed.
1269 When creating, deleting, or changing a reference the specified
1271 must be an absolute reference name, i.e. it must begin with
1279 Create a reference or change an existing reference.
1280 The reference with the specified
1282 will point at the specified
1286 argument is a ID SHA1 hash or an existing reference or tag name which will
1287 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
1288 Cannot be used together with any other options except
1291 Delete the reference with the specified
1293 from the repository.
1294 Any commit, tree, tag, and blob objects belonging to deleted references
1295 remain in the repository and may be removed separately with
1296 Git's garbage collector or
1297 .Cm gotadmin cleanup .
1298 Cannot be used together with any other options except
1301 List references in the repository.
1304 is specified, list all existing references in the repository.
1307 is a reference namespace, list all references in this namespace.
1308 Otherwise, show only the reference with the given
1310 Cannot be used together with any other options except
1314 .It Fl r Ar repository-path
1315 Use the repository at the specified path.
1316 If not specified, assume the repository is located at or above the current
1318 If this directory is a
1320 work tree, use the repository path associated with this work tree.
1321 .It Fl s Ar reference
1322 Create a symbolic reference, or change an existing symbolic reference.
1323 The symbolic reference with the specified
1325 will point at the specified
1327 which must already exist in the repository.
1328 Care should be taken not to create loops between references when
1329 this option is used.
1330 Cannot be used together with any other options except
1333 Sort listed references by modification time (most recently modified first)
1334 instead of sorting by lexicographical order.
1335 Use of this option requires the
1337 option to be used as well.
1345 .Op Fl r Ar repository-path
1349 Create, list, or delete branches.
1351 Local branches are managed via references which live in the
1353 reference namespace.
1356 command creates references in this namespace only.
1358 When deleting branches, the specified
1362 reference namespace first.
1363 If no corresponding branch is found, the
1365 namespace will be searched next.
1367 If invoked in a work tree without any arguments, print the name of the
1368 work tree's current branch.
1372 argument is passed, attempt to create a branch reference with the given name.
1373 By default the new branch reference will point at the latest commit on the
1374 work tree's current branch if invoked in a work tree, and otherwise to a commit
1375 resolved via the repository's HEAD reference.
1377 If invoked in a work tree, once the branch was created successfully
1378 switch the work tree's head reference to the newly created branch and
1379 update files across the entire work tree, just like
1380 .Cm got update -b Ar name
1382 Show the status of each affected file, using the following status codes:
1383 .Bl -column YXZ description
1384 .It U Ta file was updated and contained no local changes
1385 .It G Ta file was updated and local changes were merged cleanly
1386 .It C Ta file was updated and conflicts occurred during merge
1387 .It D Ta file was deleted
1388 .It A Ta new file was added
1389 .It \(a~ Ta versioned file is obstructed by a non-regular file
1390 .It ! Ta a missing versioned file was restored
1398 Make a newly created branch reference point at the specified
1402 argument is a commit ID SHA1 hash or an existing reference
1403 or tag name which will be resolved to a commit ID.
1411 can also be used to represent the work tree's base commit
1412 and branch head, respectively.
1413 The former is only valid if invoked in a work tree, while the latter will
1414 resolve to the tip of the work tree's current branch if invoked in a
1415 work tree, otherwise it will resolve to the repository's HEAD reference.
1416 Keywords and references may be appended with
1420 modifiers and an optional integer N to denote the
1421 Nth descendant or antecedent by first parent traversal, respectively;
1424 denotes the work tree branch head's 2nd generation ancestor, and
1426 denotes the 4th generation descendant of the work tree's base commit.
1429 will denote the 3rd generation descendant of the commit resolved by the
1436 modifier without a trailing integer has an implicit
1445 Delete the branch with the specified
1451 reference namespace.
1453 Only the branch reference is deleted.
1454 Any commit, tree, and blob objects belonging to the branch
1455 remain in the repository and may be removed separately with
1456 Git's garbage collector or
1457 .Cm gotadmin cleanup .
1459 List all existing branches in the repository, including copies of remote
1460 repositories' branches in the
1462 reference namespace.
1464 If invoked in a work tree, the work tree's current branch is shown
1465 with one of the following annotations:
1466 .Bl -column YXZ description
1467 .It * Ta work tree's base commit matches the branch tip
1468 .It \(a~ Ta work tree's base commit is out-of-date
1471 Do not switch and update the work tree after creating a new branch.
1472 .It Fl r Ar repository-path
1473 Use the repository at the specified path.
1474 If not specified, assume the repository is located at or above the current
1476 If this directory is a
1478 work tree, use the repository path associated with this work tree.
1480 Sort listed branches by modification time (most recently modified first)
1481 instead of sorting by lexicographical order.
1484 reference namespace are listed before branches in
1487 Use of this option requires the
1489 option to be used as well.
1496 .Op Fl r Ar repository-path
1497 .Op Fl s Ar signer-id
1500 Manage tags in a repository.
1502 Tags are managed via references which live in the
1504 reference namespace.
1507 command operates on references in this namespace only.
1508 References in this namespace point at tag objects which contain a pointer
1509 to another object, a tag message, as well as author and timestamp information.
1511 Attempt to create a tag with the given
1513 and make this tag point at the given
1515 If no commit is specified, default to the latest commit on the work tree's
1516 current branch if invoked in a work tree, and to a commit resolved via
1517 the repository's HEAD reference otherwise.
1524 Make the newly created tag reference point at the specified
1528 argument is a commit ID SHA1 hash or an existing reference or tag name which
1529 will be resolved to a commit ID.
1530 An abbreviated hash argument will be expanded to a full SHA1 hash
1531 automatically, provided the abbreviation is unique.
1533 List all existing tags in the repository instead of creating a new tag.
1536 argument is passed, show only the tag with the given
1539 Use the specified tag message when creating the new tag.
1544 opens a temporary file in an editor where a tag message can be written.
1545 Quitting the editor without saving the file will abort the tag operation.
1546 .It Fl r Ar repository-path
1547 Use the repository at the specified path.
1548 If not specified, assume the repository is located at or above the current
1550 If this directory is a
1552 work tree, use the repository path associated with this work tree.
1553 .It Fl s Ar signer-id
1554 While creating a new tag, sign this tag with the identity given in
1557 For SSH-based signatures,
1559 is the path to a file which may refer to either a private SSH key,
1560 or a public SSH key with the private half available via
1563 will sign the tag object by invoking
1567 command, using the signature namespace
1569 for compatibility with
1572 Verify tag object signatures.
1575 is specified, show and verify the tag object with the provided name.
1576 Otherwise, list all tag objects and verify signatures where present.
1579 verifies SSH-based signatures by invoking
1582 .Fl Y Cm verify Fl f Ar allowed_signers .
1587 otherwise verification is impossible.
1590 During SSH signature creation and verification this option will be passed to
1592 Multiple -v options increase the verbosity.
1598 command will not delete tags or change existing tags.
1599 If a tag must be deleted, the
1601 command may be used to delete a tag's reference.
1602 This should only be done if the tag has not already been copied to
1609 Schedule unversioned files in a work tree for addition to the
1610 repository in the next commit.
1611 By default, files which match a
1613 ignore pattern will not be added.
1617 mentioned in the command line is not an unversioned file then
1620 To avoid unnecessary errors from paths picked up by file globbing patterns
1621 in the shell, paths in the argument list will be silently ignored if they
1624 at all, or if they are reported with one of the following status codes
1625 and do not have changes staged via
1627 .Bl -column YXZ description
1628 .It M Ta modified file
1629 .It A Ta file scheduled for addition in next commit
1630 .It C Ta modified or added file which contains merge conflicts
1631 .It m Ta modified file modes (executable bit only)
1639 Add files even if they match a
1643 Permit recursion into directories.
1644 If this option is not specified,
1646 will refuse to run if a specified
1654 .Op Fl s Ar status-codes
1658 Remove versioned files from a work tree and schedule them for deletion
1659 from the repository in the next commit.
1666 Perform the operation even if a file contains local modifications,
1667 and do not raise an error if a specified
1669 does not exist on disk.
1671 Keep affected files on disk.
1673 Permit recursion into directories.
1674 If this option is not specified,
1676 will refuse to run if a specified
1679 .It Fl s Ar status-codes
1680 Only delete files with a modification status matching one of the
1681 single-character status codes contained in the
1684 The following status codes may be specified:
1685 .Bl -column YXZ description
1686 .It M Ta modified file (this implies the
1689 .It ! Ta versioned file expected on disk but missing
1697 .Op Fl p Ar strip-count
1703 to files in a work tree.
1704 Files added or removed by a patch will be scheduled for addition or removal in
1707 The patch must be in the unified diff format as produced by
1714 diff when invoked with their
1719 argument is provided, read unified diff data from standard input instead.
1723 contains multiple patches, then attempt to apply each of them in sequence.
1725 Show the status of each affected file, using the following status codes:
1726 .Bl -column XYZ description
1727 .It M Ta file was modified
1728 .It G Ta file was merged using a merge-base found in the repository
1729 .It C Ta file was merged and conflicts occurred during merge
1730 .It D Ta file was deleted
1731 .It A Ta file was added
1732 .It # Ta failed to patch the file
1735 If a change does not match at its exact line number, attempt to
1736 apply it somewhere else in the file if a good spot can be found.
1737 Otherwise, the patch will fail to apply.
1741 will refuse to apply a patch if certain preconditions are not met.
1742 Files to be deleted must already be under version control, and must
1743 not have been scheduled for deletion already.
1744 Files to be added must not yet be under version control and must not
1745 already be present on disk.
1746 Files to be modified must already be under version control and may not
1747 contain conflict markers.
1749 If an error occurs, the
1751 operation will be aborted.
1752 Any changes made to the work tree up to this point will be left behind.
1753 Such changes can be viewed with
1755 and can be reverted with
1764 Attempt to locate files within the specified
1766 for use as a merge-base for 3-way merges.
1769 argument is a commit ID SHA1 hash or an existing reference
1770 or tag name which will be resolved to a commit ID.
1771 An abbreviated hash argument will be expanded to a full SHA1 hash
1772 automatically, provided the abbreviation is unique.
1780 can also be used to represent the work tree's base commit
1781 and branch head, respectively.
1782 Keywords and references may be appended with
1786 modifiers and an optional integer N to denote the
1787 Nth descendant or antecedent by first parent traversal, respectively;
1790 denotes the work tree branch head's 2nd generation ancestor, and
1792 denotes the 4th generation descendant of the work tree's base commit.
1795 will denote the 3rd generation descendant of the commit resolved by the
1802 modifier without a trailing integer has an implicit
1810 Ideally, the specified
1812 should contain versions of files which the changes contained in the
1815 Files will be located by path, relative to the repository root.
1818 option is used then leading path components will be stripped
1819 before paths are looked up in the repository.
1823 option is not used then
1825 will attempt to locate merge-bases via object IDs found in
1827 meta-data, such as produced by
1833 option is only recommended in the absence of such meta-data.
1835 In case no merge-base is available for a file, changes will be applied
1836 without doing a 3-way merge.
1837 Changes which do not apply cleanly may then be rejected entirely, rather
1838 than producing merge conflicts in the patched target file.
1840 Do not make any modifications to the work tree.
1841 This can be used to check whether a patch would apply without issues.
1844 contains diffs that affect the same file multiple times, the results
1845 displayed may be incorrect.
1846 .It Fl p Ar strip-count
1847 Specify the number of leading path components to strip from paths
1856 path prefixes generated by
1858 will be recognized and stripped automatically.
1860 Reverse the patch before applying it.
1866 .Op Fl F Ar response-script
1870 Revert any local changes in files at the specified paths in a work tree.
1871 File contents will be overwritten with those contained in the
1872 work tree's base commit.
1873 There is no way to bring discarded changes back after
1876 If a file was added with
1878 it will become an unversioned file again.
1879 If a file was deleted with
1881 it will be restored.
1887 .It Fl F Ar response-script
1895 responses line-by-line from the specified
1897 file instead of prompting interactively.
1899 Instead of reverting all changes in files, interactively select or reject
1900 changes to revert based on
1906 (quit reverting this file) responses.
1907 If a file is in modified status, individual patches derived from the
1908 modified file content can be reverted.
1909 Files in added or deleted status may only be reverted in their entirety.
1911 Permit recursion into directories.
1912 If this option is not specified,
1914 will refuse to run if a specified
1928 Create a new commit in the repository from changes in a work tree
1929 and use this commit as the new base commit for the work tree.
1932 is specified, commit all changes in the work tree.
1933 Otherwise, commit changes at or within the specified paths.
1935 If changes have been explicitly staged for commit with
1937 only commit staged changes and reject any specified paths which
1938 have not been staged.
1941 opens a temporary file in an editor where a log message can be written
1949 options are used together.
1950 Quitting the editor without saving the file will abort the commit operation.
1952 Show the status of each affected file, using the following status codes:
1953 .Bl -column YXZ description
1954 .It M Ta modified file
1955 .It D Ta file was deleted
1956 .It A Ta new file was added
1957 .It m Ta modified file modes (executable bit only)
1960 Files which are not part of the new commit will retain their previously
1961 recorded base commit.
1964 commands may refuse to run while the work tree contains files from
1965 multiple base commits.
1966 The base commit of such a work tree can be made consistent by running
1968 across the entire work tree.
1972 command requires the
1974 environment variable to be set,
1975 unless an author has been configured in
1981 configuration settings can be
1982 obtained from the repository's
1984 file or from Git's global
1993 Set author information in the newly created commit to
1995 This is useful when committing changes on behalf of someone else.
1998 argument must use the same format as the
2000 environment variable.
2002 In addition to storing author information, the newly created commit
2005 information which is obtained, as usual, from the
2007 environment variable, or
2009 or Git configuration settings.
2011 Allow committing files in conflicted status.
2013 Committing files with conflict markers should generally be avoided.
2014 Cases where conflict markers must be stored in the repository for
2015 some legitimate reason should be very rare.
2016 There are usually ways to avoid storing conflict markers verbatim by
2017 applying appropriate programming tricks.
2019 Use the prepared log message stored in the file found at
2021 when creating the new commit.
2023 opens a temporary file in an editor where the prepared log message can be
2024 reviewed and edited further if needed.
2025 Cannot be used together with the
2029 Use the specified log message when creating the new commit.
2030 Cannot be used together with the
2034 This option prevents
2036 from opening the commit message in an editor.
2037 It has no effect unless it is used together with the
2039 option and is intended for non-interactive use such as scripting.
2041 This option prevents
2043 from generating a diff of the to-be-committed changes in a temporary file
2044 which can be viewed while editing a commit message.
2046 Allow the addition of symbolic links which point outside of the path space
2047 that is under version control.
2050 will reject such symbolic links due to safety concerns.
2053 may decide to represent such a symbolic link as a regular file which contains
2054 the link's target path, rather than creating an actual symbolic link which
2055 points outside of the work tree.
2056 Use of this option is discouraged because external mechanisms such as
2058 are better suited for managing symbolic links to paths not under
2063 will refuse to run if certain preconditions are not met.
2064 If the work tree's current branch is not in the
2066 reference namespace, new commits may not be created on this branch.
2067 Local changes may only be committed if they are based on file content
2068 found in the most recent commit on the work tree's branch.
2069 If a path is found to be out of date,
2071 must be used first in order to merge local changes with changes made
2079 .Op Fl r Ar repository-path
2081 .Op Ar remote-repository
2084 Send new changes to a remote repository.
2086 .Ar remote-repository
2090 The remote repository's URL is obtained from the corresponding entry in
2094 file of the local repository, as created by
2097 All objects corresponding to new changes will be written to a temporary
2098 pack file which is then uploaded to the server.
2099 Upon success, references in the
2101 reference namespace of the local repository will be updated to point at
2102 the commits which have been sent.
2104 By default, changes will only be sent if they are based on up-to-date
2105 copies of relevant branches in the remote repository.
2106 If any changes to be sent are based on out-of-date copies or would
2107 otherwise break linear history of existing branches, new changes must
2108 be fetched from the server with
2110 and local branches must be rebased with
2117 option can be used to make exceptions to these requirements.
2124 Send all branches from the local repository's
2126 reference namespace.
2129 option is equivalent to listing all branches with multiple
2132 Cannot be used together with the
2138 from the local repository's
2140 reference namespace.
2141 This option may be specified multiple times to build a list of branches
2143 If this option is not specified, default to the work tree's current branch
2144 if invoked in a work tree, or to the repository's HEAD reference.
2145 Cannot be used together with the
2149 Delete the specified
2151 from the remote repository's
2153 reference namespace.
2154 This option may be specified multiple times to build a list of branches
2157 Only references are deleted.
2158 Any commit, tree, tag, and blob objects belonging to deleted branches
2159 may become subject to deletion by Git's garbage collector running on
2162 Requesting deletion of branches results in an error if the server
2163 does not support this feature or disallows the deletion of branches
2164 based on its configuration.
2166 Attempt to force the server to overwrite existing branches or tags
2167 in the remote repository, even when
2173 would usually be required before changes can be sent.
2174 The server may reject forced requests regardless, depending on its
2177 Any commit, tree, tag, and blob objects belonging to overwritten branches
2178 or tags may become subject to deletion by Git's garbage collector running
2183 reference namespace is globally shared between all repositories.
2186 option to overwrite tags is discouraged because it can lead to
2187 inconsistencies between the tags present in different repositories.
2188 In general, creating a new tag with a different name is recommended
2189 instead of overwriting an existing tag.
2193 option is particularly discouraged if changes being sent are based
2194 on an out-of-date copy of a branch in the remote repository.
2195 Instead of using the
2197 option, new changes should
2200 and local branches should be rebased with
2204 followed by another attempt to send the changes.
2208 option should only be needed in situations where the remote repository's
2209 copy of a branch or tag is known to be out-of-date and is considered
2211 The risks of creating inconsistencies between different repositories
2212 should also be taken into account.
2214 Suppress progress reporting output.
2215 The same option will be passed to
2218 .It Fl r Ar repository-path
2219 Use the repository at the specified path.
2220 If not specified, assume the repository is located at or above the current
2222 If this directory is a
2224 work tree, use the repository path associated with this work tree.
2226 Attempt to send all tags from the local repository's
2228 reference namespace.
2231 option is equivalent to listing all tags with multiple
2234 Cannot be used together with the
2240 from the local repository's
2242 reference namespace, in addition to any branches that are being sent.
2245 option may be specified multiple times to build a list of tags to send.
2246 No tags will be sent if the
2250 Raise an error if the specified
2252 already exists in the remote repository, unless the
2254 option is used to overwrite the server's copy of the tag.
2255 In general, creating a new tag with a different name is recommended
2256 instead of overwriting an existing tag.
2258 Cannot be used together with the
2265 to print debugging messages to standard error output.
2266 The same option will be passed to
2269 Multiple -v options increase the verbosity.
2279 Merge changes from a single
2284 should be on a different branch than the work tree's base commit.
2285 The expected argument is a reference or a commit ID SHA1 hash.
2286 An abbreviated hash argument will be expanded to a full SHA1 hash
2287 automatically, provided the abbreviation is unique.
2295 can also be used to represent the work tree's base commit
2296 and branch head, respectively.
2297 Keywords and references may be appended with
2301 modifiers and an optional integer N to denote the
2302 Nth descendant or antecedent by first parent traversal, respectively;
2305 denotes the work tree branch head's 2nd generation ancestor, and
2307 denotes the 4th generation descendant of the work tree's base commit.
2310 will denote the 3rd generation descendant of the commit resolved by the
2317 modifier without a trailing integer has an implicit
2326 Show the status of each affected file, using the following status codes:
2327 .Bl -column YXZ description
2328 .It G Ta file was merged
2329 .It C Ta file was merged and conflicts occurred during merge
2330 .It ! Ta changes destined for a missing file were not merged
2331 .It D Ta file was deleted
2332 .It d Ta file's deletion was prevented by local modifications
2333 .It A Ta new file was added
2334 .It \(a~ Ta changes destined for a non-regular file were not merged
2335 .It ? Ta changes destined for an unversioned file were not merged
2338 The merged changes will appear as local changes in the work tree, which
2341 amended manually or with further
2347 If invoked in a work tree where no
2352 operation is taking place,
2354 creates a record of commits which have been merged into the work tree.
2355 When a file changed by
2359 the log messages of relevant merged commits will then appear in the editor,
2360 where the messages should be further adjusted to convey the reasons for
2361 cherrypicking the changes.
2362 Upon exiting the editor, if the time stamp of the log message file
2363 is unchanged or the log message is empty,
2365 will fail with an unmodified or empty log message error.
2367 If all the changes in all files touched by a given commit are discarded,
2370 this commit's log message record will also disappear.
2373 will refuse to run if certain preconditions are not met.
2374 If the work tree contains multiple base commits, it must first be updated
2375 to a single base commit with
2377 If any relevant files already contain merge conflicts, these
2378 conflicts must be resolved first.
2386 Display a list of commit log messages recorded by cherrypick operations,
2387 represented by references in the
2388 .Dq refs/got/worktree
2389 reference namespace.
2392 is specified, only show the log message of the specified commit.
2394 If invoked in a work tree, only log messages recorded by cherrypick operations
2395 in the current work tree will be displayed.
2396 Otherwise, all commit log messages will be displayed irrespective of the
2397 work tree in which they were created.
2398 This option cannot be used with
2401 Delete log messages created by previous cherrypick operations, represented by
2403 .Dq refs/got/worktree
2404 reference namespace.
2407 is specified, only delete the log message of the specified commit.
2409 If invoked in a work tree, only log messages recorded by cherrypick operations
2410 in the current work tree will be deleted.
2411 Otherwise, all commit log messages will be deleted irrespective of the
2412 work tree in which they were created.
2413 This option cannot be used with
2424 Reverse-merge changes from a single
2429 should be on the same branch as the work tree's base commit.
2430 The expected argument is a reference or a commit ID SHA1 hash.
2431 An abbreviated hash argument will be expanded to a full SHA1 hash
2432 automatically, provided the abbreviation is unique.
2440 can also be used to represent the work tree's base commit
2441 and branch head, respectively.
2442 Keywords and references may be appended with
2446 modifiers and an optional integer N to denote the
2447 Nth descendant or antecedent by first parent traversal, respectively;
2450 denotes the work tree branch head's 2nd generation ancestor, and
2452 denotes the 4th generation descendant of the work tree's base commit.
2455 will denote the 5th generation descendant of the commit resolved by the
2462 modifier without a trailing integer has an implicit
2471 Show the status of each affected file, using the following status codes:
2472 .Bl -column YXZ description
2473 .It G Ta file was merged
2474 .It C Ta file was merged and conflicts occurred during merge
2475 .It ! Ta changes destined for a missing file were not merged
2476 .It D Ta file was deleted
2477 .It d Ta file's deletion was prevented by local modifications
2478 .It A Ta new file was added
2479 .It \(a~ Ta changes destined for a non-regular file were not merged
2480 .It ? Ta changes destined for an unversioned file were not merged
2483 The reverse-merged changes will appear as local changes in the work tree,
2484 which may be viewed with
2486 amended manually or with further
2492 If invoked in a work tree where no
2497 operation is taking place,
2499 creates a record of commits which have been reverse-merged into the work tree.
2500 When a file changed by
2504 the log messages of relevant reverse-merged commits will then appear in
2505 the editor, where the messages should be further adjusted to convey the
2506 reasons for backing out the changes.
2507 Upon exiting the editor, if the time stamp of the log message file
2508 is unchanged or the log message is empty,
2510 will fail with an unmodified or empty log message error.
2512 If all the changes in all files touched by a given commit are discarded,
2515 this commit's log message record will also disappear.
2518 will refuse to run if certain preconditions are not met.
2519 If the work tree contains multiple base commits, it must first be updated
2520 to a single base commit with
2522 If any relevant files already contain merge conflicts, these
2523 conflicts must be resolved first.
2531 Display a list of commit log messages recorded by backout operations,
2532 represented by references in the
2533 .Dq refs/got/worktree
2534 reference namespace.
2537 is specified, only show the log message of the specified commit.
2539 If invoked in a work tree, only log messages recorded by backout operations
2540 in the current work tree will be displayed.
2541 Otherwise, all commit log messages will be displayed irrespective of the
2542 work tree in which they were created.
2543 This option cannot be used with
2546 Delete log messages created by previous backout operations, represented by
2548 .Dq refs/got/worktree
2549 reference namespace.
2552 is specified, only delete the log message of the specified commit.
2554 If invoked in a work tree, only log messages recorded by backout operations
2555 in the current work tree will be deleted.
2556 Otherwise, all commit log messages will be deleted irrespective of the
2557 work tree in which they were created.
2558 This option cannot be used with
2569 Rebase commits on the specified
2571 onto the tip of the current branch of the work tree.
2574 must share common ancestry with the work tree's current branch.
2575 Rebasing begins with the first descendant commit of the youngest
2576 common ancestor commit shared by the specified
2578 and the work tree's current branch, and stops once the tip commit
2585 is used as intended, the specified
2587 represents a local commit history and may already contain changes
2588 that are not yet visible in any other repositories.
2589 The work tree's current branch, which must be set with
2593 operation, represents a branch from a remote repository which shares
2594 a common history with the specified
2596 but has progressed, and perhaps diverged, due to commits added to the
2599 Rebased commits are accumulated on a temporary branch which the work tree
2600 will remain switched to throughout the entire rebase operation.
2601 Commits on this branch represent the same changes with the same log
2602 messages as their counterparts on the original
2604 but with different commit IDs.
2605 Once rebasing has completed successfully, the temporary branch becomes
2606 the new version of the specified
2608 and the work tree is automatically switched to it.
2609 If author information is available via the
2611 environment variable,
2617 configuration settings, this author information will be used to identify
2622 Old commits in their pre-rebase state are automatically backed up in the
2623 .Dq refs/got/backup/rebase
2624 reference namespace.
2625 As long as these references are not removed older versions of rebased
2626 commits will remain in the repository and can be viewed with the
2629 Removal of these references makes objects which become unreachable via
2630 any reference subject to removal by Git's garbage collector or
2631 .Cm gotadmin cleanup .
2633 While rebasing commits, show the status of each affected file,
2634 using the following status codes:
2635 .Bl -column YXZ description
2636 .It G Ta file was merged
2637 .It C Ta file was merged and conflicts occurred during merge
2638 .It ! Ta changes destined for a missing file were not merged
2639 .It D Ta file was deleted
2640 .It d Ta file's deletion was prevented by local modifications
2641 .It A Ta new file was added
2642 .It \(a~ Ta changes destined for a non-regular file were not merged
2643 .It ? Ta changes destined for an unversioned file were not merged
2646 If merge conflicts occur, the rebase operation is interrupted and may
2647 be continued once conflicts have been resolved.
2648 If any files with destined changes are found to be missing or unversioned,
2649 or if files could not be deleted due to differences in deleted content,
2650 the rebase operation will be interrupted to prevent potentially incomplete
2651 changes from being committed to the repository without user intervention.
2652 The work tree may be modified as desired and the rebase operation can be
2653 continued once the changes present in the work tree are considered complete.
2654 Alternatively, the rebase operation may be aborted which will leave
2656 unmodified and the work tree switched back to its original branch.
2658 If a merge conflict is resolved in a way which renders the merged
2659 change into a no-op change, the corresponding commit will be elided
2660 when the rebase operation continues.
2663 will refuse to run if certain preconditions are not met.
2668 reference namespace, the branch may not be rebased.
2669 If the work tree is not yet fully updated to the tip commit of its
2670 branch, then the work tree must first be updated with
2672 If changes have been staged with
2674 these changes must first be committed with
2678 If the work tree contains local changes, these changes must first be
2685 contains changes to files outside of the work tree's path prefix,
2686 the work tree cannot be used to rebase this branch.
2695 commands will refuse to run while a rebase operation is in progress.
2696 Other commands which manipulate the work tree may be used for
2697 conflict resolution purposes.
2701 is already based on the work tree's current branch, then no commits
2702 need to be rebased and
2704 will simply switch the work tree to the specified
2706 and update files in the work tree accordingly.
2713 Abort an interrupted rebase operation.
2714 If this option is used, no other command-line arguments are allowed.
2716 Allow a rebase operation to continue with files in conflicted status.
2717 This option should generally be avoided, and can only be used with the
2721 Continue an interrupted rebase operation.
2722 If this option is used, no other command-line arguments are allowed except
2725 Show a list of past rebase operations, represented by references in the
2726 .Dq refs/got/backup/rebase
2727 reference namespace.
2729 Display the author, date, and log message of each backed up commit,
2730 the object ID of the corresponding post-rebase commit, and
2731 the object ID of their common ancestor commit.
2732 Given these object IDs,
2739 options can be used to examine the history of either version of the branch,
2744 option can be used to create a new branch from a pre-rebase state if desired.
2748 is specified, only show commits which at some point in time represented this
2750 Otherwise, list all backed up commits for any branches.
2752 If this option is used,
2754 does not require a work tree.
2755 None of the other options can be used together with
2758 Delete backups created by past rebase operations, represented by references
2760 .Dq refs/got/backup/rebase
2761 reference namespace.
2765 is specified, only delete backups which at some point in time represented
2767 Otherwise, delete all references found within
2768 .Dq refs/got/backup/rebase .
2770 Any commit, tree, tag, and blob objects belonging to deleted backups
2771 remain in the repository and may be removed separately with
2772 Git's garbage collector or
2773 .Cm gotadmin cleanup .
2775 If this option is used,
2777 does not require a work tree.
2778 None of the other options can be used together with
2785 .Op Fl F Ar histedit-script
2789 Edit commit history between the work tree's current base commit and
2790 the tip commit of the work tree's current branch.
2794 command requires the
2796 environment variable to be set,
2797 unless an author has been configured in
2803 configuration settings can be obtained from the repository's
2805 file or from Git's global
2811 operation, the work tree's current branch must be set with
2813 to the branch which should be edited, unless this branch is already the
2814 current branch of the work tree.
2815 The tip of this branch represents the upper bound (inclusive) of commits
2820 Furthermore, the work tree's base commit
2823 to a point in this branch's commit history where editing should begin.
2824 This commit represents the lower bound (non-inclusive) of commits touched
2829 Editing of commit history is controlled via a
2831 which can be written in an editor based on a template, passed on the
2832 command line, or generated with the
2839 Quitting the editor without saving the file will abort the histedit operation.
2841 The format of the histedit script is line-based.
2842 Each line in the script begins with a command name, followed by
2843 whitespace and an argument.
2844 For most commands, the expected argument is a commit ID SHA1 hash.
2845 Any remaining text on the line is ignored.
2846 Lines which begin with the
2848 character are ignored entirely.
2850 The available histedit script commands are as follows:
2851 .Bl -column YXZ pick-commit
2852 .It Cm pick Ar commit Ta Use the specified commit as it is.
2853 .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
2854 then interrupt the histedit operation for amending, without creating a commit.
2855 While the histedit operation is interrupted arbitrary files may be edited,
2856 and commands which manipulate the work tree can be used freely.
2861 commands can be used to add new files or remove existing ones.
2864 command can be used to eliminate arbitrary changes from files in the work tree.
2867 command may be used to prepare a subset of changes for inclusion in the
2871 command can be used to insert arbitrary commits into the edited history.
2872 Regular editing of history must eventually be resumed by running
2873 .Cm got histedit -c .
2874 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
2875 listed further below that will be used.
2876 .It Cm drop Ar commit Ta Remove this commit from the edited history.
2877 .It Cm mesg Oo Ar log-message Oc Ta Create a new log message for the commit of
2882 command on the previous line of the histedit script.
2885 argument provides a new single-line log message to use.
2888 argument is omitted, open an editor where a new log message can be written.
2891 Every commit in the history being edited must be mentioned in the script.
2892 Lines may be re-ordered to change the order of commits in the edited history.
2893 No commit may be listed more than once.
2895 Edited commits are accumulated on a temporary branch which the work tree
2896 will remain switched to throughout the entire histedit operation.
2897 Once history editing has completed successfully, the temporary branch becomes
2898 the new version of the work tree's branch and the work tree is automatically
2901 Old commits in their pre-histedit state are automatically backed up in the
2902 .Dq refs/got/backup/histedit
2903 reference namespace.
2904 As long as these references are not removed older versions of edited
2905 commits will remain in the repository and can be viewed with the
2908 Removal of these references makes objects which become unreachable via
2909 any reference subject to removal by Git's garbage collector or
2910 .Cm gotadmin cleanup .
2912 While merging commits, show the status of each affected file,
2913 using the following status codes:
2914 .Bl -column YXZ description
2915 .It G Ta file was merged
2916 .It C Ta file was merged and conflicts occurred during merge
2917 .It ! Ta changes destined for a missing file were not merged
2918 .It D Ta file was deleted
2919 .It d Ta file's deletion was prevented by local modifications
2920 .It A Ta new file was added
2921 .It \(a~ Ta changes destined for a non-regular file were not merged
2922 .It ? Ta changes destined for an unversioned file were not merged
2925 If merge conflicts occur, the histedit operation is interrupted and may
2926 be continued once conflicts have been resolved.
2927 If any files with destined changes are found to be missing or unversioned,
2928 or if files could not be deleted due to differences in deleted content,
2929 the histedit operation will be interrupted to prevent potentially incomplete
2930 changes from being committed to the repository without user intervention.
2931 The work tree may be modified as desired and the histedit operation can be
2932 continued once the changes present in the work tree are considered complete.
2933 Alternatively, the histedit operation may be aborted which will leave
2934 the work tree switched back to its original branch.
2936 If a merge conflict is resolved in a way which renders the merged
2937 change into a no-op change, the corresponding commit will be elided
2938 when the histedit operation continues.
2941 will refuse to run if certain preconditions are not met.
2942 If the work tree's current branch is not in the
2944 reference namespace, the history of the branch may not be edited.
2945 If the work tree contains multiple base commits, it must first be updated
2946 to a single base commit with
2948 If changes have been staged with
2950 these changes must first be committed with
2954 If the work tree contains local changes, these changes must first be
2959 If the edited history contains changes to files outside of the work tree's
2960 path prefix, the work tree cannot be used to edit the history of this branch.
2968 commands will refuse to run while a histedit operation is in progress.
2969 Other commands which manipulate the work tree may be used, and the
2971 command may be used to commit arbitrary changes to the temporary branch
2972 while the histedit operation is interrupted.
2979 Abort an interrupted histedit operation.
2980 If this option is used, no other command-line arguments are allowed.
2982 Allow a histedit operation to continue with files in conflicted status.
2983 This option should generally be avoided, and can only be used with the
2987 Continue an interrupted histedit operation.
2988 If this option is used, no other command-line arguments are allowed except
2992 This option is a quick equivalent to a histedit script which drops all
2996 option can only be used when starting a new histedit operation.
2997 If this option is used, no other command-line arguments are allowed.
2999 Interrupt the histedit operation for editing after merging each commit.
3000 This option is a quick equivalent to a histedit script which uses the
3002 command for all commits.
3005 option can only be used when starting a new histedit operation.
3006 If this option is used, no other command-line arguments are allowed.
3007 .It Fl F Ar histedit-script
3010 instead of opening a temporary file in an editor where a histedit script
3013 Fold all commits into a single commit.
3014 This option is a quick equivalent to a histedit script which folds all
3015 commits, combining them all into one commit.
3018 option can only be used when starting a new histedit operation.
3019 If this option is used, no other command-line arguments are allowed.
3021 Show a list of past histedit operations, represented by references in the
3022 .Dq refs/got/backup/histedit
3023 reference namespace.
3025 Display the author, date, and log message of each backed up commit,
3026 the object ID of the corresponding post-histedit commit, and
3027 the object ID of their common ancestor commit.
3028 Given these object IDs,
3035 options can be used to examine the history of either version of the branch,
3040 option can be used to create a new branch from a pre-histedit state if desired.
3044 is specified, only show commits which at some point in time represented this
3046 Otherwise, list all backed up commits for any branches.
3048 If this option is used,
3050 does not require a work tree.
3051 None of the other options can be used together with
3054 Edit log messages only.
3055 This option is a quick equivalent to a histedit script which edits
3056 only log messages but otherwise leaves every picked commit as-is.
3059 option can only be used when starting a new histedit operation.
3060 If this option is used, no other command-line arguments are allowed.
3062 Delete backups created by past histedit operations, represented by references
3064 .Dq refs/got/backup/histedit
3065 reference namespace.
3069 is specified, only delete backups which at some point in time represented
3071 Otherwise, delete all references found within
3072 .Dq refs/got/backup/histedit .
3074 Any commit, tree, tag, and blob objects belonging to deleted backups
3075 remain in the repository and may be removed separately with
3076 Git's garbage collector or
3077 .Cm gotadmin cleanup .
3079 If this option is used,
3081 does not require a work tree.
3082 None of the other options can be used together with
3086 .It Cm integrate Ar branch
3088 Integrate the specified
3090 into the work tree's current branch.
3091 Files in the work tree are updated to match the contents on the integrated
3093 and the reference of the work tree's branch is changed to point at the
3094 head commit of the integrated
3097 Both branches can be considered equivalent after integration since they
3098 will be pointing at the same commit.
3099 Both branches remain available for future work, if desired.
3100 In case the integrated
3102 is no longer needed it may be deleted with
3105 Show the status of each affected file, using the following status codes:
3106 .Bl -column YXZ description
3107 .It U Ta file was updated
3108 .It D Ta file was deleted
3109 .It A Ta new file was added
3110 .It \(a~ Ta versioned file is obstructed by a non-regular file
3111 .It ! Ta a missing versioned file was restored
3115 will refuse to run if certain preconditions are not met.
3116 Most importantly, the
3118 must have been rebased onto the work tree's current branch with
3120 before it can be integrated, in order to linearize commit history and
3121 resolve merge conflicts.
3122 If the work tree contains multiple base commits, it must first be updated
3123 to a single base commit with
3125 If changes have been staged with
3127 these changes must first be committed with
3131 If the work tree contains local changes, these changes must first be
3145 into the current branch of the work tree.
3146 If the branches have diverged, creates a merge commit.
3149 already includes all commits from the work tree's branch, updates the work
3150 tree's branch to be the same as
3152 without creating a commit, and updates the work tree to the most recent commit
3155 If a linear project history is desired, then use of
3157 should be preferred over
3159 However, even strictly linear projects may require merge commits in order
3160 to merge in new versions of third-party code stored on vendor branches
3164 Merge commits are commits based on multiple parent commits.
3165 The tip commit of the work tree's current branch, which must be in the
3167 reference namespace and must be set with
3171 operation, will be used as the first parent.
3172 The tip commit of the specified
3174 will be used as the second parent.
3176 No ancestral relationship between the two branches is required.
3177 If the two branches have already been merged previously, only new changes
3180 It is not possible to create merge commits with more than two parents.
3181 If more than one branch needs to be merged, then multiple merge commits
3182 with two parents each can be created in sequence.
3184 While merging changes found on the
3186 into the work tree, show the status of each affected file,
3187 using the following status codes:
3188 .Bl -column YXZ description
3189 .It G Ta file was merged
3190 .It C Ta file was merged and conflicts occurred during merge
3191 .It ! Ta changes destined for a missing file were not merged
3192 .It D Ta file was deleted
3193 .It d Ta file's deletion was prevented by local modifications
3194 .It A Ta new file was added
3195 .It \(a~ Ta changes destined for a non-regular file were not merged
3196 .It ? Ta changes destined for an unversioned file were not merged
3199 If merge conflicts occur, the merge operation is interrupted and conflicts
3200 must be resolved before the merge operation can continue.
3201 If any files with destined changes are found to be missing or unversioned,
3202 or if files could not be deleted due to differences in deleted content,
3203 the merge operation will be interrupted to prevent potentially incomplete
3204 changes from being committed to the repository without user intervention.
3205 The work tree may be modified as desired and the merge can be continued
3206 once the changes present in the work tree are considered complete.
3207 Alternatively, the merge operation may be aborted which will leave
3208 the work tree's current branch unmodified.
3211 will refuse to run if certain preconditions are not met.
3212 If the work tree's current branch is not in the
3214 reference namespace then the work tree must first be switched to a
3219 If the work tree is not yet fully updated to the tip commit of its
3220 branch, then the work tree must first be updated with
3222 If the work tree contains multiple base commits, it must first be updated
3223 to a single base commit with
3225 If changes have been staged with
3227 these changes must first be committed with
3231 If the work tree contains local changes, these changes must first be
3238 contains changes to files outside of the work tree's path prefix,
3239 the work tree cannot be used to merge this branch.
3249 commands will refuse to run while a merge operation is in progress.
3250 Other commands which manipulate the work tree may be used for
3251 conflict resolution purposes.
3258 Abort an interrupted merge operation.
3259 If this option is used, no other command-line arguments are allowed.
3261 Allow a merge operation to continue with files in conflicted status.
3262 This option should generally be avoided, and can only be used with the
3266 Continue an interrupted merge operation.
3267 If this option is used, no other command-line arguments are allowed except
3270 Create a merge commit even if the branches have not diverged.
3272 Merge changes into the work tree as usual but do not create a merge
3274 The merge result can be adjusted as desired before a merge commit is
3277 Alternatively, the merge may be aborted with
3284 .Op Fl F Ar response-script
3288 Stage local changes for inclusion in the next commit.
3291 is specified, stage all changes in the work tree.
3292 Otherwise, stage changes at or within the specified paths.
3293 Paths may be staged if they are added, modified, or deleted according to
3296 Show the status of each affected file, using the following status codes:
3297 .Bl -column YXZ description
3298 .It A Ta file addition has been staged
3299 .It M Ta file modification has been staged
3300 .It D Ta file deletion has been staged
3303 Staged file contents are saved in newly created blob objects in the repository.
3304 These blobs will be referred to by tree objects once staged changes have been
3307 Staged changes affect the behaviour of
3312 While paths with staged changes exist, the
3314 command will refuse to commit any paths which do not have staged changes.
3315 Local changes created on top of staged changes can only be committed if
3316 the path is staged again, or if the staged changes are committed first.
3319 command will show both local changes and staged changes.
3322 command is able to display local changes relative to staged changes,
3323 and to display staged changes relative to the repository.
3326 command cannot revert staged changes but may be used to revert
3327 local changes created on top of staged changes.
3333 .It Fl F Ar response-script
3341 responses line-by-line from the specified
3343 file instead of prompting interactively.
3345 Instead of staging new changes, list paths which are already staged,
3346 along with the IDs of staged blob objects and stage status codes.
3347 If paths were provided on the command line, show the staged paths
3348 among the specified paths.
3349 Otherwise, show all staged paths.
3351 Instead of staging the entire content of a changed file, interactively
3352 select or reject changes for staging based on
3356 (reject change), and
3358 (quit staging this file) responses.
3359 If a file is in modified status, individual patches derived from the
3360 modified file content can be staged.
3361 Files in added or deleted status may only be staged or rejected in
3364 Allow staging of symbolic links which point outside of the path space
3365 that is under version control.
3368 will reject such symbolic links due to safety concerns.
3371 may decide to represent such a symbolic link as a regular file which contains
3372 the link's target path, rather than creating an actual symbolic link which
3373 points outside of the work tree.
3374 Use of this option is discouraged because external mechanisms such as
3376 are better suited for managing symbolic links to paths not under
3381 will refuse to run if certain preconditions are not met.
3382 If a file contains merge conflicts, these conflicts must be resolved first.
3383 If a file is found to be out of date relative to the head commit on the
3384 work tree's current branch, the file must be updated with
3386 before it can be staged (however, this does not prevent the file from
3387 becoming out-of-date at some point after having been staged).
3395 commands will refuse to run while staged changes exist.
3396 If staged changes cannot be committed because a staged path
3397 is out of date, the path must be unstaged with
3399 before it can be updated with
3401 and may then be staged again if necessary.
3406 .Op Fl F Ar response-script
3410 Merge staged changes back into the work tree and put affected paths
3411 back into non-staged status.
3414 is specified, unstage all staged changes across the entire work tree.
3415 Otherwise, unstage changes at or within the specified paths.
3417 Show the status of each affected file, using the following status codes:
3418 .Bl -column YXZ description
3419 .It G Ta file was unstaged
3420 .It C Ta file was unstaged and conflicts occurred during merge
3421 .It ! Ta changes destined for a missing file were not merged
3422 .It D Ta file was staged as deleted and still is deleted
3423 .It d Ta file's deletion was prevented by local modifications
3424 .It \(a~ Ta changes destined for a non-regular file were not merged
3431 .It Fl F Ar response-script
3439 responses line-by-line from the specified
3441 file instead of prompting interactively.
3443 Instead of unstaging the entire content of a changed file, interactively
3444 select or reject changes for unstaging based on
3448 (keep change staged), and
3450 (quit unstaging this file) responses.
3451 If a file is staged in modified status, individual patches derived from the
3452 staged file content can be unstaged.
3453 Files staged in added or deleted status may only be unstaged in their entirety.
3459 .Op Fl r Ar repository-path
3462 Parse and print contents of objects to standard output in a line-based
3464 Content of commit, tree, and tag objects is printed in a way similar
3465 to the actual content stored in such objects.
3466 Blob object contents are printed as they would appear in files on disk.
3468 Attempt to interpret each argument as a reference, a tag name, or
3469 an object ID SHA1 hash.
3470 References will be resolved to an object ID.
3471 Tag names will resolved to a tag object.
3472 An abbreviated hash argument will be expanded to a full SHA1 hash
3473 automatically, provided the abbreviation is unique.
3475 If none of the above interpretations produce a valid result, or if the
3477 option is used, attempt to interpret the argument as a path which will
3478 be resolved to the ID of an object found at this path in the repository.
3485 Look up paths in the specified
3487 If this option is not used, paths are looked up in the commit resolved
3488 via the repository's HEAD reference.
3489 The expected argument is a commit ID SHA1 hash or an existing reference
3490 or tag name which will be resolved to a commit ID.
3491 An abbreviated hash argument will be expanded to a full SHA1 hash
3492 automatically, provided the abbreviation is unique.
3494 Interpret all arguments as paths only.
3495 This option can be used to resolve ambiguity in cases where paths
3496 look like tag names, reference names, or object IDs.
3497 .It Fl r Ar repository-path
3498 Use the repository at the specified path.
3499 If not specified, assume the repository is located at or above the current
3501 If this directory is a
3503 work tree, use the repository path associated with this work tree.
3505 .It Cm info Op Ar path ...
3506 Display meta-data stored in a work tree.
3511 The work tree to use is resolved implicitly by walking upwards from the
3512 current working directory.
3516 arguments are specified, show additional per-file information for tracked
3517 files located at or within these paths.
3520 argument corresponds to the work tree's root directory, display information
3521 for all tracked files.
3524 .Bl -tag -width GOT_IGNORE_GITCONFIG
3526 The author's name and email address, such as
3527 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3538 may fail to parse commits without an email address in author data,
3542 environment variables with a missing email address.
3544 .Ev GOT_AUTHOR will be overridden by configuration settings in
3550 configuration settings in the repository's
3557 configuration settings contained in Git's global
3559 configuration file will only be used if neither
3563 environment variable provide author information.
3564 .It Ev GOT_IGNORE_GITCONFIG
3565 If this variable is set then any remote repository definitions or author
3566 information found in Git configuration files will be ignored.
3567 .It Ev GOT_LOG_DEFAULT_LIMIT
3568 The default limit on the number of commits traversed by
3570 If set to zero, the limit is unbounded.
3571 This variable will be silently ignored if it is set to a non-numeric value.
3572 .It Ev VISUAL , EDITOR
3573 The editor spawned by
3581 text editor will be spawned.
3584 .Bl -tag -width packed-refs -compact
3586 Repository-wide configuration settings for
3590 configuration file located in the root directory of a Git repository
3591 supersedes any relevant settings in Git's
3595 .It Pa .got/got.conf
3596 Worktree-specific configuration settings for
3600 configuration file in the
3602 meta-data directory of a work tree supersedes any relevant settings in
3605 configuration file and Git's
3612 Enable tab-completion of
3617 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3619 Clone an existing Git repository for use with
3623 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3625 Unfortunately, many of the popular Git hosting sites do not offer anonymous
3627 Such sites will require an account to be created, and a public SSH key to be
3628 uploaded to this account, before repository access via ssh:// URLs will work.
3630 Use of HTTP URLs currently requires
3634 .Dl $ git clone --bare https://github.com/openbsd/src.git
3636 Alternatively, for quick and dirty local testing of
3638 a new Git repository could be created and populated with files,
3639 e.g. from a temporary CVS checkout located at
3642 .Dl $ gotadmin init /var/git/src.git
3643 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3645 Check out a work tree from the Git repository to /usr/src:
3647 .Dl $ got checkout /var/git/src.git /usr/src
3649 View local changes in a work tree directory:
3651 .Dl $ got diff | less
3653 In a work tree, display files in a potentially problematic state:
3655 .Dl $ got status -s 'C!~?'
3657 Interactively revert selected local changes in a work tree directory:
3659 .Dl $ got revert -p -R\ .
3661 In a work tree or a git repository directory, list all branch references:
3665 As above, but list the most recently modified branches only:
3667 .Dl $ got branch -lt | head
3669 In a work tree or a git repository directory, create a new branch called
3670 .Dq unified-buffer-cache
3671 which is forked off the
3675 .Dl $ got branch -c master unified-buffer-cache
3677 Switch an existing work tree to the branch
3678 .Dq unified-buffer-cache .
3679 Local changes in the work tree will be preserved and merged if necessary:
3681 .Dl $ got update -b unified-buffer-cache
3683 Create a new commit from local changes in a work tree directory.
3684 This new commit will become the head commit of the work tree's current branch:
3688 In a work tree or a git repository directory, view changes committed in
3689 the 3 most recent commits to the work tree's branch, or the branch resolved
3690 via the repository's HEAD reference, respectively:
3692 .Dl $ got log -p -l 3
3694 As above, but display changes in the order in which
3696 could apply them in sequence:
3698 .Dl $ got log -p -l 3 -R
3700 In a work tree or a git repository directory, log the history of a subdirectory:
3702 .Dl $ got log sys/uvm
3704 While operating inside a work tree, paths are specified relative to the current
3705 working directory, so this command will log the subdirectory
3708 .Dl $ cd sys/uvm && got log\ .
3710 And this command has the same effect:
3712 .Dl $ cd sys/dev/usb && got log ../../uvm
3714 And this command displays work tree meta-data about all tracked files:
3717 .Dl $ got info\ . | less
3719 Add new files and remove obsolete files in a work tree directory:
3721 .Dl $ got add sys/uvm/uvm_ubc.c
3722 .Dl $ got remove sys/uvm/uvm_vnode.c
3724 Create a new commit from local changes in a work tree directory
3725 with a pre-defined log message.
3727 .Dl $ got commit -m 'unify the buffer cache'
3729 Alternatively, create a new commit from local changes in a work tree
3730 directory with a log message that has been prepared in the file
3733 .Dl $ got commit -F /tmp/msg
3735 Update any work tree checked out from the
3736 .Dq unified-buffer-cache
3737 branch to the latest commit on this branch:
3741 Roll file content on the unified-buffer-cache branch back by one commit,
3742 and then fetch the rolled-back change into the work tree as a local change
3743 to be amended and perhaps committed again:
3745 .Dl $ got backout unified-buffer-cache
3746 .Dl $ got commit -m 'roll back previous'
3747 .Dl $ # now back out the previous backout :-)
3748 .Dl $ got backout unified-buffer-cache
3750 Fetch new changes on the remote repository's
3752 branch, making them visible on the local repository's
3759 In a repository created with a HTTP URL and
3760 .Cm git clone --bare
3763 command must be used instead:
3765 .Dl $ cd /var/git/src.git
3766 .Dl $ git fetch origin master:refs/remotes/origin/master
3770 branch to merge the new changes that are now visible on the
3775 .Dl $ got update -b origin/master
3776 .Dl $ got rebase master
3779 .Dq unified-buffer-cache
3780 branch on top of the new head commit of the
3784 .Dl $ got update -b master
3785 .Dl $ got rebase unified-buffer-cache
3787 Create a patch from all changes on the unified-buffer-cache branch.
3788 The patch can be mailed out for review and applied to
3792 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
3794 Edit the entire commit history of the
3795 .Dq unified-buffer-cache
3798 .Dl $ got update -b unified-buffer-cache
3799 .Dl $ got update -c master
3802 Before working against existing branches in a repository cloned with
3803 .Cm git clone --bare
3808 must be configured to map all references in the remote repository
3811 namespace of the local repository.
3812 This can be achieved by setting Git's
3813 .Pa remote.origin.fetch
3814 configuration variable to the value
3815 .Dq +refs/heads/*:refs/remotes/origin/*
3820 .Dl $ cd /var/git/repo
3821 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
3825 option must be disabled:
3827 .Dl $ cd /var/git/repo
3828 .Dl $ git config remote.origin.mirror false
3830 Alternatively, the following
3832 configuration item can be added manually to the Git repository's
3836 .Dl [remote \&"origin\&"]
3838 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
3841 This configuration leaves the local repository's
3843 namespace free for use by local branches checked out with
3845 and, if needed, created with
3848 .Dq refs/remotes/origin
3849 namespace can now be updated with incoming changes from the remote
3854 without extra command line arguments.
3855 Newly fetched changes can be examined with
3858 Display changes on the remote repository's version of the
3860 branch, as of the last time
3864 .Dl $ got log -c origin/master | less
3866 As shown here, most commands accept abbreviated reference names such as
3869 .Dq refs/remotes/origin/master .
3870 The latter is only needed in case of ambiguity.
3873 can be used to merge changes which are visible on the
3878 This will also merge local changes, if any, with the incoming changes:
3880 .Dl $ got update -b origin/master
3881 .Dl $ got rebase master
3883 In order to make changes committed to the
3884 .Dq unified-buffer-cache
3888 .Dq unified-buffer-cache
3889 branch can be rebased onto the
3893 .Dl $ got update -b master
3894 .Dl $ got rebase unified-buffer-cache
3897 .Dq unified-buffer-cache
3898 branch can now be made visible on the
3902 Because the rebase operation switched the work tree to the
3903 .Dq unified-buffer-cache
3904 branch, the work tree must be switched back to the
3908 .Dl $ got update -b master
3909 .Dl $ got integrate unified-buffer-cache
3913 branch, log messages for local changes can now be amended with
3915 by other developers and any other important new information:
3917 .Dl $ got update -c origin/master
3918 .Dl $ got histedit -m
3920 If the remote repository offers write access, local changes on the
3922 branch can be sent to the remote repository with
3926 can be run without further arguments.
3927 The arguments shown here match defaults, provided the work tree's
3928 current branch is the
3932 .Dl $ got send -b master origin
3934 If the remote repository requires the HTTPS protocol, the
3936 command must be used instead:
3938 .Dl $ cd /var/git/src.git
3939 .Dl $ git push origin master
3941 When making contributions to projects which use the
3943 workflow, SSH protocol repository access needs to be set up first.
3944 Once an account has been created on a Git hosting site it should
3945 be possible to upload a public SSH key for repository access
3950 workflow will usually involve two remote repositories.
3951 In the real-life example below, the
3953 repository was forked from the
3955 repository by using the Git hosting site's web interface.
3958 file in the local repository describes both remote repositories:
3959 .Bd -literal -offset indent
3960 # Jelmers's repository, which accepts pull requests
3962 server git@github.com
3964 repository "/jelmer/dulwich"
3968 # Stefan's fork, used as the default remote repository
3970 server git@github.com
3972 repository "/stspdotname/dulwich"
3977 With this configuration, Stefan can create commits on
3978 .Dq refs/heads/master
3979 and send them to the
3981 repository by running:
3983 .Dl $ got send -b master origin
3985 The changes can now be proposed to Jelmer by opening a pull request
3986 via the Git hosting site's web interface.
3987 If Jelmer requests further changes to be made, additional commits
3988 can be created on the
3990 branch and be added to the pull request by running
3994 If Jelmer prefers additional commits to be
3996 then the following commands can be used to achieve this:
3998 .Dl $ got update -b master
3999 .Dl $ got update -c origin/master
4000 .Dl $ got histedit -f
4001 .Dl $ got send -f -b master origin
4003 In addition to reviewing the pull request in the web user interface,
4004 Jelmer can fetch the pull request's branch into his local repository
4005 and create a local branch which contains the proposed changes:
4007 .Dl $ got fetch -R refs/pull/1046/head origin
4008 .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
4010 Once Jelmer has accepted the pull request, Stefan can fetch the
4011 merged changes, and possibly several other new changes, by running:
4013 .Dl $ got fetch upstream
4015 The merged changes will now be visible under the reference
4016 .Dq refs/remotes/upstream/master .
4019 branch can now be rebased on top of the latest changes
4022 .Dl $ got update -b upstream/master
4023 .Dl $ got rebase master
4025 As an alternative to
4027 branches can be merged with
4030 .Dl $ got update -b master
4031 .Dl $ got merge upstream/master
4033 The question of whether to rebase or merge branches is philosophical.
4034 When in doubt, refer to the software project's policies set by project
4037 As a final step, the forked repository's copy of the master branch needs
4038 to be kept in sync by sending the new changes there:
4040 .Dl $ got send -f -b master origin
4042 If multiple pull requests need to be managed in parallel, a separate branch
4043 must be created for each pull request with
4045 Each such branch can then be used as above, in place of
4046 .Dq refs/heads/master .
4047 Changes for any accepted pull requests will still appear under
4048 .Dq refs/remotes/upstream/master,
4049 regardless of which branch was used in the forked repository to
4050 create a pull request.
4054 .Xr git-repository 5 ,
4055 .Xr got-worktree 5 ,
4059 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
4060 .An Christian Weisgerber Aq Mt naddy@openbsd.org
4061 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
4062 .An Josh Rickmar Aq Mt jrick@zettaport.com
4063 .An Joshua Stein Aq Mt jcs@openbsd.org
4064 .An Klemens Nanni Aq Mt kn@openbsd.org
4065 .An Martin Pieuchot Aq Mt mpi@openbsd.org
4066 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
4067 .An Omar Polo Aq Mt op@openbsd.org
4068 .An Ori Bernstein Aq Mt ori@openbsd.org
4069 .An Sebastien Marie Aq Mt semarie@openbsd.org
4070 .An Stefan Sperling Aq Mt stsp@openbsd.org
4071 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
4072 .An Theo Buehler Aq Mt tb@openbsd.org
4073 .An Thomas Adam Aq Mt thomas@xteddy.org
4074 .An Tracey Emery Aq Mt tracey@traceyemery.net
4075 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
4082 were derived from code under copyright by:
4084 .An Caldera International
4085 .An Daniel Hartmeier
4090 .An Jean-Francois Brousseau
4096 .An Niklas Hallqvist
4101 .An Xavier Santolaria
4104 contains code contributed to the public domain by
4105 .An Austin Appleby .
4108 is a work-in-progress and some features remain to be implemented.
4110 At present, the user has to fall back on
4112 to perform some tasks.
4116 Reading from remote repositories over HTTP or HTTPS protocols requires
4121 Writing to remote repositories over HTTP or HTTPS protocols requires
4124 The creation of merge commits with more than two parent commits requires
4127 In situations where files or directories were moved around
4129 will not automatically merge changes to new locations and
4131 will usually produce better results.