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 Oo Fl X 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
470 Delete all references which correspond to a particular
471 .Ar remote-repository
472 instead of fetching new changes.
473 This can be useful when a remote repository is being removed from
479 .Ar remote-repository
480 argument is mandatory and no other options except
487 Only references are deleted.
488 Any commit, tree, tag, and blob objects fetched from a remote repository
489 will generally be stored in pack files and may be removed separately with
491 and Git's garbage collector.
496 .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 Oo Fl q Oc Ar repository-path Op Ar work-tree-path
497 Copy files from a repository into a new work tree.
498 Show the status of each affected file, using the following status codes:
499 .Bl -column YXZ description
500 .It A Ta new file was added
501 .It E Ta file already exists in work tree's meta-data
506 is not specified, either use the last component of
507 .Ar repository path ,
510 was specified use the last component of
518 Proceed with the checkout operation even if the directory at
521 Existing files will be left intact.
523 Check out files from a commit on the specified
525 If this option is not specified, a branch resolved via the repository's HEAD
526 reference will be used.
528 Check out files from the specified
530 on the selected branch.
531 The expected argument is a commit ID SHA1 hash or an existing reference
532 or tag name which will be resolved to a commit ID.
533 An abbreviated hash argument will be expanded to a full SHA1 hash
534 automatically, provided the abbreviation is unique.
535 If this option is not specified, the most recent commit on the selected
540 is not contained in the selected branch, a different branch which contains
541 this commit must be specified with the
544 If no such branch is known a new branch must be created for this
550 Checking out work trees with an unknown branch is intentionally not supported.
551 .It Fl p Ar path-prefix
552 Restrict the work tree to a subset of the repository's tree hierarchy.
553 Only files beneath the specified
557 Silence progress output.
562 .It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl q Oc Op Ar path ...
563 Update an existing work tree to a different
565 Change existing files in the work tree as necessary to match file contents
567 Preserve any local changes in the work tree and merge them with the
570 Files which already contain merge conflicts will not be updated to avoid
571 further complications.
572 Such files will be updated when
574 is run again after merge conflicts have been resolved.
575 If the conflicting changes are no longer needed affected files can be
582 Show the status of each affected file, using the following status codes:
583 .Bl -column YXZ description
584 .It U Ta file was updated and contained no local changes
585 .It G Ta file was updated and local changes were merged cleanly
586 .It C Ta file was updated and conflicts occurred during merge
587 .It D Ta file was deleted
588 .It A Ta new file was added
589 .It \(a~ Ta versioned file is obstructed by a non-regular file
590 .It ! Ta a missing versioned file was restored
591 .It # Ta file was not updated because it contains merge conflicts
592 .It ? Ta changes destined for an unversioned file were not merged
597 is specified, update the entire work tree.
598 Otherwise, restrict the update operation to files at or within the
600 Each path is required to exist in the update operation's target commit.
601 Files in the work tree outside specified paths will remain unchanged and
602 will retain their previously recorded base commit.
605 commands may refuse to run while the work tree contains files from
606 multiple base commits.
607 The base commit of such a work tree can be made consistent by running
609 across the entire work tree.
612 is incompatible with the
617 cannot update paths with staged changes.
618 If changes have been staged with
620 these changes must first be committed with
630 Switch the work tree's branch reference to the specified
632 before updating the work tree.
633 This option requires that all paths in the work tree are updated.
635 As usual, any local changes in the work tree will be preserved.
636 This can be useful when switching to a newly created branch in order
637 to commit existing local changes to this branch.
639 Any local changes must be dealt with separately in order to obtain a
640 work tree with pristine file contents corresponding exactly to the specified
642 Such changes could first be committed to a different branch with
644 or could be discarded with
647 Update the work tree to the specified
649 The expected argument is a commit ID SHA1 hash or an existing reference
650 or tag name which will be resolved to a commit ID.
651 An abbreviated hash argument will be expanded to a full SHA1 hash
652 automatically, provided the abbreviation is unique.
653 If this option is not specified, the most recent commit on the work tree's
656 Silence progress output.
661 .It Cm status Oo Fl I Oc Oo Fl s Ar status-codes Oc Op Ar path ...
662 Show the current modification status of files in a work tree,
663 using the following status codes:
664 .Bl -column YXZ description
665 .It M Ta modified file
666 .It A Ta file scheduled for addition in next commit
667 .It D Ta file scheduled for deletion in next commit
668 .It C Ta modified or added file which contains merge conflicts
669 .It ! Ta versioned file was expected on disk but is missing
670 .It \(a~ Ta versioned file is obstructed by a non-regular file
671 .It ? Ta unversioned item not tracked by
673 .It m Ta modified file modes (executable bit only)
674 .It N Ta non-existent
676 specified on the command line
681 is specified, show modifications in the entire work tree.
682 Otherwise, show modifications at or within the specified paths.
684 If changes have been staged with
686 staged changes are shown in the second output column, using the following
688 .Bl -column YXZ description
689 .It M Ta file modification is staged
690 .It A Ta file addition is staged
691 .It D Ta file deletion is staged
694 Changes created on top of staged changes are indicated in the first column:
695 .Bl -column YXZ description
696 .It MM Ta file was modified after earlier changes have been staged
697 .It MA Ta file was modified after having been staged for addition
705 Show unversioned files even if they match an ignore pattern.
706 .It Fl s Ar status-codes
707 Only show files with a modification status matching any of the
708 single-character status codes contained in the
711 Any combination of codes from the above list of possible status codes
713 For staged files, status codes displayed in either column will be matched.
716 For compatibility with
727 files in each traversed directory and will not display unversioned files
728 which match these patterns.
733 supports consecutive asterisks,
735 which will match an arbitrary amount of directories.
739 only supports a single ignore pattern per line.
743 does not support negated ignore patterns prefixed with
745 and gives no special significance to the location of path component separators,
751 .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
752 Display history of a repository.
755 is specified, show only commits which modified this path.
756 If invoked in a work tree, the
758 is interpreted relative to the current working directory,
759 and the work tree's path prefix is implicitly prepended.
760 Otherwise, the path is interpreted relative to the repository root.
767 Display individual commits which were merged into the current branch
771 shows the linear history of the current branch only.
773 Start traversing history at the specified
775 The expected argument is a commit ID SHA1 hash or an existing reference
776 or tag name which will be resolved to a commit ID.
777 An abbreviated hash argument will be expanded to a full SHA1 hash
778 automatically, provided the abbreviation is unique.
779 If this option is not specified, default to the work tree's current branch
780 if invoked in a work tree, or to the repository's HEAD reference.
782 Set the number of context lines shown in diffs with
784 By default, 3 lines of context are shown.
786 Limit history traversal to a given number of commits.
787 If this option is not specified, a default limit value of zero is used,
788 which is treated as an unbounded limit.
790 .Ev GOT_LOG_DEFAULT_LIMIT
791 environment variable may be set to change this default value.
793 Display the patch of modifications made in each commit.
796 is specified, only show the patch of modifications at or within this path.
798 Display the list of file paths changed in each commit, using the following
800 .Bl -column YXZ description
801 .It M Ta modified file
802 .It D Ta file was deleted
803 .It A Ta new file was added
804 .It m Ta modified file modes (executable bit only)
806 .It Fl s Ar search-pattern
807 If specified, show only commits with a log message matched by the extended
810 When used together with
812 then the file paths changed by a commit can be matched as well.
813 Regular expression syntax is documented in
815 .It Fl r Ar repository-path
816 Use the repository at the specified path.
817 If not specified, assume the repository is located at or above the current
819 If this directory is a
821 work tree, use the repository path associated with this work tree.
823 Determine a set of commits to display as usual, but display these commits
826 Stop traversing commit history immediately after the specified
829 This option has no effect if the specified
833 .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
834 When invoked within a work tree with less than two arguments, display
835 local changes in the work tree.
838 is specified, only show changes within this path.
840 If two arguments are provided, treat each argument as a reference, a tag
841 name, or an object ID SHA1 hash, and display differences between the
842 corresponding objects.
843 Both objects must be of the same type (blobs, trees, or commits).
844 An abbreviated hash argument will be expanded to a full SHA1 hash
845 automatically, provided the abbreviation is unique.
852 Treat file contents as ASCII text even if binary data is detected.
854 Set the number of context lines shown in the diff.
855 By default, 3 lines of context are shown.
856 .It Fl r Ar repository-path
857 Use the repository at the specified path.
858 If not specified, assume the repository is located at or above the current
860 If this directory is a
862 work tree, use the repository path associated with this work tree.
864 Show changes staged with
866 instead of showing local changes in the work tree.
867 This option is only valid when
869 is invoked in a work tree.
871 Ignore whitespace-only changes.
876 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
877 Display line-by-line history of a file at the specified path.
884 Start traversing history at the specified
886 The expected argument is a commit ID SHA1 hash or an existing reference
887 or tag name which will be resolved to a commit ID.
888 An abbreviated hash argument will be expanded to a full SHA1 hash
889 automatically, provided the abbreviation is unique.
890 .It Fl r Ar repository-path
891 Use the repository at the specified path.
892 If not specified, assume the repository is located at or above the current
894 If this directory is a
896 work tree, use the repository path associated with this work tree.
901 .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
902 Display a listing of files and directories at the specified
903 directory path in the repository.
904 Entries shown in this listing may carry one of the following trailing
906 .Bl -column YXZ description
907 .It @ Ta entry is a symbolic link
908 .It / Ta entry is a directory
909 .It * Ta entry is an executable file
910 .It $ Ta entry is a Git submodule
913 Symbolic link entries are also annotated with the target path of the link.
917 is specified, list the repository path corresponding to the current
918 directory of the work tree, or the root directory of the repository
919 if there is no work tree.
926 List files and directories as they appear in the specified
928 The expected argument is a commit ID SHA1 hash or an existing reference
929 or tag name which will be resolved to a commit ID.
930 An abbreviated hash argument will be expanded to a full SHA1 hash
931 automatically, provided the abbreviation is unique.
932 .It Fl r Ar repository-path
933 Use the repository at the specified path.
934 If not specified, assume the repository is located at or above the current
936 If this directory is a
938 work tree, use the repository path associated with this work tree.
940 Show object IDs of files (blob objects) and directories (tree objects).
942 Recurse into sub-directories in the repository.
947 .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
948 Manage references in a repository.
950 References may be listed, created, deleted, and changed.
951 When creating, deleting, or changing a reference the specified
953 must be an absolute reference name, i.e. it must begin with
960 .It Fl r Ar repository-path
961 Use the repository at the specified path.
962 If not specified, assume the repository is located at or above the current
964 If this directory is a
966 work tree, use the repository path associated with this work tree.
968 List references in the repository.
971 is specified, list all existing references in the repository.
974 is a reference namespace, list all references in this namespace.
975 Otherwise, show only the reference with the given
977 Cannot be used together with any other options except
980 Create a reference or change an existing reference.
981 The reference with the specified
983 will point at the specified
987 argument is a ID SHA1 hash or an existing reference or tag name which will
988 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
989 Cannot be used together with any other options except
991 .It Fl s Ar reference
992 Create a symbolic reference, or change an existing symbolic reference.
993 The symbolic reference with the specified
995 will point at the specified
997 which must already exist in the repository.
998 Care should be taken not to create loops between references when
1000 Cannot be used together with any other options except
1003 Delete the reference with the specified
1005 from the repository.
1006 Any commit, tree, tag, and blob objects belonging to deleted references
1007 remain in the repository and may be removed separately with
1008 Git's garbage collector or
1009 .Cm gotadmin cleanup .
1010 Cannot be used together with any other options except
1013 .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
1014 Create, list, or delete branches.
1016 Local branches are managed via references which live in the
1018 reference namespace.
1021 command creates references in this namespace only.
1023 When deleting branches the specified
1027 reference namespace first.
1028 If no corresponding branch is found the
1030 namespace will be searched next.
1032 If invoked in a work tree without any arguments, print the name of the
1033 work tree's current branch.
1037 argument is passed, attempt to create a branch reference with the given name.
1038 By default the new branch reference will point at the latest commit on the
1039 work tree's current branch if invoked in a work tree, and otherwise to a commit
1040 resolved via the repository's HEAD reference.
1042 If invoked in a work tree, once the branch was created successfully
1043 switch the work tree's head reference to the newly created branch and
1044 update files across the entire work tree, just like
1045 .Cm got update -b Ar name
1047 Show the status of each affected file, using the following status codes:
1048 .Bl -column YXZ description
1049 .It U Ta file was updated and contained no local changes
1050 .It G Ta file was updated and local changes were merged cleanly
1051 .It C Ta file was updated and conflicts occurred during merge
1052 .It D Ta file was deleted
1053 .It A Ta new file was added
1054 .It \(a~ Ta versioned file is obstructed by a non-regular file
1055 .It ! Ta a missing versioned file was restored
1063 Make a newly created branch reference point at the specified
1067 argument is a commit ID SHA1 hash or an existing reference
1068 or tag name which will be resolved to a commit ID.
1069 .It Fl r Ar repository-path
1070 Use the repository at the specified path.
1071 If not specified, assume the repository is located at or above the current
1073 If this directory is a
1075 work tree, use the repository path associated with this work tree.
1077 List all existing branches in the repository, including copies of remote
1078 repositories' branches in the
1080 reference namespace.
1082 If invoked in a work tree, the work tree's current branch is shown
1083 with one the following annotations:
1084 .Bl -column YXZ description
1085 .It * Ta work tree's base commit matches the branch tip
1086 .It \(a~ Ta work tree's base commit is out-of-date
1089 Delete the branch with the specified
1095 reference namespace.
1097 Only the branch reference is deleted.
1098 Any commit, tree, and blob objects belonging to the branch
1099 remain in the repository and may be removed separately with
1100 Git's garbage collector or
1101 .Cm gotadmin cleanup .
1103 Do not switch and update the work tree after creating a new branch.
1108 .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
1109 Manage tags in a repository.
1111 Tags are managed via references which live in the
1113 reference namespace.
1116 command operates on references in this namespace only.
1117 References in this namespace point at tag objects which contain a pointer
1118 to another object, a tag message, as well as author and timestamp information.
1120 Attempt to create a tag with the given
1122 and make this tag point at the given
1124 If no commit is specified, default to the latest commit on the work tree's
1125 current branch if invoked in a work tree, and to a commit resolved via
1126 the repository's HEAD reference otherwise.
1133 Make the newly created tag reference point at the specified
1137 argument is a commit ID SHA1 hash or an existing reference or tag name which
1138 will be resolved to a commit ID.
1139 An abbreviated hash argument will be expanded to a full SHA1 hash
1140 automatically, provided the abbreviation is unique.
1142 Use the specified tag message when creating the new tag.
1147 opens a temporary file in an editor where a tag message can be written.
1148 .It Fl r Ar repository-path
1149 Use the repository at the specified path.
1150 If not specified, assume the repository is located at or above the current
1152 If this directory is a
1154 work tree, use the repository path associated with this work tree.
1156 List all existing tags in the repository instead of creating a new tag.
1157 If this option is used, no other command-line arguments are allowed.
1162 command will not delete tags or change existing tags.
1163 If a tag must be deleted, the
1165 command may be used to delete a tag's reference.
1166 This should only be done if the tag has not already been copied to
1168 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1169 Schedule unversioned files in a work tree for addition to the
1170 repository in the next commit.
1171 By default, files which match a
1173 ignore pattern will not be added.
1180 Permit recursion into directories.
1181 If this option is not specified,
1183 will refuse to run if a specified
1187 Add files even if they match a
1191 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
1192 Remove versioned files from a work tree and schedule them for deletion
1193 from the repository in the next commit.
1200 Perform the operation even if a file contains local modifications.
1202 Keep affected files on disk.
1204 Permit recursion into directories.
1205 If this option is not specified,
1207 will refuse to run if a specified
1210 .It Fl s Ar status-codes
1211 Only delete files with a modification status matching one of the
1212 single-character status codes contained in the
1215 The following status codes may be specified:
1216 .Bl -column YXZ description
1217 .It M Ta modified file (this implies the
1220 .It ! Ta versioned file expected on disk but missing
1226 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1227 Revert any local changes in files at the specified paths in a work tree.
1228 File contents will be overwritten with those contained in the
1229 work tree's base commit.
1230 There is no way to bring discarded changes back after
1233 If a file was added with
1235 it will become an unversioned file again.
1236 If a file was deleted with
1238 it will be restored.
1245 Instead of reverting all changes in files, interactively select or reject
1246 changes to revert based on
1252 (quit reverting this file) responses.
1253 If a file is in modified status, individual patches derived from the
1254 modified file content can be reverted.
1255 Files in added or deleted status may only be reverted in their entirety.
1256 .It Fl F Ar response-script
1264 responses line-by-line from the specified
1266 file instead of prompting interactively.
1268 Permit recursion into directories.
1269 If this option is not specified,
1271 will refuse to run if a specified
1278 .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 ...
1279 Create a new commit in the repository from changes in a work tree
1280 and use this commit as the new base commit for the work tree.
1283 is specified, commit all changes in the work tree.
1284 Otherwise, commit changes at or within the specified paths.
1286 If changes have been explicitly staged for commit with
1288 only commit staged changes and reject any specified paths which
1289 have not been staged.
1292 opens a temporary file in an editor where a log message can be written
1300 options are used together.
1302 Show the status of each affected file, using the following status codes:
1303 .Bl -column YXZ description
1304 .It M Ta modified file
1305 .It D Ta file was deleted
1306 .It A Ta new file was added
1307 .It m Ta modified file modes (executable bit only)
1310 Files which are not part of the new commit will retain their previously
1311 recorded base commit.
1314 commands may refuse to run while the work tree contains files from
1315 multiple base commits.
1316 The base commit of such a work tree can be made consistent by running
1318 across the entire work tree.
1322 command requires the
1324 environment variable to be set,
1325 unless an author has been configured in
1331 configuration settings can be
1332 obtained from the repository's
1334 file or from Git's global
1343 Use the prepared log message stored in the file found at
1345 when creating the new commit.
1347 opens a temporary file in an editor where the prepared log message can be
1348 reviewed and edited further if needed.
1349 Cannot be used together with the
1353 Use the specified log message when creating the new commit.
1354 Cannot be used together with the
1358 This option prevents
1360 from opening the commit message in an editor.
1361 It has no effect unless it is used together with the
1363 option and is intended for non-interactive use such as scripting.
1365 Allow the addition of symbolic links which point outside of the path space
1366 that is under version control.
1369 will reject such symbolic links due to safety concerns.
1372 may decide to represent such a symbolic link as a regular file which contains
1373 the link's target path, rather than creating an actual symbolic link which
1374 points outside of the work tree.
1375 Use of this option is discouraged because external mechanisms such as
1377 are better suited for managing symbolic links to paths not under
1382 will refuse to run if certain preconditions are not met.
1383 If the work tree's current branch is not in the
1385 reference namespace, new commits may not be created on this branch.
1386 Local changes may only be committed if they are based on file content
1387 found in the most recent commit on the work tree's branch.
1388 If a path is found to be out of date,
1390 must be used first in order to merge local changes with changes made
1395 .It Cm send Oo Fl a Oc Oo Fl b Ar branch Oc Oo Fl d Ar branch Oc Oo Fl f Oc Oo Fl r Ar repository-path Oc Oo Fl t Ar tag Oc Oo Fl T Oc Oo Fl q Oc Oo Fl v Oc Op Ar remote-repository
1396 Send new changes to a remote repository.
1398 .Ar remote-repository
1402 The remote repository's URL is obtained from the corresponding entry in
1406 file of the local repository, as created by
1409 All objects corresponding to new changes will be written to a temporary
1410 pack file which is then uploaded to the server.
1411 Upon success, references in the
1413 reference namespace of the local repository will be updated to point at
1414 the commits which have been sent.
1416 By default, changes will only be sent if they are based on up-to-date
1417 copies of relevant branches in the remote repository.
1418 If any changes to be sent are based on out-of-date copies or would
1419 otherwise break linear history of existing branches, new changes must
1420 be fetched from the server with
1422 and local branches must be rebased with
1429 option can be used to make exceptions to these requirements.
1436 Send all branches from the local repository's
1438 reference namespace.
1441 option is equivalent to listing all branches with multiple
1444 Cannot be used together with the
1450 from the local repository's
1452 reference namespace.
1453 This option may be specified multiple times to build a list of branches
1455 If this option is not specified, default to the work tree's current branch
1456 if invoked in a work tree, or to the repository's HEAD reference.
1457 Cannot be used together with the
1461 Delete the specified
1463 from the remote repository's
1465 reference namespace.
1466 This option may be specified multiple times to build a list of branches
1469 Only references are deleted.
1470 Any commit, tree, tag, and blob objects belonging to deleted branches
1471 may become subject to deletion by Git's garbage collector running on
1474 Requesting deletion of branches results in an error if the server
1475 does not support this feature or disallows the deletion of branches
1476 based on its configuration.
1478 Attempt to force the server to overwrite existing branches or tags
1479 in the remote repository, even when
1483 would usually be required before changes can be sent.
1484 The server may reject forced requests regardless, depending on its
1487 Any commit, tree, tag, and blob objects belonging to overwritten branches
1488 or tags may become subject to deletion by Git's garbage collector running
1493 reference namespace is globally shared between all repositories.
1496 option to overwrite tags is discouraged because it can lead to
1497 inconsistencies between the tags present in different repositories.
1498 In general, creating a new tag with a different name is recommended
1499 instead of overwriting an existing tag.
1503 option is particularly discouraged if changes being sent are based
1504 on an out-of-date copy of a branch in the remote repository.
1505 Instead of using the
1507 option, new changes should
1510 and local branches should be rebased with
1512 followed by another attempt to send the changes.
1516 option should only be needed in situations where the remote repository's
1517 copy of a branch or tag is known to be out-of-date and is considered
1519 The risks of creating inconsistencies between different repositories
1520 should also be taken into account.
1521 .It Fl r Ar repository-path
1522 Use the repository at the specified path.
1523 If not specified, assume the repository is located at or above the current
1525 If this directory is a
1527 work tree, use the repository path associated with this work tree.
1531 from the local repository's
1533 reference namespace, in addition to any branches that are being sent.
1536 option may be specified multiple times to build a list of tags to send.
1537 No tags will be sent if the
1541 Raise an error if the specified
1543 already exists in the remote repository, unless the
1545 option is used to overwrite the server's copy of the tag.
1546 In general, creating a new tag with a different name is recommended
1547 instead of overwriting an existing tag.
1549 Cannot be used together with the
1553 Attempt to send all tags from the local repository's
1555 reference namespace.
1558 option is equivalent to listing all tags with multiple
1561 Cannot be used together with the
1565 Suppress progress reporting output.
1566 The same option will be passed to
1573 to print debugging messages to standard error output.
1574 The same option will be passed to
1577 Multiple -v options increase the verbosity.
1583 .It Cm cherrypick Ar commit
1584 Merge changes from a single
1589 should be on a different branch than the work tree's base commit.
1590 The expected argument is a reference or a commit ID SHA1 hash.
1591 An abbreviated hash argument will be expanded to a full SHA1 hash
1592 automatically, provided the abbreviation is unique.
1594 Show the status of each affected file, using the following status codes:
1595 .Bl -column YXZ description
1596 .It G Ta file was merged
1597 .It C Ta file was merged and conflicts occurred during merge
1598 .It ! Ta changes destined for a missing file were not merged
1599 .It D Ta file was deleted
1600 .It d Ta file's deletion was obstructed by local modifications
1601 .It A Ta new file was added
1602 .It \(a~ Ta changes destined for a non-regular file were not merged
1603 .It ? Ta changes destined for an unversioned file were not merged
1606 The merged changes will appear as local changes in the work tree, which
1609 amended manually or with further
1614 or discarded again with
1618 will refuse to run if certain preconditions are not met.
1619 If the work tree contains multiple base commits it must first be updated
1620 to a single base commit with
1622 If any relevant files already contain merge conflicts, these
1623 conflicts must be resolved first.
1627 .It Cm backout Ar commit
1628 Reverse-merge changes from a single
1633 should be on the same branch as the work tree's base commit.
1634 The expected argument is a reference or a commit ID SHA1 hash.
1635 An abbreviated hash argument will be expanded to a full SHA1 hash
1636 automatically, provided the abbreviation is unique.
1638 Show the status of each affected file, using the following status codes:
1639 .Bl -column YXZ description
1640 .It G Ta file was merged
1641 .It C Ta file was merged and conflicts occurred during merge
1642 .It ! Ta changes destined for a missing file were not merged
1643 .It D Ta file was deleted
1644 .It d Ta file's deletion was obstructed by local modifications
1645 .It A Ta new file was added
1646 .It \(a~ Ta changes destined for a non-regular file were not merged
1647 .It ? Ta changes destined for an unversioned file were not merged
1650 The reverse-merged changes will appear as local changes in the work tree,
1651 which may be viewed with
1653 amended manually or with further
1658 or discarded again with
1662 will refuse to run if certain preconditions are not met.
1663 If the work tree contains multiple base commits it must first be updated
1664 to a single base commit with
1666 If any relevant files already contain merge conflicts, these
1667 conflicts must be resolved first.
1671 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Oo Fl l Oc Oo Fl X Oc Op Ar branch
1672 Rebase commits on the specified
1674 onto the tip of the current branch of the work tree.
1677 must share common ancestry with the work tree's current branch.
1678 Rebasing begins with the first descendant commit of the youngest
1679 common ancestor commit shared by the specified
1681 and the work tree's current branch, and stops once the tip commit
1688 is used as intended, the specified
1690 represents a local commit history and may already contain changes
1691 that are not yet visible in any other repositories.
1692 The work tree's current branch, which must be set with
1696 operation, represents a branch from a remote repository which shares
1697 a common history with the specified
1699 but has progressed, and perhaps diverged, due to commits added to the
1702 Rebased commits are accumulated on a temporary branch which the work tree
1703 will remain switched to throughout the entire rebase operation.
1704 Commits on this branch represent the same changes with the same log
1705 messages as their counterparts on the original
1707 but with different commit IDs.
1708 Once rebasing has completed successfully, the temporary branch becomes
1709 the new version of the specified
1711 and the work tree is automatically switched to it.
1713 Old commits in their pre-rebase state are automatically backed up in the
1714 .Dq refs/got/backup/rebase
1715 reference namespace.
1716 As long as these references are not removed older versions of rebased
1717 commits will remain in the repository and can be viewed with the
1720 Removal of these references makes objects which become unreachable via
1721 any reference subject to removal by Git's garbage collector or
1722 .Cm gotadmin cleanup .
1724 While rebasing commits, show the status of each affected file,
1725 using the following status codes:
1726 .Bl -column YXZ description
1727 .It G Ta file was merged
1728 .It C Ta file was merged and conflicts occurred during merge
1729 .It ! Ta changes destined for a missing file were not merged
1730 .It D Ta file was deleted
1731 .It d Ta file's deletion was obstructed by local modifications
1732 .It A Ta new file was added
1733 .It \(a~ Ta changes destined for a non-regular file were not merged
1734 .It ? Ta changes destined for an unversioned file were not merged
1737 If merge conflicts occur the rebase operation is interrupted and may
1738 be continued once conflicts have been resolved.
1739 Alternatively, the rebase operation may be aborted which will leave
1741 unmodified and the work tree switched back to its original branch.
1743 If a merge conflict is resolved in a way which renders the merged
1744 change into a no-op change, the corresponding commit will be elided
1745 when the rebase operation continues.
1748 will refuse to run if certain preconditions are not met.
1749 If the work tree is not yet fully updated to the tip commit of its
1750 branch then the work tree must first be updated with
1752 If changes have been staged with
1754 these changes must first be committed with
1758 If the work tree contains local changes, these changes must first be
1765 contains changes to files outside of the work tree's path prefix,
1766 the work tree cannot be used to rebase this branch.
1772 commands will refuse to run while a rebase operation is in progress.
1773 Other commands which manipulate the work tree may be used for
1774 conflict resolution purposes.
1781 Abort an interrupted rebase operation.
1782 If this option is used, no other command-line arguments are allowed.
1784 Continue an interrupted rebase operation.
1785 If this option is used, no other command-line arguments are allowed.
1787 Show a list of past rebase operations, represented by references in the
1788 .Dq refs/got/backup/rebase
1789 reference namespace.
1791 Display the author, date, and log message of each backed up commit,
1792 the object ID of the corresponding post-rebase commit, and
1793 the object ID of their common ancestor commit.
1794 Given these object IDs,
1801 options can be used to examine the history of either version of the branch,
1806 option can be used to create a new branch from a pre-rebase state if desired.
1810 is specified, only show commits which at some point in time represented this
1812 Otherwise, list all backed up commits for any branches.
1814 If this option is used,
1816 does not require a work tree.
1817 None of the other options can be used together with
1820 Delete backups created by past rebase operations, represented by references
1822 .Dq refs/got/backup/rebase
1823 reference namespace.
1827 is specified, only delete backups which at some point in time represented
1829 Otherwise, delete all references found within
1830 .Dq refs/got/backup/rebase .
1832 Any commit, tree, tag, and blob objects belonging to deleted backups
1833 remain in the repository and may be removed separately with
1834 Git's garbage collector or
1835 .Cm gotadmin cleanup .
1837 If this option is used,
1839 does not require a work tree.
1840 None of the other options can be used together with
1846 .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 Oo Fl X Oc Op Ar branch
1847 Edit commit history between the work tree's current base commit and
1848 the tip commit of the work tree's current branch.
1852 operation the work tree's current branch must be set with
1854 to the branch which should be edited, unless this branch is already the
1855 current branch of the work tree.
1856 The tip of this branch represents the upper bound (inclusive) of commits
1861 Furthermore, the work tree's base commit
1864 to a point in this branch's commit history where editing should begin.
1865 This commit represents the lower bound (non-inclusive) of commits touched
1870 Editing of commit history is controlled via a
1872 which can be written in an editor based on a template, passed on the
1873 command line, or generated with the
1879 The format of the histedit script is line-based.
1880 Each line in the script begins with a command name, followed by
1881 whitespace and an argument.
1882 For most commands, the expected argument is a commit ID SHA1 hash.
1883 Any remaining text on the line is ignored.
1884 Lines which begin with the
1886 character are ignored entirely.
1888 The available commands are as follows:
1889 .Bl -column YXZ pick-commit
1890 .It pick Ar commit Ta Use the specified commit as it is.
1891 .It edit Ar commit Ta Use the specified commit but once changes have been
1892 merged into the work tree interrupt the histedit operation for amending.
1893 .It fold Ar commit Ta Combine the specified commit with the next commit
1894 listed further below that will be used.
1895 .It drop Ar commit Ta Remove this commit from the edited history.
1896 .It mesg Ar log-message Ta Use the specified single-line log message for
1897 the commit on the previous line.
1898 If the log message argument is left empty, open an editor where a new
1899 log message can be written.
1902 Every commit in the history being edited must be mentioned in the script.
1903 Lines may be re-ordered to change the order of commits in the edited history.
1904 No commit may be listed more than once.
1906 Edited commits are accumulated on a temporary branch which the work tree
1907 will remain switched to throughout the entire histedit operation.
1908 Once history editing has completed successfully, the temporary branch becomes
1909 the new version of the work tree's branch and the work tree is automatically
1912 Old commits in their pre-histedit state are automatically backed up in the
1913 .Dq refs/got/backup/histedit
1914 reference namespace.
1915 As long as these references are not removed older versions of edited
1916 commits will remain in the repository and can be viewed with the
1919 Removal of these references makes objects which become unreachable via
1920 any reference subject to removal by Git's garbage collector or
1921 .Cm gotadmin cleanup .
1923 While merging commits, show the status of each affected file,
1924 using the following status codes:
1925 .Bl -column YXZ description
1926 .It G Ta file was merged
1927 .It C Ta file was merged and conflicts occurred during merge
1928 .It ! Ta changes destined for a missing file were not merged
1929 .It D Ta file was deleted
1930 .It d Ta file's deletion was obstructed by local modifications
1931 .It A Ta new file was added
1932 .It \(a~ Ta changes destined for a non-regular file were not merged
1933 .It ? Ta changes destined for an unversioned file were not merged
1936 If merge conflicts occur the histedit operation is interrupted and may
1937 be continued once conflicts have been resolved.
1938 Alternatively, the histedit operation may be aborted which will leave
1939 the work tree switched back to its original branch.
1941 If a merge conflict is resolved in a way which renders the merged
1942 change into a no-op change, the corresponding commit will be elided
1943 when the histedit operation continues.
1946 will refuse to run if certain preconditions are not met.
1947 If the work tree's current branch is not in the
1949 reference namespace, the history of the branch may not be edited.
1950 If the work tree contains multiple base commits it must first be updated
1951 to a single base commit with
1953 If changes have been staged with
1955 these changes must first be committed with
1959 If the work tree contains local changes, these changes must first be
1964 If the edited history contains changes to files outside of the work tree's
1965 path prefix, the work tree cannot be used to edit the history of this branch.
1972 commands will refuse to run while a histedit operation is in progress.
1973 Other commands which manipulate the work tree may be used, and the
1975 command may be used to commit arbitrary changes to the temporary branch
1976 while the histedit operation is interrupted.
1983 Abort an interrupted histedit operation.
1984 If this option is used, no other command-line arguments are allowed.
1986 Continue an interrupted histedit operation.
1987 If this option is used, no other command-line arguments are allowed.
1989 Fold all commits into a single commit.
1990 This option is a quick equivalent to a histedit script which folds all
1991 commits, combining them all into one commit.
1994 option can only be used when starting a new histedit operation.
1995 If this option is used, no other command-line arguments are allowed.
1996 .It Fl F Ar histedit-script
1999 instead of opening a temporary file in an editor where a histedit script
2002 Edit log messages only.
2003 This option is a quick equivalent to a histedit script which edits
2004 only log messages but otherwise leaves every picked commit as-is.
2007 option can only be used when starting a new histedit operation.
2008 If this option is used, no other command-line arguments are allowed.
2010 Show a list of past histedit operations, represented by references in the
2011 .Dq refs/got/backup/histedit
2012 reference namespace.
2014 Display the author, date, and log message of each backed up commit,
2015 the object ID of the corresponding post-histedit commit, and
2016 the object ID of their common ancestor commit.
2017 Given these object IDs,
2024 options can be used to examine the history of either version of the branch,
2029 option can be used to create a new branch from a pre-histedit state if desired.
2033 is specified, only show commits which at some point in time represented this
2035 Otherwise, list all backed up commits for any branches.
2037 If this option is used,
2039 does not require a work tree.
2040 None of the other options can be used together with
2043 Delete backups created by past histedit operations, represented by references
2045 .Dq refs/got/backup/histedit
2046 reference namespace.
2050 is specified, only delete backups which at some point in time represented
2052 Otherwise, delete all references found within
2053 .Dq refs/got/backup/histedit .
2055 Any commit, tree, tag, and blob objects belonging to deleted backups
2056 remain in the repository and may be removed separately with
2057 Git's garbage collector or
2058 .Cm gotadmin cleanup .
2060 If this option is used,
2062 does not require a work tree.
2063 None of the other options can be used together with
2069 .It Cm integrate Ar branch
2070 Integrate the specified
2072 into the work tree's current branch.
2073 Files in the work tree are updated to match the contents on the integrated
2075 and the reference of the work tree's branch is changed to point at the
2076 head commit of the integrated
2079 Both branches can be considered equivalent after integration since they
2080 will be pointing at the same commit.
2081 Both branches remain available for future work, if desired.
2082 In case the integrated
2084 is no longer needed it may be deleted with
2087 Show the status of each affected file, using the following status codes:
2088 .Bl -column YXZ description
2089 .It U Ta file was updated
2090 .It D Ta file was deleted
2091 .It A Ta new file was added
2092 .It \(a~ Ta versioned file is obstructed by a non-regular file
2093 .It ! Ta a missing versioned file was restored
2097 will refuse to run if certain preconditions are not met.
2098 Most importantly, the
2100 must have been rebased onto the work tree's current branch with
2102 before it can be integrated, in order to linearize commit history and
2103 resolve merge conflicts.
2104 If the work tree contains multiple base commits it must first be updated
2105 to a single base commit with
2107 If changes have been staged with
2109 these changes must first be committed with
2113 If the work tree contains local changes, these changes must first be
2121 .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 ...
2122 Stage local changes for inclusion in the next commit.
2125 is specified, stage all changes in the work tree.
2126 Otherwise, stage changes at or within the specified paths.
2127 Paths may be staged if they are added, modified, or deleted according to
2130 Show the status of each affected file, using the following status codes:
2131 .Bl -column YXZ description
2132 .It A Ta file addition has been staged
2133 .It M Ta file modification has been staged
2134 .It D Ta file deletion has been staged
2137 Staged file contents are saved in newly created blob objects in the repository.
2138 These blobs will be referred to by tree objects once staged changes have been
2141 Staged changes affect the behaviour of
2146 While paths with staged changes exist, the
2148 command will refuse to commit any paths which do not have staged changes.
2149 Local changes created on top of staged changes can only be committed if
2150 the path is staged again, or if the staged changes are committed first.
2153 command will show both local changes and staged changes.
2156 command is able to display local changes relative to staged changes,
2157 and to display staged changes relative to the repository.
2160 command cannot revert staged changes but may be used to revert
2161 local changes created on top of staged changes.
2168 Instead of staging new changes, list paths which are already staged,
2169 along with the IDs of staged blob objects and stage status codes.
2170 If paths were provided in the command line show the staged paths
2171 among the specified paths.
2172 Otherwise, show all staged paths.
2174 Instead of staging the entire content of a changed file, interactively
2175 select or reject changes for staging based on
2179 (reject change), and
2181 (quit staging this file) responses.
2182 If a file is in modified status, individual patches derived from the
2183 modified file content can be staged.
2184 Files in added or deleted status may only be staged or rejected in
2186 .It Fl F Ar response-script
2194 responses line-by-line from the specified
2196 file instead of prompting interactively.
2198 Allow staging of symbolic links which point outside of the path space
2199 that is under version control.
2202 will reject such symbolic links due to safety concerns.
2205 may decide to represent such a symbolic link as a regular file which contains
2206 the link's target path, rather than creating an actual symbolic link which
2207 points outside of the work tree.
2208 Use of this option is discouraged because external mechanisms such as
2210 are better suited for managing symbolic links to paths not under
2215 will refuse to run if certain preconditions are not met.
2216 If a file contains merge conflicts, these conflicts must be resolved first.
2217 If a file is found to be out of date relative to the head commit on the
2218 work tree's current branch, the file must be updated with
2220 before it can be staged (however, this does not prevent the file from
2221 becoming out-of-date at some point after having been staged).
2228 commands will refuse to run while staged changes exist.
2229 If staged changes cannot be committed because a staged path
2230 is out of date, the path must be unstaged with
2232 before it can be updated with
2234 and may then be staged again if necessary.
2238 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
2239 Merge staged changes back into the work tree and put affected paths
2240 back into non-staged status.
2243 is specified, unstage all staged changes across the entire work tree.
2244 Otherwise, unstage changes at or within the specified paths.
2246 Show the status of each affected file, using the following status codes:
2247 .Bl -column YXZ description
2248 .It G Ta file was unstaged
2249 .It C Ta file was unstaged and conflicts occurred during merge
2250 .It ! Ta changes destined for a missing file were not merged
2251 .It D Ta file was staged as deleted and still is deleted
2252 .It d Ta file's deletion was obstructed by local modifications
2253 .It \(a~ Ta changes destined for a non-regular file were not merged
2261 Instead of unstaging the entire content of a changed file, interactively
2262 select or reject changes for unstaging based on
2266 (keep change staged), and
2268 (quit unstaging this file) responses.
2269 If a file is staged in modified status, individual patches derived from the
2270 staged file content can be unstaged.
2271 Files staged in added or deleted status may only be unstaged in their entirety.
2272 .It Fl F Ar response-script
2280 responses line-by-line from the specified
2282 file instead of prompting interactively.
2287 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
2288 Parse and print contents of objects to standard output in a line-based
2290 Content of commit, tree, and tag objects is printed in a way similar
2291 to the actual content stored in such objects.
2292 Blob object contents are printed as they would appear in files on disk.
2294 Attempt to interpret each argument as a reference, a tag name, or
2295 an object ID SHA1 hash.
2296 References will be resolved to an object ID.
2297 Tag names will resolved to a tag object.
2298 An abbreviated hash argument will be expanded to a full SHA1 hash
2299 automatically, provided the abbreviation is unique.
2301 If none of the above interpretations produce a valid result, or if the
2303 option is used, attempt to interpret the argument as a path which will
2304 be resolved to the ID of an object found at this path in the repository.
2311 Look up paths in the specified
2313 If this option is not used, paths are looked up in the commit resolved
2314 via the repository's HEAD reference.
2315 The expected argument is a commit ID SHA1 hash or an existing reference
2316 or tag name which will be resolved to a commit ID.
2317 An abbreviated hash argument will be expanded to a full SHA1 hash
2318 automatically, provided the abbreviation is unique.
2319 .It Fl r Ar repository-path
2320 Use the repository at the specified path.
2321 If not specified, assume the repository is located at or above the current
2323 If this directory is a
2325 work tree, use the repository path associated with this work tree.
2327 Interpret all arguments as paths only.
2328 This option can be used to resolve ambiguity in cases where paths
2329 look like tag names, reference names, or object IDs.
2331 .It Cm info Op Ar path ...
2332 Display meta-data stored in a work tree.
2337 The work tree to use is resolved implicitly by walking upwards from the
2338 current working directory.
2342 arguments are specified, show additional per-file information for tracked
2343 files located at or within these paths.
2346 argument corresponds to the work tree's root directory, display information
2347 for all tracked files.
2350 .Bl -tag -width GOT_AUTHOR
2352 The author's name and email address for
2357 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
2360 may fail to parse commits without an email address in author data,
2364 environment variables with a missing email address.
2366 .Ev GOT_AUTHOR will be overridden by configuration settings in
2372 configuration settings in the repository's
2379 configuration settings contained in Git's global
2381 configuration file will only be used if neither
2385 environment variable provide author information.
2386 .It Ev VISUAL , EDITOR
2387 The editor spawned by
2395 text editor will be spawned in order to give
2397 the attention it deserves.
2398 .It Ev GOT_LOG_DEFAULT_LIMIT
2399 The default limit on the number of commits traversed by
2401 If set to zero, the limit is unbounded.
2402 This variable will be silently ignored if it is set to a non-numeric value.
2405 .Bl -tag -width packed-refs -compact
2407 Repository-wide configuration settings for
2411 configuration file located in the root directory of a Git repository
2412 supersedes any relevant settings in Git's
2416 .It Pa .got/got.conf
2417 Worktree-specific configuration settings for
2421 configuration file in the
2423 meta-data directory of a work tree supersedes any relevant settings in
2426 configuration file and Git's
2433 Enable tab-completion of
2438 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
2440 Clone an existing Git repository for use with
2444 .Dl $ got clone ssh://git@github.com/openbsd/src.git
2446 Use of HTTP URLs currently requires
2450 .Dl $ git clone --bare https://github.com/openbsd/src.git
2452 Alternatively, for quick and dirty local testing of
2454 a new Git repository could be created and populated with files,
2455 e.g. from a temporary CVS checkout located at
2458 .Dl $ got init /var/git/src.git
2459 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
2461 Check out a work tree from the Git repository to /usr/src:
2463 .Dl $ got checkout /var/git/src.git /usr/src
2465 View local changes in a work tree directory:
2467 .Dl $ got diff | less
2469 In a work tree, display files in a potentially problematic state:
2471 .Dl $ got status -s 'C!~?'
2473 Interactively revert selected local changes in a work tree directory:
2475 .Dl $ got revert -p -R\ .
2477 In a work tree or a git repository directory, list all branch references:
2481 In a work tree or a git repository directory, create a new branch called
2482 .Dq unified-buffer-cache
2483 which is forked off the
2487 .Dl $ got branch -c master unified-buffer-cache
2489 Switch an existing work tree to the branch
2490 .Dq unified-buffer-cache .
2491 Local changes in the work tree will be preserved and merged if necessary:
2493 .Dl $ got update -b unified-buffer-cache
2495 Create a new commit from local changes in a work tree directory.
2496 This new commit will become the head commit of the work tree's current branch:
2500 In a work tree or a git repository directory, view changes committed in
2501 the 3 most recent commits to the work tree's branch, or the branch resolved
2502 via the repository's HEAD reference, respectively:
2504 .Dl $ got log -p -l 3
2506 As above, but display changes in the order in which
2508 could apply them in sequence:
2510 .Dl $ got log -p -l 3 -R
2512 In a work tree or a git repository directory, log the history of a subdirectory:
2514 .Dl $ got log sys/uvm
2516 While operating inside a work tree, paths are specified relative to the current
2517 working directory, so this command will log the subdirectory
2520 .Dl $ cd sys/uvm && got log\ .
2522 And this command has the same effect:
2524 .Dl $ cd sys/dev/usb && got log ../../uvm
2526 And this command displays work tree meta-data about all tracked files:
2529 .Dl $ got info\ . | less
2531 Add new files and remove obsolete files in a work tree directory:
2533 .Dl $ got add sys/uvm/uvm_ubc.c
2534 .Dl $ got remove sys/uvm/uvm_vnode.c
2536 Create a new commit from local changes in a work tree directory
2537 with a pre-defined log message.
2539 .Dl $ got commit -m 'unify the buffer cache'
2541 Alternatively, create a new commit from local changes in a work tree
2542 directory with a log message that has been prepared in the file
2545 .Dl $ got commit -F /tmp/msg
2547 Update any work tree checked out from the
2548 .Dq unified-buffer-cache
2549 branch to the latest commit on this branch:
2553 Roll file content on the unified-buffer-cache branch back by one commit,
2554 and then fetch the rolled-back change into the work tree as a local change
2555 to be amended and perhaps committed again:
2557 .Dl $ got backout unified-buffer-cache
2558 .Dl $ got commit -m 'roll back previous'
2559 .Dl $ # now back out the previous backout :-)
2560 .Dl $ got backout unified-buffer-cache
2562 Fetch new changes on the remote repository's
2564 branch, making them visible on the local repository's
2571 In a repository created with a HTTP URL and
2572 .Cm git clone --bare
2575 command must be used instead:
2577 .Dl $ cd /var/git/src.git
2578 .Dl $ git fetch origin master:refs/remotes/origin/master
2582 branch to merge the new changes that are now visible on the
2587 .Dl $ got update -b origin/master
2588 .Dl $ got rebase master
2591 .Dq unified-buffer-cache
2592 branch on top of the new head commit of the
2596 .Dl $ got update -b master
2597 .Dl $ got rebase unified-buffer-cache
2599 Create a patch from all changes on the unified-buffer-cache branch.
2600 The patch can be mailed out for review and applied to
2604 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2606 Edit the entire commit history of the
2607 .Dq unified-buffer-cache
2610 .Dl $ got update -b unified-buffer-cache
2611 .Dl $ got update -c master
2614 Before working against existing branches in a repository cloned with
2615 .Cm git clone --bare
2620 must be configured to map all references in the remote repository
2623 namespace of the local repository.
2624 This can be achieved by setting Git's
2625 .Pa remote.origin.fetch
2626 configuration variable to the value
2627 .Dq +refs/heads/*:refs/remotes/origin/*
2632 .Dl $ cd /var/git/repo
2633 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2637 option must be disabled:
2639 .Dl $ cd /var/git/repo
2640 .Dl $ git config remote.origin.mirror false
2642 Alternatively, the following
2644 configuration item can be added manually to the Git repository's
2648 .Dl [remote \&"origin\&"]
2650 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2653 This configuration leaves the local repository's
2655 namespace free for use by local branches checked out with
2657 and, if needed, created with
2660 .Dq refs/remotes/origin
2661 namespace can now be updated with incoming changes from the remote
2666 without extra command line arguments.
2667 Newly fetched changes can be examined with
2670 Display changes on the remote repository's version of the
2672 branch, as of the last time
2676 .Dl $ got log -c origin/master | less
2678 As shown here, most commands accept abbreviated reference names such as
2681 .Dq refs/remotes/origin/master .
2682 The latter is only needed in case of ambiguity.
2685 must be used to merge changes which are visible on the
2690 This will also merge local changes, if any, with the incoming changes:
2692 .Dl $ got update -b origin/master
2693 .Dl $ got rebase master
2695 In order to make changes committed to the
2696 .Dq unified-buffer-cache
2700 .Dq unified-buffer-cache
2701 branch must first be rebased onto the
2705 .Dl $ got update -b master
2706 .Dl $ got rebase unified-buffer-cache
2709 .Dq unified-buffer-cache
2710 branch can now be made visible on the
2714 Because the rebase operation switched the work tree to the
2715 .Dq unified-buffer-cache
2716 branch the work tree must be switched back to the
2720 .Dl $ got update -b master
2721 .Dl $ got integrate unified-buffer-cache
2725 branch, log messages for local changes can now be amended with
2727 by other developers and any other important new information:
2729 .Dl $ got update -c origin/master
2730 .Dl $ got histedit -m
2732 If the remote repository offers write access local changes on the
2734 branch can be sent to the remote repository with
2738 can be run without further arguments.
2739 The arguments shown here match defaults, provided the work tree's
2740 current branch is the
2744 .Dl $ got send -b master origin
2746 If the remote repository requires the HTTPS protocol the
2748 command must be used instead:
2750 .Dl $ cd /var/git/src.git
2751 .Dl $ git push origin master
2755 .Xr git-repository 5 ,
2756 .Xr got-worktree 5 ,
2759 .An Stefan Sperling Aq Mt stsp@openbsd.org
2760 .An Martin Pieuchot Aq Mt mpi@openbsd.org
2761 .An Joshua Stein Aq Mt jcs@openbsd.org
2762 .An Ori Bernstein Aq Mt ori@openbsd.org
2765 is a work-in-progress and some features remain to be implemented.
2767 At present, the user has to fall back on
2769 to perform some tasks.
2773 Reading from remote repositories over HTTP or HTTPS protocols requires
2778 Writing to remote repositories over HTTP or HTTPS protocols requires
2781 The creation of merge commits, i.e. commits with two or more parent commits,
2785 In situations where files or directories were moved around
2787 will not automatically merge changes to new locations and
2789 will usually produce better results.