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
247 Create the cloned repository as a mirror of the original repository.
248 This is useful if the cloned repository will not be used to store
249 locally created commits.
255 files will be set up with the
257 option enabled, such that
261 will write incoming changes directly to branches in the
263 reference namespace, rather than to branches in the
266 This avoids the usual requirement of having to run
270 in order to make incoming changes appear on branches in the
273 But maintaining custom changes in the cloned repository becomes difficult
274 since such changes will be at risk of being discarded whenever incoming
277 Suppress progress reporting output.
278 The same option will be passed to
285 to print debugging messages to standard error output.
286 This option will be passed to
289 Multiple -v options increase the verbosity.
291 .It Fl R Ar reference
292 In addition to the branches and tags that will be fetched, fetch an arbitrary
294 from the remote repository's
297 This option may be specified multiple times to build a list of additional
301 may either be a path to a specific reference, or a reference namespace
302 which will cause all references in this namespace to be fetched.
304 Each reference will be mapped into the cloned repository's
306 namespace, unless the
308 option is used to mirror references directly into the cloned repository's
313 will refuse to fetch references from the remote repository's
322 .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
323 Fetch new changes from a remote repository.
325 .Ar remote-repository
329 The remote repository's URL is obtained from the corresponding entry in
333 file of the local repository, as created by
336 New changes will be stored in a separate pack file downloaded from the server.
337 Optionally, separate pack files stored in the repository can be combined with
340 By default, branch references in the
342 reference namespace will be updated to point at the newly fetched commits.
345 command can then be used to make new changes visible on branches in the
347 namespace, merging incoming changes with the changes on those branches
350 If the repository was created as a mirror with
352 then all branches in the
354 namespace will be updated directly to match the corresponding branches in
355 the remote repository.
356 If those branches contained local commits, these commits will no longer be
357 reachable via a reference and will therefore be at risk of being discarded
358 by Git's garbage collector.
359 Maintaining custom changes in a mirror repository is therefore discouraged.
361 In any case, references in the
363 namespace will always be fetched and mapped directly to local references
364 in the same namespace.
371 Fetch all branches from the remote repository's
374 This option can be enabled by default for specific repositories in
376 If this option is not specified, a branch resolved via the remote
377 repository's HEAD reference will be fetched.
378 Cannot be used together with the
384 from the remote repository's
387 This option may be specified multiple times to build a list of branches
389 If this option is not specified, a branch resolved via the remote
390 repository's HEAD reference will be fetched.
391 Cannot be used together with the
395 Delete branches and tags from the local repository which are no longer
396 present in the remote repository.
397 Only references are deleted.
398 Any commit, tree, tag, and blob objects belonging to deleted branches or
399 tags remain in the repository and may be removed separately with
400 Git's garbage collector.
402 List branches and tags available for fetching from the remote repository
403 and exit immediately.
404 Cannot be used together with any of the other options except
410 Allow existing references in the
412 namespace to be updated if they have changed on the server.
413 If not specified, only new tag references will be created.
414 .It Fl r Ar repository-path
415 Use the repository at the specified path.
416 If not specified, assume the repository is located at or above the current
418 If this directory is a
420 work tree, use the repository path associated with this work tree.
422 Suppress progress reporting output.
423 The same option will be passed to
430 to print debugging messages to standard error output.
431 The same option will be passed to
434 Multiple -v options increase the verbosity.
436 .It Fl R Ar reference
437 In addition to the branches and tags that will be fetched, fetch an arbitrary
439 from the remote repository's
442 This option may be specified multiple times to build a list of additional
446 may either be a path to a specific reference, or a reference namespace
447 which will cause all references in this namespace to be fetched.
449 Each reference will be mapped into the local repository's
451 namespace, unless the local repository was created as a mirror with
453 in which case references will be mapped directly into the local repository's
457 Once a reference has been fetched, a branch based on it can be created with
462 will refuse to fetch references from the remote repository's
471 .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
472 Copy files from a repository into a new work tree.
473 Show the status of each affected file, using the following status codes:
474 .Bl -column YXZ description
475 .It A Ta new file was added
476 .It E Ta file already exists in work tree's meta-data
481 is not specified, either use the last component of
482 .Ar repository path ,
485 was specified use the last component of
493 Proceed with the checkout operation even if the directory at
496 Existing files will be left intact.
498 Check out files from a commit on the specified
500 If this option is not specified, a branch resolved via the repository's HEAD
501 reference will be used.
503 Check out files from the specified
505 on the selected branch.
506 The expected argument is a commit ID SHA1 hash or an existing reference
507 or tag name which will be resolved to a commit ID.
508 An abbreviated hash argument will be expanded to a full SHA1 hash
509 automatically, provided the abbreviation is unique.
510 If this option is not specified, the most recent commit on the selected
515 is not contained in the selected branch, a different branch which contains
516 this commit must be specified with the
519 If no such branch is known a new branch must be created for this
525 Checking out work trees with an unknown branch is intentionally not supported.
526 .It Fl p Ar path-prefix
527 Restrict the work tree to a subset of the repository's tree hierarchy.
528 Only files beneath the specified
535 .It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Op Ar path ...
536 Update an existing work tree to a different
538 Change existing files in the work tree as necessary to match file contents
540 Preserve any local changes in the work tree and merge them with the
543 Files which already contain merge conflicts will not be updated to avoid
544 further complications.
545 Such files will be updated when
547 is run again after merge conflicts have been resolved.
548 If the conflicting changes are no longer needed affected files can be
555 Show the status of each affected file, using the following status codes:
556 .Bl -column YXZ description
557 .It U Ta file was updated and contained no local changes
558 .It G Ta file was updated and local changes were merged cleanly
559 .It C Ta file was updated and conflicts occurred during merge
560 .It D Ta file was deleted
561 .It A Ta new file was added
562 .It \(a~ Ta versioned file is obstructed by a non-regular file
563 .It ! Ta a missing versioned file was restored
564 .It # Ta file was not updated because it contains merge conflicts
565 .It ? Ta changes destined for an unversioned file were not merged
570 is specified, update the entire work tree.
571 Otherwise, restrict the update operation to files at or within the
573 Each path is required to exist in the update operation's target commit.
574 Files in the work tree outside specified paths will remain unchanged and
575 will retain their previously recorded base commit.
578 commands may refuse to run while the work tree contains files from
579 multiple base commits.
580 The base commit of such a work tree can be made consistent by running
582 across the entire work tree.
585 is incompatible with the
590 cannot update paths with staged changes.
591 If changes have been staged with
593 these changes must first be committed with
603 Switch the work tree's branch reference to the specified
605 before updating the work tree.
606 This option requires that all paths in the work tree are updated.
608 As usual, any local changes in the work tree will be preserved.
609 This can be useful when switching to a newly created branch in order
610 to commit existing local changes to this branch.
612 Any local changes must be dealt with separately in order to obtain a
613 work tree with pristine file contents corresponding exactly to the specified
615 Such changes could first be committed to a different branch with
617 or could be discarded with
620 Update the work tree to the specified
622 The expected argument is a commit ID SHA1 hash or an existing reference
623 or tag name which will be resolved to a commit ID.
624 An abbreviated hash argument will be expanded to a full SHA1 hash
625 automatically, provided the abbreviation is unique.
626 If this option is not specified, the most recent commit on the work tree's
632 .It Cm status Oo Fl s Ar status-codes Oc Op Ar path ...
633 Show the current modification status of files in a work tree,
634 using the following status codes:
635 .Bl -column YXZ description
636 .It M Ta modified file
637 .It A Ta file scheduled for addition in next commit
638 .It D Ta file scheduled for deletion in next commit
639 .It C Ta modified or added file which contains merge conflicts
640 .It ! Ta versioned file was expected on disk but is missing
641 .It \(a~ Ta versioned file is obstructed by a non-regular file
642 .It ? Ta unversioned item not tracked by
644 .It m Ta modified file modes (executable bit only)
645 .It N Ta non-existent
647 specified on the command line
652 is specified, show modifications in the entire work tree.
653 Otherwise, show modifications at or within the specified paths.
655 If changes have been staged with
657 staged changes are shown in the second output column, using the following
659 .Bl -column YXZ description
660 .It M Ta file modification is staged
661 .It A Ta file addition is staged
662 .It D Ta file deletion is staged
665 Changes created on top of staged changes are indicated in the first column:
666 .Bl -column YXZ description
667 .It MM Ta file was modified after earlier changes have been staged
668 .It MA Ta file was modified after having been staged for addition
675 .It Fl s Ar status-codes
676 Only show files with a modification status matching any of the
677 single-character status codes contained in the
680 Any combination of codes from the above list of possible status codes
682 For staged files, status codes displayed in either column will be matched.
685 For compatibility with
696 files in each traversed directory and will not display unversioned files
697 which match these patterns.
702 supports consecutive asterisks,
704 which will match an arbitrary amount of directories.
708 only supports a single ignore pattern per line.
712 does not support negated ignore patterns prefixed with
714 and gives no special significance to the location of path component separators,
720 .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
721 Display history of a repository.
724 is specified, show only commits which modified this path.
725 If invoked in a work tree, the
727 is interpreted relative to the current working directory,
728 and the work tree's path prefix is implicitly prepended.
729 Otherwise, the path is interpreted relative to the repository root.
736 Display individual commits which were merged into the current branch
740 shows the linear history of the current branch only.
742 Start traversing history at the specified
744 The expected argument is a commit ID SHA1 hash or an existing reference
745 or tag name which will be resolved to a commit ID.
746 An abbreviated hash argument will be expanded to a full SHA1 hash
747 automatically, provided the abbreviation is unique.
748 If this option is not specified, default to the work tree's current branch
749 if invoked in a work tree, or to the repository's HEAD reference.
751 Set the number of context lines shown in diffs with
753 By default, 3 lines of context are shown.
755 Limit history traversal to a given number of commits.
756 If this option is not specified, a default limit value of zero is used,
757 which is treated as an unbounded limit.
759 .Ev GOT_LOG_DEFAULT_LIMIT
760 environment variable may be set to change this default value.
762 Display the patch of modifications made in each commit.
765 is specified, only show the patch of modifications at or within this path.
767 Display the list of file paths changed in each commit, using the following
769 .Bl -column YXZ description
770 .It M Ta modified file
771 .It D Ta file was deleted
772 .It A Ta new file was added
773 .It m Ta modified file modes (executable bit only)
775 .It Fl s Ar search-pattern
776 If specified, show only commits with a log message matched by the extended
779 When used together with
781 then the file paths changed by a commit can be matched as well.
782 Regular expression syntax is documented in
784 .It Fl r Ar repository-path
785 Use the repository at the specified path.
786 If not specified, assume the repository is located at or above the current
788 If this directory is a
790 work tree, use the repository path associated with this work tree.
792 Determine a set of commits to display as usual, but display these commits
795 Stop traversing commit history immediately after the specified
798 This option has no effect if the specified
802 .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
803 When invoked within a work tree with less than two arguments, display
804 local changes in the work tree.
807 is specified, only show changes within this path.
809 If two arguments are provided, treat each argument as a reference, a tag
810 name, or an object ID SHA1 hash, and display differences between the
811 corresponding objects.
812 Both objects must be of the same type (blobs, trees, or commits).
813 An abbreviated hash argument will be expanded to a full SHA1 hash
814 automatically, provided the abbreviation is unique.
821 Treat file contents as ASCII text even if binary data is detected.
823 Set the number of context lines shown in the diff.
824 By default, 3 lines of context are shown.
825 .It Fl r Ar repository-path
826 Use the repository at the specified path.
827 If not specified, assume the repository is located at or above the current
829 If this directory is a
831 work tree, use the repository path associated with this work tree.
833 Show changes staged with
835 instead of showing local changes in the work tree.
836 This option is only valid when
838 is invoked in a work tree.
840 Ignore whitespace-only changes.
845 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
846 Display line-by-line history of a file at the specified path.
853 Start traversing history at the specified
855 The expected argument is a commit ID SHA1 hash or an existing reference
856 or tag name which will be resolved to a commit ID.
857 An abbreviated hash argument will be expanded to a full SHA1 hash
858 automatically, provided the abbreviation is unique.
859 .It Fl r Ar repository-path
860 Use the repository at the specified path.
861 If not specified, assume the repository is located at or above the current
863 If this directory is a
865 work tree, use the repository path associated with this work tree.
870 .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
871 Display a listing of files and directories at the specified
872 directory path in the repository.
873 Entries shown in this listing may carry one of the following trailing
875 .Bl -column YXZ description
876 .It @ Ta entry is a symbolic link
877 .It / Ta entry is a directory
878 .It * Ta entry is an executable file
879 .It $ Ta entry is a Git submodule
882 Symbolic link entries are also annotated with the target path of the link.
886 is specified, list the repository path corresponding to the current
887 directory of the work tree, or the root directory of the repository
888 if there is no work tree.
895 List files and directories as they appear in the specified
897 The expected argument is a commit ID SHA1 hash or an existing reference
898 or tag name which will be resolved to a commit ID.
899 An abbreviated hash argument will be expanded to a full SHA1 hash
900 automatically, provided the abbreviation is unique.
901 .It Fl r Ar repository-path
902 Use the repository at the specified path.
903 If not specified, assume the repository is located at or above the current
905 If this directory is a
907 work tree, use the repository path associated with this work tree.
909 Show object IDs of files (blob objects) and directories (tree objects).
911 Recurse into sub-directories in the repository.
916 .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
917 Manage references in a repository.
919 References may be listed, created, deleted, and changed.
920 When creating, deleting, or changing a reference the specified
922 must be an absolute reference name, i.e. it must begin with
929 .It Fl r Ar repository-path
930 Use the repository at the specified path.
931 If not specified, assume the repository is located at or above the current
933 If this directory is a
935 work tree, use the repository path associated with this work tree.
937 List references in the repository.
940 is specified, list all existing references in the repository.
943 is a reference namespace, list all references in this namespace.
944 Otherwise, show only the reference with the given
946 Cannot be used together with any other options except
949 Create a reference or change an existing reference.
950 The reference with the specified
952 will point at the specified
956 argument is a ID SHA1 hash or an existing reference or tag name which will
957 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
958 Cannot be used together with any other options except
960 .It Fl s Ar reference
961 Create a symbolic reference, or change an existing symbolic reference.
962 The symbolic reference with the specified
964 will point at the specified
966 which must already exist in the repository.
967 Care should be taken not to create loops between references when
969 Cannot be used together with any other options except
972 Delete the reference with the specified
975 Any commit, tree, tag, and blob objects belonging to deleted references
976 remain in the repository and may be removed separately with
977 Git's garbage collector.
978 Cannot be used together with any other options except
981 .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
982 Create, list, or delete branches.
984 Local branches are managed via references which live in the
989 command creates or deletes references in this namespace only.
991 If invoked in a work tree without any arguments, print the name of the
992 work tree's current branch.
996 argument is passed, attempt to create a branch reference with the given name.
997 By default the new branch reference will point at the latest commit on the
998 work tree's current branch if invoked in a work tree, and otherwise to a commit
999 resolved via the repository's HEAD reference.
1001 If invoked in a work tree, once the branch was created successfully
1002 switch the work tree's head reference to the newly created branch and
1003 update files across the entire work tree, just like
1004 .Cm got update -b Ar name
1006 Show the status of each affected file, using the following status codes:
1007 .Bl -column YXZ description
1008 .It U Ta file was updated and contained no local changes
1009 .It G Ta file was updated and local changes were merged cleanly
1010 .It C Ta file was updated and conflicts occurred during merge
1011 .It D Ta file was deleted
1012 .It A Ta new file was added
1013 .It \(a~ Ta versioned file is obstructed by a non-regular file
1014 .It ! Ta a missing versioned file was restored
1022 Make a newly created branch reference point at the specified
1026 argument is a commit ID SHA1 hash or an existing reference
1027 or tag name which will be resolved to a commit ID.
1028 .It Fl r Ar repository-path
1029 Use the repository at the specified path.
1030 If not specified, assume the repository is located at or above the current
1032 If this directory is a
1034 work tree, use the repository path associated with this work tree.
1036 List all existing branches in the repository, including copies of remote
1037 repositories' branches in the
1039 reference namespace.
1041 If invoked in a work tree, the work tree's current branch is shown
1042 with one the following annotations:
1043 .Bl -column YXZ description
1044 .It * Ta work tree's base commit matches the branch tip
1045 .It \(a~ Ta work tree's base commit is out-of-date
1048 Delete the branch with the specified name from the repository.
1049 Only the branch reference is deleted.
1050 Any commit, tree, and blob objects belonging to the branch
1051 remain in the repository and may be removed separately with
1052 Git's garbage collector.
1054 Do not switch and update the work tree after creating a new branch.
1059 .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
1060 Manage tags in a repository.
1062 Tags are managed via references which live in the
1064 reference namespace.
1067 command operates on references in this namespace only.
1068 References in this namespace point at tag objects which contain a pointer
1069 to another object, a tag message, as well as author and timestamp information.
1071 Attempt to create a tag with the given
1073 and make this tag point at the given
1075 If no commit is specified, default to the latest commit on the work tree's
1076 current branch if invoked in a work tree, and to a commit resolved via
1077 the repository's HEAD reference otherwise.
1084 Make the newly created tag reference point at the specified
1088 argument is a commit ID SHA1 hash or an existing reference or tag name which
1089 will be resolved to a commit ID.
1090 An abbreviated hash argument will be expanded to a full SHA1 hash
1091 automatically, provided the abbreviation is unique.
1093 Use the specified tag message when creating the new tag.
1098 opens a temporary file in an editor where a tag message can be written.
1099 .It Fl r Ar repository-path
1100 Use the repository at the specified path.
1101 If not specified, assume the repository is located at or above the current
1103 If this directory is a
1105 work tree, use the repository path associated with this work tree.
1107 List all existing tags in the repository instead of creating a new tag.
1108 If this option is used, no other command-line arguments are allowed.
1113 command will not delete tags or change existing tags.
1114 If a tag must be deleted, the
1116 command may be used to delete a tag's reference.
1117 This should only be done if the tag has not already been copied to
1119 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1120 Schedule unversioned files in a work tree for addition to the
1121 repository in the next commit.
1128 Permit recursion into directories.
1129 If this option is not specified,
1131 will refuse to run if a specified
1135 With -R, add files even if they match a
1139 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
1140 Remove versioned files from a work tree and schedule them for deletion
1141 from the repository in the next commit.
1148 Perform the operation even if a file contains local modifications.
1150 Keep affected files on disk.
1152 Permit recursion into directories.
1153 If this option is not specified,
1155 will refuse to run if a specified
1158 .It Fl s Ar status-codes
1159 Only delete files with a modification status matching one of the
1160 single-character status codes contained in the
1163 The following status codes may be specified:
1164 .Bl -column YXZ description
1165 .It M Ta modified file (this implies the
1168 .It ! Ta versioned file expected on disk but missing
1174 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1175 Revert any local changes in files at the specified paths in a work tree.
1176 File contents will be overwritten with those contained in the
1177 work tree's base commit.
1178 There is no way to bring discarded changes back after
1181 If a file was added with
1183 it will become an unversioned file again.
1184 If a file was deleted with
1186 it will be restored.
1193 Instead of reverting all changes in files, interactively select or reject
1194 changes to revert based on
1200 (quit reverting this file) responses.
1201 If a file is in modified status, individual patches derived from the
1202 modified file content can be reverted.
1203 Files in added or deleted status may only be reverted in their entirety.
1204 .It Fl F Ar response-script
1212 responses line-by-line from the specified
1214 file instead of prompting interactively.
1216 Permit recursion into directories.
1217 If this option is not specified,
1219 will refuse to run if a specified
1226 .It Cm commit Oo Fl F Ar path Oc Oo Fl m Ar message Oc Oo Fl N Oc Oo Fl S Oc Op Ar path ...
1227 Create a new commit in the repository from changes in a work tree
1228 and use this commit as the new base commit for the work tree.
1231 is specified, commit all changes in the work tree.
1232 Otherwise, commit changes at or within the specified paths.
1234 If changes have been explicitly staged for commit with
1236 only commit staged changes and reject any specified paths which
1237 have not been staged.
1240 opens a temporary file in an editor where a log message can be written
1248 options are used together.
1250 Show the status of each affected file, using the following status codes:
1251 .Bl -column YXZ description
1252 .It M Ta modified file
1253 .It D Ta file was deleted
1254 .It A Ta new file was added
1255 .It m Ta modified file modes (executable bit only)
1258 Files which are not part of the new commit will retain their previously
1259 recorded base commit.
1262 commands may refuse to run while the work tree contains files from
1263 multiple base commits.
1264 The base commit of such a work tree can be made consistent by running
1266 across the entire work tree.
1270 command requires the
1272 environment variable to be set,
1273 unless an author has been configured in
1279 configuration settings can be
1280 obtained from the repository's
1282 file or from Git's global
1291 Use the prepared log message stored in the file found at
1293 when creating the new commit.
1295 opens a temporary file in an editor where the prepared log message can be
1296 reviewed and edited further if needed.
1297 Cannot be used together with the
1301 Use the specified log message when creating the new commit.
1302 Cannot be used together with the
1306 This option prevents
1308 from opening the commit message in an editor.
1309 It has no effect unless it is used together with the
1311 option and is intended for non-interactive use such as scripting.
1313 Allow the addition of symbolic links which point outside of the path space
1314 that is under version control.
1317 will reject such symbolic links due to safety concerns.
1320 may decide to represent such a symbolic link as a regular file which contains
1321 the link's target path, rather than creating an actual symbolic link which
1322 points outside of the work tree.
1323 Use of this option is discouraged because external mechanisms such as
1325 are better suited for managing symbolic links to paths not under
1330 will refuse to run if certain preconditions are not met.
1331 If the work tree's current branch is not in the
1333 reference namespace, new commits may not be created on this branch.
1334 Local changes may only be committed if they are based on file content
1335 found in the most recent commit on the work tree's branch.
1336 If a path is found to be out of date,
1338 must be used first in order to merge local changes with changes made
1343 .It Cm cherrypick Ar commit
1344 Merge changes from a single
1349 must be on a different branch than the work tree's base commit.
1350 The expected argument is a reference or a commit ID SHA1 hash.
1351 An abbreviated hash argument will be expanded to a full SHA1 hash
1352 automatically, provided the abbreviation is unique.
1354 Show the status of each affected file, using the following status codes:
1355 .Bl -column YXZ description
1356 .It G Ta file was merged
1357 .It C Ta file was merged and conflicts occurred during merge
1358 .It ! Ta changes destined for a missing file were not merged
1359 .It D Ta file was deleted
1360 .It d Ta file's deletion was obstructed by local modifications
1361 .It A Ta new file was added
1362 .It \(a~ Ta changes destined for a non-regular file were not merged
1363 .It ? Ta changes destined for an unversioned file were not merged
1366 The merged changes will appear as local changes in the work tree, which
1369 amended manually or with further
1374 or discarded again with
1378 will refuse to run if certain preconditions are not met.
1379 If the work tree contains multiple base commits it must first be updated
1380 to a single base commit with
1382 If the work tree already contains files with merge conflicts, these
1383 conflicts must be resolved first.
1387 .It Cm backout Ar commit
1388 Reverse-merge changes from a single
1393 must be on the same branch as the work tree's base commit.
1394 The expected argument is a reference or a commit ID SHA1 hash.
1395 An abbreviated hash argument will be expanded to a full SHA1 hash
1396 automatically, provided the abbreviation is unique.
1398 Show the status of each affected file, using the following status codes:
1399 .Bl -column YXZ description
1400 .It G Ta file was merged
1401 .It C Ta file was merged and conflicts occurred during merge
1402 .It ! Ta changes destined for a missing file were not merged
1403 .It D Ta file was deleted
1404 .It d Ta file's deletion was obstructed by local modifications
1405 .It A Ta new file was added
1406 .It \(a~ Ta changes destined for a non-regular file were not merged
1407 .It ? Ta changes destined for an unversioned file were not merged
1410 The reverse-merged changes will appear as local changes in the work tree,
1411 which may be viewed with
1413 amended manually or with further
1418 or discarded again with
1422 will refuse to run if certain preconditions are not met.
1423 If the work tree contains multiple base commits it must first be updated
1424 to a single base commit with
1426 If the work tree already contains files with merge conflicts, these
1427 conflicts must be resolved first.
1431 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Oo Fl l Oc Op Ar branch
1432 Rebase commits on the specified
1434 onto the tip of the current branch of the work tree.
1437 must share common ancestry with the work tree's current branch.
1438 Rebasing begins with the first descendant commit of the youngest
1439 common ancestor commit shared by the specified
1441 and the work tree's current branch, and stops once the tip commit
1448 is used as intended, the specified
1450 represents a local commit history and may already contain changes
1451 that are not yet visible in any other repositories.
1452 The work tree's current branch, which must be set with
1456 operation, represents a branch from a remote repository which shares
1457 a common history with the specified
1459 but has progressed, and perhaps diverged, due to commits added to the
1462 Rebased commits are accumulated on a temporary branch which the work tree
1463 will remain switched to throughout the entire rebase operation.
1464 Commits on this branch represent the same changes with the same log
1465 messages as their counterparts on the original
1467 but with different commit IDs.
1468 Once rebasing has completed successfully, the temporary branch becomes
1469 the new version of the specified
1471 and the work tree is automatically switched to it.
1473 Old commits in their pre-rebase state are automatically backed up in the
1474 .Dq refs/got/backup/rebase
1475 reference namespace.
1476 As long as these references are not removed older versions of rebased
1477 commits will remain in the repository and can be viewed with the
1480 Removal of these references makes objects which become unreachable via
1481 any reference subject to removal by Git's garbage collector.
1483 While rebasing commits, show the status of each affected file,
1484 using the following status codes:
1485 .Bl -column YXZ description
1486 .It G Ta file was merged
1487 .It C Ta file was merged and conflicts occurred during merge
1488 .It ! Ta changes destined for a missing file were not merged
1489 .It D Ta file was deleted
1490 .It d Ta file's deletion was obstructed by local modifications
1491 .It A Ta new file was added
1492 .It \(a~ Ta changes destined for a non-regular file were not merged
1493 .It ? Ta changes destined for an unversioned file were not merged
1496 If merge conflicts occur the rebase operation is interrupted and may
1497 be continued once conflicts have been resolved.
1498 Alternatively, the rebase operation may be aborted which will leave
1500 unmodified and the work tree switched back to its original branch.
1502 If a merge conflict is resolved in a way which renders the merged
1503 change into a no-op change, the corresponding commit will be elided
1504 when the rebase operation continues.
1507 will refuse to run if certain preconditions are not met.
1508 If the work tree is not yet fully updated to the tip commit of its
1509 branch then the work tree must first be updated with
1511 If changes have been staged with
1513 these changes must first be committed with
1517 If the work tree contains local changes, these changes must first be
1524 contains changes to files outside of the work tree's path prefix,
1525 the work tree cannot be used to rebase this branch.
1531 commands will refuse to run while a rebase operation is in progress.
1532 Other commands which manipulate the work tree may be used for
1533 conflict resolution purposes.
1540 Abort an interrupted rebase operation.
1541 If this option is used, no other command-line arguments are allowed.
1543 Continue an interrupted rebase operation.
1544 If this option is used, no other command-line arguments are allowed.
1546 Show a list of past rebase operations, represented by references in the
1547 .Dq refs/got/backup/rebase
1548 reference namespace.
1550 Display the author, date, and log message of each backed up commit,
1551 the object ID of the corresponding post-rebase commit, and
1552 the object ID of their common ancestor commit.
1553 Given these object IDs,
1560 options can be used to examine the history of either version of the branch,
1565 option can be used to create a new branch from a pre-rebase state if desired.
1569 is specified, only show commits which at some point in time represented this
1571 Otherwise, list all backed up commits for any branches.
1573 If this option is used,
1575 does not require a work tree.
1576 None of the other options can be used together with
1582 .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 Oo Fl l Oc Op Ar branch
1583 Edit commit history between the work tree's current base commit and
1584 the tip commit of the work tree's current branch.
1588 operation the work tree's current branch must be set with
1590 to the branch which should be edited, unless this branch is already the
1591 current branch of the work tree.
1592 The tip of this branch represents the upper bound (inclusive) of commits
1597 Furthermore, the work tree's base commit
1600 to a point in this branch's commit history where editing should begin.
1601 This commit represents the lower bound (non-inclusive) of commits touched
1606 Editing of commit history is controlled via a
1608 which can be written in an editor based on a template, passed on the
1609 command line, or generated with the
1615 The format of the histedit script is line-based.
1616 Each line in the script begins with a command name, followed by
1617 whitespace and an argument.
1618 For most commands, the expected argument is a commit ID SHA1 hash.
1619 Any remaining text on the line is ignored.
1620 Lines which begin with the
1622 character are ignored entirely.
1624 The available commands are as follows:
1625 .Bl -column YXZ pick-commit
1626 .It pick Ar commit Ta Use the specified commit as it is.
1627 .It edit Ar commit Ta Use the specified commit but once changes have been
1628 merged into the work tree interrupt the histedit operation for amending.
1629 .It fold Ar commit Ta Combine the specified commit with the next commit
1630 listed further below that will be used.
1631 .It drop Ar commit Ta Remove this commit from the edited history.
1632 .It mesg Ar log-message Ta Use the specified single-line log message for
1633 the commit on the previous line.
1634 If the log message argument is left empty, open an editor where a new
1635 log message can be written.
1638 Every commit in the history being edited must be mentioned in the script.
1639 Lines may be re-ordered to change the order of commits in the edited history.
1640 No commit may be listed more than once.
1642 Edited commits are accumulated on a temporary branch which the work tree
1643 will remain switched to throughout the entire histedit operation.
1644 Once history editing has completed successfully, the temporary branch becomes
1645 the new version of the work tree's branch and the work tree is automatically
1648 Old commits in their pre-histedit state are automatically backed up in the
1649 .Dq refs/got/backup/histedit
1650 reference namespace.
1651 As long as these references are not removed older versions of edited
1652 commits will remain in the repository and can be viewed with the
1655 Removal of these references makes objects which become unreachable via
1656 any reference subject to removal by Git's garbage collector.
1658 While merging commits, show the status of each affected file,
1659 using the following status codes:
1660 .Bl -column YXZ description
1661 .It G Ta file was merged
1662 .It C Ta file was merged and conflicts occurred during merge
1663 .It ! Ta changes destined for a missing file were not merged
1664 .It D Ta file was deleted
1665 .It d Ta file's deletion was obstructed by local modifications
1666 .It A Ta new file was added
1667 .It \(a~ Ta changes destined for a non-regular file were not merged
1668 .It ? Ta changes destined for an unversioned file were not merged
1671 If merge conflicts occur the histedit operation is interrupted and may
1672 be continued once conflicts have been resolved.
1673 Alternatively, the histedit operation may be aborted which will leave
1674 the work tree switched back to its original branch.
1676 If a merge conflict is resolved in a way which renders the merged
1677 change into a no-op change, the corresponding commit will be elided
1678 when the histedit operation continues.
1681 will refuse to run if certain preconditions are not met.
1682 If the work tree's current branch is not in the
1684 reference namespace, the history of the branch may not be edited.
1685 If the work tree contains multiple base commits it must first be updated
1686 to a single base commit with
1688 If changes have been staged with
1690 these changes must first be committed with
1694 If the work tree contains local changes, these changes must first be
1699 If the edited history contains changes to files outside of the work tree's
1700 path prefix, the work tree cannot be used to edit the history of this branch.
1707 commands will refuse to run while a histedit operation is in progress.
1708 Other commands which manipulate the work tree may be used, and the
1710 command may be used to commit arbitrary changes to the temporary branch
1711 while the histedit operation is interrupted.
1718 Abort an interrupted histedit operation.
1719 If this option is used, no other command-line arguments are allowed.
1721 Continue an interrupted histedit operation.
1722 If this option is used, no other command-line arguments are allowed.
1724 Fold all commits into a single commit.
1725 This option is a quick equivalent to a histedit script which folds all
1726 commits, combining them all into one commit.
1729 option can only be used when starting a new histedit operation.
1730 If this option is used, no other command-line arguments are allowed.
1731 .It Fl F Ar histedit-script
1734 instead of opening a temporary file in an editor where a histedit script
1737 Edit log messages only.
1738 This option is a quick equivalent to a histedit script which edits
1739 only log messages but otherwise leaves every picked commit as-is.
1742 option can only be used when starting a new histedit operation.
1743 If this option is used, no other command-line arguments are allowed.
1745 Show a list of past histedit operations, represented by references in the
1746 .Dq refs/got/backup/histedit
1747 reference namespace.
1749 Display the author, date, and log message of each backed up commit,
1750 the object ID of the corresponding post-histedit commit, and
1751 the object ID of their common ancestor commit.
1752 Given these object IDs,
1759 options can be used to examine the history of either version of the branch,
1764 option can be used to create a new branch from a pre-histedit state if desired.
1768 is specified, only show commits which at some point in time represented this
1770 Otherwise, list all backed up commits for any branches.
1772 If this option is used,
1774 does not require a work tree.
1775 None of the other options can be used together with
1781 .It Cm integrate Ar branch
1782 Integrate the specified
1784 into the work tree's current branch.
1785 Files in the work tree are updated to match the contents on the integrated
1787 and the reference of the work tree's branch is changed to point at the
1788 head commit of the integrated
1791 Both branches can be considered equivalent after integration since they
1792 will be pointing at the same commit.
1793 Both branches remain available for future work, if desired.
1794 In case the integrated
1796 is no longer needed it may be deleted with
1799 Show the status of each affected file, using the following status codes:
1800 .Bl -column YXZ description
1801 .It U Ta file was updated
1802 .It D Ta file was deleted
1803 .It A Ta new file was added
1804 .It \(a~ Ta versioned file is obstructed by a non-regular file
1805 .It ! Ta a missing versioned file was restored
1809 will refuse to run if certain preconditions are not met.
1810 Most importantly, the
1812 must have been rebased onto the work tree's current branch with
1814 before it can be integrated, in order to linearize commit history and
1815 resolve merge conflicts.
1816 If the work tree contains multiple base commits it must first be updated
1817 to a single base commit with
1819 If changes have been staged with
1821 these changes must first be committed with
1825 If the work tree contains local changes, these changes must first be
1833 .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 ...
1834 Stage local changes for inclusion in the next commit.
1837 is specified, stage all changes in the work tree.
1838 Otherwise, stage changes at or within the specified paths.
1839 Paths may be staged if they are added, modified, or deleted according to
1842 Show the status of each affected file, using the following status codes:
1843 .Bl -column YXZ description
1844 .It A Ta file addition has been staged
1845 .It M Ta file modification has been staged
1846 .It D Ta file deletion has been staged
1849 Staged file contents are saved in newly created blob objects in the repository.
1850 These blobs will be referred to by tree objects once staged changes have been
1853 Staged changes affect the behaviour of
1858 While paths with staged changes exist, the
1860 command will refuse to commit any paths which do not have staged changes.
1861 Local changes created on top of staged changes can only be committed if
1862 the path is staged again, or if the staged changes are committed first.
1865 command will show both local changes and staged changes.
1868 command is able to display local changes relative to staged changes,
1869 and to display staged changes relative to the repository.
1872 command cannot revert staged changes but may be used to revert
1873 local changes created on top of staged changes.
1880 Instead of staging new changes, list paths which are already staged,
1881 along with the IDs of staged blob objects and stage status codes.
1882 If paths were provided in the command line show the staged paths
1883 among the specified paths.
1884 Otherwise, show all staged paths.
1886 Instead of staging the entire content of a changed file, interactively
1887 select or reject changes for staging based on
1891 (reject change), and
1893 (quit staging this file) responses.
1894 If a file is in modified status, individual patches derived from the
1895 modified file content can be staged.
1896 Files in added or deleted status may only be staged or rejected in
1898 .It Fl F Ar response-script
1906 responses line-by-line from the specified
1908 file instead of prompting interactively.
1910 Allow staging of symbolic links which point outside of the path space
1911 that is under version control.
1914 will reject such symbolic links due to safety concerns.
1917 may decide to represent such a symbolic link as a regular file which contains
1918 the link's target path, rather than creating an actual symbolic link which
1919 points outside of the work tree.
1920 Use of this option is discouraged because external mechanisms such as
1922 are better suited for managing symbolic links to paths not under
1927 will refuse to run if certain preconditions are not met.
1928 If a file contains merge conflicts, these conflicts must be resolved first.
1929 If a file is found to be out of date relative to the head commit on the
1930 work tree's current branch, the file must be updated with
1932 before it can be staged (however, this does not prevent the file from
1933 becoming out-of-date at some point after having been staged).
1940 commands will refuse to run while staged changes exist.
1941 If staged changes cannot be committed because a staged path
1942 is out of date, the path must be unstaged with
1944 before it can be updated with
1946 and may then be staged again if necessary.
1950 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
1951 Merge staged changes back into the work tree and put affected paths
1952 back into non-staged status.
1955 is specified, unstage all staged changes across the entire work tree.
1956 Otherwise, unstage changes at or within the specified paths.
1958 Show the status of each affected file, using the following status codes:
1959 .Bl -column YXZ description
1960 .It G Ta file was unstaged
1961 .It C Ta file was unstaged and conflicts occurred during merge
1962 .It ! Ta changes destined for a missing file were not merged
1963 .It D Ta file was staged as deleted and still is deleted
1964 .It d Ta file's deletion was obstructed by local modifications
1965 .It \(a~ Ta changes destined for a non-regular file were not merged
1973 Instead of unstaging the entire content of a changed file, interactively
1974 select or reject changes for unstaging based on
1978 (keep change staged), and
1980 (quit unstaging this file) responses.
1981 If a file is staged in modified status, individual patches derived from the
1982 staged file content can be unstaged.
1983 Files staged in added or deleted status may only be unstaged in their entirety.
1984 .It Fl F Ar response-script
1992 responses line-by-line from the specified
1994 file instead of prompting interactively.
1999 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
2000 Parse and print contents of objects to standard output in a line-based
2002 Content of commit, tree, and tag objects is printed in a way similar
2003 to the actual content stored in such objects.
2004 Blob object contents are printed as they would appear in files on disk.
2006 Attempt to interpret each argument as a reference, a tag name, or
2007 an object ID SHA1 hash.
2008 References will be resolved to an object ID.
2009 Tag names will resolved to a tag object.
2010 An abbreviated hash argument will be expanded to a full SHA1 hash
2011 automatically, provided the abbreviation is unique.
2013 If none of the above interpretations produce a valid result, or if the
2015 option is used, attempt to interpret the argument as a path which will
2016 be resolved to the ID of an object found at this path in the repository.
2023 Look up paths in the specified
2025 If this option is not used, paths are looked up in the commit resolved
2026 via the repository's HEAD reference.
2027 The expected argument is a commit ID SHA1 hash or an existing reference
2028 or tag name which will be resolved to a commit ID.
2029 An abbreviated hash argument will be expanded to a full SHA1 hash
2030 automatically, provided the abbreviation is unique.
2031 .It Fl r Ar repository-path
2032 Use the repository at the specified path.
2033 If not specified, assume the repository is located at or above the current
2035 If this directory is a
2037 work tree, use the repository path associated with this work tree.
2039 Interpret all arguments as paths only.
2040 This option can be used to resolve ambiguity in cases where paths
2041 look like tag names, reference names, or object IDs.
2043 .It Cm info Op Ar path ...
2044 Display meta-data stored in a work tree.
2049 The work tree to use is resolved implicitly by walking upwards from the
2050 current working directory.
2054 arguments are specified, show additional per-file information for tracked
2055 files located at or within these paths.
2058 argument corresponds to the work tree's root directory, display information
2059 for all tracked files.
2062 .Bl -tag -width GOT_AUTHOR
2064 The author's name and email address for
2069 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
2072 may fail to parse commits without an email address in author data,
2076 environment variables with a missing email address.
2078 .Ev GOT_AUTHOR will be overriden by configuration settings in
2084 configuration settings in the repository's
2091 configuration settings contained in Git's global
2093 configuration file will only be used if neither
2097 environment variable provide author information.
2098 .It Ev VISUAL , EDITOR
2099 The editor spawned by
2107 text editor will be spawned in order to give
2109 the attention it deserves.
2110 .It Ev GOT_LOG_DEFAULT_LIMIT
2111 The default limit on the number of commits traversed by
2113 If set to zero, the limit is unbounded.
2114 This variable will be silently ignored if it is set to a non-numeric value.
2117 .Bl -tag -width packed-refs -compact
2119 Repository-wide configuration settings for
2123 configuration file located in the root directory of a Git repository
2124 supersedes any relevant settings in Git's
2128 .It Pa .got/got.conf
2129 Worktree-specific configuration settings for
2133 configuration file in the
2135 meta-data directory of a work tree supersedes any relevant settings in
2138 configuration file and Git's
2145 Clone an existing Git repository for use with
2149 .Dl $ got clone ssh://git@github.com/openbsd/src.git
2151 Use of HTTP URLs currently requires
2155 .Dl $ git clone --bare https://github.com/openbsd/src.git
2157 Alternatively, for quick and dirty local testing of
2159 a new Git repository could be created and populated with files,
2160 e.g. from a temporary CVS checkout located at
2163 .Dl $ got init /var/git/src.git
2164 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
2166 Check out a work tree from the Git repository to /usr/src:
2168 .Dl $ got checkout /var/git/src.git /usr/src
2170 View local changes in a work tree directory:
2172 .Dl $ got diff | less
2174 In a work tree, display files in a potentially problematic state:
2176 .Dl $ got status -s 'C!~?'
2178 Interactively revert selected local changes in a work tree directory:
2180 .Dl $ got revert -p -R\ .
2182 In a work tree or a git repository directory, list all branch references:
2186 In a work tree or a git repository directory, create a new branch called
2187 .Dq unified-buffer-cache
2188 which is forked off the
2192 .Dl $ got branch -c master unified-buffer-cache
2194 Switch an existing work tree to the branch
2195 .Dq unified-buffer-cache .
2196 Local changes in the work tree will be preserved and merged if necessary:
2198 .Dl $ got update -b unified-buffer-cache
2200 Create a new commit from local changes in a work tree directory.
2201 This new commit will become the head commit of the work tree's current branch:
2205 In a work tree or a git repository directory, view changes committed in
2206 the 3 most recent commits to the work tree's branch, or the branch resolved
2207 via the repository's HEAD reference, respectively:
2209 .Dl $ got log -p -l 3
2211 As above, but display changes in the order in which
2213 could apply them in sequence:
2215 .Dl $ got log -p -l 3 -R
2217 In a work tree or a git repository directory, log the history of a subdirectory:
2219 .Dl $ got log sys/uvm
2221 While operating inside a work tree, paths are specified relative to the current
2222 working directory, so this command will log the subdirectory
2225 .Dl $ cd sys/uvm && got log\ .
2227 And this command has the same effect:
2229 .Dl $ cd sys/dev/usb && got log ../../uvm
2231 And this command displays work tree meta-data about all tracked files:
2234 .Dl $ got info\ . | less
2236 Add new files and remove obsolete files in a work tree directory:
2238 .Dl $ got add sys/uvm/uvm_ubc.c
2239 .Dl $ got remove sys/uvm/uvm_vnode.c
2241 Create a new commit from local changes in a work tree directory
2242 with a pre-defined log message.
2244 .Dl $ got commit -m 'unify the buffer cache'
2246 Alternatively, create a new commit from local changes in a work tree
2247 directory with a log message that has been prepared in the file
2250 .Dl $ got commit -F /tmp/msg
2252 Update any work tree checked out from the
2253 .Dq unified-buffer-cache
2254 branch to the latest commit on this branch:
2258 Roll file content on the unified-buffer-cache branch back by one commit,
2259 and then fetch the rolled-back change into the work tree as a local change
2260 to be amended and perhaps committed again:
2262 .Dl $ got backout unified-buffer-cache
2263 .Dl $ got commit -m 'roll back previous'
2264 .Dl $ # now back out the previous backout :-)
2265 .Dl $ got backout unified-buffer-cache
2267 Fetch new upstream commits into the local repository's
2274 In a repository created with a HTTP URL and
2275 .Cm git clone --bare
2278 command must be used instead:
2280 .Dl $ cd /var/git/src.git
2281 .Dl $ git fetch origin master:refs/remotes/origin/master
2285 branch to merge the new changes that are now visible on the
2290 .Dl $ got update -b origin/master
2291 .Dl $ got rebase master
2294 .Dq unified-buffer-cache
2295 branch on top of the new head commit of the
2299 .Dl $ got update -b master
2300 .Dl $ got rebase unified-buffer-cache
2302 Create a patch from all changes on the unified-buffer-cache branch.
2303 The patch can be mailed out for review and applied to
2307 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2309 Edit the entire commit history of the
2310 .Dq unified-buffer-cache
2313 .Dl $ got update -b unified-buffer-cache
2314 .Dl $ got update -c master
2317 In order to merge changes committed to the
2318 .Dq unified-buffer-cache
2319 branch back into the
2322 .Dq unified-buffer-cache
2323 branch must first be rebased onto the
2327 .Dl $ got update -b master
2328 .Dl $ got rebase unified-buffer-cache
2331 .Dq unified-buffer-cache
2332 branch can now be made visible on the
2336 Because the rebase operation switched the work tree to the
2337 .Dq unified-buffer-cache
2338 branch, the work tree must be switched back to the
2341 .Dq unified-buffer-cache
2342 branch can be integrated into
2345 .Dl $ got update -b master
2346 .Dl $ got integrate unified-buffer-cache
2348 Additional steps may be necessary if local changes need to be pushed back
2349 to the remote repository, which currently requires
2351 Before working against existing branches in a repository cloned with
2352 .Cm git clone --bare
2357 must be configured to map all references in the remote repository
2360 namespace of the local repository.
2361 This can be achieved by setting Git's
2362 .Pa remote.origin.fetch
2363 configuration variable to the value
2364 .Dq +refs/heads/*:refs/remotes/origin/*
2369 .Dl $ cd /var/git/repo
2370 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2374 option must be disabled:
2376 .Dl $ cd /var/git/repo
2377 .Dl $ git config remote.origin.mirror false
2379 Alternatively, the following
2381 configuration item can be added manually to the Git repository's
2385 .Dl [remote \&"origin\&"]
2387 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2390 This configuration leaves the local repository's
2392 namespace free for use by local branches checked out with
2394 and, if needed, created with
2399 namespace can now be updated with incoming changes from the remote
2404 without extra command line arguments:
2406 .Dl $ cd /var/git/repo
2409 To make changes fetched from the remote repository appear on the
2413 branch must be rebased onto the
2416 This will also merge local changes, if any, with the incoming changes:
2418 .Dl $ got update -b origin/master
2419 .Dl $ got rebase master
2423 branch, log messages for local changes can now be amended with
2425 by other developers and any other important new information:
2427 .Dl $ got update -c origin/master
2428 .Dl $ got histedit -m
2430 Local changes on the
2432 branch can then be pushed to the remote
2436 .Dl $ cd /var/git/repo
2437 .Dl $ git push origin master
2441 .Xr git-repository 5 ,
2442 .Xr got-worktree 5 ,
2445 .An Stefan Sperling Aq Mt stsp@openbsd.org
2446 .An Martin Pieuchot Aq Mt mpi@openbsd.org
2447 .An Joshua Stein Aq Mt jcs@openbsd.org
2448 .An Ori Bernstein Aq Mt ori@openbsd.org
2451 is a work-in-progress and some features remain to be implemented.
2453 At present, the user has to fall back on
2455 to perform some tasks.
2459 Reading from remote repositories over HTTP or HTTPS protocols requires
2464 Writing to remote repositories, over any protocol, requires
2467 Packing repositories, which reduces disk space consumption and improves
2468 read-access performance, requires
2471 Exporting data from repositories requires
2472 .Xr git-fast-export 1 .
2474 Importing data into repositories requires
2475 .Xr git-fast-import 1 .
2477 Reducing the size of repositories by removing redundant or unreferenced
2481 The creation of merge commits, i.e. commits with two or more parent commits,
2485 In situations where files or directories were moved around
2487 will not automatically merge changes to new locations and
2489 will usually produce better results.