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 or
359 .Cm gotadmin cleanup .
360 Maintaining custom changes in a mirror repository is therefore discouraged.
362 In any case, references in the
364 namespace will always be fetched and mapped directly to local references
365 in the same namespace.
372 Fetch all branches from the remote repository's
375 This option can be enabled by default for specific repositories in
377 If this option is not specified, a branch resolved via the remote
378 repository's HEAD reference will be fetched.
379 Cannot be used together with the
385 from the remote repository's
388 This option may be specified multiple times to build a list of branches
390 If this option is not specified, a branch resolved via the remote
391 repository's HEAD reference will be fetched.
392 Cannot be used together with the
396 Delete branches and tags from the local repository which are no longer
397 present in the remote repository.
398 Only references are deleted.
399 Any commit, tree, tag, and blob objects belonging to deleted branches or
400 tags remain in the repository and may be removed separately with
401 Git's garbage collector or
402 .Cm gotadmin cleanup .
404 List branches and tags available for fetching from the remote repository
405 and exit immediately.
406 Cannot be used together with any of the other options except
412 Allow existing references in the
414 namespace to be updated if they have changed on the server.
415 If not specified, only new tag references will be created.
416 .It Fl r Ar repository-path
417 Use the repository at the specified path.
418 If not specified, assume the repository is located at or above the current
420 If this directory is a
422 work tree, use the repository path associated with this work tree.
424 Suppress progress reporting output.
425 The same option will be passed to
432 to print debugging messages to standard error output.
433 The same option will be passed to
436 Multiple -v options increase the verbosity.
438 .It Fl R Ar reference
439 In addition to the branches and tags that will be fetched, fetch an arbitrary
441 from the remote repository's
444 This option may be specified multiple times to build a list of additional
448 may either be a path to a specific reference, or a reference namespace
449 which will cause all references in this namespace to be fetched.
451 Each reference will be mapped into the local repository's
453 namespace, unless the local repository was created as a mirror with
455 in which case references will be mapped directly into the local repository's
459 Once a reference has been fetched, a branch based on it can be created with
464 will refuse to fetch references from the remote repository's
473 .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
474 Copy files from a repository into a new work tree.
475 Show the status of each affected file, using the following status codes:
476 .Bl -column YXZ description
477 .It A Ta new file was added
478 .It E Ta file already exists in work tree's meta-data
483 is not specified, either use the last component of
484 .Ar repository path ,
487 was specified use the last component of
495 Proceed with the checkout operation even if the directory at
498 Existing files will be left intact.
500 Check out files from a commit on the specified
502 If this option is not specified, a branch resolved via the repository's HEAD
503 reference will be used.
505 Check out files from the specified
507 on the selected branch.
508 The expected argument is a commit ID SHA1 hash or an existing reference
509 or tag name which will be resolved to a commit ID.
510 An abbreviated hash argument will be expanded to a full SHA1 hash
511 automatically, provided the abbreviation is unique.
512 If this option is not specified, the most recent commit on the selected
517 is not contained in the selected branch, a different branch which contains
518 this commit must be specified with the
521 If no such branch is known a new branch must be created for this
527 Checking out work trees with an unknown branch is intentionally not supported.
528 .It Fl p Ar path-prefix
529 Restrict the work tree to a subset of the repository's tree hierarchy.
530 Only files beneath the specified
537 .It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Op Ar path ...
538 Update an existing work tree to a different
540 Change existing files in the work tree as necessary to match file contents
542 Preserve any local changes in the work tree and merge them with the
545 Files which already contain merge conflicts will not be updated to avoid
546 further complications.
547 Such files will be updated when
549 is run again after merge conflicts have been resolved.
550 If the conflicting changes are no longer needed affected files can be
557 Show the status of each affected file, using the following status codes:
558 .Bl -column YXZ description
559 .It U Ta file was updated and contained no local changes
560 .It G Ta file was updated and local changes were merged cleanly
561 .It C Ta file was updated and conflicts occurred during merge
562 .It D Ta file was deleted
563 .It A Ta new file was added
564 .It \(a~ Ta versioned file is obstructed by a non-regular file
565 .It ! Ta a missing versioned file was restored
566 .It # Ta file was not updated because it contains merge conflicts
567 .It ? Ta changes destined for an unversioned file were not merged
572 is specified, update the entire work tree.
573 Otherwise, restrict the update operation to files at or within the
575 Each path is required to exist in the update operation's target commit.
576 Files in the work tree outside specified paths will remain unchanged and
577 will retain their previously recorded base commit.
580 commands may refuse to run while the work tree contains files from
581 multiple base commits.
582 The base commit of such a work tree can be made consistent by running
584 across the entire work tree.
587 is incompatible with the
592 cannot update paths with staged changes.
593 If changes have been staged with
595 these changes must first be committed with
605 Switch the work tree's branch reference to the specified
607 before updating the work tree.
608 This option requires that all paths in the work tree are updated.
610 As usual, any local changes in the work tree will be preserved.
611 This can be useful when switching to a newly created branch in order
612 to commit existing local changes to this branch.
614 Any local changes must be dealt with separately in order to obtain a
615 work tree with pristine file contents corresponding exactly to the specified
617 Such changes could first be committed to a different branch with
619 or could be discarded with
622 Update the work tree to the specified
624 The expected argument is a commit ID SHA1 hash or an existing reference
625 or tag name which will be resolved to a commit ID.
626 An abbreviated hash argument will be expanded to a full SHA1 hash
627 automatically, provided the abbreviation is unique.
628 If this option is not specified, the most recent commit on the work tree's
634 .It Cm status Oo Fl I Oc Oo Fl s Ar status-codes Oc Op Ar path ...
635 Show the current modification status of files in a work tree,
636 using the following status codes:
637 .Bl -column YXZ description
638 .It M Ta modified file
639 .It A Ta file scheduled for addition in next commit
640 .It D Ta file scheduled for deletion in next commit
641 .It C Ta modified or added file which contains merge conflicts
642 .It ! Ta versioned file was expected on disk but is missing
643 .It \(a~ Ta versioned file is obstructed by a non-regular file
644 .It ? Ta unversioned item not tracked by
646 .It m Ta modified file modes (executable bit only)
647 .It N Ta non-existent
649 specified on the command line
654 is specified, show modifications in the entire work tree.
655 Otherwise, show modifications at or within the specified paths.
657 If changes have been staged with
659 staged changes are shown in the second output column, using the following
661 .Bl -column YXZ description
662 .It M Ta file modification is staged
663 .It A Ta file addition is staged
664 .It D Ta file deletion is staged
667 Changes created on top of staged changes are indicated in the first column:
668 .Bl -column YXZ description
669 .It MM Ta file was modified after earlier changes have been staged
670 .It MA Ta file was modified after having been staged for addition
678 Show unversioned files even if they match an ignore pattern.
679 .It Fl s Ar status-codes
680 Only show files with a modification status matching any of the
681 single-character status codes contained in the
684 Any combination of codes from the above list of possible status codes
686 For staged files, status codes displayed in either column will be matched.
689 For compatibility with
700 files in each traversed directory and will not display unversioned files
701 which match these patterns.
706 supports consecutive asterisks,
708 which will match an arbitrary amount of directories.
712 only supports a single ignore pattern per line.
716 does not support negated ignore patterns prefixed with
718 and gives no special significance to the location of path component separators,
724 .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
725 Display history of a repository.
728 is specified, show only commits which modified this path.
729 If invoked in a work tree, the
731 is interpreted relative to the current working directory,
732 and the work tree's path prefix is implicitly prepended.
733 Otherwise, the path is interpreted relative to the repository root.
740 Display individual commits which were merged into the current branch
744 shows the linear history of the current branch only.
746 Start traversing history at the specified
748 The expected argument is a commit ID SHA1 hash or an existing reference
749 or tag name which will be resolved to a commit ID.
750 An abbreviated hash argument will be expanded to a full SHA1 hash
751 automatically, provided the abbreviation is unique.
752 If this option is not specified, default to the work tree's current branch
753 if invoked in a work tree, or to the repository's HEAD reference.
755 Set the number of context lines shown in diffs with
757 By default, 3 lines of context are shown.
759 Limit history traversal to a given number of commits.
760 If this option is not specified, a default limit value of zero is used,
761 which is treated as an unbounded limit.
763 .Ev GOT_LOG_DEFAULT_LIMIT
764 environment variable may be set to change this default value.
766 Display the patch of modifications made in each commit.
769 is specified, only show the patch of modifications at or within this path.
771 Display the list of file paths changed in each commit, using the following
773 .Bl -column YXZ description
774 .It M Ta modified file
775 .It D Ta file was deleted
776 .It A Ta new file was added
777 .It m Ta modified file modes (executable bit only)
779 .It Fl s Ar search-pattern
780 If specified, show only commits with a log message matched by the extended
783 When used together with
785 then the file paths changed by a commit can be matched as well.
786 Regular expression syntax is documented in
788 .It Fl r Ar repository-path
789 Use the repository at the specified path.
790 If not specified, assume the repository is located at or above the current
792 If this directory is a
794 work tree, use the repository path associated with this work tree.
796 Determine a set of commits to display as usual, but display these commits
799 Stop traversing commit history immediately after the specified
802 This option has no effect if the specified
806 .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
807 When invoked within a work tree with less than two arguments, display
808 local changes in the work tree.
811 is specified, only show changes within this path.
813 If two arguments are provided, treat each argument as a reference, a tag
814 name, or an object ID SHA1 hash, and display differences between the
815 corresponding objects.
816 Both objects must be of the same type (blobs, trees, or commits).
817 An abbreviated hash argument will be expanded to a full SHA1 hash
818 automatically, provided the abbreviation is unique.
825 Treat file contents as ASCII text even if binary data is detected.
827 Set the number of context lines shown in the diff.
828 By default, 3 lines of context are shown.
829 .It Fl r Ar repository-path
830 Use the repository at the specified path.
831 If not specified, assume the repository is located at or above the current
833 If this directory is a
835 work tree, use the repository path associated with this work tree.
837 Show changes staged with
839 instead of showing local changes in the work tree.
840 This option is only valid when
842 is invoked in a work tree.
844 Ignore whitespace-only changes.
849 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
850 Display line-by-line history of a file at the specified path.
857 Start traversing history at the specified
859 The expected argument is a commit ID SHA1 hash or an existing reference
860 or tag name which will be resolved to a commit ID.
861 An abbreviated hash argument will be expanded to a full SHA1 hash
862 automatically, provided the abbreviation is unique.
863 .It Fl r Ar repository-path
864 Use the repository at the specified path.
865 If not specified, assume the repository is located at or above the current
867 If this directory is a
869 work tree, use the repository path associated with this work tree.
874 .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
875 Display a listing of files and directories at the specified
876 directory path in the repository.
877 Entries shown in this listing may carry one of the following trailing
879 .Bl -column YXZ description
880 .It @ Ta entry is a symbolic link
881 .It / Ta entry is a directory
882 .It * Ta entry is an executable file
883 .It $ Ta entry is a Git submodule
886 Symbolic link entries are also annotated with the target path of the link.
890 is specified, list the repository path corresponding to the current
891 directory of the work tree, or the root directory of the repository
892 if there is no work tree.
899 List files and directories as they appear in the specified
901 The expected argument is a commit ID SHA1 hash or an existing reference
902 or tag name which will be resolved to a commit ID.
903 An abbreviated hash argument will be expanded to a full SHA1 hash
904 automatically, provided the abbreviation is unique.
905 .It Fl r Ar repository-path
906 Use the repository at the specified path.
907 If not specified, assume the repository is located at or above the current
909 If this directory is a
911 work tree, use the repository path associated with this work tree.
913 Show object IDs of files (blob objects) and directories (tree objects).
915 Recurse into sub-directories in the repository.
920 .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
921 Manage references in a repository.
923 References may be listed, created, deleted, and changed.
924 When creating, deleting, or changing a reference the specified
926 must be an absolute reference name, i.e. it must begin with
933 .It Fl r Ar repository-path
934 Use the repository at the specified path.
935 If not specified, assume the repository is located at or above the current
937 If this directory is a
939 work tree, use the repository path associated with this work tree.
941 List references in the repository.
944 is specified, list all existing references in the repository.
947 is a reference namespace, list all references in this namespace.
948 Otherwise, show only the reference with the given
950 Cannot be used together with any other options except
953 Create a reference or change an existing reference.
954 The reference with the specified
956 will point at the specified
960 argument is a ID SHA1 hash or an existing reference or tag name which will
961 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
962 Cannot be used together with any other options except
964 .It Fl s Ar reference
965 Create a symbolic reference, or change an existing symbolic reference.
966 The symbolic reference with the specified
968 will point at the specified
970 which must already exist in the repository.
971 Care should be taken not to create loops between references when
973 Cannot be used together with any other options except
976 Delete the reference with the specified
979 Any commit, tree, tag, and blob objects belonging to deleted references
980 remain in the repository and may be removed separately with
981 Git's garbage collector or
982 .Cm gotadmin cleanup .
983 Cannot be used together with any other options except
986 .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
987 Create, list, or delete branches.
989 Local branches are managed via references which live in the
994 command creates or deletes references in this namespace only.
996 If invoked in a work tree without any arguments, print the name of the
997 work tree's current branch.
1001 argument is passed, attempt to create a branch reference with the given name.
1002 By default the new branch reference will point at the latest commit on the
1003 work tree's current branch if invoked in a work tree, and otherwise to a commit
1004 resolved via the repository's HEAD reference.
1006 If invoked in a work tree, once the branch was created successfully
1007 switch the work tree's head reference to the newly created branch and
1008 update files across the entire work tree, just like
1009 .Cm got update -b Ar name
1011 Show the status of each affected file, using the following status codes:
1012 .Bl -column YXZ description
1013 .It U Ta file was updated and contained no local changes
1014 .It G Ta file was updated and local changes were merged cleanly
1015 .It C Ta file was updated and conflicts occurred during merge
1016 .It D Ta file was deleted
1017 .It A Ta new file was added
1018 .It \(a~ Ta versioned file is obstructed by a non-regular file
1019 .It ! Ta a missing versioned file was restored
1027 Make a newly created branch reference point at the specified
1031 argument is a commit ID SHA1 hash or an existing reference
1032 or tag name which will be resolved to a commit ID.
1033 .It Fl r Ar repository-path
1034 Use the repository at the specified path.
1035 If not specified, assume the repository is located at or above the current
1037 If this directory is a
1039 work tree, use the repository path associated with this work tree.
1041 List all existing branches in the repository, including copies of remote
1042 repositories' branches in the
1044 reference namespace.
1046 If invoked in a work tree, the work tree's current branch is shown
1047 with one the following annotations:
1048 .Bl -column YXZ description
1049 .It * Ta work tree's base commit matches the branch tip
1050 .It \(a~ Ta work tree's base commit is out-of-date
1053 Delete the branch with the specified name from the repository.
1054 Only the branch reference is deleted.
1055 Any commit, tree, and blob objects belonging to the branch
1056 remain in the repository and may be removed separately with
1057 Git's garbage collector or
1058 .Cm gotadmin cleanup .
1060 Do not switch and update the work tree after creating a new branch.
1065 .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
1066 Manage tags in a repository.
1068 Tags are managed via references which live in the
1070 reference namespace.
1073 command operates on references in this namespace only.
1074 References in this namespace point at tag objects which contain a pointer
1075 to another object, a tag message, as well as author and timestamp information.
1077 Attempt to create a tag with the given
1079 and make this tag point at the given
1081 If no commit is specified, default to the latest commit on the work tree's
1082 current branch if invoked in a work tree, and to a commit resolved via
1083 the repository's HEAD reference otherwise.
1090 Make the newly created tag reference point at the specified
1094 argument is a commit ID SHA1 hash or an existing reference or tag name which
1095 will be resolved to a commit ID.
1096 An abbreviated hash argument will be expanded to a full SHA1 hash
1097 automatically, provided the abbreviation is unique.
1099 Use the specified tag message when creating the new tag.
1104 opens a temporary file in an editor where a tag message can be written.
1105 .It Fl r Ar repository-path
1106 Use the repository at the specified path.
1107 If not specified, assume the repository is located at or above the current
1109 If this directory is a
1111 work tree, use the repository path associated with this work tree.
1113 List all existing tags in the repository instead of creating a new tag.
1114 If this option is used, no other command-line arguments are allowed.
1119 command will not delete tags or change existing tags.
1120 If a tag must be deleted, the
1122 command may be used to delete a tag's reference.
1123 This should only be done if the tag has not already been copied to
1125 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1126 Schedule unversioned files in a work tree for addition to the
1127 repository in the next commit.
1134 Permit recursion into directories.
1135 If this option is not specified,
1137 will refuse to run if a specified
1141 With -R, add files even if they match a
1145 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
1146 Remove versioned files from a work tree and schedule them for deletion
1147 from the repository in the next commit.
1154 Perform the operation even if a file contains local modifications.
1156 Keep affected files on disk.
1158 Permit recursion into directories.
1159 If this option is not specified,
1161 will refuse to run if a specified
1164 .It Fl s Ar status-codes
1165 Only delete files with a modification status matching one of the
1166 single-character status codes contained in the
1169 The following status codes may be specified:
1170 .Bl -column YXZ description
1171 .It M Ta modified file (this implies the
1174 .It ! Ta versioned file expected on disk but missing
1180 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1181 Revert any local changes in files at the specified paths in a work tree.
1182 File contents will be overwritten with those contained in the
1183 work tree's base commit.
1184 There is no way to bring discarded changes back after
1187 If a file was added with
1189 it will become an unversioned file again.
1190 If a file was deleted with
1192 it will be restored.
1199 Instead of reverting all changes in files, interactively select or reject
1200 changes to revert based on
1206 (quit reverting this file) responses.
1207 If a file is in modified status, individual patches derived from the
1208 modified file content can be reverted.
1209 Files in added or deleted status may only be reverted in their entirety.
1210 .It Fl F Ar response-script
1218 responses line-by-line from the specified
1220 file instead of prompting interactively.
1222 Permit recursion into directories.
1223 If this option is not specified,
1225 will refuse to run if a specified
1232 .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 ...
1233 Create a new commit in the repository from changes in a work tree
1234 and use this commit as the new base commit for the work tree.
1237 is specified, commit all changes in the work tree.
1238 Otherwise, commit changes at or within the specified paths.
1240 If changes have been explicitly staged for commit with
1242 only commit staged changes and reject any specified paths which
1243 have not been staged.
1246 opens a temporary file in an editor where a log message can be written
1254 options are used together.
1256 Show the status of each affected file, using the following status codes:
1257 .Bl -column YXZ description
1258 .It M Ta modified file
1259 .It D Ta file was deleted
1260 .It A Ta new file was added
1261 .It m Ta modified file modes (executable bit only)
1264 Files which are not part of the new commit will retain their previously
1265 recorded base commit.
1268 commands may refuse to run while the work tree contains files from
1269 multiple base commits.
1270 The base commit of such a work tree can be made consistent by running
1272 across the entire work tree.
1276 command requires the
1278 environment variable to be set,
1279 unless an author has been configured in
1285 configuration settings can be
1286 obtained from the repository's
1288 file or from Git's global
1297 Use the prepared log message stored in the file found at
1299 when creating the new commit.
1301 opens a temporary file in an editor where the prepared log message can be
1302 reviewed and edited further if needed.
1303 Cannot be used together with the
1307 Use the specified log message when creating the new commit.
1308 Cannot be used together with the
1312 This option prevents
1314 from opening the commit message in an editor.
1315 It has no effect unless it is used together with the
1317 option and is intended for non-interactive use such as scripting.
1319 Allow the addition of symbolic links which point outside of the path space
1320 that is under version control.
1323 will reject such symbolic links due to safety concerns.
1326 may decide to represent such a symbolic link as a regular file which contains
1327 the link's target path, rather than creating an actual symbolic link which
1328 points outside of the work tree.
1329 Use of this option is discouraged because external mechanisms such as
1331 are better suited for managing symbolic links to paths not under
1336 will refuse to run if certain preconditions are not met.
1337 If the work tree's current branch is not in the
1339 reference namespace, new commits may not be created on this branch.
1340 Local changes may only be committed if they are based on file content
1341 found in the most recent commit on the work tree's branch.
1342 If a path is found to be out of date,
1344 must be used first in order to merge local changes with changes made
1349 .It Cm cherrypick Ar commit
1350 Merge changes from a single
1355 must be on a different branch than the work tree's base commit.
1356 The expected argument is a reference or a commit ID SHA1 hash.
1357 An abbreviated hash argument will be expanded to a full SHA1 hash
1358 automatically, provided the abbreviation is unique.
1360 Show the status of each affected file, using the following status codes:
1361 .Bl -column YXZ description
1362 .It G Ta file was merged
1363 .It C Ta file was merged and conflicts occurred during merge
1364 .It ! Ta changes destined for a missing file were not merged
1365 .It D Ta file was deleted
1366 .It d Ta file's deletion was obstructed by local modifications
1367 .It A Ta new file was added
1368 .It \(a~ Ta changes destined for a non-regular file were not merged
1369 .It ? Ta changes destined for an unversioned file were not merged
1372 The merged changes will appear as local changes in the work tree, which
1375 amended manually or with further
1380 or discarded again with
1384 will refuse to run if certain preconditions are not met.
1385 If the work tree contains multiple base commits it must first be updated
1386 to a single base commit with
1388 If the work tree already contains files with merge conflicts, these
1389 conflicts must be resolved first.
1393 .It Cm backout Ar commit
1394 Reverse-merge changes from a single
1399 must be on the same branch as the work tree's base commit.
1400 The expected argument is a reference or a commit ID SHA1 hash.
1401 An abbreviated hash argument will be expanded to a full SHA1 hash
1402 automatically, provided the abbreviation is unique.
1404 Show the status of each affected file, using the following status codes:
1405 .Bl -column YXZ description
1406 .It G Ta file was merged
1407 .It C Ta file was merged and conflicts occurred during merge
1408 .It ! Ta changes destined for a missing file were not merged
1409 .It D Ta file was deleted
1410 .It d Ta file's deletion was obstructed by local modifications
1411 .It A Ta new file was added
1412 .It \(a~ Ta changes destined for a non-regular file were not merged
1413 .It ? Ta changes destined for an unversioned file were not merged
1416 The reverse-merged changes will appear as local changes in the work tree,
1417 which may be viewed with
1419 amended manually or with further
1424 or discarded again with
1428 will refuse to run if certain preconditions are not met.
1429 If the work tree contains multiple base commits it must first be updated
1430 to a single base commit with
1432 If the work tree already contains files with merge conflicts, these
1433 conflicts must be resolved first.
1437 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Oo Fl l Oc Op Ar branch
1438 Rebase commits on the specified
1440 onto the tip of the current branch of the work tree.
1443 must share common ancestry with the work tree's current branch.
1444 Rebasing begins with the first descendant commit of the youngest
1445 common ancestor commit shared by the specified
1447 and the work tree's current branch, and stops once the tip commit
1454 is used as intended, the specified
1456 represents a local commit history and may already contain changes
1457 that are not yet visible in any other repositories.
1458 The work tree's current branch, which must be set with
1462 operation, represents a branch from a remote repository which shares
1463 a common history with the specified
1465 but has progressed, and perhaps diverged, due to commits added to the
1468 Rebased commits are accumulated on a temporary branch which the work tree
1469 will remain switched to throughout the entire rebase operation.
1470 Commits on this branch represent the same changes with the same log
1471 messages as their counterparts on the original
1473 but with different commit IDs.
1474 Once rebasing has completed successfully, the temporary branch becomes
1475 the new version of the specified
1477 and the work tree is automatically switched to it.
1479 Old commits in their pre-rebase state are automatically backed up in the
1480 .Dq refs/got/backup/rebase
1481 reference namespace.
1482 As long as these references are not removed older versions of rebased
1483 commits will remain in the repository and can be viewed with the
1486 Removal of these references makes objects which become unreachable via
1487 any reference subject to removal by Git's garbage collector or
1488 .Cm gotadmin cleanup .
1490 While rebasing commits, show the status of each affected file,
1491 using the following status codes:
1492 .Bl -column YXZ description
1493 .It G Ta file was merged
1494 .It C Ta file was merged and conflicts occurred during merge
1495 .It ! Ta changes destined for a missing file were not merged
1496 .It D Ta file was deleted
1497 .It d Ta file's deletion was obstructed by local modifications
1498 .It A Ta new file was added
1499 .It \(a~ Ta changes destined for a non-regular file were not merged
1500 .It ? Ta changes destined for an unversioned file were not merged
1503 If merge conflicts occur the rebase operation is interrupted and may
1504 be continued once conflicts have been resolved.
1505 Alternatively, the rebase operation may be aborted which will leave
1507 unmodified and the work tree switched back to its original branch.
1509 If a merge conflict is resolved in a way which renders the merged
1510 change into a no-op change, the corresponding commit will be elided
1511 when the rebase operation continues.
1514 will refuse to run if certain preconditions are not met.
1515 If the work tree is not yet fully updated to the tip commit of its
1516 branch then the work tree must first be updated with
1518 If changes have been staged with
1520 these changes must first be committed with
1524 If the work tree contains local changes, these changes must first be
1531 contains changes to files outside of the work tree's path prefix,
1532 the work tree cannot be used to rebase this branch.
1538 commands will refuse to run while a rebase operation is in progress.
1539 Other commands which manipulate the work tree may be used for
1540 conflict resolution purposes.
1547 Abort an interrupted rebase operation.
1548 If this option is used, no other command-line arguments are allowed.
1550 Continue an interrupted rebase operation.
1551 If this option is used, no other command-line arguments are allowed.
1553 Show a list of past rebase operations, represented by references in the
1554 .Dq refs/got/backup/rebase
1555 reference namespace.
1557 Display the author, date, and log message of each backed up commit,
1558 the object ID of the corresponding post-rebase commit, and
1559 the object ID of their common ancestor commit.
1560 Given these object IDs,
1567 options can be used to examine the history of either version of the branch,
1572 option can be used to create a new branch from a pre-rebase state if desired.
1576 is specified, only show commits which at some point in time represented this
1578 Otherwise, list all backed up commits for any branches.
1580 If this option is used,
1582 does not require a work tree.
1583 None of the other options can be used together with
1589 .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
1590 Edit commit history between the work tree's current base commit and
1591 the tip commit of the work tree's current branch.
1595 operation the work tree's current branch must be set with
1597 to the branch which should be edited, unless this branch is already the
1598 current branch of the work tree.
1599 The tip of this branch represents the upper bound (inclusive) of commits
1604 Furthermore, the work tree's base commit
1607 to a point in this branch's commit history where editing should begin.
1608 This commit represents the lower bound (non-inclusive) of commits touched
1613 Editing of commit history is controlled via a
1615 which can be written in an editor based on a template, passed on the
1616 command line, or generated with the
1622 The format of the histedit script is line-based.
1623 Each line in the script begins with a command name, followed by
1624 whitespace and an argument.
1625 For most commands, the expected argument is a commit ID SHA1 hash.
1626 Any remaining text on the line is ignored.
1627 Lines which begin with the
1629 character are ignored entirely.
1631 The available commands are as follows:
1632 .Bl -column YXZ pick-commit
1633 .It pick Ar commit Ta Use the specified commit as it is.
1634 .It edit Ar commit Ta Use the specified commit but once changes have been
1635 merged into the work tree interrupt the histedit operation for amending.
1636 .It fold Ar commit Ta Combine the specified commit with the next commit
1637 listed further below that will be used.
1638 .It drop Ar commit Ta Remove this commit from the edited history.
1639 .It mesg Ar log-message Ta Use the specified single-line log message for
1640 the commit on the previous line.
1641 If the log message argument is left empty, open an editor where a new
1642 log message can be written.
1645 Every commit in the history being edited must be mentioned in the script.
1646 Lines may be re-ordered to change the order of commits in the edited history.
1647 No commit may be listed more than once.
1649 Edited commits are accumulated on a temporary branch which the work tree
1650 will remain switched to throughout the entire histedit operation.
1651 Once history editing has completed successfully, the temporary branch becomes
1652 the new version of the work tree's branch and the work tree is automatically
1655 Old commits in their pre-histedit state are automatically backed up in the
1656 .Dq refs/got/backup/histedit
1657 reference namespace.
1658 As long as these references are not removed older versions of edited
1659 commits will remain in the repository and can be viewed with the
1662 Removal of these references makes objects which become unreachable via
1663 any reference subject to removal by Git's garbage collector or
1664 .Cm gotadmin cleanup .
1666 While merging commits, show the status of each affected file,
1667 using the following status codes:
1668 .Bl -column YXZ description
1669 .It G Ta file was merged
1670 .It C Ta file was merged and conflicts occurred during merge
1671 .It ! Ta changes destined for a missing file were not merged
1672 .It D Ta file was deleted
1673 .It d Ta file's deletion was obstructed by local modifications
1674 .It A Ta new file was added
1675 .It \(a~ Ta changes destined for a non-regular file were not merged
1676 .It ? Ta changes destined for an unversioned file were not merged
1679 If merge conflicts occur the histedit operation is interrupted and may
1680 be continued once conflicts have been resolved.
1681 Alternatively, the histedit operation may be aborted which will leave
1682 the work tree switched back to its original branch.
1684 If a merge conflict is resolved in a way which renders the merged
1685 change into a no-op change, the corresponding commit will be elided
1686 when the histedit operation continues.
1689 will refuse to run if certain preconditions are not met.
1690 If the work tree's current branch is not in the
1692 reference namespace, the history of the branch may not be edited.
1693 If the work tree contains multiple base commits it must first be updated
1694 to a single base commit with
1696 If changes have been staged with
1698 these changes must first be committed with
1702 If the work tree contains local changes, these changes must first be
1707 If the edited history contains changes to files outside of the work tree's
1708 path prefix, the work tree cannot be used to edit the history of this branch.
1715 commands will refuse to run while a histedit operation is in progress.
1716 Other commands which manipulate the work tree may be used, and the
1718 command may be used to commit arbitrary changes to the temporary branch
1719 while the histedit operation is interrupted.
1726 Abort an interrupted histedit operation.
1727 If this option is used, no other command-line arguments are allowed.
1729 Continue an interrupted histedit operation.
1730 If this option is used, no other command-line arguments are allowed.
1732 Fold all commits into a single commit.
1733 This option is a quick equivalent to a histedit script which folds all
1734 commits, combining them all into one commit.
1737 option can only be used when starting a new histedit operation.
1738 If this option is used, no other command-line arguments are allowed.
1739 .It Fl F Ar histedit-script
1742 instead of opening a temporary file in an editor where a histedit script
1745 Edit log messages only.
1746 This option is a quick equivalent to a histedit script which edits
1747 only log messages but otherwise leaves every picked commit as-is.
1750 option can only be used when starting a new histedit operation.
1751 If this option is used, no other command-line arguments are allowed.
1753 Show a list of past histedit operations, represented by references in the
1754 .Dq refs/got/backup/histedit
1755 reference namespace.
1757 Display the author, date, and log message of each backed up commit,
1758 the object ID of the corresponding post-histedit commit, and
1759 the object ID of their common ancestor commit.
1760 Given these object IDs,
1767 options can be used to examine the history of either version of the branch,
1772 option can be used to create a new branch from a pre-histedit state if desired.
1776 is specified, only show commits which at some point in time represented this
1778 Otherwise, list all backed up commits for any branches.
1780 If this option is used,
1782 does not require a work tree.
1783 None of the other options can be used together with
1789 .It Cm integrate Ar branch
1790 Integrate the specified
1792 into the work tree's current branch.
1793 Files in the work tree are updated to match the contents on the integrated
1795 and the reference of the work tree's branch is changed to point at the
1796 head commit of the integrated
1799 Both branches can be considered equivalent after integration since they
1800 will be pointing at the same commit.
1801 Both branches remain available for future work, if desired.
1802 In case the integrated
1804 is no longer needed it may be deleted with
1807 Show the status of each affected file, using the following status codes:
1808 .Bl -column YXZ description
1809 .It U Ta file was updated
1810 .It D Ta file was deleted
1811 .It A Ta new file was added
1812 .It \(a~ Ta versioned file is obstructed by a non-regular file
1813 .It ! Ta a missing versioned file was restored
1817 will refuse to run if certain preconditions are not met.
1818 Most importantly, the
1820 must have been rebased onto the work tree's current branch with
1822 before it can be integrated, in order to linearize commit history and
1823 resolve merge conflicts.
1824 If the work tree contains multiple base commits it must first be updated
1825 to a single base commit with
1827 If changes have been staged with
1829 these changes must first be committed with
1833 If the work tree contains local changes, these changes must first be
1841 .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 ...
1842 Stage local changes for inclusion in the next commit.
1845 is specified, stage all changes in the work tree.
1846 Otherwise, stage changes at or within the specified paths.
1847 Paths may be staged if they are added, modified, or deleted according to
1850 Show the status of each affected file, using the following status codes:
1851 .Bl -column YXZ description
1852 .It A Ta file addition has been staged
1853 .It M Ta file modification has been staged
1854 .It D Ta file deletion has been staged
1857 Staged file contents are saved in newly created blob objects in the repository.
1858 These blobs will be referred to by tree objects once staged changes have been
1861 Staged changes affect the behaviour of
1866 While paths with staged changes exist, the
1868 command will refuse to commit any paths which do not have staged changes.
1869 Local changes created on top of staged changes can only be committed if
1870 the path is staged again, or if the staged changes are committed first.
1873 command will show both local changes and staged changes.
1876 command is able to display local changes relative to staged changes,
1877 and to display staged changes relative to the repository.
1880 command cannot revert staged changes but may be used to revert
1881 local changes created on top of staged changes.
1888 Instead of staging new changes, list paths which are already staged,
1889 along with the IDs of staged blob objects and stage status codes.
1890 If paths were provided in the command line show the staged paths
1891 among the specified paths.
1892 Otherwise, show all staged paths.
1894 Instead of staging the entire content of a changed file, interactively
1895 select or reject changes for staging based on
1899 (reject change), and
1901 (quit staging this file) responses.
1902 If a file is in modified status, individual patches derived from the
1903 modified file content can be staged.
1904 Files in added or deleted status may only be staged or rejected in
1906 .It Fl F Ar response-script
1914 responses line-by-line from the specified
1916 file instead of prompting interactively.
1918 Allow staging of symbolic links which point outside of the path space
1919 that is under version control.
1922 will reject such symbolic links due to safety concerns.
1925 may decide to represent such a symbolic link as a regular file which contains
1926 the link's target path, rather than creating an actual symbolic link which
1927 points outside of the work tree.
1928 Use of this option is discouraged because external mechanisms such as
1930 are better suited for managing symbolic links to paths not under
1935 will refuse to run if certain preconditions are not met.
1936 If a file contains merge conflicts, these conflicts must be resolved first.
1937 If a file is found to be out of date relative to the head commit on the
1938 work tree's current branch, the file must be updated with
1940 before it can be staged (however, this does not prevent the file from
1941 becoming out-of-date at some point after having been staged).
1948 commands will refuse to run while staged changes exist.
1949 If staged changes cannot be committed because a staged path
1950 is out of date, the path must be unstaged with
1952 before it can be updated with
1954 and may then be staged again if necessary.
1958 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
1959 Merge staged changes back into the work tree and put affected paths
1960 back into non-staged status.
1963 is specified, unstage all staged changes across the entire work tree.
1964 Otherwise, unstage changes at or within the specified paths.
1966 Show the status of each affected file, using the following status codes:
1967 .Bl -column YXZ description
1968 .It G Ta file was unstaged
1969 .It C Ta file was unstaged and conflicts occurred during merge
1970 .It ! Ta changes destined for a missing file were not merged
1971 .It D Ta file was staged as deleted and still is deleted
1972 .It d Ta file's deletion was obstructed by local modifications
1973 .It \(a~ Ta changes destined for a non-regular file were not merged
1981 Instead of unstaging the entire content of a changed file, interactively
1982 select or reject changes for unstaging based on
1986 (keep change staged), and
1988 (quit unstaging this file) responses.
1989 If a file is staged in modified status, individual patches derived from the
1990 staged file content can be unstaged.
1991 Files staged in added or deleted status may only be unstaged in their entirety.
1992 .It Fl F Ar response-script
2000 responses line-by-line from the specified
2002 file instead of prompting interactively.
2007 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
2008 Parse and print contents of objects to standard output in a line-based
2010 Content of commit, tree, and tag objects is printed in a way similar
2011 to the actual content stored in such objects.
2012 Blob object contents are printed as they would appear in files on disk.
2014 Attempt to interpret each argument as a reference, a tag name, or
2015 an object ID SHA1 hash.
2016 References will be resolved to an object ID.
2017 Tag names will resolved to a tag object.
2018 An abbreviated hash argument will be expanded to a full SHA1 hash
2019 automatically, provided the abbreviation is unique.
2021 If none of the above interpretations produce a valid result, or if the
2023 option is used, attempt to interpret the argument as a path which will
2024 be resolved to the ID of an object found at this path in the repository.
2031 Look up paths in the specified
2033 If this option is not used, paths are looked up in the commit resolved
2034 via the repository's HEAD reference.
2035 The expected argument is a commit ID SHA1 hash or an existing reference
2036 or tag name which will be resolved to a commit ID.
2037 An abbreviated hash argument will be expanded to a full SHA1 hash
2038 automatically, provided the abbreviation is unique.
2039 .It Fl r Ar repository-path
2040 Use the repository at the specified path.
2041 If not specified, assume the repository is located at or above the current
2043 If this directory is a
2045 work tree, use the repository path associated with this work tree.
2047 Interpret all arguments as paths only.
2048 This option can be used to resolve ambiguity in cases where paths
2049 look like tag names, reference names, or object IDs.
2051 .It Cm info Op Ar path ...
2052 Display meta-data stored in a work tree.
2057 The work tree to use is resolved implicitly by walking upwards from the
2058 current working directory.
2062 arguments are specified, show additional per-file information for tracked
2063 files located at or within these paths.
2066 argument corresponds to the work tree's root directory, display information
2067 for all tracked files.
2070 .Bl -tag -width GOT_AUTHOR
2072 The author's name and email address for
2077 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
2080 may fail to parse commits without an email address in author data,
2084 environment variables with a missing email address.
2086 .Ev GOT_AUTHOR will be overriden by configuration settings in
2092 configuration settings in the repository's
2099 configuration settings contained in Git's global
2101 configuration file will only be used if neither
2105 environment variable provide author information.
2106 .It Ev VISUAL , EDITOR
2107 The editor spawned by
2115 text editor will be spawned in order to give
2117 the attention it deserves.
2118 .It Ev GOT_LOG_DEFAULT_LIMIT
2119 The default limit on the number of commits traversed by
2121 If set to zero, the limit is unbounded.
2122 This variable will be silently ignored if it is set to a non-numeric value.
2125 .Bl -tag -width packed-refs -compact
2127 Repository-wide configuration settings for
2131 configuration file located in the root directory of a Git repository
2132 supersedes any relevant settings in Git's
2136 .It Pa .got/got.conf
2137 Worktree-specific configuration settings for
2141 configuration file in the
2143 meta-data directory of a work tree supersedes any relevant settings in
2146 configuration file and Git's
2153 Clone an existing Git repository for use with
2157 .Dl $ got clone ssh://git@github.com/openbsd/src.git
2159 Use of HTTP URLs currently requires
2163 .Dl $ git clone --bare https://github.com/openbsd/src.git
2165 Alternatively, for quick and dirty local testing of
2167 a new Git repository could be created and populated with files,
2168 e.g. from a temporary CVS checkout located at
2171 .Dl $ got init /var/git/src.git
2172 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
2174 Check out a work tree from the Git repository to /usr/src:
2176 .Dl $ got checkout /var/git/src.git /usr/src
2178 View local changes in a work tree directory:
2180 .Dl $ got diff | less
2182 In a work tree, display files in a potentially problematic state:
2184 .Dl $ got status -s 'C!~?'
2186 Interactively revert selected local changes in a work tree directory:
2188 .Dl $ got revert -p -R\ .
2190 In a work tree or a git repository directory, list all branch references:
2194 In a work tree or a git repository directory, create a new branch called
2195 .Dq unified-buffer-cache
2196 which is forked off the
2200 .Dl $ got branch -c master unified-buffer-cache
2202 Switch an existing work tree to the branch
2203 .Dq unified-buffer-cache .
2204 Local changes in the work tree will be preserved and merged if necessary:
2206 .Dl $ got update -b unified-buffer-cache
2208 Create a new commit from local changes in a work tree directory.
2209 This new commit will become the head commit of the work tree's current branch:
2213 In a work tree or a git repository directory, view changes committed in
2214 the 3 most recent commits to the work tree's branch, or the branch resolved
2215 via the repository's HEAD reference, respectively:
2217 .Dl $ got log -p -l 3
2219 As above, but display changes in the order in which
2221 could apply them in sequence:
2223 .Dl $ got log -p -l 3 -R
2225 In a work tree or a git repository directory, log the history of a subdirectory:
2227 .Dl $ got log sys/uvm
2229 While operating inside a work tree, paths are specified relative to the current
2230 working directory, so this command will log the subdirectory
2233 .Dl $ cd sys/uvm && got log\ .
2235 And this command has the same effect:
2237 .Dl $ cd sys/dev/usb && got log ../../uvm
2239 And this command displays work tree meta-data about all tracked files:
2242 .Dl $ got info\ . | less
2244 Add new files and remove obsolete files in a work tree directory:
2246 .Dl $ got add sys/uvm/uvm_ubc.c
2247 .Dl $ got remove sys/uvm/uvm_vnode.c
2249 Create a new commit from local changes in a work tree directory
2250 with a pre-defined log message.
2252 .Dl $ got commit -m 'unify the buffer cache'
2254 Alternatively, create a new commit from local changes in a work tree
2255 directory with a log message that has been prepared in the file
2258 .Dl $ got commit -F /tmp/msg
2260 Update any work tree checked out from the
2261 .Dq unified-buffer-cache
2262 branch to the latest commit on this branch:
2266 Roll file content on the unified-buffer-cache branch back by one commit,
2267 and then fetch the rolled-back change into the work tree as a local change
2268 to be amended and perhaps committed again:
2270 .Dl $ got backout unified-buffer-cache
2271 .Dl $ got commit -m 'roll back previous'
2272 .Dl $ # now back out the previous backout :-)
2273 .Dl $ got backout unified-buffer-cache
2275 Fetch new upstream commits into the local repository's
2282 In a repository created with a HTTP URL and
2283 .Cm git clone --bare
2286 command must be used instead:
2288 .Dl $ cd /var/git/src.git
2289 .Dl $ git fetch origin master:refs/remotes/origin/master
2293 branch to merge the new changes that are now visible on the
2298 .Dl $ got update -b origin/master
2299 .Dl $ got rebase master
2302 .Dq unified-buffer-cache
2303 branch on top of the new head commit of the
2307 .Dl $ got update -b master
2308 .Dl $ got rebase unified-buffer-cache
2310 Create a patch from all changes on the unified-buffer-cache branch.
2311 The patch can be mailed out for review and applied to
2315 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2317 Edit the entire commit history of the
2318 .Dq unified-buffer-cache
2321 .Dl $ got update -b unified-buffer-cache
2322 .Dl $ got update -c master
2325 In order to merge changes committed to the
2326 .Dq unified-buffer-cache
2327 branch back into the
2330 .Dq unified-buffer-cache
2331 branch must first be rebased onto the
2335 .Dl $ got update -b master
2336 .Dl $ got rebase unified-buffer-cache
2339 .Dq unified-buffer-cache
2340 branch can now be made visible on the
2344 Because the rebase operation switched the work tree to the
2345 .Dq unified-buffer-cache
2346 branch, the work tree must be switched back to the
2349 .Dq unified-buffer-cache
2350 branch can be integrated into
2353 .Dl $ got update -b master
2354 .Dl $ got integrate unified-buffer-cache
2356 Additional steps may be necessary if local changes need to be pushed back
2357 to the remote repository, which currently requires
2359 Before working against existing branches in a repository cloned with
2360 .Cm git clone --bare
2365 must be configured to map all references in the remote repository
2368 namespace of the local repository.
2369 This can be achieved by setting Git's
2370 .Pa remote.origin.fetch
2371 configuration variable to the value
2372 .Dq +refs/heads/*:refs/remotes/origin/*
2377 .Dl $ cd /var/git/repo
2378 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2382 option must be disabled:
2384 .Dl $ cd /var/git/repo
2385 .Dl $ git config remote.origin.mirror false
2387 Alternatively, the following
2389 configuration item can be added manually to the Git repository's
2393 .Dl [remote \&"origin\&"]
2395 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2398 This configuration leaves the local repository's
2400 namespace free for use by local branches checked out with
2402 and, if needed, created with
2407 namespace can now be updated with incoming changes from the remote
2412 without extra command line arguments:
2414 .Dl $ cd /var/git/repo
2417 To make changes fetched from the remote repository appear on the
2421 branch must be rebased onto the
2424 This will also merge local changes, if any, with the incoming changes:
2426 .Dl $ got update -b origin/master
2427 .Dl $ got rebase master
2431 branch, log messages for local changes can now be amended with
2433 by other developers and any other important new information:
2435 .Dl $ got update -c origin/master
2436 .Dl $ got histedit -m
2438 Local changes on the
2440 branch can then be pushed to the remote
2444 .Dl $ cd /var/git/repo
2445 .Dl $ git push origin master
2449 .Xr git-repository 5 ,
2450 .Xr got-worktree 5 ,
2453 .An Stefan Sperling Aq Mt stsp@openbsd.org
2454 .An Martin Pieuchot Aq Mt mpi@openbsd.org
2455 .An Joshua Stein Aq Mt jcs@openbsd.org
2456 .An Ori Bernstein Aq Mt ori@openbsd.org
2459 is a work-in-progress and some features remain to be implemented.
2461 At present, the user has to fall back on
2463 to perform some tasks.
2467 Reading from remote repositories over HTTP or HTTPS protocols requires
2472 Writing to remote repositories, over any protocol, requires
2475 The creation of merge commits, i.e. commits with two or more parent commits,
2479 In situations where files or directories were moved around
2481 will not automatically merge changes to new locations and
2483 will usually produce better results.