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.
573 If this option is not specified, the most recent commit on the selected
578 is not contained in the selected branch, a different branch which contains
579 this commit must be specified with the
582 If no such branch is known, a new branch must be created for this
588 Checking out work trees with an unknown branch is intentionally not supported.
590 Proceed with the checkout operation even if the directory at
593 Existing files will be left intact.
594 .It Fl p Ar path-prefix
595 Restrict the work tree to a subset of the repository's tree hierarchy.
596 Only files beneath the specified
600 Silence progress output.
611 Update an existing work tree to a different
613 Change existing files in the work tree as necessary to match file contents
615 Preserve any local changes in the work tree and merge them with the
618 Files which already contain merge conflicts will not be updated to avoid
619 further complications.
620 Such files will be updated when
622 is run again after merge conflicts have been resolved.
623 If the conflicting changes are no longer needed, affected files can be
630 Show the status of each affected file, using the following status codes:
631 .Bl -column YXZ description
632 .It U Ta file was updated and contained no local changes
633 .It G Ta file was updated and local changes were merged cleanly
634 .It C Ta file was updated and conflicts occurred during merge
635 .It D Ta file was deleted
636 .It d Ta file's deletion was prevented by local modifications
637 .It A Ta new file was added
638 .It \(a~ Ta versioned file is obstructed by a non-regular file
639 .It ! Ta a missing versioned file was restored
640 .It # Ta file was not updated because it contains merge conflicts
641 .It ? Ta changes destined for an unversioned file were not merged
646 is specified, update the entire work tree.
647 Otherwise, restrict the update operation to files at or within the
649 Each path is required to exist in the update operation's target commit.
650 Files in the work tree outside specified paths will remain unchanged and
651 will retain their previously recorded base commit.
654 commands may refuse to run while the work tree contains files from
655 multiple base commits.
656 The base commit of such a work tree can be made consistent by running
658 across the entire work tree.
661 is incompatible with the
666 cannot update paths with staged changes.
667 If changes have been staged with
669 these changes must first be committed with
679 Switch the work tree's branch reference to the specified
681 before updating the work tree.
682 This option requires that all paths in the work tree are updated.
684 As usual, any local changes in the work tree will be preserved.
685 This can be useful when switching to a newly created branch in order
686 to commit existing local changes to this branch.
688 Any local changes must be dealt with separately in order to obtain a
689 work tree with pristine file contents corresponding exactly to the specified
691 Such changes could first be committed to a different branch with
693 or could be discarded with
696 Update the work tree to the specified
698 The expected argument is a commit ID SHA1 hash or an existing reference
699 or tag name which will be resolved to a commit ID.
700 An abbreviated hash argument will be expanded to a full SHA1 hash
701 automatically, provided the abbreviation is unique.
708 can also be used to represent the work tree's base commit
709 and HEAD reference, respectively.
710 Keywords and reference names may be appended with
714 modifiers and an optional integer N to denote the
715 Nth descendant or antecedent, respectively, by first parent traversal;
718 denotes the HEAD reference's 2nd generation ancestor, and
720 denotes the 4th generation descendant of the work tree's base commit.
723 will denote the 3rd generation ancestor of the commit resolved by the
726 If an integer does not follow the
732 is implicitly appended
738 If this option is not specified, the most recent commit on the work tree's
741 Silence progress output.
747 .Op Fl S Ar status-codes
748 .Op Fl s Ar status-codes
752 Show the current modification status of files in a work tree,
753 using the following status codes:
754 .Bl -column YXZ description
755 .It M Ta modified file
756 .It A Ta file scheduled for addition in next commit
757 .It D Ta file scheduled for deletion in next commit
758 .It C Ta modified or added file which contains merge conflicts
759 .It ! Ta versioned file was expected on disk but is missing
760 .It \(a~ Ta versioned file is obstructed by a non-regular file
761 .It ? Ta unversioned item not tracked by
763 .It m Ta modified file modes (executable bit only)
764 .It N Ta non-existent
766 specified on the command line
771 is specified, show modifications in the entire work tree.
772 Otherwise, show modifications at or within the specified paths.
774 If changes have been staged with
776 staged changes are shown in the second output column, using the following
778 .Bl -column YXZ description
779 .It M Ta file modification is staged
780 .It A Ta file addition is staged
781 .It D Ta file deletion is staged
784 Changes created on top of staged changes are indicated in the first column:
785 .Bl -column YXZ description
786 .It MM Ta file was modified after earlier changes have been staged
787 .It MA Ta file was modified after having been staged for addition
795 Show unversioned files even if they match an ignore pattern.
796 .It Fl S Ar status-codes
797 Suppress the output of files with a modification status matching any of the
798 single-character status codes contained in the
801 Any combination of codes from the above list of possible status codes
803 For staged files, status codes displayed in either column will be matched.
804 Cannot be used together with the
807 .It Fl s Ar status-codes
808 Only show files with a modification status matching any of the
809 single-character status codes contained in the
812 Any combination of codes from the above list of possible status codes
814 For staged files, status codes displayed in either column will be matched.
815 Cannot be used together with the
820 For compatibility with
831 files in each traversed directory and will not display unversioned files
832 which match these patterns.
833 Ignore patterns which end with a slash,
835 will only match directories.
840 supports consecutive asterisks,
842 which will match an arbitrary amount of directories.
846 only supports a single ignore pattern per line.
850 does not support negated ignore patterns prefixed with
852 and gives no special significance to the location of path component separators,
861 .Op Fl r Ar repository-path
862 .Op Fl S Ar search-pattern
866 Display history of a repository.
869 is specified, show only commits which modified this path.
870 If invoked in a work tree, the
872 is interpreted relative to the current working directory,
873 and the work tree's path prefix is implicitly prepended.
874 Otherwise, the path is interpreted relative to the repository root.
881 Display individual commits which were merged into the current branch
885 shows the linear history of the current branch only.
887 Set the number of context lines shown in diffs with
889 By default, 3 lines of context are shown.
891 Start traversing history at the specified
893 The expected argument is a commit ID SHA1 hash or an existing reference
894 or tag name which will be resolved to a commit ID.
895 An abbreviated hash argument will be expanded to a full SHA1 hash
896 automatically, provided the abbreviation is unique.
903 can also be used to represent the work tree's base commit
904 and HEAD reference, respectively.
905 The former is only valid if invoked in a work tree, while the latter will
906 resolve to the tip of the work tree's current branch if invoked in a
907 work tree, otherwise it will resolve to the repository's HEAD reference.
908 Keywords and references may be appended with
912 modifiers and an optional integer N to denote the
913 Nth descendant or antecedent, respectively, by first parent traversal;
916 denotes the HEAD reference's 2nd generation ancestor, and
918 denotes the 4th generation descendant of the work tree's base commit.
921 will denote the 3rd generation descendant of the commit resolved by the
928 modifier without a trailing integer has an implicit
936 If this option is not specified, default to the work tree's current branch
937 if invoked in a work tree, or to the repository's HEAD reference.
939 Display diffstat of changes introduced in each commit.
940 Cannot be used with the
944 Limit history traversal to a given number of commits.
945 If this option is not specified, a default limit value of zero is used,
946 which is treated as an unbounded limit.
948 .Ev GOT_LOG_DEFAULT_LIMIT
949 environment variable may be set to change this default value.
951 Display the list of file paths changed in each commit, using the following
953 .Bl -column YXZ description
954 .It M Ta modified file
955 .It D Ta file was deleted
956 .It A Ta new file was added
957 .It m Ta modified file modes (executable bit only)
960 Cannot be used with the
964 Display the patch of modifications made in each commit.
967 is specified, only show the patch of modifications at or within this path.
968 Cannot be used with the
972 Determine a set of commits to display as usual, but display these commits
974 .It Fl r Ar repository-path
975 Use the repository at the specified path.
976 If not specified, assume the repository is located at or above the current
978 If this directory is a
980 work tree, use the repository path associated with this work tree.
981 .It Fl S Ar search-pattern
982 If specified, show only commits with a log message, author name,
983 committer name, or ID SHA1 hash matched by the extended regular
986 Lines in committed patches will be matched if
989 File paths changed by a commit will be matched if
992 Regular expression syntax is documented in
995 Display a short one-line summary of each commit, instead of the default
997 Cannot be used together with the
1003 Stop traversing commit history immediately after the specified
1006 This option has no effect if the specified
1016 .Op Fl r Ar repository-path
1017 .Op Ar object1 Ar object2 | Ar path ...
1020 When invoked within a work tree without any arguments, display all
1021 local changes in the work tree.
1024 arguments are specified, only show changes within the specified paths.
1026 If two arguments are provided, treat each argument as a reference, a tag
1027 name, or an object ID SHA1 hash, and display differences between the
1028 corresponding objects.
1029 Both objects must be of the same type (blobs, trees, or commits).
1030 An abbreviated hash argument will be expanded to a full SHA1 hash
1031 automatically, provided the abbreviation is unique.
1032 If none of these interpretations produce a valid result or if the
1037 is running in a work tree, attempt to interpret the two arguments as paths.
1044 Treat file contents as ASCII text even if binary data is detected.
1046 Set the number of context lines shown in the diff.
1047 By default, 3 lines of context are shown.
1049 Show differences between commits in the repository.
1050 This option may be used up to two times.
1051 When used only once, show differences between the specified
1053 and its first parent commit.
1054 When used twice, show differences between the two specified commits.
1056 The expected argument is a commit ID SHA1 hash or an existing reference
1057 or tag name which will be resolved to a commit ID.
1058 An abbreviated hash argument will be expanded to a full SHA1 hash
1059 automatically, provided the abbreviation is unique.
1066 can also be used to represent the work tree's base commit
1067 and HEAD reference, respectively.
1068 The former is only valid if invoked in a work tree, while the latter will
1069 resolve to the tip of the work tree's current branch if invoked in a
1070 work tree, otherwise it will resolve to the repository's HEAD reference.
1071 Keywords and references may be appended with
1075 modifiers and an optional integer N to denote the
1076 Nth descendant or antecedent, respectively, by first parent traversal;
1079 denotes the HEAD reference's 2nd generation ancestor, and
1081 denotes the 4th generation descendant of the work tree's base commit.
1084 will denote the 8th generation descendant of the commit resolved by the
1087 If an integer does not follow the
1093 is implicitly appended
1102 option is used, all non-option arguments will be interpreted as paths.
1105 arguments are provided, only show differences for the specified paths.
1107 Cannot be used together with the
1111 Display diffstat of changes before the actual diff by annotating each file path
1112 or blob hash being diffed with the total number of lines added and removed.
1113 A summary line will display the total number of changes across all files.
1115 Interpret all arguments as paths only.
1116 This option can be used to resolve ambiguity in cases where paths
1117 look like tag names, reference names, or object IDs.
1118 This option is only valid when
1120 is invoked in a work tree.
1121 .It Fl r Ar repository-path
1122 Use the repository at the specified path.
1123 If not specified, assume the repository is located at or above the current
1125 If this directory is a
1127 work tree, use the repository path associated with this work tree.
1129 Show changes staged with
1131 instead of showing local changes in the work tree.
1132 This option is only valid when
1134 is invoked in a work tree.
1136 Ignore whitespace-only changes.
1142 .Op Fl r Ar repository-path
1146 Display line-by-line history of a file at the specified path.
1153 Start traversing history at the specified
1155 The expected argument is a commit ID SHA1 hash or an existing reference
1156 or tag name which will be resolved to a commit ID.
1157 An abbreviated hash argument will be expanded to a full SHA1 hash
1158 automatically, provided the abbreviation is unique.
1159 .It Fl r Ar repository-path
1160 Use the repository at the specified path.
1161 If not specified, assume the repository is located at or above the current
1163 If this directory is a
1165 work tree, use the repository path associated with this work tree.
1172 .Op Fl r Ar repository-path
1176 Display a listing of files and directories at the specified
1177 directory path in the repository.
1178 Entries shown in this listing may carry one of the following trailing
1180 .Bl -column YXZ description
1181 .It @ Ta entry is a symbolic link
1182 .It / Ta entry is a directory
1183 .It * Ta entry is an executable file
1184 .It $ Ta entry is a Git submodule
1187 Symbolic link entries are also annotated with the target path of the link.
1191 is specified, list the repository path corresponding to the current
1192 directory of the work tree, or the root directory of the repository
1193 if there is no work tree.
1200 List files and directories as they appear in the specified
1202 The expected argument is a commit ID SHA1 hash or an existing reference
1203 or tag name which will be resolved to a commit ID.
1204 An abbreviated hash argument will be expanded to a full SHA1 hash
1205 automatically, provided the abbreviation is unique.
1207 Show object IDs of files (blob objects) and directories (tree objects).
1209 Recurse into sub-directories in the repository.
1210 .It Fl r Ar repository-path
1211 Use the repository at the specified path.
1212 If not specified, assume the repository is located at or above the current
1214 If this directory is a
1216 work tree, use the repository path associated with this work tree.
1222 .Op Fl r Ar repository-path
1223 .Op Fl s Ar reference
1226 Manage references in a repository.
1228 References may be listed, created, deleted, and changed.
1229 When creating, deleting, or changing a reference the specified
1231 must be an absolute reference name, i.e. it must begin with
1239 Create a reference or change an existing reference.
1240 The reference with the specified
1242 will point at the specified
1246 argument is a ID SHA1 hash or an existing reference or tag name which will
1247 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
1248 Cannot be used together with any other options except
1251 Delete the reference with the specified
1253 from the repository.
1254 Any commit, tree, tag, and blob objects belonging to deleted references
1255 remain in the repository and may be removed separately with
1256 Git's garbage collector or
1257 .Cm gotadmin cleanup .
1258 Cannot be used together with any other options except
1261 List references in the repository.
1264 is specified, list all existing references in the repository.
1267 is a reference namespace, list all references in this namespace.
1268 Otherwise, show only the reference with the given
1270 Cannot be used together with any other options except
1274 .It Fl r Ar repository-path
1275 Use the repository at the specified path.
1276 If not specified, assume the repository is located at or above the current
1278 If this directory is a
1280 work tree, use the repository path associated with this work tree.
1281 .It Fl s Ar reference
1282 Create a symbolic reference, or change an existing symbolic reference.
1283 The symbolic reference with the specified
1285 will point at the specified
1287 which must already exist in the repository.
1288 Care should be taken not to create loops between references when
1289 this option is used.
1290 Cannot be used together with any other options except
1293 Sort listed references by modification time (most recently modified first)
1294 instead of sorting by lexicographical order.
1295 Use of this option requires the
1297 option to be used as well.
1305 .Op Fl r Ar repository-path
1309 Create, list, or delete branches.
1311 Local branches are managed via references which live in the
1313 reference namespace.
1316 command creates references in this namespace only.
1318 When deleting branches, the specified
1322 reference namespace first.
1323 If no corresponding branch is found, the
1325 namespace will be searched next.
1327 If invoked in a work tree without any arguments, print the name of the
1328 work tree's current branch.
1332 argument is passed, attempt to create a branch reference with the given name.
1333 By default the new branch reference will point at the latest commit on the
1334 work tree's current branch if invoked in a work tree, and otherwise to a commit
1335 resolved via the repository's HEAD reference.
1337 If invoked in a work tree, once the branch was created successfully
1338 switch the work tree's head reference to the newly created branch and
1339 update files across the entire work tree, just like
1340 .Cm got update -b Ar name
1342 Show the status of each affected file, using the following status codes:
1343 .Bl -column YXZ description
1344 .It U Ta file was updated and contained no local changes
1345 .It G Ta file was updated and local changes were merged cleanly
1346 .It C Ta file was updated and conflicts occurred during merge
1347 .It D Ta file was deleted
1348 .It A Ta new file was added
1349 .It \(a~ Ta versioned file is obstructed by a non-regular file
1350 .It ! Ta a missing versioned file was restored
1358 Make a newly created branch reference point at the specified
1362 argument is a commit ID SHA1 hash or an existing reference
1363 or tag name which will be resolved to a commit ID.
1365 Delete the branch with the specified
1371 reference namespace.
1373 Only the branch reference is deleted.
1374 Any commit, tree, and blob objects belonging to the branch
1375 remain in the repository and may be removed separately with
1376 Git's garbage collector or
1377 .Cm gotadmin cleanup .
1379 List all existing branches in the repository, including copies of remote
1380 repositories' branches in the
1382 reference namespace.
1384 If invoked in a work tree, the work tree's current branch is shown
1385 with one of the following annotations:
1386 .Bl -column YXZ description
1387 .It * Ta work tree's base commit matches the branch tip
1388 .It \(a~ Ta work tree's base commit is out-of-date
1391 Do not switch and update the work tree after creating a new branch.
1392 .It Fl r Ar repository-path
1393 Use the repository at the specified path.
1394 If not specified, assume the repository is located at or above the current
1396 If this directory is a
1398 work tree, use the repository path associated with this work tree.
1400 Sort listed branches by modification time (most recently modified first)
1401 instead of sorting by lexicographical order.
1404 reference namespace are listed before branches in
1407 Use of this option requires the
1409 option to be used as well.
1416 .Op Fl r Ar repository-path
1417 .Op Fl s Ar signer-id
1420 Manage tags in a repository.
1422 Tags are managed via references which live in the
1424 reference namespace.
1427 command operates on references in this namespace only.
1428 References in this namespace point at tag objects which contain a pointer
1429 to another object, a tag message, as well as author and timestamp information.
1431 Attempt to create a tag with the given
1433 and make this tag point at the given
1435 If no commit is specified, default to the latest commit on the work tree's
1436 current branch if invoked in a work tree, and to a commit resolved via
1437 the repository's HEAD reference otherwise.
1444 Make the newly created tag reference point at the specified
1448 argument is a commit ID SHA1 hash or an existing reference or tag name which
1449 will be resolved to a commit ID.
1450 An abbreviated hash argument will be expanded to a full SHA1 hash
1451 automatically, provided the abbreviation is unique.
1453 List all existing tags in the repository instead of creating a new tag.
1456 argument is passed, show only the tag with the given
1459 Use the specified tag message when creating the new tag.
1464 opens a temporary file in an editor where a tag message can be written.
1465 Quitting the editor without saving the file will abort the tag operation.
1466 .It Fl r Ar repository-path
1467 Use the repository at the specified path.
1468 If not specified, assume the repository is located at or above the current
1470 If this directory is a
1472 work tree, use the repository path associated with this work tree.
1473 .It Fl s Ar signer-id
1474 While creating a new tag, sign this tag with the identity given in
1477 For SSH-based signatures,
1479 is the path to a file which may refer to either a private SSH key,
1480 or a public SSH key with the private half available via
1483 will sign the tag object by invoking
1487 command, using the signature namespace
1489 for compatibility with
1492 Verify tag object signatures.
1495 is specified, show and verify the tag object with the provided name.
1496 Otherwise, list all tag objects and verify signatures where present.
1499 verifies SSH-based signatures by invoking
1502 .Fl Y Cm verify Fl f Ar allowed_signers .
1507 otherwise verification is impossible.
1510 During SSH signature creation and verification this option will be passed to
1512 Multiple -v options increase the verbosity.
1518 command will not delete tags or change existing tags.
1519 If a tag must be deleted, the
1521 command may be used to delete a tag's reference.
1522 This should only be done if the tag has not already been copied to
1529 Schedule unversioned files in a work tree for addition to the
1530 repository in the next commit.
1531 By default, files which match a
1533 ignore pattern will not be added.
1537 mentioned in the command line is not an unversioned file then
1540 To avoid unnecessary errors from paths picked up by file globbing patterns
1541 in the shell, paths in the argument list will be silently ignored if they
1544 at all, or if they are reported with one of the following status codes
1545 and do not have changes staged via
1547 .Bl -column YXZ description
1548 .It M Ta modified file
1549 .It A Ta file scheduled for addition in next commit
1550 .It C Ta modified or added file which contains merge conflicts
1551 .It m Ta modified file modes (executable bit only)
1559 Add files even if they match a
1563 Permit recursion into directories.
1564 If this option is not specified,
1566 will refuse to run if a specified
1574 .Op Fl s Ar status-codes
1578 Remove versioned files from a work tree and schedule them for deletion
1579 from the repository in the next commit.
1586 Perform the operation even if a file contains local modifications,
1587 and do not raise an error if a specified
1589 does not exist on disk.
1591 Keep affected files on disk.
1593 Permit recursion into directories.
1594 If this option is not specified,
1596 will refuse to run if a specified
1599 .It Fl s Ar status-codes
1600 Only delete files with a modification status matching one of the
1601 single-character status codes contained in the
1604 The following status codes may be specified:
1605 .Bl -column YXZ description
1606 .It M Ta modified file (this implies the
1609 .It ! Ta versioned file expected on disk but missing
1617 .Op Fl p Ar strip-count
1623 to files in a work tree.
1624 Files added or removed by a patch will be scheduled for addition or removal in
1627 The patch must be in the unified diff format as produced by
1634 diff when invoked with their
1639 argument is provided, read unified diff data from standard input instead.
1643 contains multiple patches, then attempt to apply each of them in sequence.
1645 Show the status of each affected file, using the following status codes:
1646 .Bl -column XYZ description
1647 .It M Ta file was modified
1648 .It G Ta file was merged using a merge-base found in the repository
1649 .It C Ta file was merged and conflicts occurred during merge
1650 .It D Ta file was deleted
1651 .It A Ta file was added
1652 .It # Ta failed to patch the file
1655 If a change does not match at its exact line number, attempt to
1656 apply it somewhere else in the file if a good spot can be found.
1657 Otherwise, the patch will fail to apply.
1661 will refuse to apply a patch if certain preconditions are not met.
1662 Files to be deleted must already be under version control, and must
1663 not have been scheduled for deletion already.
1664 Files to be added must not yet be under version control and must not
1665 already be present on disk.
1666 Files to be modified must already be under version control and may not
1667 contain conflict markers.
1669 If an error occurs, the
1671 operation will be aborted.
1672 Any changes made to the work tree up to this point will be left behind.
1673 Such changes can be viewed with
1675 and can be reverted with
1684 Attempt to locate files within the specified
1686 for use as a merge-base for 3-way merges.
1687 Ideally, the specified
1689 should contain versions of files which the changes contained in the
1692 Files will be located by path, relative to the repository root.
1695 option is used then leading path components will be stripped
1696 before paths are looked up in the repository.
1700 option is not used then
1702 will attempt to locate merge-bases via object IDs found in
1704 meta-data, such as produced by
1710 option is only recommended in the absence of such meta-data.
1712 In case no merge-base is available for a file, changes will be applied
1713 without doing a 3-way merge.
1714 Changes which do not apply cleanly may then be rejected entirely, rather
1715 than producing merge conflicts in the patched target file.
1717 Do not make any modifications to the work tree.
1718 This can be used to check whether a patch would apply without issues.
1721 contains diffs that affect the same file multiple times, the results
1722 displayed may be incorrect.
1723 .It Fl p Ar strip-count
1724 Specify the number of leading path components to strip from paths
1733 path prefixes generated by
1735 will be recognized and stripped automatically.
1737 Reverse the patch before applying it.
1743 .Op Fl F Ar response-script
1747 Revert any local changes in files at the specified paths in a work tree.
1748 File contents will be overwritten with those contained in the
1749 work tree's base commit.
1750 There is no way to bring discarded changes back after
1753 If a file was added with
1755 it will become an unversioned file again.
1756 If a file was deleted with
1758 it will be restored.
1764 .It Fl F Ar response-script
1772 responses line-by-line from the specified
1774 file instead of prompting interactively.
1776 Instead of reverting all changes in files, interactively select or reject
1777 changes to revert based on
1783 (quit reverting this file) responses.
1784 If a file is in modified status, individual patches derived from the
1785 modified file content can be reverted.
1786 Files in added or deleted status may only be reverted in their entirety.
1788 Permit recursion into directories.
1789 If this option is not specified,
1791 will refuse to run if a specified
1805 Create a new commit in the repository from changes in a work tree
1806 and use this commit as the new base commit for the work tree.
1809 is specified, commit all changes in the work tree.
1810 Otherwise, commit changes at or within the specified paths.
1812 If changes have been explicitly staged for commit with
1814 only commit staged changes and reject any specified paths which
1815 have not been staged.
1818 opens a temporary file in an editor where a log message can be written
1826 options are used together.
1827 Quitting the editor without saving the file will abort the commit operation.
1829 Show the status of each affected file, using the following status codes:
1830 .Bl -column YXZ description
1831 .It M Ta modified file
1832 .It D Ta file was deleted
1833 .It A Ta new file was added
1834 .It m Ta modified file modes (executable bit only)
1837 Files which are not part of the new commit will retain their previously
1838 recorded base commit.
1841 commands may refuse to run while the work tree contains files from
1842 multiple base commits.
1843 The base commit of such a work tree can be made consistent by running
1845 across the entire work tree.
1849 command requires the
1851 environment variable to be set,
1852 unless an author has been configured in
1858 configuration settings can be
1859 obtained from the repository's
1861 file or from Git's global
1870 Set author information in the newly created commit to
1872 This is useful when committing changes on behalf of someone else.
1875 argument must use the same format as the
1877 environment variable.
1879 In addition to storing author information, the newly created commit
1882 information which is obtained, as usual, from the
1884 environment variable, or
1886 or Git configuration settings.
1888 Allow committing files in conflicted status.
1890 Committing files with conflict markers should generally be avoided.
1891 Cases where conflict markers must be stored in the repository for
1892 some legitimate reason should be very rare.
1893 There are usually ways to avoid storing conflict markers verbatim by
1894 applying appropriate programming tricks.
1896 Use the prepared log message stored in the file found at
1898 when creating the new commit.
1900 opens a temporary file in an editor where the prepared log message can be
1901 reviewed and edited further if needed.
1902 Cannot be used together with the
1906 Use the specified log message when creating the new commit.
1907 Cannot be used together with the
1911 This option prevents
1913 from opening the commit message in an editor.
1914 It has no effect unless it is used together with the
1916 option and is intended for non-interactive use such as scripting.
1918 This option prevents
1920 from generating a diff of the to-be-committed changes in a temporary file
1921 which can be viewed while editing a commit message.
1923 Allow the addition of symbolic links which point outside of the path space
1924 that is under version control.
1927 will reject such symbolic links due to safety concerns.
1930 may decide to represent such a symbolic link as a regular file which contains
1931 the link's target path, rather than creating an actual symbolic link which
1932 points outside of the work tree.
1933 Use of this option is discouraged because external mechanisms such as
1935 are better suited for managing symbolic links to paths not under
1940 will refuse to run if certain preconditions are not met.
1941 If the work tree's current branch is not in the
1943 reference namespace, new commits may not be created on this branch.
1944 Local changes may only be committed if they are based on file content
1945 found in the most recent commit on the work tree's branch.
1946 If a path is found to be out of date,
1948 must be used first in order to merge local changes with changes made
1956 .Op Fl r Ar repository-path
1958 .Op Ar remote-repository
1961 Send new changes to a remote repository.
1963 .Ar remote-repository
1967 The remote repository's URL is obtained from the corresponding entry in
1971 file of the local repository, as created by
1974 All objects corresponding to new changes will be written to a temporary
1975 pack file which is then uploaded to the server.
1976 Upon success, references in the
1978 reference namespace of the local repository will be updated to point at
1979 the commits which have been sent.
1981 By default, changes will only be sent if they are based on up-to-date
1982 copies of relevant branches in the remote repository.
1983 If any changes to be sent are based on out-of-date copies or would
1984 otherwise break linear history of existing branches, new changes must
1985 be fetched from the server with
1987 and local branches must be rebased with
1994 option can be used to make exceptions to these requirements.
2001 Send all branches from the local repository's
2003 reference namespace.
2006 option is equivalent to listing all branches with multiple
2009 Cannot be used together with the
2015 from the local repository's
2017 reference namespace.
2018 This option may be specified multiple times to build a list of branches
2020 If this option is not specified, default to the work tree's current branch
2021 if invoked in a work tree, or to the repository's HEAD reference.
2022 Cannot be used together with the
2026 Delete the specified
2028 from the remote repository's
2030 reference namespace.
2031 This option may be specified multiple times to build a list of branches
2034 Only references are deleted.
2035 Any commit, tree, tag, and blob objects belonging to deleted branches
2036 may become subject to deletion by Git's garbage collector running on
2039 Requesting deletion of branches results in an error if the server
2040 does not support this feature or disallows the deletion of branches
2041 based on its configuration.
2043 Attempt to force the server to overwrite existing branches or tags
2044 in the remote repository, even when
2050 would usually be required before changes can be sent.
2051 The server may reject forced requests regardless, depending on its
2054 Any commit, tree, tag, and blob objects belonging to overwritten branches
2055 or tags may become subject to deletion by Git's garbage collector running
2060 reference namespace is globally shared between all repositories.
2063 option to overwrite tags is discouraged because it can lead to
2064 inconsistencies between the tags present in different repositories.
2065 In general, creating a new tag with a different name is recommended
2066 instead of overwriting an existing tag.
2070 option is particularly discouraged if changes being sent are based
2071 on an out-of-date copy of a branch in the remote repository.
2072 Instead of using the
2074 option, new changes should
2077 and local branches should be rebased with
2081 followed by another attempt to send the changes.
2085 option should only be needed in situations where the remote repository's
2086 copy of a branch or tag is known to be out-of-date and is considered
2088 The risks of creating inconsistencies between different repositories
2089 should also be taken into account.
2091 Suppress progress reporting output.
2092 The same option will be passed to
2095 .It Fl r Ar repository-path
2096 Use the repository at the specified path.
2097 If not specified, assume the repository is located at or above the current
2099 If this directory is a
2101 work tree, use the repository path associated with this work tree.
2103 Attempt to send all tags from the local repository's
2105 reference namespace.
2108 option is equivalent to listing all tags with multiple
2111 Cannot be used together with the
2117 from the local repository's
2119 reference namespace, in addition to any branches that are being sent.
2122 option may be specified multiple times to build a list of tags to send.
2123 No tags will be sent if the
2127 Raise an error if the specified
2129 already exists in the remote repository, unless the
2131 option is used to overwrite the server's copy of the tag.
2132 In general, creating a new tag with a different name is recommended
2133 instead of overwriting an existing tag.
2135 Cannot be used together with the
2142 to print debugging messages to standard error output.
2143 The same option will be passed to
2146 Multiple -v options increase the verbosity.
2156 Merge changes from a single
2161 should be on a different branch than the work tree's base commit.
2162 The expected argument is a reference or a commit ID SHA1 hash.
2163 An abbreviated hash argument will be expanded to a full SHA1 hash
2164 automatically, provided the abbreviation is unique.
2166 Show the status of each affected file, using the following status codes:
2167 .Bl -column YXZ description
2168 .It G Ta file was merged
2169 .It C Ta file was merged and conflicts occurred during merge
2170 .It ! Ta changes destined for a missing file were not merged
2171 .It D Ta file was deleted
2172 .It d Ta file's deletion was prevented by local modifications
2173 .It A Ta new file was added
2174 .It \(a~ Ta changes destined for a non-regular file were not merged
2175 .It ? Ta changes destined for an unversioned file were not merged
2178 The merged changes will appear as local changes in the work tree, which
2181 amended manually or with further
2187 If invoked in a work tree where no
2192 operation is taking place,
2194 creates a record of commits which have been merged into the work tree.
2195 When a file changed by
2199 the log messages of relevant merged commits will then appear in the editor,
2200 where the messages should be further adjusted to convey the reasons for
2201 cherrypicking the changes.
2202 Upon exiting the editor, if the time stamp of the log message file
2203 is unchanged or the log message is empty,
2205 will fail with an unmodified or empty log message error.
2207 If all the changes in all files touched by a given commit are discarded,
2210 this commit's log message record will also disappear.
2213 will refuse to run if certain preconditions are not met.
2214 If the work tree contains multiple base commits, it must first be updated
2215 to a single base commit with
2217 If any relevant files already contain merge conflicts, these
2218 conflicts must be resolved first.
2226 Display a list of commit log messages recorded by cherrypick operations,
2227 represented by references in the
2228 .Dq refs/got/worktree
2229 reference namespace.
2232 is specified, only show the log message of the specified commit.
2234 If invoked in a work tree, only log messages recorded by cherrypick operations
2235 in the current work tree will be displayed.
2236 Otherwise, all commit log messages will be displayed irrespective of the
2237 work tree in which they were created.
2238 This option cannot be used with
2241 Delete log messages created by previous cherrypick operations, represented by
2243 .Dq refs/got/worktree
2244 reference namespace.
2247 is specified, only delete the log message of the specified commit.
2249 If invoked in a work tree, only log messages recorded by cherrypick operations
2250 in the current work tree will be deleted.
2251 Otherwise, all commit log messages will be deleted irrespective of the
2252 work tree in which they were created.
2253 This option cannot be used with
2264 Reverse-merge changes from a single
2269 should be on the same branch as the work tree's base commit.
2270 The expected argument is a reference or a commit ID SHA1 hash.
2271 An abbreviated hash argument will be expanded to a full SHA1 hash
2272 automatically, provided the abbreviation is unique.
2274 Show the status of each affected file, using the following status codes:
2275 .Bl -column YXZ description
2276 .It G Ta file was merged
2277 .It C Ta file was merged and conflicts occurred during merge
2278 .It ! Ta changes destined for a missing file were not merged
2279 .It D Ta file was deleted
2280 .It d Ta file's deletion was prevented by local modifications
2281 .It A Ta new file was added
2282 .It \(a~ Ta changes destined for a non-regular file were not merged
2283 .It ? Ta changes destined for an unversioned file were not merged
2286 The reverse-merged changes will appear as local changes in the work tree,
2287 which may be viewed with
2289 amended manually or with further
2295 If invoked in a work tree where no
2300 operation is taking place,
2302 creates a record of commits which have been reverse-merged into the work tree.
2303 When a file changed by
2307 the log messages of relevant reverse-merged commits will then appear in
2308 the editor, where the messages should be further adjusted to convey the
2309 reasons for backing out the changes.
2310 Upon exiting the editor, if the time stamp of the log message file
2311 is unchanged or the log message is empty,
2313 will fail with an unmodified or empty log message error.
2315 If all the changes in all files touched by a given commit are discarded,
2318 this commit's log message record will also disappear.
2321 will refuse to run if certain preconditions are not met.
2322 If the work tree contains multiple base commits, it must first be updated
2323 to a single base commit with
2325 If any relevant files already contain merge conflicts, these
2326 conflicts must be resolved first.
2334 Display a list of commit log messages recorded by backout operations,
2335 represented by references in the
2336 .Dq refs/got/worktree
2337 reference namespace.
2340 is specified, only show the log message of the specified commit.
2342 If invoked in a work tree, only log messages recorded by backout operations
2343 in the current work tree will be displayed.
2344 Otherwise, all commit log messages will be displayed irrespective of the
2345 work tree in which they were created.
2346 This option cannot be used with
2349 Delete log messages created by previous backout operations, represented by
2351 .Dq refs/got/worktree
2352 reference namespace.
2355 is specified, only delete the log message of the specified commit.
2357 If invoked in a work tree, only log messages recorded by backout operations
2358 in the current work tree will be deleted.
2359 Otherwise, all commit log messages will be deleted irrespective of the
2360 work tree in which they were created.
2361 This option cannot be used with
2372 Rebase commits on the specified
2374 onto the tip of the current branch of the work tree.
2377 must share common ancestry with the work tree's current branch.
2378 Rebasing begins with the first descendant commit of the youngest
2379 common ancestor commit shared by the specified
2381 and the work tree's current branch, and stops once the tip commit
2388 is used as intended, the specified
2390 represents a local commit history and may already contain changes
2391 that are not yet visible in any other repositories.
2392 The work tree's current branch, which must be set with
2396 operation, represents a branch from a remote repository which shares
2397 a common history with the specified
2399 but has progressed, and perhaps diverged, due to commits added to the
2402 Rebased commits are accumulated on a temporary branch which the work tree
2403 will remain switched to throughout the entire rebase operation.
2404 Commits on this branch represent the same changes with the same log
2405 messages as their counterparts on the original
2407 but with different commit IDs.
2408 Once rebasing has completed successfully, the temporary branch becomes
2409 the new version of the specified
2411 and the work tree is automatically switched to it.
2412 If author information is available via the
2414 environment variable,
2420 configuration settings, this author information will be used to identify
2425 Old commits in their pre-rebase state are automatically backed up in the
2426 .Dq refs/got/backup/rebase
2427 reference namespace.
2428 As long as these references are not removed older versions of rebased
2429 commits will remain in the repository and can be viewed with the
2432 Removal of these references makes objects which become unreachable via
2433 any reference subject to removal by Git's garbage collector or
2434 .Cm gotadmin cleanup .
2436 While rebasing commits, show the status of each affected file,
2437 using the following status codes:
2438 .Bl -column YXZ description
2439 .It G Ta file was merged
2440 .It C Ta file was merged and conflicts occurred during merge
2441 .It ! Ta changes destined for a missing file were not merged
2442 .It D Ta file was deleted
2443 .It d Ta file's deletion was prevented by local modifications
2444 .It A Ta new file was added
2445 .It \(a~ Ta changes destined for a non-regular file were not merged
2446 .It ? Ta changes destined for an unversioned file were not merged
2449 If merge conflicts occur, the rebase operation is interrupted and may
2450 be continued once conflicts have been resolved.
2451 If any files with destined changes are found to be missing or unversioned,
2452 or if files could not be deleted due to differences in deleted content,
2453 the rebase operation will be interrupted to prevent potentially incomplete
2454 changes from being committed to the repository without user intervention.
2455 The work tree may be modified as desired and the rebase operation can be
2456 continued once the changes present in the work tree are considered complete.
2457 Alternatively, the rebase operation may be aborted which will leave
2459 unmodified and the work tree switched back to its original branch.
2461 If a merge conflict is resolved in a way which renders the merged
2462 change into a no-op change, the corresponding commit will be elided
2463 when the rebase operation continues.
2466 will refuse to run if certain preconditions are not met.
2471 reference namespace, the branch may not be rebased.
2472 If the work tree is not yet fully updated to the tip commit of its
2473 branch, then the work tree must first be updated with
2475 If changes have been staged with
2477 these changes must first be committed with
2481 If the work tree contains local changes, these changes must first be
2488 contains changes to files outside of the work tree's path prefix,
2489 the work tree cannot be used to rebase this branch.
2498 commands will refuse to run while a rebase operation is in progress.
2499 Other commands which manipulate the work tree may be used for
2500 conflict resolution purposes.
2504 is already based on the work tree's current branch, then no commits
2505 need to be rebased and
2507 will simply switch the work tree to the specified
2509 and update files in the work tree accordingly.
2516 Abort an interrupted rebase operation.
2517 If this option is used, no other command-line arguments are allowed.
2519 Allow a rebase operation to continue with files in conflicted status.
2520 This option should generally be avoided, and can only be used with the
2524 Continue an interrupted rebase operation.
2525 If this option is used, no other command-line arguments are allowed except
2528 Show a list of past rebase operations, represented by references in the
2529 .Dq refs/got/backup/rebase
2530 reference namespace.
2532 Display the author, date, and log message of each backed up commit,
2533 the object ID of the corresponding post-rebase commit, and
2534 the object ID of their common ancestor commit.
2535 Given these object IDs,
2542 options can be used to examine the history of either version of the branch,
2547 option can be used to create a new branch from a pre-rebase state if desired.
2551 is specified, only show commits which at some point in time represented this
2553 Otherwise, list all backed up commits for any branches.
2555 If this option is used,
2557 does not require a work tree.
2558 None of the other options can be used together with
2561 Delete backups created by past rebase operations, represented by references
2563 .Dq refs/got/backup/rebase
2564 reference namespace.
2568 is specified, only delete backups which at some point in time represented
2570 Otherwise, delete all references found within
2571 .Dq refs/got/backup/rebase .
2573 Any commit, tree, tag, and blob objects belonging to deleted backups
2574 remain in the repository and may be removed separately with
2575 Git's garbage collector or
2576 .Cm gotadmin cleanup .
2578 If this option is used,
2580 does not require a work tree.
2581 None of the other options can be used together with
2588 .Op Fl F Ar histedit-script
2592 Edit commit history between the work tree's current base commit and
2593 the tip commit of the work tree's current branch.
2597 command requires the
2599 environment variable to be set,
2600 unless an author has been configured in
2606 configuration settings can be obtained from the repository's
2608 file or from Git's global
2614 operation, the work tree's current branch must be set with
2616 to the branch which should be edited, unless this branch is already the
2617 current branch of the work tree.
2618 The tip of this branch represents the upper bound (inclusive) of commits
2623 Furthermore, the work tree's base commit
2626 to a point in this branch's commit history where editing should begin.
2627 This commit represents the lower bound (non-inclusive) of commits touched
2632 Editing of commit history is controlled via a
2634 which can be written in an editor based on a template, passed on the
2635 command line, or generated with the
2642 Quitting the editor without saving the file will abort the histedit operation.
2644 The format of the histedit script is line-based.
2645 Each line in the script begins with a command name, followed by
2646 whitespace and an argument.
2647 For most commands, the expected argument is a commit ID SHA1 hash.
2648 Any remaining text on the line is ignored.
2649 Lines which begin with the
2651 character are ignored entirely.
2653 The available histedit script commands are as follows:
2654 .Bl -column YXZ pick-commit
2655 .It Cm pick Ar commit Ta Use the specified commit as it is.
2656 .It Cm edit Ar commit Ta Apply the changes from the specified commit, but
2657 then interrupt the histedit operation for amending, without creating a commit.
2658 While the histedit operation is interrupted arbitrary files may be edited,
2659 and commands which manipulate the work tree can be used freely.
2664 commands can be used to add new files or remove existing ones.
2667 command can be used to eliminate arbitrary changes from files in the work tree.
2670 command may be used to prepare a subset of changes for inclusion in the
2674 command can be used to insert arbitrary commits into the edited history.
2675 Regular editing of history must eventually be resumed by running
2676 .Cm got histedit -c .
2677 .It Cm fold Ar commit Ta Combine the specified commit with the next commit
2678 listed further below that will be used.
2679 .It Cm drop Ar commit Ta Remove this commit from the edited history.
2680 .It Cm mesg Oo Ar log-message Oc Ta Create a new log message for the commit of
2685 command on the previous line of the histedit script.
2688 argument provides a new single-line log message to use.
2691 argument is omitted, open an editor where a new log message can be written.
2694 Every commit in the history being edited must be mentioned in the script.
2695 Lines may be re-ordered to change the order of commits in the edited history.
2696 No commit may be listed more than once.
2698 Edited commits are accumulated on a temporary branch which the work tree
2699 will remain switched to throughout the entire histedit operation.
2700 Once history editing has completed successfully, the temporary branch becomes
2701 the new version of the work tree's branch and the work tree is automatically
2704 Old commits in their pre-histedit state are automatically backed up in the
2705 .Dq refs/got/backup/histedit
2706 reference namespace.
2707 As long as these references are not removed older versions of edited
2708 commits will remain in the repository and can be viewed with the
2711 Removal of these references makes objects which become unreachable via
2712 any reference subject to removal by Git's garbage collector or
2713 .Cm gotadmin cleanup .
2715 While merging commits, show the status of each affected file,
2716 using the following status codes:
2717 .Bl -column YXZ description
2718 .It G Ta file was merged
2719 .It C Ta file was merged and conflicts occurred during merge
2720 .It ! Ta changes destined for a missing file were not merged
2721 .It D Ta file was deleted
2722 .It d Ta file's deletion was prevented by local modifications
2723 .It A Ta new file was added
2724 .It \(a~ Ta changes destined for a non-regular file were not merged
2725 .It ? Ta changes destined for an unversioned file were not merged
2728 If merge conflicts occur, the histedit operation is interrupted and may
2729 be continued once conflicts have been resolved.
2730 If any files with destined changes are found to be missing or unversioned,
2731 or if files could not be deleted due to differences in deleted content,
2732 the histedit operation will be interrupted to prevent potentially incomplete
2733 changes from being committed to the repository without user intervention.
2734 The work tree may be modified as desired and the histedit operation can be
2735 continued once the changes present in the work tree are considered complete.
2736 Alternatively, the histedit operation may be aborted which will leave
2737 the work tree switched back to its original branch.
2739 If a merge conflict is resolved in a way which renders the merged
2740 change into a no-op change, the corresponding commit will be elided
2741 when the histedit operation continues.
2744 will refuse to run if certain preconditions are not met.
2745 If the work tree's current branch is not in the
2747 reference namespace, the history of the branch may not be edited.
2748 If the work tree contains multiple base commits, it must first be updated
2749 to a single base commit with
2751 If changes have been staged with
2753 these changes must first be committed with
2757 If the work tree contains local changes, these changes must first be
2762 If the edited history contains changes to files outside of the work tree's
2763 path prefix, the work tree cannot be used to edit the history of this branch.
2771 commands will refuse to run while a histedit operation is in progress.
2772 Other commands which manipulate the work tree may be used, and the
2774 command may be used to commit arbitrary changes to the temporary branch
2775 while the histedit operation is interrupted.
2782 Abort an interrupted histedit operation.
2783 If this option is used, no other command-line arguments are allowed.
2785 Allow a histedit operation to continue with files in conflicted status.
2786 This option should generally be avoided, and can only be used with the
2790 Continue an interrupted histedit operation.
2791 If this option is used, no other command-line arguments are allowed except
2795 This option is a quick equivalent to a histedit script which drops all
2799 option can only be used when starting a new histedit operation.
2800 If this option is used, no other command-line arguments are allowed.
2802 Interrupt the histedit operation for editing after merging each commit.
2803 This option is a quick equivalent to a histedit script which uses the
2805 command for all commits.
2808 option can only be used when starting a new histedit operation.
2809 If this option is used, no other command-line arguments are allowed.
2810 .It Fl F Ar histedit-script
2813 instead of opening a temporary file in an editor where a histedit script
2816 Fold all commits into a single commit.
2817 This option is a quick equivalent to a histedit script which folds all
2818 commits, combining them all into one commit.
2821 option can only be used when starting a new histedit operation.
2822 If this option is used, no other command-line arguments are allowed.
2824 Show a list of past histedit operations, represented by references in the
2825 .Dq refs/got/backup/histedit
2826 reference namespace.
2828 Display the author, date, and log message of each backed up commit,
2829 the object ID of the corresponding post-histedit commit, and
2830 the object ID of their common ancestor commit.
2831 Given these object IDs,
2838 options can be used to examine the history of either version of the branch,
2843 option can be used to create a new branch from a pre-histedit state if desired.
2847 is specified, only show commits which at some point in time represented this
2849 Otherwise, list all backed up commits for any branches.
2851 If this option is used,
2853 does not require a work tree.
2854 None of the other options can be used together with
2857 Edit log messages only.
2858 This option is a quick equivalent to a histedit script which edits
2859 only log messages but otherwise leaves every picked commit as-is.
2862 option can only be used when starting a new histedit operation.
2863 If this option is used, no other command-line arguments are allowed.
2865 Delete backups created by past histedit operations, represented by references
2867 .Dq refs/got/backup/histedit
2868 reference namespace.
2872 is specified, only delete backups which at some point in time represented
2874 Otherwise, delete all references found within
2875 .Dq refs/got/backup/histedit .
2877 Any commit, tree, tag, and blob objects belonging to deleted backups
2878 remain in the repository and may be removed separately with
2879 Git's garbage collector or
2880 .Cm gotadmin cleanup .
2882 If this option is used,
2884 does not require a work tree.
2885 None of the other options can be used together with
2889 .It Cm integrate Ar branch
2891 Integrate the specified
2893 into the work tree's current branch.
2894 Files in the work tree are updated to match the contents on the integrated
2896 and the reference of the work tree's branch is changed to point at the
2897 head commit of the integrated
2900 Both branches can be considered equivalent after integration since they
2901 will be pointing at the same commit.
2902 Both branches remain available for future work, if desired.
2903 In case the integrated
2905 is no longer needed it may be deleted with
2908 Show the status of each affected file, using the following status codes:
2909 .Bl -column YXZ description
2910 .It U Ta file was updated
2911 .It D Ta file was deleted
2912 .It A Ta new file was added
2913 .It \(a~ Ta versioned file is obstructed by a non-regular file
2914 .It ! Ta a missing versioned file was restored
2918 will refuse to run if certain preconditions are not met.
2919 Most importantly, the
2921 must have been rebased onto the work tree's current branch with
2923 before it can be integrated, in order to linearize commit history and
2924 resolve merge conflicts.
2925 If the work tree contains multiple base commits, it must first be updated
2926 to a single base commit with
2928 If changes have been staged with
2930 these changes must first be committed with
2934 If the work tree contains local changes, these changes must first be
2948 into the current branch of the work tree.
2949 If the branches have diverged, creates a merge commit.
2952 already includes all commits from the work tree's branch, updates the work
2953 tree's branch to be the same as
2955 without creating a commit, and updates the work tree to the most recent commit
2958 If a linear project history is desired, then use of
2960 should be preferred over
2962 However, even strictly linear projects may require merge commits in order
2963 to merge in new versions of third-party code stored on vendor branches
2967 Merge commits are commits based on multiple parent commits.
2968 The tip commit of the work tree's current branch, which must be in the
2970 reference namespace and must be set with
2974 operation, will be used as the first parent.
2975 The tip commit of the specified
2977 will be used as the second parent.
2979 No ancestral relationship between the two branches is required.
2980 If the two branches have already been merged previously, only new changes
2983 It is not possible to create merge commits with more than two parents.
2984 If more than one branch needs to be merged, then multiple merge commits
2985 with two parents each can be created in sequence.
2987 While merging changes found on the
2989 into the work tree, show the status of each affected file,
2990 using the following status codes:
2991 .Bl -column YXZ description
2992 .It G Ta file was merged
2993 .It C Ta file was merged and conflicts occurred during merge
2994 .It ! Ta changes destined for a missing file were not merged
2995 .It D Ta file was deleted
2996 .It d Ta file's deletion was prevented by local modifications
2997 .It A Ta new file was added
2998 .It \(a~ Ta changes destined for a non-regular file were not merged
2999 .It ? Ta changes destined for an unversioned file were not merged
3002 If merge conflicts occur, the merge operation is interrupted and conflicts
3003 must be resolved before the merge operation can continue.
3004 If any files with destined changes are found to be missing or unversioned,
3005 or if files could not be deleted due to differences in deleted content,
3006 the merge operation will be interrupted to prevent potentially incomplete
3007 changes from being committed to the repository without user intervention.
3008 The work tree may be modified as desired and the merge can be continued
3009 once the changes present in the work tree are considered complete.
3010 Alternatively, the merge operation may be aborted which will leave
3011 the work tree's current branch unmodified.
3014 will refuse to run if certain preconditions are not met.
3015 If the work tree's current branch is not in the
3017 reference namespace then the work tree must first be switched to a
3022 If the work tree is not yet fully updated to the tip commit of its
3023 branch, then the work tree must first be updated with
3025 If the work tree contains multiple base commits, it must first be updated
3026 to a single base commit with
3028 If changes have been staged with
3030 these changes must first be committed with
3034 If the work tree contains local changes, these changes must first be
3041 contains changes to files outside of the work tree's path prefix,
3042 the work tree cannot be used to merge this branch.
3052 commands will refuse to run while a merge operation is in progress.
3053 Other commands which manipulate the work tree may be used for
3054 conflict resolution purposes.
3061 Abort an interrupted merge operation.
3062 If this option is used, no other command-line arguments are allowed.
3064 Allow a merge operation to continue with files in conflicted status.
3065 This option should generally be avoided, and can only be used with the
3069 Continue an interrupted merge operation.
3070 If this option is used, no other command-line arguments are allowed except
3073 Create a merge commit even if the branches have not diverged.
3075 Merge changes into the work tree as usual but do not create a merge
3077 The merge result can be adjusted as desired before a merge commit is
3080 Alternatively, the merge may be aborted with
3087 .Op Fl F Ar response-script
3091 Stage local changes for inclusion in the next commit.
3094 is specified, stage all changes in the work tree.
3095 Otherwise, stage changes at or within the specified paths.
3096 Paths may be staged if they are added, modified, or deleted according to
3099 Show the status of each affected file, using the following status codes:
3100 .Bl -column YXZ description
3101 .It A Ta file addition has been staged
3102 .It M Ta file modification has been staged
3103 .It D Ta file deletion has been staged
3106 Staged file contents are saved in newly created blob objects in the repository.
3107 These blobs will be referred to by tree objects once staged changes have been
3110 Staged changes affect the behaviour of
3115 While paths with staged changes exist, the
3117 command will refuse to commit any paths which do not have staged changes.
3118 Local changes created on top of staged changes can only be committed if
3119 the path is staged again, or if the staged changes are committed first.
3122 command will show both local changes and staged changes.
3125 command is able to display local changes relative to staged changes,
3126 and to display staged changes relative to the repository.
3129 command cannot revert staged changes but may be used to revert
3130 local changes created on top of staged changes.
3136 .It Fl F Ar response-script
3144 responses line-by-line from the specified
3146 file instead of prompting interactively.
3148 Instead of staging new changes, list paths which are already staged,
3149 along with the IDs of staged blob objects and stage status codes.
3150 If paths were provided on the command line, show the staged paths
3151 among the specified paths.
3152 Otherwise, show all staged paths.
3154 Instead of staging the entire content of a changed file, interactively
3155 select or reject changes for staging based on
3159 (reject change), and
3161 (quit staging this file) responses.
3162 If a file is in modified status, individual patches derived from the
3163 modified file content can be staged.
3164 Files in added or deleted status may only be staged or rejected in
3167 Allow staging of symbolic links which point outside of the path space
3168 that is under version control.
3171 will reject such symbolic links due to safety concerns.
3174 may decide to represent such a symbolic link as a regular file which contains
3175 the link's target path, rather than creating an actual symbolic link which
3176 points outside of the work tree.
3177 Use of this option is discouraged because external mechanisms such as
3179 are better suited for managing symbolic links to paths not under
3184 will refuse to run if certain preconditions are not met.
3185 If a file contains merge conflicts, these conflicts must be resolved first.
3186 If a file is found to be out of date relative to the head commit on the
3187 work tree's current branch, the file must be updated with
3189 before it can be staged (however, this does not prevent the file from
3190 becoming out-of-date at some point after having been staged).
3198 commands will refuse to run while staged changes exist.
3199 If staged changes cannot be committed because a staged path
3200 is out of date, the path must be unstaged with
3202 before it can be updated with
3204 and may then be staged again if necessary.
3209 .Op Fl F Ar response-script
3213 Merge staged changes back into the work tree and put affected paths
3214 back into non-staged status.
3217 is specified, unstage all staged changes across the entire work tree.
3218 Otherwise, unstage changes at or within the specified paths.
3220 Show the status of each affected file, using the following status codes:
3221 .Bl -column YXZ description
3222 .It G Ta file was unstaged
3223 .It C Ta file was unstaged and conflicts occurred during merge
3224 .It ! Ta changes destined for a missing file were not merged
3225 .It D Ta file was staged as deleted and still is deleted
3226 .It d Ta file's deletion was prevented by local modifications
3227 .It \(a~ Ta changes destined for a non-regular file were not merged
3234 .It Fl F Ar response-script
3242 responses line-by-line from the specified
3244 file instead of prompting interactively.
3246 Instead of unstaging the entire content of a changed file, interactively
3247 select or reject changes for unstaging based on
3251 (keep change staged), and
3253 (quit unstaging this file) responses.
3254 If a file is staged in modified status, individual patches derived from the
3255 staged file content can be unstaged.
3256 Files staged in added or deleted status may only be unstaged in their entirety.
3262 .Op Fl r Ar repository-path
3265 Parse and print contents of objects to standard output in a line-based
3267 Content of commit, tree, and tag objects is printed in a way similar
3268 to the actual content stored in such objects.
3269 Blob object contents are printed as they would appear in files on disk.
3271 Attempt to interpret each argument as a reference, a tag name, or
3272 an object ID SHA1 hash.
3273 References will be resolved to an object ID.
3274 Tag names will resolved to a tag object.
3275 An abbreviated hash argument will be expanded to a full SHA1 hash
3276 automatically, provided the abbreviation is unique.
3278 If none of the above interpretations produce a valid result, or if the
3280 option is used, attempt to interpret the argument as a path which will
3281 be resolved to the ID of an object found at this path in the repository.
3288 Look up paths in the specified
3290 If this option is not used, paths are looked up in the commit resolved
3291 via the repository's HEAD reference.
3292 The expected argument is a commit ID SHA1 hash or an existing reference
3293 or tag name which will be resolved to a commit ID.
3294 An abbreviated hash argument will be expanded to a full SHA1 hash
3295 automatically, provided the abbreviation is unique.
3297 Interpret all arguments as paths only.
3298 This option can be used to resolve ambiguity in cases where paths
3299 look like tag names, reference names, or object IDs.
3300 .It Fl r Ar repository-path
3301 Use the repository at the specified path.
3302 If not specified, assume the repository is located at or above the current
3304 If this directory is a
3306 work tree, use the repository path associated with this work tree.
3308 .It Cm info Op Ar path ...
3309 Display meta-data stored in a work tree.
3314 The work tree to use is resolved implicitly by walking upwards from the
3315 current working directory.
3319 arguments are specified, show additional per-file information for tracked
3320 files located at or within these paths.
3323 argument corresponds to the work tree's root directory, display information
3324 for all tracked files.
3327 .Bl -tag -width GOT_IGNORE_GITCONFIG
3329 The author's name and email address, such as
3330 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
3341 may fail to parse commits without an email address in author data,
3345 environment variables with a missing email address.
3347 .Ev GOT_AUTHOR will be overridden by configuration settings in
3353 configuration settings in the repository's
3360 configuration settings contained in Git's global
3362 configuration file will only be used if neither
3366 environment variable provide author information.
3367 .It Ev GOT_IGNORE_GITCONFIG
3368 If this variable is set then any remote repository definitions or author
3369 information found in Git configuration files will be ignored.
3370 .It Ev GOT_LOG_DEFAULT_LIMIT
3371 The default limit on the number of commits traversed by
3373 If set to zero, the limit is unbounded.
3374 This variable will be silently ignored if it is set to a non-numeric value.
3375 .It Ev VISUAL , EDITOR
3376 The editor spawned by
3384 text editor will be spawned.
3387 .Bl -tag -width packed-refs -compact
3389 Repository-wide configuration settings for
3393 configuration file located in the root directory of a Git repository
3394 supersedes any relevant settings in Git's
3398 .It Pa .got/got.conf
3399 Worktree-specific configuration settings for
3403 configuration file in the
3405 meta-data directory of a work tree supersedes any relevant settings in
3408 configuration file and Git's
3415 Enable tab-completion of
3420 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
3422 Clone an existing Git repository for use with
3426 .Dl $ got clone ssh://git@github.com/openbsd/src.git
3428 Unfortunately, many of the popular Git hosting sites do not offer anonymous
3430 Such sites will require an account to be created, and a public SSH key to be
3431 uploaded to this account, before repository access via ssh:// URLs will work.
3433 Use of HTTP URLs currently requires
3437 .Dl $ git clone --bare https://github.com/openbsd/src.git
3439 Alternatively, for quick and dirty local testing of
3441 a new Git repository could be created and populated with files,
3442 e.g. from a temporary CVS checkout located at
3445 .Dl $ gotadmin init /var/git/src.git
3446 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
3448 Check out a work tree from the Git repository to /usr/src:
3450 .Dl $ got checkout /var/git/src.git /usr/src
3452 View local changes in a work tree directory:
3454 .Dl $ got diff | less
3456 In a work tree, display files in a potentially problematic state:
3458 .Dl $ got status -s 'C!~?'
3460 Interactively revert selected local changes in a work tree directory:
3462 .Dl $ got revert -p -R\ .
3464 In a work tree or a git repository directory, list all branch references:
3468 As above, but list the most recently modified branches only:
3470 .Dl $ got branch -lt | head
3472 In a work tree or a git repository directory, create a new branch called
3473 .Dq unified-buffer-cache
3474 which is forked off the
3478 .Dl $ got branch -c master unified-buffer-cache
3480 Switch an existing work tree to the branch
3481 .Dq unified-buffer-cache .
3482 Local changes in the work tree will be preserved and merged if necessary:
3484 .Dl $ got update -b unified-buffer-cache
3486 Create a new commit from local changes in a work tree directory.
3487 This new commit will become the head commit of the work tree's current branch:
3491 In a work tree or a git repository directory, view changes committed in
3492 the 3 most recent commits to the work tree's branch, or the branch resolved
3493 via the repository's HEAD reference, respectively:
3495 .Dl $ got log -p -l 3
3497 As above, but display changes in the order in which
3499 could apply them in sequence:
3501 .Dl $ got log -p -l 3 -R
3503 In a work tree or a git repository directory, log the history of a subdirectory:
3505 .Dl $ got log sys/uvm
3507 While operating inside a work tree, paths are specified relative to the current
3508 working directory, so this command will log the subdirectory
3511 .Dl $ cd sys/uvm && got log\ .
3513 And this command has the same effect:
3515 .Dl $ cd sys/dev/usb && got log ../../uvm
3517 And this command displays work tree meta-data about all tracked files:
3520 .Dl $ got info\ . | less
3522 Add new files and remove obsolete files in a work tree directory:
3524 .Dl $ got add sys/uvm/uvm_ubc.c
3525 .Dl $ got remove sys/uvm/uvm_vnode.c
3527 Create a new commit from local changes in a work tree directory
3528 with a pre-defined log message.
3530 .Dl $ got commit -m 'unify the buffer cache'
3532 Alternatively, create a new commit from local changes in a work tree
3533 directory with a log message that has been prepared in the file
3536 .Dl $ got commit -F /tmp/msg
3538 Update any work tree checked out from the
3539 .Dq unified-buffer-cache
3540 branch to the latest commit on this branch:
3544 Roll file content on the unified-buffer-cache branch back by one commit,
3545 and then fetch the rolled-back change into the work tree as a local change
3546 to be amended and perhaps committed again:
3548 .Dl $ got backout unified-buffer-cache
3549 .Dl $ got commit -m 'roll back previous'
3550 .Dl $ # now back out the previous backout :-)
3551 .Dl $ got backout unified-buffer-cache
3553 Fetch new changes on the remote repository's
3555 branch, making them visible on the local repository's
3562 In a repository created with a HTTP URL and
3563 .Cm git clone --bare
3566 command must be used instead:
3568 .Dl $ cd /var/git/src.git
3569 .Dl $ git fetch origin master:refs/remotes/origin/master
3573 branch to merge the new changes that are now visible on the
3578 .Dl $ got update -b origin/master
3579 .Dl $ got rebase master
3582 .Dq unified-buffer-cache
3583 branch on top of the new head commit of the
3587 .Dl $ got update -b master
3588 .Dl $ got rebase unified-buffer-cache
3590 Create a patch from all changes on the unified-buffer-cache branch.
3591 The patch can be mailed out for review and applied to
3595 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
3597 Edit the entire commit history of the
3598 .Dq unified-buffer-cache
3601 .Dl $ got update -b unified-buffer-cache
3602 .Dl $ got update -c master
3605 Before working against existing branches in a repository cloned with
3606 .Cm git clone --bare
3611 must be configured to map all references in the remote repository
3614 namespace of the local repository.
3615 This can be achieved by setting Git's
3616 .Pa remote.origin.fetch
3617 configuration variable to the value
3618 .Dq +refs/heads/*:refs/remotes/origin/*
3623 .Dl $ cd /var/git/repo
3624 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
3628 option must be disabled:
3630 .Dl $ cd /var/git/repo
3631 .Dl $ git config remote.origin.mirror false
3633 Alternatively, the following
3635 configuration item can be added manually to the Git repository's
3639 .Dl [remote \&"origin\&"]
3641 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
3644 This configuration leaves the local repository's
3646 namespace free for use by local branches checked out with
3648 and, if needed, created with
3651 .Dq refs/remotes/origin
3652 namespace can now be updated with incoming changes from the remote
3657 without extra command line arguments.
3658 Newly fetched changes can be examined with
3661 Display changes on the remote repository's version of the
3663 branch, as of the last time
3667 .Dl $ got log -c origin/master | less
3669 As shown here, most commands accept abbreviated reference names such as
3672 .Dq refs/remotes/origin/master .
3673 The latter is only needed in case of ambiguity.
3676 can be used to merge changes which are visible on the
3681 This will also merge local changes, if any, with the incoming changes:
3683 .Dl $ got update -b origin/master
3684 .Dl $ got rebase master
3686 In order to make changes committed to the
3687 .Dq unified-buffer-cache
3691 .Dq unified-buffer-cache
3692 branch can be rebased onto the
3696 .Dl $ got update -b master
3697 .Dl $ got rebase unified-buffer-cache
3700 .Dq unified-buffer-cache
3701 branch can now be made visible on the
3705 Because the rebase operation switched the work tree to the
3706 .Dq unified-buffer-cache
3707 branch, the work tree must be switched back to the
3711 .Dl $ got update -b master
3712 .Dl $ got integrate unified-buffer-cache
3716 branch, log messages for local changes can now be amended with
3718 by other developers and any other important new information:
3720 .Dl $ got update -c origin/master
3721 .Dl $ got histedit -m
3723 If the remote repository offers write access, local changes on the
3725 branch can be sent to the remote repository with
3729 can be run without further arguments.
3730 The arguments shown here match defaults, provided the work tree's
3731 current branch is the
3735 .Dl $ got send -b master origin
3737 If the remote repository requires the HTTPS protocol, the
3739 command must be used instead:
3741 .Dl $ cd /var/git/src.git
3742 .Dl $ git push origin master
3744 When making contributions to projects which use the
3746 workflow, SSH protocol repository access needs to be set up first.
3747 Once an account has been created on a Git hosting site it should
3748 be possible to upload a public SSH key for repository access
3753 workflow will usually involve two remote repositories.
3754 In the real-life example below, the
3756 repository was forked from the
3758 repository by using the Git hosting site's web interface.
3761 file in the local repository describes both remote repositories:
3762 .Bd -literal -offset indent
3763 # Jelmers's repository, which accepts pull requests
3765 server git@github.com
3767 repository "/jelmer/dulwich"
3771 # Stefan's fork, used as the default remote repository
3773 server git@github.com
3775 repository "/stspdotname/dulwich"
3780 With this configuration, Stefan can create commits on
3781 .Dq refs/heads/master
3782 and send them to the
3784 repository by running:
3786 .Dl $ got send -b master origin
3788 The changes can now be proposed to Jelmer by opening a pull request
3789 via the Git hosting site's web interface.
3790 If Jelmer requests further changes to be made, additional commits
3791 can be created on the
3793 branch and be added to the pull request by running
3797 If Jelmer prefers additional commits to be
3799 then the following commands can be used to achieve this:
3801 .Dl $ got update -b master
3802 .Dl $ got update -c origin/master
3803 .Dl $ got histedit -f
3804 .Dl $ got send -f -b master origin
3806 In addition to reviewing the pull request in the web user interface,
3807 Jelmer can fetch the pull request's branch into his local repository
3808 and create a local branch which contains the proposed changes:
3810 .Dl $ got fetch -R refs/pull/1046/head origin
3811 .Dl $ got branch -c refs/remotes/origin/pull/1046/head pr1046
3813 Once Jelmer has accepted the pull request, Stefan can fetch the
3814 merged changes, and possibly several other new changes, by running:
3816 .Dl $ got fetch upstream
3818 The merged changes will now be visible under the reference
3819 .Dq refs/remotes/upstream/master .
3822 branch can now be rebased on top of the latest changes
3825 .Dl $ got update -b upstream/master
3826 .Dl $ got rebase master
3828 As an alternative to
3830 branches can be merged with
3833 .Dl $ got update -b master
3834 .Dl $ got merge upstream/master
3836 The question of whether to rebase or merge branches is philosophical.
3837 When in doubt, refer to the software project's policies set by project
3840 As a final step, the forked repository's copy of the master branch needs
3841 to be kept in sync by sending the new changes there:
3843 .Dl $ got send -f -b master origin
3845 If multiple pull requests need to be managed in parallel, a separate branch
3846 must be created for each pull request with
3848 Each such branch can then be used as above, in place of
3849 .Dq refs/heads/master .
3850 Changes for any accepted pull requests will still appear under
3851 .Dq refs/remotes/upstream/master,
3852 regardless of which branch was used in the forked repository to
3853 create a pull request.
3857 .Xr git-repository 5 ,
3858 .Xr got-worktree 5 ,
3862 .An Anthony J. Bentley Aq Mt bentley@openbsd.org
3863 .An Christian Weisgerber Aq Mt naddy@openbsd.org
3864 .An Hiltjo Posthuma Aq Mt hiltjo@codemadness.org
3865 .An Josh Rickmar Aq Mt jrick@zettaport.com
3866 .An Joshua Stein Aq Mt jcs@openbsd.org
3867 .An Klemens Nanni Aq Mt kn@openbsd.org
3868 .An Martin Pieuchot Aq Mt mpi@openbsd.org
3869 .An Neels Hofmeyr Aq Mt neels@hofmeyr.de
3870 .An Omar Polo Aq Mt op@openbsd.org
3871 .An Ori Bernstein Aq Mt ori@openbsd.org
3872 .An Sebastien Marie Aq Mt semarie@openbsd.org
3873 .An Stefan Sperling Aq Mt stsp@openbsd.org
3874 .An Steven McDonald Aq Mt steven@steven-mcdonald.id.au
3875 .An Theo Buehler Aq Mt tb@openbsd.org
3876 .An Thomas Adam Aq Mt thomas@xteddy.org
3877 .An Tracey Emery Aq Mt tracey@traceyemery.net
3878 .An Yang Zhong Aq Mt yzhong@freebsdfoundation.org
3885 were derived from code under copyright by:
3887 .An Caldera International
3888 .An Daniel Hartmeier
3893 .An Jean-Francois Brousseau
3899 .An Niklas Hallqvist
3904 .An Xavier Santolaria
3907 contains code contributed to the public domain by
3908 .An Austin Appleby .
3911 is a work-in-progress and some features remain to be implemented.
3913 At present, the user has to fall back on
3915 to perform some tasks.
3919 Reading from remote repositories over HTTP or HTTPS protocols requires
3924 Writing to remote repositories over HTTP or HTTPS protocols requires
3927 The creation of merge commits with more than two parent commits requires
3930 In situations where files or directories were moved around
3932 will not automatically merge changes to new locations and
3934 will usually produce better results.