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
65 .It Cm init Ar repository-path
66 Create a new empty repository at the specified
73 command must be used to populate the empty repository before
76 .It Cm import Oo Fl b Ar branch Oc Oo Fl m Ar message Oc Oo Fl r Ar repository-path Oc Oo Fl I Ar pattern Oc Ar directory
77 Create an initial commit in a repository from the file hierarchy
80 The created commit will not have any parent commits, i.e. it will be a
82 Also create a new reference which provides a branch name for the newly
84 Show the path of each imported file to indicate progress.
90 environment variable to be set,
91 unless an author has been configured in
97 configuration settings can be obtained from the repository's
99 file or from Git's global
110 instead of creating the default branch
112 Use of this option is required if the
114 branch already exists.
116 Use the specified log message when creating the new commit.
121 opens a temporary file in an editor where a log message can be written.
122 .It Fl r Ar repository-path
123 Use the repository at the specified path.
124 If not specified, assume the repository is located at or above the current
127 Ignore files or directories with a name which matches the specified
129 This option may be specified multiple times to build a list of ignore patterns.
132 follows the globbing rules documented in
138 .It Cm clone Oo Fl a Oc Oo Fl b Ar branch Oc Oo Fl l Oc Oo Fl m Oc Oo Fl q Oc Oo Fl v Oc Oo Fl R Ar reference Oc Ar repository-URL Op Ar directory
139 Clone a Git repository at the specified
145 is specified the directory name will be derived from the name of the
148 will refuse to run if the
154 specifies a protocol scheme, a server hostname, an optional port number
155 separated from the hostname by a colon, and a path to the repository on
157 .Lk scheme://hostname:port/path/to/repository
159 The following protocol schemes are supported:
160 .Bl -tag -width git+ssh
162 The Git protocol as implemented by the
165 Use of this protocol is discouraged since it supports neither authentication
168 The Git protocol wrapped in an authenticated and encrypted
171 With this protocol the hostname may contain an embedded username for
176 Short alias for git+ssh.
179 Objects in the cloned repository are stored in a pack file which is downloaded
181 This pack file will then be indexed to facilitate access to the objects stored
183 If any objects in the pack file are stored in deltified form, all deltas will
184 be fully resolved in order to compute the ID of such objects.
185 This can take some time.
186 More details about the pack file format are documented in
187 .Xr git-repository 5 .
190 creates a remote repository entry in the
194 files of the cloned repository to store the
200 arguments for future use by
210 Fetch all branches from the remote repository's
212 reference namespace and set
213 .Cm fetch-all-branches
214 in the cloned repository's
216 file for future use by
218 If this option is not specified, a branch resolved via the remote
219 repository's HEAD reference will be fetched.
220 Cannot be used together with the
226 from the remote repository's
229 This option may be specified multiple times to build a list of branches
231 If the branch corresponding to the remote repository's HEAD reference is not
232 in this list, the cloned repository's HEAD reference will be set to the first
233 branch which was fetched.
234 If this option is not specified, a branch resolved via the remote
235 repository's HEAD reference will be fetched.
236 Cannot be used together with the
240 List branches and tags available for fetching from the remote repository
241 and exit immediately.
242 Cannot be used together with any of the other options except
245 Create the cloned repository as a mirror of the original repository.
246 This is useful if the cloned repository will not be used to store
247 locally created commits.
253 files will be set up with the
255 option enabled, such that
259 will write incoming changes directly to branches in the
261 reference namespace, rather than to branches in the
264 This avoids the usual requirement of having to run
268 in order to make incoming changes appear on branches in the
271 But maintaining custom changes in the cloned repository becomes difficult
272 since such changes will be at risk of being discarded whenever incoming
275 Suppress progress reporting output.
276 The same option will be passed to
283 to print debugging messages to standard error output.
284 This option will be passed to
287 Multiple -v options increase the verbosity.
289 .It Fl R Ar reference
290 In addition to the branches and tags that will be fetched, fetch an arbitrary
292 from the remote repository's
295 This option may be specified multiple times to build a list of additional
299 may either be a path to a specific reference, or a reference namespace
300 which will cause all references in this namespace to be fetched.
302 Each reference will be mapped into the cloned repository's
304 namespace, unless the
306 option is used to mirror references directly into the cloned repository's
311 will refuse to fetch references from the remote repository's
320 .It Cm fetch Oo Fl a Oc Oo Fl b Ar branch Oc Oo Fl d Oc Oo Fl l Oc Oo Fl r Ar repository-path Oc Oo Fl t Oc Oo Fl q Oc Oo Fl v Oc Oo Fl R Ar reference Oc Op Ar remote-repository
321 Fetch new changes from a remote repository.
323 .Ar remote-repository
327 The remote repository's URL is obtained from the corresponding entry in
331 file of the local repository, as created by
334 New changes will be stored in a separate pack file downloaded from the server.
335 Optionally, separate pack files stored in the repository can be combined with
338 By default, branch references in the
340 reference namespace will be updated to point at the newly fetched commits.
343 command can then be used to make new changes visible on branches in the
345 namespace, merging incoming changes with the changes on those branches
348 If the repository was created as a mirror with
350 then all branches in the
352 namespace will be updated directly to match the corresponding branches in
353 the remote repository.
354 If those branches contained local commits, these commits will no longer be
355 reachable via a reference and will therefore be at risk of being discarded
356 by Git's garbage collector.
357 Maintaining custom changes in a mirror repository is therefore discouraged.
359 In any case, references in the
361 namespace will always be fetched and mapped directly to local references
362 in the same namespace.
369 Fetch all branches from the remote repository's
372 This option can be enabled by default for specific repositories in
374 If this option is not specified, a branch resolved via the remote
375 repository's HEAD reference will be fetched.
376 Cannot be used together with the
382 from the remote repository's
385 This option may be specified multiple times to build a list of branches
387 If this option is not specified, a branch resolved via the remote
388 repository's HEAD reference will be fetched.
389 Cannot be used together with the
393 Delete branches and tags from the local repository which are no longer
394 present in the remote repository.
395 Only references are deleted.
396 Any commit, tree, tag, and blob objects belonging to deleted branches or
397 tags remain in the repository and may be removed separately with
398 Git's garbage collector.
400 List branches and tags available for fetching from the remote repository
401 and exit immediately.
402 Cannot be used together with any of the other options except
408 Allow existing references in the
410 namespace to be updated if they have changed on the server.
411 If not specified, only new tag references will be created.
412 .It Fl r Ar repository-path
413 Use the repository at the specified path.
414 If not specified, assume the repository is located at or above the current
416 If this directory is a
418 work tree, use the repository path associated with this work tree.
420 Suppress progress reporting output.
421 The same option will be passed to
428 to print debugging messages to standard error output.
429 The same option will be passed to
432 Multiple -v options increase the verbosity.
434 .It Fl R Ar reference
435 In addition to the branches and tags that will be fetched, fetch an arbitrary
437 from the remote repository's
440 This option may be specified multiple times to build a list of additional
444 may either be a path to a specific reference, or a reference namespace
445 which will cause all references in this namespace to be fetched.
447 Each reference will be mapped into the local repository's
449 namespace, unless the local repository was created as a mirror with
451 in which case references will be mapped directly into the local repository's
455 Once a reference has been fetched, a branch based on it can be created with
460 will refuse to fetch references from the remote repository's
469 .It Cm checkout Oo Fl E Oc Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl p Ar path-prefix Oc Ar repository-path Op Ar work-tree-path
470 Copy files from a repository into a new work tree.
471 Show the status of each affected file, using the following status codes:
472 .Bl -column YXZ description
473 .It A Ta new file was added
474 .It E Ta file already exists in work tree's meta-data
479 is not specified, either use the last component of
480 .Ar repository path ,
483 was specified use the last component of
491 Proceed with the checkout operation even if the directory at
494 Existing files will be left intact.
496 Check out files from a commit on the specified
498 If this option is not specified, a branch resolved via the repository's HEAD
499 reference will be used.
501 Check out files from the specified
503 on the selected branch.
504 The expected argument is a commit ID SHA1 hash or an existing reference
505 or tag name which will be resolved to a commit ID.
506 An abbreviated hash argument will be expanded to a full SHA1 hash
507 automatically, provided the abbreviation is unique.
508 If this option is not specified, the most recent commit on the selected
513 is not contained in the selected branch, a different branch which contains
514 this commit must be specified with the
517 If no such branch is known a new branch must be created for this
523 Checking out work trees with an unknown branch is intentionally not supported.
524 .It Fl p Ar path-prefix
525 Restrict the work tree to a subset of the repository's tree hierarchy.
526 Only files beneath the specified
533 .It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Op Ar path ...
534 Update an existing work tree to a different
536 Change existing files in the work tree as necessary to match file contents
538 Preserve any local changes in the work tree and merge them with the
541 Files which already contain merge conflicts will not be updated to avoid
542 further complications.
543 Such files will be updated when
545 is run again after merge conflicts have been resolved.
546 If the conflicting changes are no longer needed affected files can be
553 Show the status of each affected file, using the following status codes:
554 .Bl -column YXZ description
555 .It U Ta file was updated and contained no local changes
556 .It G Ta file was updated and local changes were merged cleanly
557 .It C Ta file was updated and conflicts occurred during merge
558 .It D Ta file was deleted
559 .It A Ta new file was added
560 .It \(a~ Ta versioned file is obstructed by a non-regular file
561 .It ! Ta a missing versioned file was restored
562 .It # Ta file was not updated because it contains merge conflicts
563 .It ? Ta changes destined for an unversioned file were not merged
568 is specified, update the entire work tree.
569 Otherwise, restrict the update operation to files at or within the
571 Each path is required to exist in the update operation's target commit.
572 Files in the work tree outside specified paths will remain unchanged and
573 will retain their previously recorded base commit.
576 commands may refuse to run while the work tree contains files from
577 multiple base commits.
578 The base commit of such a work tree can be made consistent by running
580 across the entire work tree.
583 is incompatible with the
588 cannot update paths with staged changes.
589 If changes have been staged with
591 these changes must first be committed with
601 Switch the work tree's branch reference to the specified
603 before updating the work tree.
604 This option requires that all paths in the work tree are updated.
606 As usual, any local changes in the work tree will be preserved.
607 This can be useful when switching to a newly created branch in order
608 to commit existing local changes to this branch.
610 Any local changes must be dealt with separately in order to obtain a
611 work tree with pristine file contents corresponding exactly to the specified
613 Such changes could first be committed to a different branch with
615 or could be discarded with
618 Update the work tree to the specified
620 The expected argument is a commit ID SHA1 hash or an existing reference
621 or tag name which will be resolved to a commit ID.
622 An abbreviated hash argument will be expanded to a full SHA1 hash
623 automatically, provided the abbreviation is unique.
624 If this option is not specified, the most recent commit on the work tree's
630 .It Cm status Oo Fl s Ar status-codes Oc Op Ar path ...
631 Show the current modification status of files in a work tree,
632 using the following status codes:
633 .Bl -column YXZ description
634 .It M Ta modified file
635 .It A Ta file scheduled for addition in next commit
636 .It D Ta file scheduled for deletion in next commit
637 .It C Ta modified or added file which contains merge conflicts
638 .It ! Ta versioned file was expected on disk but is missing
639 .It \(a~ Ta versioned file is obstructed by a non-regular file
640 .It ? Ta unversioned item not tracked by
642 .It m Ta modified file modes (executable bit only)
643 .It N Ta non-existent
645 specified on the command line
650 is specified, show modifications in the entire work tree.
651 Otherwise, show modifications at or within the specified paths.
653 If changes have been staged with
655 staged changes are shown in the second output column, using the following
657 .Bl -column YXZ description
658 .It M Ta file modification is staged
659 .It A Ta file addition is staged
660 .It D Ta file deletion is staged
663 Changes created on top of staged changes are indicated in the first column:
664 .Bl -column YXZ description
665 .It MM Ta file was modified after earlier changes have been staged
666 .It MA Ta file was modified after having been staged for addition
673 .It Fl s Ar status-codes
674 Only show files with a modification status matching any of the
675 single-character status codes contained in the
678 Any combination of codes from the above list of possible status codes
680 For staged files, status codes displayed in either column will be matched.
683 For compatibility with
694 files in each traversed directory and will not display unversioned files
695 which match these patterns.
700 supports consecutive asterisks,
702 which will match an arbitrary amount of directories.
706 only supports a single ignore pattern per line.
710 does not support negated ignore patterns prefixed with
712 and gives no special significance to the location of path component separators,
718 .It Cm log Oo Fl b Oc Oo Fl c Ar commit Oc Oo Fl C Ar number Oc Oo Fl l Ar N Oc Oo Fl p Oc Oo Fl P Oc Oo Fl s Ar search-pattern Oc Oo Fl r Ar repository-path Oc Oo Fl R Oc Oo Fl x Ar commit Oc Op Ar path
719 Display history of a repository.
722 is specified, show only commits which modified this path.
723 If invoked in a work tree, the
725 is interpreted relative to the current working directory,
726 and the work tree's path prefix is implicitly prepended.
727 Otherwise, the path is interpreted relative to the repository root.
734 Display individual commits which were merged into the current branch
738 shows the linear history of the current branch only.
740 Start traversing history at the specified
742 The expected argument is a commit ID SHA1 hash or an existing reference
743 or tag name which will be resolved to a commit ID.
744 An abbreviated hash argument will be expanded to a full SHA1 hash
745 automatically, provided the abbreviation is unique.
746 If this option is not specified, default to the work tree's current branch
747 if invoked in a work tree, or to the repository's HEAD reference.
749 Set the number of context lines shown in diffs with
751 By default, 3 lines of context are shown.
753 Limit history traversal to a given number of commits.
754 If this option is not specified, a default limit value of zero is used,
755 which is treated as an unbounded limit.
757 .Ev GOT_LOG_DEFAULT_LIMIT
758 environment variable may be set to change this default value.
760 Display the patch of modifications made in each commit.
763 is specified, only show the patch of modifications at or within this path.
765 Display the list of file paths changed in each commit, using the following
767 .Bl -column YXZ description
768 .It M Ta modified file
769 .It D Ta file was deleted
770 .It A Ta new file was added
771 .It m Ta modified file modes (executable bit only)
773 .It Fl s Ar search-pattern
774 If specified, show only commits with a log message matched by the extended
777 When used together with
779 then the file paths changed by a commit can be matched as well.
780 Regular expression syntax is documented in
782 .It Fl r Ar repository-path
783 Use the repository at the specified path.
784 If not specified, assume the repository is located at or above the current
786 If this directory is a
788 work tree, use the repository path associated with this work tree.
790 Determine a set of commits to display as usual, but display these commits
793 Stop traversing commit history as soon as the specified
796 This option has no effect if the specified
800 .It Cm diff Oo Fl a Oc Oo Fl C Ar number Oc Oo Fl r Ar repository-path Oc Oo Fl s Oc Oo Fl w Oc Op Ar object1 Ar object2 | Ar path
801 When invoked within a work tree with less than two arguments, display
802 local changes in the work tree.
805 is specified, only show changes within this path.
807 If two arguments are provided, treat each argument as a reference, a tag
808 name, or an object ID SHA1 hash, and display differences between the
809 corresponding objects.
810 Both objects must be of the same type (blobs, trees, or commits).
811 An abbreviated hash argument will be expanded to a full SHA1 hash
812 automatically, provided the abbreviation is unique.
819 Treat file contents as ASCII text even if binary data is detected.
821 Set the number of context lines shown in the diff.
822 By default, 3 lines of context are shown.
823 .It Fl r Ar repository-path
824 Use the repository at the specified path.
825 If not specified, assume the repository is located at or above the current
827 If this directory is a
829 work tree, use the repository path associated with this work tree.
831 Show changes staged with
833 instead of showing local changes in the work tree.
834 This option is only valid when
836 is invoked in a work tree.
838 Ignore whitespace-only changes.
843 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
844 Display line-by-line history of a file at the specified path.
851 Start traversing history at the specified
853 The expected argument is a commit ID SHA1 hash or an existing reference
854 or tag name which will be resolved to a commit ID.
855 An abbreviated hash argument will be expanded to a full SHA1 hash
856 automatically, provided the abbreviation is unique.
857 .It Fl r Ar repository-path
858 Use the repository at the specified path.
859 If not specified, assume the repository is located at or above the current
861 If this directory is a
863 work tree, use the repository path associated with this work tree.
868 .It Cm tree Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl i Oc Oo Fl R Oc Op Ar path
869 Display a listing of files and directories at the specified
870 directory path in the repository.
871 Entries shown in this listing may carry one of the following trailing
873 .Bl -column YXZ description
874 .It @ Ta entry is a symbolic link
875 .It / Ta entry is a directory
876 .It * Ta entry is an executable file
877 .It $ Ta entry is a Git submodule
880 Symbolic link entries are also annotated with the target path of the link.
884 is specified, list the repository path corresponding to the current
885 directory of the work tree, or the root directory of the repository
886 if there is no work tree.
893 List files and directories as they appear in the specified
895 The expected argument is a commit ID SHA1 hash or an existing reference
896 or tag name which will be resolved to a commit ID.
897 An abbreviated hash argument will be expanded to a full SHA1 hash
898 automatically, provided the abbreviation is unique.
899 .It Fl r Ar repository-path
900 Use the repository at the specified path.
901 If not specified, assume the repository is located at or above the current
903 If this directory is a
905 work tree, use the repository path associated with this work tree.
907 Show object IDs of files (blob objects) and directories (tree objects).
909 Recurse into sub-directories in the repository.
914 .It Cm ref Oo Fl r Ar repository-path Oc Oo Fl l Oc Oo Fl c Ar object Oc Oo Fl s Ar reference Oc Oo Fl d Oc Op Ar name
915 Manage references in a repository.
917 References may be listed, created, deleted, and changed.
918 When creating, deleting, or changing a reference the specified
920 must be an absolute reference name, i.e. it must begin with
927 .It Fl r Ar repository-path
928 Use the repository at the specified path.
929 If not specified, assume the repository is located at or above the current
931 If this directory is a
933 work tree, use the repository path associated with this work tree.
935 List references in the repository.
938 is specified, list all existing references in the repository.
941 is a reference namespace, list all references in this namespace.
942 Otherwise, show only the reference with the given
944 Cannot be used together with any other options except
947 Create a reference or change an existing reference.
948 The reference with the specified
950 will point at the specified
954 argument is a ID SHA1 hash or an existing reference or tag name which will
955 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
956 Cannot be used together with any other options except
958 .It Fl s Ar reference
959 Create a symbolic reference, or change an existing symbolic reference.
960 The symbolic reference with the specified
962 will point at the specified
964 which must already exist in the repository.
965 Care should be taken not to create loops between references when
967 Cannot be used together with any other options except
970 Delete the reference with the specified
973 Cannot be used together with any other options except
976 .It Cm branch Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl l Oc Oo Fl d Ar name Oc Oo Fl n Oc Op Ar name
977 Create, list, or delete branches.
979 Branches are managed via references which live in the
984 command operates on references in this namespace only.
986 If invoked in a work tree without any arguments, print the name of the
987 work tree's current branch.
991 argument is passed, attempt to create a branch reference with the given name.
992 By default the new branch reference will point at the latest commit on the
993 work tree's current branch if invoked in a work tree, and otherwise to a commit
994 resolved via the repository's HEAD reference.
996 If invoked in a work tree, once the branch was created successfully
997 switch the work tree's head reference to the newly created branch and
998 update files across the entire work tree, just like
999 .Cm got update -b Ar name
1001 Show the status of each affected file, using the following status codes:
1002 .Bl -column YXZ description
1003 .It U Ta file was updated and contained no local changes
1004 .It G Ta file was updated and local changes were merged cleanly
1005 .It C Ta file was updated and conflicts occurred during merge
1006 .It D Ta file was deleted
1007 .It A Ta new file was added
1008 .It \(a~ Ta versioned file is obstructed by a non-regular file
1009 .It ! Ta a missing versioned file was restored
1017 Make a newly created branch reference point at the specified
1021 argument is a commit ID SHA1 hash or an existing reference
1022 or tag name which will be resolved to a commit ID.
1023 .It Fl r Ar repository-path
1024 Use the repository at the specified path.
1025 If not specified, assume the repository is located at or above the current
1027 If this directory is a
1029 work tree, use the repository path associated with this work tree.
1031 List all existing branches in the repository.
1032 If invoked in a work tree, the work tree's current branch is shown
1033 with one the following annotations:
1034 .Bl -column YXZ description
1035 .It * Ta work tree's base commit matches the branch tip
1036 .It \(a~ Ta work tree's base commit is out-of-date
1039 Delete the branch with the specified name from the repository.
1040 Only the branch reference is deleted.
1041 Any commit, tree, and blob objects belonging to the branch
1042 remain in the repository and may be removed separately with
1043 Git's garbage collector.
1045 Do not switch and update the work tree after creating a new branch.
1050 .It Cm tag Oo Fl c Ar commit Oc Oo Fl m Ar message Oc Oo Fl r Ar repository-path Oc Oo Fl l Oc Ar name
1051 Manage tags in a repository.
1053 Tags are managed via references which live in the
1055 reference namespace.
1058 command operates on references in this namespace only.
1059 References in this namespace point at tag objects which contain a pointer
1060 to another object, a tag message, as well as author and timestamp information.
1062 Attempt to create a tag with the given
1064 and make this tag point at the given
1066 If no commit is specified, default to the latest commit on the work tree's
1067 current branch if invoked in a work tree, and to a commit resolved via
1068 the repository's HEAD reference otherwise.
1075 Make the newly created tag reference point at the specified
1079 argument is a commit ID SHA1 hash or an existing reference or tag name which
1080 will be resolved to a commit ID.
1081 An abbreviated hash argument will be expanded to a full SHA1 hash
1082 automatically, provided the abbreviation is unique.
1084 Use the specified tag message when creating the new tag.
1089 opens a temporary file in an editor where a tag message can be written.
1090 .It Fl r Ar repository-path
1091 Use the repository at the specified path.
1092 If not specified, assume the repository is located at or above the current
1094 If this directory is a
1096 work tree, use the repository path associated with this work tree.
1098 List all existing tags in the repository instead of creating a new tag.
1099 If this option is used, no other command-line arguments are allowed.
1104 command will not delete tags or change existing tags.
1105 If a tag must be deleted, the
1107 command may be used to delete a tag's reference.
1108 This should only be done if the tag has not already been copied to
1110 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1111 Schedule unversioned files in a work tree for addition to the
1112 repository in the next commit.
1119 Permit recursion into directories.
1120 If this option is not specified,
1122 will refuse to run if a specified
1126 With -R, add files even if they match a
1130 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
1131 Remove versioned files from a work tree and schedule them for deletion
1132 from the repository in the next commit.
1139 Perform the operation even if a file contains local modifications.
1141 Keep affected files on disk.
1143 Permit recursion into directories.
1144 If this option is not specified,
1146 will refuse to run if a specified
1149 .It Fl s Ar status-codes
1150 Only delete files with a modification status matching one of the
1151 single-character status codes contained in the
1154 The following status codes may be specified:
1155 .Bl -column YXZ description
1156 .It M Ta modified file (this implies the
1159 .It ! Ta versioned file expected on disk but missing
1165 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1166 Revert any local changes in files at the specified paths in a work tree.
1167 File contents will be overwritten with those contained in the
1168 work tree's base commit.
1169 There is no way to bring discarded changes back after
1172 If a file was added with
1174 it will become an unversioned file again.
1175 If a file was deleted with
1177 it will be restored.
1184 Instead of reverting all changes in files, interactively select or reject
1185 changes to revert based on
1191 (quit reverting this file) responses.
1192 If a file is in modified status, individual patches derived from the
1193 modified file content can be reverted.
1194 Files in added or deleted status may only be reverted in their entirety.
1195 .It Fl F Ar response-script
1203 responses line-by-line from the specified
1205 file instead of prompting interactively.
1207 Permit recursion into directories.
1208 If this option is not specified,
1210 will refuse to run if a specified
1217 .It Cm commit Oo Fl m Ar message Oc Oo Fl S Oc Op Ar path ...
1218 Create a new commit in the repository from changes in a work tree
1219 and use this commit as the new base commit for the work tree.
1222 is specified, commit all changes in the work tree.
1223 Otherwise, commit changes at or within the specified paths.
1225 If changes have been explicitly staged for commit with
1227 only commit staged changes and reject any specified paths which
1228 have not been staged.
1230 Show the status of each affected file, using the following status codes:
1231 .Bl -column YXZ description
1232 .It M Ta modified file
1233 .It D Ta file was deleted
1234 .It A Ta new file was added
1235 .It m Ta modified file modes (executable bit only)
1238 Files which are not part of the new commit will retain their previously
1239 recorded base commit.
1242 commands may refuse to run while the work tree contains files from
1243 multiple base commits.
1244 The base commit of such a work tree can be made consistent by running
1246 across the entire work tree.
1250 command requires the
1252 environment variable to be set,
1253 unless an author has been configured in
1259 configuration settings can be
1260 obtained from the repository's
1262 file or from Git's global
1271 Use the specified log message when creating the new commit.
1276 opens a temporary file in an editor where a log message can be written.
1278 Allow the addition of symbolic links which point outside of the path space
1279 that is under version control.
1282 will reject such symbolic links due to safety concerns.
1285 may decide to represent such a symbolic link as a regular file which contains
1286 the link's target path, rather than creating an actual symbolic link which
1287 points outside of the work tree.
1288 Use of this option is discouraged because external mechanisms such as
1290 are better suited for managing symbolic links to paths not under
1295 will refuse to run if certain preconditions are not met.
1296 If the work tree's current branch is not in the
1298 reference namespace, new commits may not be created on this branch.
1299 Local changes may only be committed if they are based on file content
1300 found in the most recent commit on the work tree's branch.
1301 If a path is found to be out of date,
1303 must be used first in order to merge local changes with changes made
1308 .It Cm cherrypick Ar commit
1309 Merge changes from a single
1314 must be on a different branch than the work tree's base commit.
1315 The expected argument is a reference or a commit ID SHA1 hash.
1316 An abbreviated hash argument will be expanded to a full SHA1 hash
1317 automatically, provided the abbreviation is unique.
1319 Show the status of each affected file, using the following status codes:
1320 .Bl -column YXZ description
1321 .It G Ta file was merged
1322 .It C Ta file was merged and conflicts occurred during merge
1323 .It ! Ta changes destined for a missing file were not merged
1324 .It D Ta file was deleted
1325 .It d Ta file's deletion was obstructed by local modifications
1326 .It A Ta new file was added
1327 .It \(a~ Ta changes destined for a non-regular file were not merged
1328 .It ? Ta changes destined for an unversioned file were not merged
1331 The merged changes will appear as local changes in the work tree, which
1334 amended manually or with further
1339 or discarded again with
1343 will refuse to run if certain preconditions are not met.
1344 If the work tree contains multiple base commits it must first be updated
1345 to a single base commit with
1347 If the work tree already contains files with merge conflicts, these
1348 conflicts must be resolved first.
1352 .It Cm backout Ar commit
1353 Reverse-merge changes from a single
1358 must be on the same branch as the work tree's base commit.
1359 The expected argument is a reference or a commit ID SHA1 hash.
1360 An abbreviated hash argument will be expanded to a full SHA1 hash
1361 automatically, provided the abbreviation is unique.
1363 Show the status of each affected file, using the following status codes:
1364 .Bl -column YXZ description
1365 .It G Ta file was merged
1366 .It C Ta file was merged and conflicts occurred during merge
1367 .It ! Ta changes destined for a missing file were not merged
1368 .It D Ta file was deleted
1369 .It d Ta file's deletion was obstructed by local modifications
1370 .It A Ta new file was added
1371 .It \(a~ Ta changes destined for a non-regular file were not merged
1372 .It ? Ta changes destined for an unversioned file were not merged
1375 The reverse-merged changes will appear as local changes in the work tree,
1376 which may be viewed with
1378 amended manually or with further
1383 or discarded again with
1387 will refuse to run if certain preconditions are not met.
1388 If the work tree contains multiple base commits it must first be updated
1389 to a single base commit with
1391 If the work tree already contains files with merge conflicts, these
1392 conflicts must be resolved first.
1396 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Op Ar branch
1397 Rebase commits on the specified
1399 onto the tip of the current branch of the work tree.
1402 must share common ancestry with the work tree's current branch.
1403 Rebasing begins with the first descendant commit of the youngest
1404 common ancestor commit shared by the specified
1406 and the work tree's current branch, and stops once the tip commit
1413 is used as intended, the specified
1415 represents a local commit history and may already contain changes
1416 that are not yet visible in any other repositories.
1417 The work tree's current branch, which must be set with
1421 operation, represents a branch from a remote repository which shares
1422 a common history with the specified
1424 but has progressed, and perhaps diverged, due to commits added to the
1427 Rebased commits are accumulated on a temporary branch which the work tree
1428 will remain switched to throughout the entire rebase operation.
1429 Commits on this branch represent the same changes with the same log
1430 messages as their counterparts on the original
1432 but with different commit IDs.
1433 Once rebasing has completed successfully, the temporary branch becomes
1434 the new version of the specified
1436 and the work tree is automatically switched to it.
1438 While rebasing commits, show the status of each affected file,
1439 using the following status codes:
1440 .Bl -column YXZ description
1441 .It G Ta file was merged
1442 .It C Ta file was merged and conflicts occurred during merge
1443 .It ! Ta changes destined for a missing file were not merged
1444 .It D Ta file was deleted
1445 .It d Ta file's deletion was obstructed by local modifications
1446 .It A Ta new file was added
1447 .It \(a~ Ta changes destined for a non-regular file were not merged
1448 .It ? Ta changes destined for an unversioned file were not merged
1451 If merge conflicts occur the rebase operation is interrupted and may
1452 be continued once conflicts have been resolved.
1453 Alternatively, the rebase operation may be aborted which will leave
1455 unmodified and the work tree switched back to its original branch.
1457 If a merge conflict is resolved in a way which renders the merged
1458 change into a no-op change, the corresponding commit will be elided
1459 when the rebase operation continues.
1462 will refuse to run if certain preconditions are not met.
1463 If the work tree is not yet fully updated to the tip commit of its
1464 branch then the work tree must first be updated with
1466 If changes have been staged with
1468 these changes must first be committed with
1472 If the work tree contains local changes, these changes must first be
1479 contains changes to files outside of the work tree's path prefix,
1480 the work tree cannot be used to rebase this branch.
1486 commands will refuse to run while a rebase operation is in progress.
1487 Other commands which manipulate the work tree may be used for
1488 conflict resolution purposes.
1495 Abort an interrupted rebase operation.
1496 If this option is used, no other command-line arguments are allowed.
1498 Continue an interrupted rebase operation.
1499 If this option is used, no other command-line arguments are allowed.
1504 .It Cm histedit Oo Fl a Oc Oo Fl c Oc Oo Fl f Oc Oo Fl F Ar histedit-script Oc Oo Fl m Oc
1505 Edit commit history between the work tree's current base commit and
1506 the tip commit of the work tree's current branch.
1510 operation the work tree's current branch must be set with
1512 to the branch which should be edited, unless this branch is already the
1513 current branch of the work tree.
1514 The tip of this branch represents the upper bound (inclusive) of commits
1519 Furthermore, the work tree's base commit
1522 to a point in this branch's commit history where editing should begin.
1523 This commit represents the lower bound (non-inclusive) of commits touched
1528 Editing of commit history is controlled via a
1530 which can be written in an editor based on a template, passed on the
1531 command line, or generated with the
1537 The format of the histedit script is line-based.
1538 Each line in the script begins with a command name, followed by
1539 whitespace and an argument.
1540 For most commands, the expected argument is a commit ID SHA1 hash.
1541 Any remaining text on the line is ignored.
1542 Lines which begin with the
1544 character are ignored entirely.
1546 The available commands are as follows:
1547 .Bl -column YXZ pick-commit
1548 .It pick Ar commit Ta Use the specified commit as it is.
1549 .It edit Ar commit Ta Use the specified commit but once changes have been
1550 merged into the work tree interrupt the histedit operation for amending.
1551 .It fold Ar commit Ta Combine the specified commit with the next commit
1552 listed further below that will be used.
1553 .It drop Ar commit Ta Remove this commit from the edited history.
1554 .It mesg Ar log-message Ta Use the specified single-line log message for
1555 the commit on the previous line.
1556 If the log message argument is left empty, open an editor where a new
1557 log message can be written.
1560 Every commit in the history being edited must be mentioned in the script.
1561 Lines may be re-ordered to change the order of commits in the edited history.
1562 No commit may be listed more than once.
1564 Edited commits are accumulated on a temporary branch which the work tree
1565 will remain switched to throughout the entire histedit operation.
1566 Once history editing has completed successfully, the temporary branch becomes
1567 the new version of the work tree's branch and the work tree is automatically
1570 While merging commits, show the status of each affected file,
1571 using the following status codes:
1572 .Bl -column YXZ description
1573 .It G Ta file was merged
1574 .It C Ta file was merged and conflicts occurred during merge
1575 .It ! Ta changes destined for a missing file were not merged
1576 .It D Ta file was deleted
1577 .It d Ta file's deletion was obstructed by local modifications
1578 .It A Ta new file was added
1579 .It \(a~ Ta changes destined for a non-regular file were not merged
1580 .It ? Ta changes destined for an unversioned file were not merged
1583 If merge conflicts occur the histedit operation is interrupted and may
1584 be continued once conflicts have been resolved.
1585 Alternatively, the histedit operation may be aborted which will leave
1586 the work tree switched back to its original branch.
1588 If a merge conflict is resolved in a way which renders the merged
1589 change into a no-op change, the corresponding commit will be elided
1590 when the histedit operation continues.
1593 will refuse to run if certain preconditions are not met.
1594 If the work tree's current branch is not in the
1596 reference namespace, the history of the branch may not be edited.
1597 If the work tree contains multiple base commits it must first be updated
1598 to a single base commit with
1600 If changes have been staged with
1602 these changes must first be committed with
1606 If the work tree contains local changes, these changes must first be
1611 If the edited history contains changes to files outside of the work tree's
1612 path prefix, the work tree cannot be used to edit the history of this branch.
1619 commands will refuse to run while a histedit operation is in progress.
1620 Other commands which manipulate the work tree may be used, and the
1622 command may be used to commit arbitrary changes to the temporary branch
1623 while the histedit operation is interrupted.
1630 Abort an interrupted histedit operation.
1631 If this option is used, no other command-line arguments are allowed.
1633 Continue an interrupted histedit operation.
1634 If this option is used, no other command-line arguments are allowed.
1636 Fold all commits into a single commit.
1637 This option is a quick equivalent to a histedit script which folds all
1638 commits, combining them all into one commit.
1641 option can only be used when starting a new histedit operation.
1642 If this option is used, no other command-line arguments are allowed.
1643 .It Fl F Ar histedit-script
1646 instead of opening a temporary file in an editor where a histedit script
1649 Edit log messages only.
1650 This option is a quick equivalent to a histedit script which edits
1651 only log messages but otherwise leaves every picked commit as-is.
1654 option can only be used when starting a new histedit operation.
1655 If this option is used, no other command-line arguments are allowed.
1660 .It Cm integrate Ar branch
1661 Integrate the specified
1663 into the work tree's current branch.
1664 Files in the work tree are updated to match the contents on the integrated
1666 and the reference of the work tree's branch is changed to point at the
1667 head commit of the integrated
1670 Both branches can be considered equivalent after integration since they
1671 will be pointing at the same commit.
1672 Both branches remain available for future work, if desired.
1673 In case the integrated
1675 is no longer needed it may be deleted with
1678 Show the status of each affected file, using the following status codes:
1679 .Bl -column YXZ description
1680 .It U Ta file was updated
1681 .It D Ta file was deleted
1682 .It A Ta new file was added
1683 .It \(a~ Ta versioned file is obstructed by a non-regular file
1684 .It ! Ta a missing versioned file was restored
1688 will refuse to run if certain preconditions are not met.
1689 Most importantly, the
1691 must have been rebased onto the work tree's current branch with
1693 before it can be integrated, in order to linearize commit history and
1694 resolve merge conflicts.
1695 If the work tree contains multiple base commits it must first be updated
1696 to a single base commit with
1698 If changes have been staged with
1700 these changes must first be committed with
1704 If the work tree contains local changes, these changes must first be
1712 .It Cm stage Oo Fl l Oc Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl S Oc Op Ar path ...
1713 Stage local changes for inclusion in the next commit.
1716 is specified, stage all changes in the work tree.
1717 Otherwise, stage changes at or within the specified paths.
1718 Paths may be staged if they are added, modified, or deleted according to
1721 Show the status of each affected file, using the following status codes:
1722 .Bl -column YXZ description
1723 .It A Ta file addition has been staged
1724 .It M Ta file modification has been staged
1725 .It D Ta file deletion has been staged
1728 Staged file contents are saved in newly created blob objects in the repository.
1729 These blobs will be referred to by tree objects once staged changes have been
1732 Staged changes affect the behaviour of
1737 While paths with staged changes exist, the
1739 command will refuse to commit any paths which do not have staged changes.
1740 Local changes created on top of staged changes can only be committed if
1741 the path is staged again, or if the staged changes are committed first.
1744 command will show both local changes and staged changes.
1747 command is able to display local changes relative to staged changes,
1748 and to display staged changes relative to the repository.
1751 command cannot revert staged changes but may be used to revert
1752 local changes created on top of staged changes.
1759 Instead of staging new changes, list paths which are already staged,
1760 along with the IDs of staged blob objects and stage status codes.
1761 If paths were provided in the command line show the staged paths
1762 among the specified paths.
1763 Otherwise, show all staged paths.
1765 Instead of staging the entire content of a changed file, interactively
1766 select or reject changes for staging based on
1770 (reject change), and
1772 (quit staging this file) responses.
1773 If a file is in modified status, individual patches derived from the
1774 modified file content can be staged.
1775 Files in added or deleted status may only be staged or rejected in
1777 .It Fl F Ar response-script
1785 responses line-by-line from the specified
1787 file instead of prompting interactively.
1789 Allow staging of symbolic links which point outside of the path space
1790 that is under version control.
1793 will reject such symbolic links due to safety concerns.
1796 may decide to represent such a symbolic link as a regular file which contains
1797 the link's target path, rather than creating an actual symbolic link which
1798 points outside of the work tree.
1799 Use of this option is discouraged because external mechanisms such as
1801 are better suited for managing symbolic links to paths not under
1806 will refuse to run if certain preconditions are not met.
1807 If a file contains merge conflicts, these conflicts must be resolved first.
1808 If a file is found to be out of date relative to the head commit on the
1809 work tree's current branch, the file must be updated with
1811 before it can be staged (however, this does not prevent the file from
1812 becoming out-of-date at some point after having been staged).
1819 commands will refuse to run while staged changes exist.
1820 If staged changes cannot be committed because a staged path
1821 is out of date, the path must be unstaged with
1823 before it can be updated with
1825 and may then be staged again if necessary.
1829 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
1830 Merge staged changes back into the work tree and put affected paths
1831 back into non-staged status.
1834 is specified, unstage all staged changes across the entire work tree.
1835 Otherwise, unstage changes at or within the specified paths.
1837 Show the status of each affected file, using the following status codes:
1838 .Bl -column YXZ description
1839 .It G Ta file was unstaged
1840 .It C Ta file was unstaged and conflicts occurred during merge
1841 .It ! Ta changes destined for a missing file were not merged
1842 .It D Ta file was staged as deleted and still is deleted
1843 .It d Ta file's deletion was obstructed by local modifications
1844 .It \(a~ Ta changes destined for a non-regular file were not merged
1852 Instead of unstaging the entire content of a changed file, interactively
1853 select or reject changes for unstaging based on
1857 (keep change staged), and
1859 (quit unstaging this file) responses.
1860 If a file is staged in modified status, individual patches derived from the
1861 staged file content can be unstaged.
1862 Files staged in added or deleted status may only be unstaged in their entirety.
1863 .It Fl F Ar response-script
1871 responses line-by-line from the specified
1873 file instead of prompting interactively.
1878 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
1879 Parse and print contents of objects to standard output in a line-based
1881 Content of commit, tree, and tag objects is printed in a way similar
1882 to the actual content stored in such objects.
1883 Blob object contents are printed as they would appear in files on disk.
1885 Attempt to interpret each argument as a reference, a tag name, or
1886 an object ID SHA1 hash.
1887 References will be resolved to an object ID.
1888 Tag names will resolved to a tag object.
1889 An abbreviated hash argument will be expanded to a full SHA1 hash
1890 automatically, provided the abbreviation is unique.
1892 If none of the above interpretations produce a valid result, or if the
1894 option is used, attempt to interpret the argument as a path which will
1895 be resolved to the ID of an object found at this path in the repository.
1902 Look up paths in the specified
1904 If this option is not used, paths are looked up in the commit resolved
1905 via the repository's HEAD reference.
1906 The expected argument is a commit ID SHA1 hash or an existing reference
1907 or tag name which will be resolved to a commit ID.
1908 An abbreviated hash argument will be expanded to a full SHA1 hash
1909 automatically, provided the abbreviation is unique.
1910 .It Fl r Ar repository-path
1911 Use the repository at the specified path.
1912 If not specified, assume the repository is located at or above the current
1914 If this directory is a
1916 work tree, use the repository path associated with this work tree.
1918 Interpret all arguments as paths only.
1919 This option can be used to resolve ambiguity in cases where paths
1920 look like tag names, reference names, or object IDs.
1922 .It Cm info Op Ar path ...
1923 Display meta-data stored in a work tree.
1928 The work tree to use is resolved implicitly by walking upwards from the
1929 current working directory.
1933 arguments are specified, show additional per-file information for tracked
1934 files located at or within these paths.
1937 argument corresponds to the work tree's root directory, display information
1938 for all tracked files.
1941 .Bl -tag -width GOT_AUTHOR
1943 The author's name and email address for
1948 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
1951 may fail to parse commits without an email address in author data,
1955 environment variables with a missing email address.
1957 .Ev GOT_AUTHOR will be overriden by configuration settings in
1963 configuration settings in the repository's
1970 configuration settings contained in Git's global
1972 configuration file will only be used if neither
1976 environment variable provide author information.
1977 .It Ev VISUAL , EDITOR
1978 The editor spawned by
1986 text editor will be spawned in order to give
1988 the attention it deserves.
1989 .It Ev GOT_LOG_DEFAULT_LIMIT
1990 The default limit on the number of commits traversed by
1992 If set to zero, the limit is unbounded.
1993 This variable will be silently ignored if it is set to a non-numeric value.
1996 .Bl -tag -width packed-refs -compact
1998 Repository-wide configuration settings for
2002 configuration file located in the root directory of a Git repository
2003 supersedes any relevant settings in Git's
2007 .It Pa .got/got.conf
2008 Worktree-specific configuration settings for
2012 configuration file in the
2014 meta-data directory of a work tree supersedes any relevant settings in
2017 configuration file and Git's
2024 Clone an existing Git repository for use with
2028 .Dl $ got clone ssh://git@github.com/openbsd/src.git
2030 Use of HTTP URLs currently requires
2034 .Dl $ git clone --bare https://github.com/openbsd/src.git
2036 Alternatively, for quick and dirty local testing of
2038 a new Git repository could be created and populated with files,
2039 e.g. from a temporary CVS checkout located at
2042 .Dl $ got init /var/git/src.git
2043 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
2045 Check out a work tree from the Git repository to /usr/src:
2047 .Dl $ got checkout /var/git/src.git /usr/src
2049 View local changes in a work tree directory:
2051 .Dl $ got diff | less
2053 In a work tree, display files in a potentially problematic state:
2055 .Dl $ got status -s 'C!~?'
2057 Interactively revert selected local changes in a work tree directory:
2059 .Dl $ got revert -p -R\ .
2061 In a work tree or a git repository directory, list all branch references:
2065 In a work tree or a git repository directory, create a new branch called
2066 .Dq unified-buffer-cache
2067 which is forked off the
2071 .Dl $ got branch unified-buffer-cache master
2073 Switch an existing work tree to the branch
2074 .Dq unified-buffer-cache .
2075 Local changes in the work tree will be preserved and merged if necessary:
2077 .Dl $ got update -b unified-buffer-cache
2079 Create a new commit from local changes in a work tree directory.
2080 This new commit will become the head commit of the work tree's current branch:
2084 In a work tree or a git repository directory, view changes committed in
2085 the 3 most recent commits to the work tree's branch, or the branch resolved
2086 via the repository's HEAD reference, respectively:
2088 .Dl $ got log -p -l 3
2090 As above, but display changes in the order in which
2092 could apply them in sequence:
2094 .Dl $ got log -p -l 3 -R
2096 In a work tree or a git repository directory, log the history of a subdirectory:
2098 .Dl $ got log sys/uvm
2100 While operating inside a work tree, paths are specified relative to the current
2101 working directory, so this command will log the subdirectory
2104 .Dl $ cd sys/uvm && got log\ .
2106 And this command has the same effect:
2108 .Dl $ cd sys/dev/usb && got log ../../uvm
2110 And this command displays work tree meta-data about all tracked files:
2113 .Dl $ got info\ . | less
2115 Add new files and remove obsolete files in a work tree directory:
2117 .Dl $ got add sys/uvm/uvm_ubc.c
2118 .Dl $ got remove sys/uvm/uvm_vnode.c
2120 Create a new commit from local changes in a work tree directory
2121 with a pre-defined log message.
2123 .Dl $ got commit -m 'unify the buffer cache'
2125 Alternatively, create a new commit from local changes in a work tree
2126 directory with a log message that has been prepared in the file
2133 can be read into the buffer for review:
2138 Update any work tree checked out from the
2139 .Dq unified-buffer-cache
2140 branch to the latest commit on this branch:
2144 Roll file content on the unified-buffer-cache branch back by one commit,
2145 and then fetch the rolled-back change into the work tree as a local change
2146 to be amended and perhaps committed again:
2148 .Dl $ got backout unified-buffer-cache
2149 .Dl $ got commit -m 'roll back previous'
2150 .Dl $ # now back out the previous backout :-)
2151 .Dl $ got backout unified-buffer-cache
2153 Fetch new upstream commits into the local repository's
2160 In a repository created with a HTTP URL and
2161 .Cm git clone --bare
2164 command must be used instead:
2166 .Dl $ cd /var/git/src.git
2167 .Dl $ git fetch origin master:refs/remotes/origin/master
2171 branch to merge the new changes that are now visible on the
2176 .Dl $ got update -b origin/master
2177 .Dl $ got rebase master
2180 .Dq unified-buffer-cache
2181 branch on top of the new head commit of the
2185 .Dl $ got update -b master
2186 .Dl $ got rebase unified-buffer-cache
2188 Create a patch from all changes on the unified-buffer-cache branch.
2189 The patch can be mailed out for review and applied to
2193 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2195 Edit the entire commit history of the
2196 .Dq unified-buffer-cache
2199 .Dl $ got update -b unified-buffer-cache
2200 .Dl $ got update -c master
2203 In order to merge changes committed to the
2204 .Dq unified-buffer-cache
2205 branch back into the
2208 .Dq unified-buffer-cache
2209 branch must first be rebased onto the
2213 .Dl $ got update -b master
2214 .Dl $ got rebase unified-buffer-cache
2217 .Dq unified-buffer-cache
2218 branch can now be made visible on the
2222 Because the rebase operation switched the work tree to the
2223 .Dq unified-buffer-cache
2224 branch, the work tree must be switched back to the
2227 .Dq unified-buffer-cache
2228 branch can be integrated into
2231 .Dl $ got update -b master
2232 .Dl $ got integrate unified-buffer-cache
2234 Additional steps may be necessary if local changes need to be pushed back
2235 to the remote repository, which currently requires
2237 Before working against existing branches in a repository cloned with
2238 .Cm git clone --bare
2243 must be configured to map all references in the remote repository
2246 namespace of the local repository.
2247 This can achieved by setting Git's
2248 .Pa remote.origin.fetch
2249 configuration variable to the value
2250 .Dq +refs/heads/*:refs/remotes/origin/*
2255 .Dl $ cd /var/git/repo
2256 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2260 option must be disabled:
2262 .Dl $ cd /var/git/repo
2263 .Dl $ git config remote.origin.mirror false
2265 Alternatively, the following
2267 configuration item can be added manually to the Git repository's
2271 .Dl [remote "origin"]
2273 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2276 This configuration leaves the local repository's
2278 namespace free for use by local branches checked out with
2280 and, if needed, created with
2285 namespace can now be updated with incoming changes from the remote
2290 without extra command line arguments:
2292 .Dl $ cd /var/git/repo
2295 To make changes fetched from the remote repository appear on the
2299 branch must be rebased onto the
2302 This will also merge local changes, if any, with the incoming changes:
2304 .Dl $ got update -b origin/master
2305 .Dl $ got rebase master
2309 branch, log messages for local changes can now be amended with
2311 by other developers and any other important new information:
2313 .Dl $ got update -c origin/master
2314 .Dl $ got histedit -m
2316 Local changes on the
2318 branch can then be pushed to the remote
2322 .Dl $ cd /var/git/repo
2323 .Dl $ git push origin master
2326 .Xr git-repository 5 ,
2327 .Xr got-worktree 5 ,
2330 .An Stefan Sperling Aq Mt stsp@openbsd.org
2331 .An Martin Pieuchot Aq Mt mpi@openbsd.org
2332 .An Joshua Stein Aq Mt jcs@openbsd.org
2333 .An Ori Bernstein Aq Mt ori@openbsd.org
2336 is a work-in-progress and some features remain to be implemented.
2338 At present, the user has to fall back on
2340 to perform some tasks.
2344 Reading from remote repositories over HTTP or HTTPS protocols requires
2349 Writing to remote repositories, over any protocol, requires
2352 Packing repositories, which reduces disk space consumption and improves
2353 read-access performance, requires
2356 Exporting data from repositories requires
2357 .Xr git-fast-export 1 .
2359 Importing data into repositories requires
2360 .Xr git-fast-import 1 .
2362 Reducing the size of repositories by removing redundant or unreferenced
2366 The creation of merge commits, i.e. commits with two or more parent commits,
2370 In situations where files or directories were moved around
2372 will not automatically merge changes to new locations and
2374 will usually produce better results.