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
198 arguments for future use by
208 Fetch all branches from the remote repository's
211 If this option is not specified, a branch resolved via the remote
212 repository's HEAD reference will be fetched.
213 Cannot be used together with the
219 from the remote repository's
222 This option may be specified multiple times to build a list of branches
224 If the branch corresponding to the remote repository's HEAD reference is not
225 in this list, the cloned repository's HEAD reference will be set to the first
226 branch which was fetched.
227 If this option is not specified, a branch resolved via the remote
228 repository's HEAD reference will be fetched.
229 Cannot be used together with the
233 List branches and tags available for fetching from the remote repository
234 and exit immediately.
235 Cannot be used together with any of the other options except
238 Create the cloned repository as a mirror of the original repository.
239 This is useful if the cloned repository will not be used to store
240 locally created commits.
246 files will be set up with the
248 option enabled, such that
252 will write incoming changes directly to branches in the
254 reference namespace, rather than to branches in the
257 This avoids the usual requirement of having to run
261 in order to make incoming changes appear on branches in the
264 But maintaining custom changes in the cloned repository becomes difficult
265 since such changes will be at risk of being discarded whenever incoming
268 Suppress progress reporting output.
269 The same option will be passed to
276 to print debugging messages to standard error output.
277 This option will be passed to
280 Multiple -v options increase the verbosity.
282 .It Fl R Ar reference
283 In addition to the branches and tags that will be fetched, fetch an arbitrary
285 from the remote repository's
288 This option may be specified multiple times to build a list of additional
292 may either be a path to a specific reference, or a reference namespace
293 which will cause all references in this namespace to be fetched.
295 Each reference will be mapped into the cloned repository's
297 namespace, unless the
299 option is used to mirror references directly into the cloned repository's
304 will refuse to fetch references from the remote repository's
313 .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
314 Fetch new changes from a remote repository.
316 .Ar remote-repository
320 The remote repository's URL is obtained from the corresponding entry in
324 file of the local repository, as created by
327 New changes will be stored in a separate pack file downloaded from the server.
328 Optionally, separate pack files stored in the repository can be combined with
331 By default, branch references in the
333 reference namespace will be updated to point at the newly fetched commits.
336 command can then be used to make new changes visible on branches in the
338 namespace, merging incoming changes with the changes on those branches
341 If the repository was created as a mirror with
343 then all branches in the
345 namespace will be updated directly to match the corresponding branches in
346 the remote repository.
347 If those branches contained local commits, these commits will no longer be
348 reachable via a reference and will therefore be at risk of being discarded
349 by Git's garbage collector.
350 Maintaining custom changes in a mirror repository is therefore discouraged.
352 In any case, references in the
354 namespace will always be fetched and mapped directly to local references
355 in the same namespace.
362 Fetch all branches from the remote repository's
365 This option can be enabled by default for specific repositories in
367 If this option is not specified, a branch resolved via the remote
368 repository's HEAD reference will be fetched.
369 Cannot be used together with the
375 from the remote repository's
378 This option may be specified multiple times to build a list of branches
380 If this option is not specified, a branch resolved via the remote
381 repository's HEAD reference will be fetched.
382 Cannot be used together with the
386 Delete branches and tags from the local repository which are no longer
387 present in the remote repository.
388 Only references are deleted.
389 Any commit, tree, tag, and blob objects belonging to deleted branches or
390 tags remain in the repository and may be removed separately with
391 Git's garbage collector.
393 List branches and tags available for fetching from the remote repository
394 and exit immediately.
395 Cannot be used together with any of the other options except
401 Allow existing references in the
403 namespace to be updated if they have changed on the server.
404 If not specified, only new tag references will be created.
405 .It Fl r Ar repository-path
406 Use the repository at the specified path.
407 If not specified, assume the repository is located at or above the current
409 If this directory is a
411 work tree, use the repository path associated with this work tree.
413 Suppress progress reporting output.
414 The same option will be passed to
421 to print debugging messages to standard error output.
422 The same option will be passed to
425 Multiple -v options increase the verbosity.
427 .It Fl R Ar reference
428 In addition to the branches and tags that will be fetched, fetch an arbitrary
430 from the remote repository's
433 This option may be specified multiple times to build a list of additional
437 may either be a path to a specific reference, or a reference namespace
438 which will cause all references in this namespace to be fetched.
440 Each reference will be mapped into the local repository's
442 namespace, unless the local repository was created as a mirror with
444 in which case references will be mapped directly into the local repository's
448 Once a reference has been fetched, a branch based on it can be created with
453 will refuse to fetch references from the remote repository's
462 .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
463 Copy files from a repository into a new work tree.
464 Show the status of each affected file, using the following status codes:
465 .Bl -column YXZ description
466 .It A Ta new file was added
467 .It E Ta file already exists in work tree's meta-data
472 is not specified, either use the last component of
473 .Ar repository path ,
476 was specified use the last component of
484 Proceed with the checkout operation even if the directory at
487 Existing files will be left intact.
489 Check out files from a commit on the specified
491 If this option is not specified, a branch resolved via the repository's HEAD
492 reference will be used.
494 Check out files from the specified
496 on the selected branch.
497 The expected argument is a commit ID SHA1 hash or an existing reference
498 or tag name which will be resolved to a commit ID.
499 An abbreviated hash argument will be expanded to a full SHA1 hash
500 automatically, provided the abbreviation is unique.
501 If this option is not specified, the most recent commit on the selected
506 is not contained in the selected branch, a different branch which contains
507 this commit must be specified with the
510 If no such branch is known a new branch must be created for this
516 Checking out work trees with an unknown branch is intentionally not supported.
517 .It Fl p Ar path-prefix
518 Restrict the work tree to a subset of the repository's tree hierarchy.
519 Only files beneath the specified
526 .It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Op Ar path ...
527 Update an existing work tree to a different
529 Change existing files in the work tree as necessary to match file contents
531 Preserve any local changes in the work tree and merge them with the
534 Files which already contain merge conflicts will not be updated to avoid
535 further complications.
536 Such files will be updated when
538 is run again after merge conflicts have been resolved.
539 If the conflicting changes are no longer needed affected files can be
546 Show the status of each affected file, using the following status codes:
547 .Bl -column YXZ description
548 .It U Ta file was updated and contained no local changes
549 .It G Ta file was updated and local changes were merged cleanly
550 .It C Ta file was updated and conflicts occurred during merge
551 .It D Ta file was deleted
552 .It A Ta new file was added
553 .It \(a~ Ta versioned file is obstructed by a non-regular file
554 .It ! Ta a missing versioned file was restored
555 .It # Ta file was not updated because it contains merge conflicts
556 .It ? Ta changes destined for an unversioned file were not merged
561 is specified, update the entire work tree.
562 Otherwise, restrict the update operation to files at or within the
564 Each path is required to exist in the update operation's target commit.
565 Files in the work tree outside specified paths will remain unchanged and
566 will retain their previously recorded base commit.
569 commands may refuse to run while the work tree contains files from
570 multiple base commits.
571 The base commit of such a work tree can be made consistent by running
573 across the entire work tree.
576 is incompatible with the
581 cannot update paths with staged changes.
582 If changes have been staged with
584 these changes must first be committed with
594 Switch the work tree's branch reference to the specified
596 before updating the work tree.
597 This option requires that all paths in the work tree are updated.
599 As usual, any local changes in the work tree will be preserved.
600 This can be useful when switching to a newly created branch in order
601 to commit existing local changes to this branch.
603 Any local changes must be dealt with separately in order to obtain a
604 work tree with pristine file contents corresponding exactly to the specified
606 Such changes could first be committed to a different branch with
608 or could be discarded with
611 Update the work tree to the specified
613 The expected argument is a commit ID SHA1 hash or an existing reference
614 or tag name which will be resolved to a commit ID.
615 An abbreviated hash argument will be expanded to a full SHA1 hash
616 automatically, provided the abbreviation is unique.
617 If this option is not specified, the most recent commit on the work tree's
623 .It Cm status Oo Fl s Ar status-codes Oc Op Ar path ...
624 Show the current modification status of files in a work tree,
625 using the following status codes:
626 .Bl -column YXZ description
627 .It M Ta modified file
628 .It A Ta file scheduled for addition in next commit
629 .It D Ta file scheduled for deletion in next commit
630 .It C Ta modified or added file which contains merge conflicts
631 .It ! Ta versioned file was expected on disk but is missing
632 .It \(a~ Ta versioned file is obstructed by a non-regular file
633 .It ? Ta unversioned item not tracked by
635 .It m Ta modified file modes (executable bit only)
636 .It N Ta non-existent
638 specified on the command line
643 is specified, show modifications in the entire work tree.
644 Otherwise, show modifications at or within the specified paths.
646 If changes have been staged with
648 staged changes are shown in the second output column, using the following
650 .Bl -column YXZ description
651 .It M Ta file modification is staged
652 .It A Ta file addition is staged
653 .It D Ta file deletion is staged
656 Changes created on top of staged changes are indicated in the first column:
657 .Bl -column YXZ description
658 .It MM Ta file was modified after earlier changes have been staged
659 .It MA Ta file was modified after having been staged for addition
666 .It Fl s Ar status-codes
667 Only show files with a modification status matching any of the
668 single-character status codes contained in the
671 Any combination of codes from the above list of possible status codes
673 For staged files, status codes displayed in either column will be matched.
676 For compatibility with
687 files in each traversed directory and will not display unversioned files
688 which match these patterns.
693 supports consecutive asterisks,
695 which will match an arbitrary amount of directories.
699 only supports a single ignore pattern per line.
703 does not support negated ignore patterns prefixed with
705 and gives no special significance to the location of path component separators,
711 .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
712 Display history of a repository.
715 is specified, show only commits which modified this path.
716 If invoked in a work tree, the
718 is interpreted relative to the current working directory,
719 and the work tree's path prefix is implicitly prepended.
720 Otherwise, the path is interpreted relative to the repository root.
727 Display individual commits which were merged into the current branch
731 shows the linear history of the current branch only.
733 Start traversing history at the specified
735 The expected argument is a commit ID SHA1 hash or an existing reference
736 or tag name which will be resolved to a commit ID.
737 An abbreviated hash argument will be expanded to a full SHA1 hash
738 automatically, provided the abbreviation is unique.
739 If this option is not specified, default to the work tree's current branch
740 if invoked in a work tree, or to the repository's HEAD reference.
742 Set the number of context lines shown in diffs with
744 By default, 3 lines of context are shown.
746 Limit history traversal to a given number of commits.
747 If this option is not specified, a default limit value of zero is used,
748 which is treated as an unbounded limit.
750 .Ev GOT_LOG_DEFAULT_LIMIT
751 environment variable may be set to change this default value.
753 Display the patch of modifications made in each commit.
756 is specified, only show the patch of modifications at or within this path.
758 Display the list of file paths changed in each commit, using the following
760 .Bl -column YXZ description
761 .It M Ta modified file
762 .It D Ta file was deleted
763 .It A Ta new file was added
764 .It m Ta modified file modes (executable bit only)
766 .It Fl s Ar search-pattern
767 If specified, show only commits with a log message matched by the extended
770 When used together with
772 then the file paths changed by a commit can be matched as well.
773 Regular expression syntax is documented in
775 .It Fl r Ar repository-path
776 Use the repository at the specified path.
777 If not specified, assume the repository is located at or above the current
779 If this directory is a
781 work tree, use the repository path associated with this work tree.
783 Determine a set of commits to display as usual, but display these commits
786 Stop traversing commit history as soon as the specified
789 This option has no effect if the specified
793 .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
794 When invoked within a work tree with less than two arguments, display
795 local changes in the work tree.
798 is specified, only show changes within this path.
800 If two arguments are provided, treat each argument as a reference, a tag
801 name, or an object ID SHA1 hash, and display differences between the
802 corresponding objects.
803 Both objects must be of the same type (blobs, trees, or commits).
804 An abbreviated hash argument will be expanded to a full SHA1 hash
805 automatically, provided the abbreviation is unique.
812 Treat file contents as ASCII text even if binary data is detected.
814 Set the number of context lines shown in the diff.
815 By default, 3 lines of context are shown.
816 .It Fl r Ar repository-path
817 Use the repository at the specified path.
818 If not specified, assume the repository is located at or above the current
820 If this directory is a
822 work tree, use the repository path associated with this work tree.
824 Show changes staged with
826 instead of showing local changes in the work tree.
827 This option is only valid when
829 is invoked in a work tree.
831 Ignore whitespace-only changes.
836 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
837 Display line-by-line history of a file at the specified path.
844 Start traversing history at the specified
846 The expected argument is a commit ID SHA1 hash or an existing reference
847 or tag name which will be resolved to a commit ID.
848 An abbreviated hash argument will be expanded to a full SHA1 hash
849 automatically, provided the abbreviation is unique.
850 .It Fl r Ar repository-path
851 Use the repository at the specified path.
852 If not specified, assume the repository is located at or above the current
854 If this directory is a
856 work tree, use the repository path associated with this work tree.
861 .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
862 Display a listing of files and directories at the specified
863 directory path in the repository.
864 Entries shown in this listing may carry one of the following trailing
866 .Bl -column YXZ description
867 .It @ Ta entry is a symbolic link
868 .It / Ta entry is a directory
869 .It * Ta entry is an executable file
870 .It $ Ta entry is a Git submodule
873 Symbolic link entries are also annotated with the target path of the link.
877 is specified, list the repository path corresponding to the current
878 directory of the work tree, or the root directory of the repository
879 if there is no work tree.
886 List files and directories as they appear in the specified
888 The expected argument is a commit ID SHA1 hash or an existing reference
889 or tag name which will be resolved to a commit ID.
890 An abbreviated hash argument will be expanded to a full SHA1 hash
891 automatically, provided the abbreviation is unique.
892 .It Fl r Ar repository-path
893 Use the repository at the specified path.
894 If not specified, assume the repository is located at or above the current
896 If this directory is a
898 work tree, use the repository path associated with this work tree.
900 Show object IDs of files (blob objects) and directories (tree objects).
902 Recurse into sub-directories in the repository.
907 .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
908 Manage references in a repository.
910 References may be listed, created, deleted, and changed.
911 When creating, deleting, or changing a reference the specified
913 must be an absolute reference name, i.e. it must begin with
920 .It Fl r Ar repository-path
921 Use the repository at the specified path.
922 If not specified, assume the repository is located at or above the current
924 If this directory is a
926 work tree, use the repository path associated with this work tree.
928 List references in the repository.
931 is specified, list all existing references in the repository.
934 is a reference namespace, list all references in this namespace.
935 Otherwise, show only the reference with the given
937 Cannot be used together with any other options except
940 Create a reference or change an existing reference.
941 The reference with the specified
943 will point at the specified
947 argument is a ID SHA1 hash or an existing reference or tag name which will
948 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
949 Cannot be used together with any other options except
951 .It Fl s Ar reference
952 Create a symbolic reference, or change an existing symbolic reference.
953 The symbolic reference with the specified
955 will point at the specified
957 which must already exist in the repository.
958 Care should be taken not to create loops between references when
960 Cannot be used together with any other options except
963 Delete the reference with the specified
966 Cannot be used together with any other options except
969 .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
970 Create, list, or delete branches.
972 Branches are managed via references which live in the
977 command operates on references in this namespace only.
979 If invoked in a work tree without any arguments, print the name of the
980 work tree's current branch.
984 argument is passed, attempt to create a branch reference with the given name.
985 By default the new branch reference will point at the latest commit on the
986 work tree's current branch if invoked in a work tree, and otherwise to a commit
987 resolved via the repository's HEAD reference.
989 If invoked in a work tree, once the branch was created successfully
990 switch the work tree's head reference to the newly created branch and
991 update files across the entire work tree, just like
992 .Cm got update -b Ar name
994 Show the status of each affected file, using the following status codes:
995 .Bl -column YXZ description
996 .It U Ta file was updated and contained no local changes
997 .It G Ta file was updated and local changes were merged cleanly
998 .It C Ta file was updated and conflicts occurred during merge
999 .It D Ta file was deleted
1000 .It A Ta new file was added
1001 .It \(a~ Ta versioned file is obstructed by a non-regular file
1002 .It ! Ta a missing versioned file was restored
1010 Make a newly created branch reference point at the specified
1014 argument is a commit ID SHA1 hash or an existing reference
1015 or tag name which will be resolved to a commit ID.
1016 .It Fl r Ar repository-path
1017 Use the repository at the specified path.
1018 If not specified, assume the repository is located at or above the current
1020 If this directory is a
1022 work tree, use the repository path associated with this work tree.
1024 List all existing branches in the repository.
1025 If invoked in a work tree, the work tree's current branch is shown
1026 with one the following annotations:
1027 .Bl -column YXZ description
1028 .It * Ta work tree's base commit matches the branch tip
1029 .It \(a~ Ta work tree's base commit is out-of-date
1032 Delete the branch with the specified name from the repository.
1033 Only the branch reference is deleted.
1034 Any commit, tree, and blob objects belonging to the branch
1035 remain in the repository and may be removed separately with
1036 Git's garbage collector.
1038 Do not switch and update the work tree after creating a new branch.
1043 .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
1044 Manage tags in a repository.
1046 Tags are managed via references which live in the
1048 reference namespace.
1051 command operates on references in this namespace only.
1052 References in this namespace point at tag objects which contain a pointer
1053 to another object, a tag message, as well as author and timestamp information.
1055 Attempt to create a tag with the given
1057 and make this tag point at the given
1059 If no commit is specified, default to the latest commit on the work tree's
1060 current branch if invoked in a work tree, and to a commit resolved via
1061 the repository's HEAD reference otherwise.
1068 Make the newly created tag reference point at the specified
1072 argument is a commit ID SHA1 hash or an existing reference or tag name which
1073 will be resolved to a commit ID.
1074 An abbreviated hash argument will be expanded to a full SHA1 hash
1075 automatically, provided the abbreviation is unique.
1077 Use the specified tag message when creating the new tag.
1082 opens a temporary file in an editor where a tag message can be written.
1083 .It Fl r Ar repository-path
1084 Use the repository at the specified path.
1085 If not specified, assume the repository is located at or above the current
1087 If this directory is a
1089 work tree, use the repository path associated with this work tree.
1091 List all existing tags in the repository instead of creating a new tag.
1092 If this option is used, no other command-line arguments are allowed.
1097 command will not delete tags or change existing tags.
1098 If a tag must be deleted, the
1100 command may be used to delete a tag's reference.
1101 This should only be done if the tag has not already been copied to
1103 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1104 Schedule unversioned files in a work tree for addition to the
1105 repository in the next commit.
1112 Permit recursion into directories.
1113 If this option is not specified,
1115 will refuse to run if a specified
1119 With -R, add files even if they match a
1123 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
1124 Remove versioned files from a work tree and schedule them for deletion
1125 from the repository in the next commit.
1132 Perform the operation even if a file contains local modifications.
1134 Keep affected files on disk.
1136 Permit recursion into directories.
1137 If this option is not specified,
1139 will refuse to run if a specified
1142 .It Fl s Ar status-codes
1143 Only delete files with a modification status matching one of the
1144 single-character status codes contained in the
1147 The following status codes may be specified:
1148 .Bl -column YXZ description
1149 .It M Ta modified file (this implies the
1152 .It ! Ta versioned file expected on disk but missing
1158 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1159 Revert any local changes in files at the specified paths in a work tree.
1160 File contents will be overwritten with those contained in the
1161 work tree's base commit.
1162 There is no way to bring discarded changes back after
1165 If a file was added with
1167 it will become an unversioned file again.
1168 If a file was deleted with
1170 it will be restored.
1177 Instead of reverting all changes in files, interactively select or reject
1178 changes to revert based on
1184 (quit reverting this file) responses.
1185 If a file is in modified status, individual patches derived from the
1186 modified file content can be reverted.
1187 Files in added or deleted status may only be reverted in their entirety.
1188 .It Fl F Ar response-script
1196 responses line-by-line from the specified
1198 file instead of prompting interactively.
1200 Permit recursion into directories.
1201 If this option is not specified,
1203 will refuse to run if a specified
1210 .It Cm commit Oo Fl m Ar message Oc Oo Fl S Oc Op Ar path ...
1211 Create a new commit in the repository from changes in a work tree
1212 and use this commit as the new base commit for the work tree.
1215 is specified, commit all changes in the work tree.
1216 Otherwise, commit changes at or within the specified paths.
1218 If changes have been explicitly staged for commit with
1220 only commit staged changes and reject any specified paths which
1221 have not been staged.
1223 Show the status of each affected file, using the following status codes:
1224 .Bl -column YXZ description
1225 .It M Ta modified file
1226 .It D Ta file was deleted
1227 .It A Ta new file was added
1228 .It m Ta modified file modes (executable bit only)
1231 Files which are not part of the new commit will retain their previously
1232 recorded base commit.
1235 commands may refuse to run while the work tree contains files from
1236 multiple base commits.
1237 The base commit of such a work tree can be made consistent by running
1239 across the entire work tree.
1243 command requires the
1245 environment variable to be set,
1246 unless an author has been configured in
1252 configuration settings can be
1253 obtained from the repository's
1255 file or from Git's global
1264 Use the specified log message when creating the new commit.
1269 opens a temporary file in an editor where a log message can be written.
1271 Allow the addition of symbolic links which point outside of the path space
1272 that is under version control.
1275 will reject such symbolic links due to safety concerns.
1278 may decide to represent such a symbolic link as a regular file which contains
1279 the link's target path, rather than creating an actual symbolic link which
1280 points outside of the work tree.
1281 Use of this option is discouraged because external mechanisms such as
1283 are better suited for managing symbolic links to paths not under
1288 will refuse to run if certain preconditions are not met.
1289 If the work tree's current branch is not in the
1291 reference namespace, new commits may not be created on this branch.
1292 Local changes may only be committed if they are based on file content
1293 found in the most recent commit on the work tree's branch.
1294 If a path is found to be out of date,
1296 must be used first in order to merge local changes with changes made
1301 .It Cm cherrypick Ar commit
1302 Merge changes from a single
1307 must be on a different branch than the work tree's base commit.
1308 The expected argument is a reference or a commit ID SHA1 hash.
1309 An abbreviated hash argument will be expanded to a full SHA1 hash
1310 automatically, provided the abbreviation is unique.
1312 Show the status of each affected file, using the following status codes:
1313 .Bl -column YXZ description
1314 .It G Ta file was merged
1315 .It C Ta file was merged and conflicts occurred during merge
1316 .It ! Ta changes destined for a missing file were not merged
1317 .It D Ta file was deleted
1318 .It d Ta file's deletion was obstructed by local modifications
1319 .It A Ta new file was added
1320 .It \(a~ Ta changes destined for a non-regular file were not merged
1321 .It ? Ta changes destined for an unversioned file were not merged
1324 The merged changes will appear as local changes in the work tree, which
1327 amended manually or with further
1332 or discarded again with
1336 will refuse to run if certain preconditions are not met.
1337 If the work tree contains multiple base commits it must first be updated
1338 to a single base commit with
1340 If the work tree already contains files with merge conflicts, these
1341 conflicts must be resolved first.
1345 .It Cm backout Ar commit
1346 Reverse-merge changes from a single
1351 must be on the same branch as the work tree's base commit.
1352 The expected argument is a reference or a commit ID SHA1 hash.
1353 An abbreviated hash argument will be expanded to a full SHA1 hash
1354 automatically, provided the abbreviation is unique.
1356 Show the status of each affected file, using the following status codes:
1357 .Bl -column YXZ description
1358 .It G Ta file was merged
1359 .It C Ta file was merged and conflicts occurred during merge
1360 .It ! Ta changes destined for a missing file were not merged
1361 .It D Ta file was deleted
1362 .It d Ta file's deletion was obstructed by local modifications
1363 .It A Ta new file was added
1364 .It \(a~ Ta changes destined for a non-regular file were not merged
1365 .It ? Ta changes destined for an unversioned file were not merged
1368 The reverse-merged changes will appear as local changes in the work tree,
1369 which may be viewed with
1371 amended manually or with further
1376 or discarded again with
1380 will refuse to run if certain preconditions are not met.
1381 If the work tree contains multiple base commits it must first be updated
1382 to a single base commit with
1384 If the work tree already contains files with merge conflicts, these
1385 conflicts must be resolved first.
1389 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Op Ar branch
1390 Rebase commits on the specified
1392 onto the tip of the current branch of the work tree.
1395 must share common ancestry with the work tree's current branch.
1396 Rebasing begins with the first descendant commit of the youngest
1397 common ancestor commit shared by the specified
1399 and the work tree's current branch, and stops once the tip commit
1406 is used as intended, the specified
1408 represents a local commit history and may already contain changes
1409 that are not yet visible in any other repositories.
1410 The work tree's current branch, which must be set with
1414 operation, represents a branch from a remote repository which shares
1415 a common history with the specified
1417 but has progressed, and perhaps diverged, due to commits added to the
1420 Rebased commits are accumulated on a temporary branch which the work tree
1421 will remain switched to throughout the entire rebase operation.
1422 Commits on this branch represent the same changes with the same log
1423 messages as their counterparts on the original
1425 but with different commit IDs.
1426 Once rebasing has completed successfully, the temporary branch becomes
1427 the new version of the specified
1429 and the work tree is automatically switched to it.
1431 While rebasing commits, show the status of each affected file,
1432 using the following status codes:
1433 .Bl -column YXZ description
1434 .It G Ta file was merged
1435 .It C Ta file was merged and conflicts occurred during merge
1436 .It ! Ta changes destined for a missing file were not merged
1437 .It D Ta file was deleted
1438 .It d Ta file's deletion was obstructed by local modifications
1439 .It A Ta new file was added
1440 .It \(a~ Ta changes destined for a non-regular file were not merged
1441 .It ? Ta changes destined for an unversioned file were not merged
1444 If merge conflicts occur the rebase operation is interrupted and may
1445 be continued once conflicts have been resolved.
1446 Alternatively, the rebase operation may be aborted which will leave
1448 unmodified and the work tree switched back to its original branch.
1450 If a merge conflict is resolved in a way which renders the merged
1451 change into a no-op change, the corresponding commit will be elided
1452 when the rebase operation continues.
1455 will refuse to run if certain preconditions are not met.
1456 If the work tree is not yet fully updated to the tip commit of its
1457 branch then the work tree must first be updated with
1459 If changes have been staged with
1461 these changes must first be committed with
1465 If the work tree contains local changes, these changes must first be
1472 contains changes to files outside of the work tree's path prefix,
1473 the work tree cannot be used to rebase this branch.
1479 commands will refuse to run while a rebase operation is in progress.
1480 Other commands which manipulate the work tree may be used for
1481 conflict resolution purposes.
1488 Abort an interrupted rebase operation.
1489 If this option is used, no other command-line arguments are allowed.
1491 Continue an interrupted rebase operation.
1492 If this option is used, no other command-line arguments are allowed.
1497 .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
1498 Edit commit history between the work tree's current base commit and
1499 the tip commit of the work tree's current branch.
1503 operation the work tree's current branch must be set with
1505 to the branch which should be edited, unless this branch is already the
1506 current branch of the work tree.
1507 The tip of this branch represents the upper bound (inclusive) of commits
1512 Furthermore, the work tree's base commit
1515 to a point in this branch's commit history where editing should begin.
1516 This commit represents the lower bound (non-inclusive) of commits touched
1521 Editing of commit history is controlled via a
1523 which can be written in an editor based on a template, passed on the
1524 command line, or generated with the
1530 The format of the histedit script is line-based.
1531 Each line in the script begins with a command name, followed by
1532 whitespace and an argument.
1533 For most commands, the expected argument is a commit ID SHA1 hash.
1534 Any remaining text on the line is ignored.
1535 Lines which begin with the
1537 character are ignored entirely.
1539 The available commands are as follows:
1540 .Bl -column YXZ pick-commit
1541 .It pick Ar commit Ta Use the specified commit as it is.
1542 .It edit Ar commit Ta Use the specified commit but once changes have been
1543 merged into the work tree interrupt the histedit operation for amending.
1544 .It fold Ar commit Ta Combine the specified commit with the next commit
1545 listed further below that will be used.
1546 .It drop Ar commit Ta Remove this commit from the edited history.
1547 .It mesg Ar log-message Ta Use the specified single-line log message for
1548 the commit on the previous line.
1549 If the log message argument is left empty, open an editor where a new
1550 log message can be written.
1553 Every commit in the history being edited must be mentioned in the script.
1554 Lines may be re-ordered to change the order of commits in the edited history.
1555 No commit may be listed more than once.
1557 Edited commits are accumulated on a temporary branch which the work tree
1558 will remain switched to throughout the entire histedit operation.
1559 Once history editing has completed successfully, the temporary branch becomes
1560 the new version of the work tree's branch and the work tree is automatically
1563 While merging commits, show the status of each affected file,
1564 using the following status codes:
1565 .Bl -column YXZ description
1566 .It G Ta file was merged
1567 .It C Ta file was merged and conflicts occurred during merge
1568 .It ! Ta changes destined for a missing file were not merged
1569 .It D Ta file was deleted
1570 .It d Ta file's deletion was obstructed by local modifications
1571 .It A Ta new file was added
1572 .It \(a~ Ta changes destined for a non-regular file were not merged
1573 .It ? Ta changes destined for an unversioned file were not merged
1576 If merge conflicts occur the histedit operation is interrupted and may
1577 be continued once conflicts have been resolved.
1578 Alternatively, the histedit operation may be aborted which will leave
1579 the work tree switched back to its original branch.
1581 If a merge conflict is resolved in a way which renders the merged
1582 change into a no-op change, the corresponding commit will be elided
1583 when the histedit operation continues.
1586 will refuse to run if certain preconditions are not met.
1587 If the work tree's current branch is not in the
1589 reference namespace, the history of the branch may not be edited.
1590 If the work tree contains multiple base commits it must first be updated
1591 to a single base commit with
1593 If changes have been staged with
1595 these changes must first be committed with
1599 If the work tree contains local changes, these changes must first be
1604 If the edited history contains changes to files outside of the work tree's
1605 path prefix, the work tree cannot be used to edit the history of this branch.
1612 commands will refuse to run while a histedit operation is in progress.
1613 Other commands which manipulate the work tree may be used, and the
1615 command may be used to commit arbitrary changes to the temporary branch
1616 while the histedit operation is interrupted.
1623 Abort an interrupted histedit operation.
1624 If this option is used, no other command-line arguments are allowed.
1626 Continue an interrupted histedit operation.
1627 If this option is used, no other command-line arguments are allowed.
1629 Fold all commits into a single commit.
1630 This option is a quick equivalent to a histedit script which folds all
1631 commits, combining them all into one commit.
1634 option can only be used when starting a new histedit operation.
1635 If this option is used, no other command-line arguments are allowed.
1636 .It Fl F Ar histedit-script
1639 instead of opening a temporary file in an editor where a histedit script
1642 Edit log messages only.
1643 This option is a quick equivalent to a histedit script which edits
1644 only log messages but otherwise leaves every picked commit as-is.
1647 option can only be used when starting a new histedit operation.
1648 If this option is used, no other command-line arguments are allowed.
1653 .It Cm integrate Ar branch
1654 Integrate the specified
1656 into the work tree's current branch.
1657 Files in the work tree are updated to match the contents on the integrated
1659 and the reference of the work tree's branch is changed to point at the
1660 head commit of the integrated
1663 Both branches can be considered equivalent after integration since they
1664 will be pointing at the same commit.
1665 Both branches remain available for future work, if desired.
1666 In case the integrated
1668 is no longer needed it may be deleted with
1671 Show the status of each affected file, using the following status codes:
1672 .Bl -column YXZ description
1673 .It U Ta file was updated
1674 .It D Ta file was deleted
1675 .It A Ta new file was added
1676 .It \(a~ Ta versioned file is obstructed by a non-regular file
1677 .It ! Ta a missing versioned file was restored
1681 will refuse to run if certain preconditions are not met.
1682 Most importantly, the
1684 must have been rebased onto the work tree's current branch with
1686 before it can be integrated, in order to linearize commit history and
1687 resolve merge conflicts.
1688 If the work tree contains multiple base commits it must first be updated
1689 to a single base commit with
1691 If changes have been staged with
1693 these changes must first be committed with
1697 If the work tree contains local changes, these changes must first be
1705 .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 ...
1706 Stage local changes for inclusion in the next commit.
1709 is specified, stage all changes in the work tree.
1710 Otherwise, stage changes at or within the specified paths.
1711 Paths may be staged if they are added, modified, or deleted according to
1714 Show the status of each affected file, using the following status codes:
1715 .Bl -column YXZ description
1716 .It A Ta file addition has been staged
1717 .It M Ta file modification has been staged
1718 .It D Ta file deletion has been staged
1721 Staged file contents are saved in newly created blob objects in the repository.
1722 These blobs will be referred to by tree objects once staged changes have been
1725 Staged changes affect the behaviour of
1730 While paths with staged changes exist, the
1732 command will refuse to commit any paths which do not have staged changes.
1733 Local changes created on top of staged changes can only be committed if
1734 the path is staged again, or if the staged changes are committed first.
1737 command will show both local changes and staged changes.
1740 command is able to display local changes relative to staged changes,
1741 and to display staged changes relative to the repository.
1744 command cannot revert staged changes but may be used to revert
1745 local changes created on top of staged changes.
1752 Instead of staging new changes, list paths which are already staged,
1753 along with the IDs of staged blob objects and stage status codes.
1754 If paths were provided in the command line show the staged paths
1755 among the specified paths.
1756 Otherwise, show all staged paths.
1758 Instead of staging the entire content of a changed file, interactively
1759 select or reject changes for staging based on
1763 (reject change), and
1765 (quit staging this file) responses.
1766 If a file is in modified status, individual patches derived from the
1767 modified file content can be staged.
1768 Files in added or deleted status may only be staged or rejected in
1770 .It Fl F Ar response-script
1778 responses line-by-line from the specified
1780 file instead of prompting interactively.
1782 Allow staging of symbolic links which point outside of the path space
1783 that is under version control.
1786 will reject such symbolic links due to safety concerns.
1789 may decide to represent such a symbolic link as a regular file which contains
1790 the link's target path, rather than creating an actual symbolic link which
1791 points outside of the work tree.
1792 Use of this option is discouraged because external mechanisms such as
1794 are better suited for managing symbolic links to paths not under
1799 will refuse to run if certain preconditions are not met.
1800 If a file contains merge conflicts, these conflicts must be resolved first.
1801 If a file is found to be out of date relative to the head commit on the
1802 work tree's current branch, the file must be updated with
1804 before it can be staged (however, this does not prevent the file from
1805 becoming out-of-date at some point after having been staged).
1812 commands will refuse to run while staged changes exist.
1813 If staged changes cannot be committed because a staged path
1814 is out of date, the path must be unstaged with
1816 before it can be updated with
1818 and may then be staged again if necessary.
1822 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
1823 Merge staged changes back into the work tree and put affected paths
1824 back into non-staged status.
1827 is specified, unstage all staged changes across the entire work tree.
1828 Otherwise, unstage changes at or within the specified paths.
1830 Show the status of each affected file, using the following status codes:
1831 .Bl -column YXZ description
1832 .It G Ta file was unstaged
1833 .It C Ta file was unstaged and conflicts occurred during merge
1834 .It ! Ta changes destined for a missing file were not merged
1835 .It D Ta file was staged as deleted and still is deleted
1836 .It d Ta file's deletion was obstructed by local modifications
1837 .It \(a~ Ta changes destined for a non-regular file were not merged
1845 Instead of unstaging the entire content of a changed file, interactively
1846 select or reject changes for unstaging based on
1850 (keep change staged), and
1852 (quit unstaging this file) responses.
1853 If a file is staged in modified status, individual patches derived from the
1854 staged file content can be unstaged.
1855 Files staged in added or deleted status may only be unstaged in their entirety.
1856 .It Fl F Ar response-script
1864 responses line-by-line from the specified
1866 file instead of prompting interactively.
1871 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
1872 Parse and print contents of objects to standard output in a line-based
1874 Content of commit, tree, and tag objects is printed in a way similar
1875 to the actual content stored in such objects.
1876 Blob object contents are printed as they would appear in files on disk.
1878 Attempt to interpret each argument as a reference, a tag name, or
1879 an object ID SHA1 hash.
1880 References will be resolved to an object ID.
1881 Tag names will resolved to a tag object.
1882 An abbreviated hash argument will be expanded to a full SHA1 hash
1883 automatically, provided the abbreviation is unique.
1885 If none of the above interpretations produce a valid result, or if the
1887 option is used, attempt to interpret the argument as a path which will
1888 be resolved to the ID of an object found at this path in the repository.
1895 Look up paths in the specified
1897 If this option is not used, paths are looked up in the commit resolved
1898 via the repository's HEAD reference.
1899 The expected argument is a commit ID SHA1 hash or an existing reference
1900 or tag name which will be resolved to a commit ID.
1901 An abbreviated hash argument will be expanded to a full SHA1 hash
1902 automatically, provided the abbreviation is unique.
1903 .It Fl r Ar repository-path
1904 Use the repository at the specified path.
1905 If not specified, assume the repository is located at or above the current
1907 If this directory is a
1909 work tree, use the repository path associated with this work tree.
1911 Interpret all arguments as paths only.
1912 This option can be used to resolve ambiguity in cases where paths
1913 look like tag names, reference names, or object IDs.
1915 .It Cm info Op Ar path ...
1916 Display meta-data stored in a work tree.
1921 The work tree to use is resolved implicitly by walking upwards from the
1922 current working directory.
1926 arguments are specified, show additional per-file information for tracked
1927 files located at or within these paths.
1930 argument corresponds to the work tree's root directory, display information
1931 for all tracked files.
1934 .Bl -tag -width GOT_AUTHOR
1936 The author's name and email address for
1941 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
1944 may fail to parse commits without an email address in author data,
1948 environment variables with a missing email address.
1950 .Ev GOT_AUTHOR will be overriden by configuration settings in
1956 configuration settings in the repository's
1963 configuration settings contained in Git's global
1965 configuration file will only be used if neither
1969 environment variable provide author information.
1970 .It Ev VISUAL , EDITOR
1971 The editor spawned by
1979 text editor will be spawned in order to give
1981 the attention it deserves.
1982 .It Ev GOT_LOG_DEFAULT_LIMIT
1983 The default limit on the number of commits traversed by
1985 If set to zero, the limit is unbounded.
1986 This variable will be silently ignored if it is set to a non-numeric value.
1989 .Bl -tag -width packed-refs -compact
1991 Repository-wide configuration settings for
1995 configuration file located in the root directory of a Git repository
1996 supersedes any relevant settings in Git's
2000 .It Pa .got/got.conf
2001 Worktree-specific configuration settings for
2005 configuration file in the
2007 meta-data directory of a work tree supersedes any relevant settings in
2010 configuration file and Git's
2017 Clone an existing Git repository for use with
2021 .Dl $ got clone ssh://git@github.com/openbsd/src.git
2023 Use of HTTP URLs currently requires
2027 .Dl $ git clone --bare https://github.com/openbsd/src.git
2029 Alternatively, for quick and dirty local testing of
2031 a new Git repository could be created and populated with files,
2032 e.g. from a temporary CVS checkout located at
2035 .Dl $ got init /var/git/src.git
2036 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
2038 Check out a work tree from the Git repository to /usr/src:
2040 .Dl $ got checkout /var/git/src.git /usr/src
2042 View local changes in a work tree directory:
2044 .Dl $ got diff | less
2046 In a work tree, display files in a potentially problematic state:
2048 .Dl $ got status -s 'C!~?'
2050 Interactively revert selected local changes in a work tree directory:
2052 .Dl $ got revert -p -R\ .
2054 In a work tree or a git repository directory, list all branch references:
2058 In a work tree or a git repository directory, create a new branch called
2059 .Dq unified-buffer-cache
2060 which is forked off the
2064 .Dl $ got branch unified-buffer-cache master
2066 Switch an existing work tree to the branch
2067 .Dq unified-buffer-cache .
2068 Local changes in the work tree will be preserved and merged if necessary:
2070 .Dl $ got update -b unified-buffer-cache
2072 Create a new commit from local changes in a work tree directory.
2073 This new commit will become the head commit of the work tree's current branch:
2077 In a work tree or a git repository directory, view changes committed in
2078 the 3 most recent commits to the work tree's branch, or the branch resolved
2079 via the repository's HEAD reference, respectively:
2081 .Dl $ got log -p -l 3
2083 As above, but display changes in the order in which
2085 could apply them in sequence:
2087 .Dl $ got log -p -l 3 -R
2089 In a work tree or a git repository directory, log the history of a subdirectory:
2091 .Dl $ got log sys/uvm
2093 While operating inside a work tree, paths are specified relative to the current
2094 working directory, so this command will log the subdirectory
2097 .Dl $ cd sys/uvm && got log\ .
2099 And this command has the same effect:
2101 .Dl $ cd sys/dev/usb && got log ../../uvm
2103 And this command displays work tree meta-data about all tracked files:
2106 .Dl $ got info\ . | less
2108 Add new files and remove obsolete files in a work tree directory:
2110 .Dl $ got add sys/uvm/uvm_ubc.c
2111 .Dl $ got remove sys/uvm/uvm_vnode.c
2113 Create a new commit from local changes in a work tree directory
2114 with a pre-defined log message.
2116 .Dl $ got commit -m 'unify the buffer cache'
2118 Alternatively, create a new commit from local changes in a work tree
2119 directory with a log message that has been prepared in the file
2126 can be read into the buffer for review:
2131 Update any work tree checked out from the
2132 .Dq unified-buffer-cache
2133 branch to the latest commit on this branch:
2137 Roll file content on the unified-buffer-cache branch back by one commit,
2138 and then fetch the rolled-back change into the work tree as a local change
2139 to be amended and perhaps committed again:
2141 .Dl $ got backout unified-buffer-cache
2142 .Dl $ got commit -m 'roll back previous'
2143 .Dl $ # now back out the previous backout :-)
2144 .Dl $ got backout unified-buffer-cache
2146 Fetch new upstream commits into the local repository's
2153 In a repository created with a HTTP URL and
2154 .Cm git clone --bare
2157 command must be used instead:
2159 .Dl $ cd /var/git/src.git
2160 .Dl $ git fetch origin master:refs/remotes/origin/master
2164 branch to merge the new changes that are now visible on the
2169 .Dl $ got update -b origin/master
2170 .Dl $ got rebase master
2173 .Dq unified-buffer-cache
2174 branch on top of the new head commit of the
2178 .Dl $ got update -b master
2179 .Dl $ got rebase unified-buffer-cache
2181 Create a patch from all changes on the unified-buffer-cache branch.
2182 The patch can be mailed out for review and applied to
2186 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2188 Edit the entire commit history of the
2189 .Dq unified-buffer-cache
2192 .Dl $ got update -b unified-buffer-cache
2193 .Dl $ got update -c master
2196 In order to merge changes committed to the
2197 .Dq unified-buffer-cache
2198 branch back into the
2201 .Dq unified-buffer-cache
2202 branch must first be rebased onto the
2206 .Dl $ got update -b master
2207 .Dl $ got rebase unified-buffer-cache
2210 .Dq unified-buffer-cache
2211 branch can now be made visible on the
2215 Because the rebase operation switched the work tree to the
2216 .Dq unified-buffer-cache
2217 branch, the work tree must be switched back to the
2220 .Dq unified-buffer-cache
2221 branch can be integrated into
2224 .Dl $ got update -b master
2225 .Dl $ got integrate unified-buffer-cache
2227 Additional steps may be necessary if local changes need to be pushed back
2228 to the remote repository, which currently requires
2230 Before working against existing branches in a repository cloned with
2231 .Cm git clone --bare
2236 must be configured to map all references in the remote repository
2239 namespace of the local repository.
2240 This can achieved by setting Git's
2241 .Pa remote.origin.fetch
2242 configuration variable to the value
2243 .Dq +refs/heads/*:refs/remotes/origin/*
2248 .Dl $ cd /var/git/repo
2249 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2253 option must be disabled:
2255 .Dl $ cd /var/git/repo
2256 .Dl $ git config remote.origin.mirror false
2258 Alternatively, the following
2260 configuration item can be added manually to the Git repository's
2264 .Dl [remote "origin"]
2266 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2269 This configuration leaves the local repository's
2271 namespace free for use by local branches checked out with
2273 and, if needed, created with
2278 namespace can now be updated with incoming changes from the remote
2283 without extra command line arguments:
2285 .Dl $ cd /var/git/repo
2288 To make changes fetched from the remote repository appear on the
2292 branch must be rebased onto the
2295 This will also merge local changes, if any, with the incoming changes:
2297 .Dl $ got update -b origin/master
2298 .Dl $ got rebase master
2302 branch, log messages for local changes can now be amended with
2304 by other developers and any other important new information:
2306 .Dl $ got update -c origin/master
2307 .Dl $ got histedit -m
2309 Local changes on the
2311 branch can then be pushed to the remote
2315 .Dl $ cd /var/git/repo
2316 .Dl $ git push origin master
2319 .Xr git-repository 5 ,
2320 .Xr got-worktree 5 ,
2323 .An Stefan Sperling Aq Mt stsp@openbsd.org
2324 .An Martin Pieuchot Aq Mt mpi@openbsd.org
2325 .An Joshua Stein Aq Mt jcs@openbsd.org
2326 .An Ori Bernstein Aq Mt ori@openbsd.org
2329 is a work-in-progress and some features remain to be implemented.
2331 At present, the user has to fall back on
2333 to perform some tasks.
2337 Reading from remote repositories over HTTP or HTTPS protocols requires
2342 Writing to remote repositories, over any protocol, requires
2345 Packing repositories, which reduces disk space consumption and improves
2346 read-access performance, requires
2349 Exporting data from repositories requires
2350 .Xr git-fast-export 1 .
2352 Importing data into repositories requires
2353 .Xr git-fast-import 1 .
2355 Reducing the size of repositories by removing redundant or unreferenced
2359 The creation of merge commits, i.e. commits with two or more parent commits,
2363 In situations where files or directories were moved around
2365 will not automatically merge changes to new locations and
2367 will usually produce better results.