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 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.
714 Cannot be used together with the
717 .It Fl S Ar status-codes
718 Suppress the output of files with a modification status matching any of the
719 single-character status codes contained in the
722 Any combination of codes from the above list of possible status codes
724 For staged files, status codes displayed in either column will be matched.
725 Cannot be used together with the
730 For compatibility with
741 files in each traversed directory and will not display unversioned files
742 which match these patterns.
747 supports consecutive asterisks,
749 which will match an arbitrary amount of directories.
753 only supports a single ignore pattern per line.
757 does not support negated ignore patterns prefixed with
759 and gives no special significance to the location of path component separators,
765 .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
766 Display history of a repository.
769 is specified, show only commits which modified this path.
770 If invoked in a work tree, the
772 is interpreted relative to the current working directory,
773 and the work tree's path prefix is implicitly prepended.
774 Otherwise, the path is interpreted relative to the repository root.
781 Display individual commits which were merged into the current branch
785 shows the linear history of the current branch only.
787 Start traversing history at the specified
789 The expected argument is a commit ID SHA1 hash or an existing reference
790 or tag name which will be resolved to a commit ID.
791 An abbreviated hash argument will be expanded to a full SHA1 hash
792 automatically, provided the abbreviation is unique.
793 If this option is not specified, default to the work tree's current branch
794 if invoked in a work tree, or to the repository's HEAD reference.
796 Set the number of context lines shown in diffs with
798 By default, 3 lines of context are shown.
800 Limit history traversal to a given number of commits.
801 If this option is not specified, a default limit value of zero is used,
802 which is treated as an unbounded limit.
804 .Ev GOT_LOG_DEFAULT_LIMIT
805 environment variable may be set to change this default value.
807 Display the patch of modifications made in each commit.
810 is specified, only show the patch of modifications at or within this path.
812 Display the list of file paths changed in each commit, using the following
814 .Bl -column YXZ description
815 .It M Ta modified file
816 .It D Ta file was deleted
817 .It A Ta new file was added
818 .It m Ta modified file modes (executable bit only)
820 .It Fl s Ar search-pattern
821 If specified, show only commits with a log message matched by the extended
824 When used together with
826 then the file paths changed by a commit can be matched as well.
827 Regular expression syntax is documented in
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 Determine a set of commits to display as usual, but display these commits
840 Stop traversing commit history immediately after the specified
843 This option has no effect if the specified
847 .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
848 When invoked within a work tree with less than two arguments, display
849 local changes in the work tree.
852 is specified, only show changes within this path.
854 If two arguments are provided, treat each argument as a reference, a tag
855 name, or an object ID SHA1 hash, and display differences between the
856 corresponding objects.
857 Both objects must be of the same type (blobs, trees, or commits).
858 An abbreviated hash argument will be expanded to a full SHA1 hash
859 automatically, provided the abbreviation is unique.
866 Treat file contents as ASCII text even if binary data is detected.
868 Set the number of context lines shown in the diff.
869 By default, 3 lines of context are shown.
870 .It Fl r Ar repository-path
871 Use the repository at the specified path.
872 If not specified, assume the repository is located at or above the current
874 If this directory is a
876 work tree, use the repository path associated with this work tree.
878 Show changes staged with
880 instead of showing local changes in the work tree.
881 This option is only valid when
883 is invoked in a work tree.
885 Ignore whitespace-only changes.
890 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
891 Display line-by-line history of a file at the specified path.
898 Start traversing history at the specified
900 The expected argument is a commit ID SHA1 hash or an existing reference
901 or tag name which will be resolved to a commit ID.
902 An abbreviated hash argument will be expanded to a full SHA1 hash
903 automatically, provided the abbreviation is unique.
904 .It Fl r Ar repository-path
905 Use the repository at the specified path.
906 If not specified, assume the repository is located at or above the current
908 If this directory is a
910 work tree, use the repository path associated with this work tree.
915 .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
916 Display a listing of files and directories at the specified
917 directory path in the repository.
918 Entries shown in this listing may carry one of the following trailing
920 .Bl -column YXZ description
921 .It @ Ta entry is a symbolic link
922 .It / Ta entry is a directory
923 .It * Ta entry is an executable file
924 .It $ Ta entry is a Git submodule
927 Symbolic link entries are also annotated with the target path of the link.
931 is specified, list the repository path corresponding to the current
932 directory of the work tree, or the root directory of the repository
933 if there is no work tree.
940 List files and directories as they appear in the specified
942 The expected argument is a commit ID SHA1 hash or an existing reference
943 or tag name which will be resolved to a commit ID.
944 An abbreviated hash argument will be expanded to a full SHA1 hash
945 automatically, provided the abbreviation is unique.
946 .It Fl r Ar repository-path
947 Use the repository at the specified path.
948 If not specified, assume the repository is located at or above the current
950 If this directory is a
952 work tree, use the repository path associated with this work tree.
954 Show object IDs of files (blob objects) and directories (tree objects).
956 Recurse into sub-directories in the repository.
961 .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
962 Manage references in a repository.
964 References may be listed, created, deleted, and changed.
965 When creating, deleting, or changing a reference the specified
967 must be an absolute reference name, i.e. it must begin with
974 .It Fl r Ar repository-path
975 Use the repository at the specified path.
976 If not specified, assume the repository is located at or above the current
978 If this directory is a
980 work tree, use the repository path associated with this work tree.
982 List references in the repository.
985 is specified, list all existing references in the repository.
988 is a reference namespace, list all references in this namespace.
989 Otherwise, show only the reference with the given
991 Cannot be used together with any other options except
994 Create a reference or change an existing reference.
995 The reference with the specified
997 will point at the specified
1001 argument is a ID SHA1 hash or an existing reference or tag name which will
1002 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
1003 Cannot be used together with any other options except
1005 .It Fl s Ar reference
1006 Create a symbolic reference, or change an existing symbolic reference.
1007 The symbolic reference with the specified
1009 will point at the specified
1011 which must already exist in the repository.
1012 Care should be taken not to create loops between references when
1013 this option is used.
1014 Cannot be used together with any other options except
1017 Delete the reference with the specified
1019 from the repository.
1020 Any commit, tree, tag, and blob objects belonging to deleted references
1021 remain in the repository and may be removed separately with
1022 Git's garbage collector or
1023 .Cm gotadmin cleanup .
1024 Cannot be used together with any other options except
1027 .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
1028 Create, list, or delete branches.
1030 Local branches are managed via references which live in the
1032 reference namespace.
1035 command creates references in this namespace only.
1037 When deleting branches the specified
1041 reference namespace first.
1042 If no corresponding branch is found the
1044 namespace will be searched next.
1046 If invoked in a work tree without any arguments, print the name of the
1047 work tree's current branch.
1051 argument is passed, attempt to create a branch reference with the given name.
1052 By default the new branch reference will point at the latest commit on the
1053 work tree's current branch if invoked in a work tree, and otherwise to a commit
1054 resolved via the repository's HEAD reference.
1056 If invoked in a work tree, once the branch was created successfully
1057 switch the work tree's head reference to the newly created branch and
1058 update files across the entire work tree, just like
1059 .Cm got update -b Ar name
1061 Show the status of each affected file, using the following status codes:
1062 .Bl -column YXZ description
1063 .It U Ta file was updated and contained no local changes
1064 .It G Ta file was updated and local changes were merged cleanly
1065 .It C Ta file was updated and conflicts occurred during merge
1066 .It D Ta file was deleted
1067 .It A Ta new file was added
1068 .It \(a~ Ta versioned file is obstructed by a non-regular file
1069 .It ! Ta a missing versioned file was restored
1077 Make a newly created branch reference point at the specified
1081 argument is a commit ID SHA1 hash or an existing reference
1082 or tag name which will be resolved to a commit ID.
1083 .It Fl r Ar repository-path
1084 Use the repository at the specified path.
1085 If not specified, assume the repository is located at or above the current
1087 If this directory is a
1089 work tree, use the repository path associated with this work tree.
1091 List all existing branches in the repository, including copies of remote
1092 repositories' branches in the
1094 reference namespace.
1096 If invoked in a work tree, the work tree's current branch is shown
1097 with one the following annotations:
1098 .Bl -column YXZ description
1099 .It * Ta work tree's base commit matches the branch tip
1100 .It \(a~ Ta work tree's base commit is out-of-date
1103 Delete the branch with the specified
1109 reference namespace.
1111 Only the branch reference is deleted.
1112 Any commit, tree, and blob objects belonging to the branch
1113 remain in the repository and may be removed separately with
1114 Git's garbage collector or
1115 .Cm gotadmin cleanup .
1117 Do not switch and update the work tree after creating a new branch.
1122 .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
1123 Manage tags in a repository.
1125 Tags are managed via references which live in the
1127 reference namespace.
1130 command operates on references in this namespace only.
1131 References in this namespace point at tag objects which contain a pointer
1132 to another object, a tag message, as well as author and timestamp information.
1134 Attempt to create a tag with the given
1136 and make this tag point at the given
1138 If no commit is specified, default to the latest commit on the work tree's
1139 current branch if invoked in a work tree, and to a commit resolved via
1140 the repository's HEAD reference otherwise.
1147 Make the newly created tag reference point at the specified
1151 argument is a commit ID SHA1 hash or an existing reference or tag name which
1152 will be resolved to a commit ID.
1153 An abbreviated hash argument will be expanded to a full SHA1 hash
1154 automatically, provided the abbreviation is unique.
1156 Use the specified tag message when creating the new tag.
1161 opens a temporary file in an editor where a tag message can be written.
1162 .It Fl r Ar repository-path
1163 Use the repository at the specified path.
1164 If not specified, assume the repository is located at or above the current
1166 If this directory is a
1168 work tree, use the repository path associated with this work tree.
1170 List all existing tags in the repository instead of creating a new tag.
1171 If this option is used, no other command-line arguments are allowed.
1176 command will not delete tags or change existing tags.
1177 If a tag must be deleted, the
1179 command may be used to delete a tag's reference.
1180 This should only be done if the tag has not already been copied to
1182 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1183 Schedule unversioned files in a work tree for addition to the
1184 repository in the next commit.
1185 By default, files which match a
1187 ignore pattern will not be added.
1194 Permit recursion into directories.
1195 If this option is not specified,
1197 will refuse to run if a specified
1201 Add files even if they match a
1205 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
1206 Remove versioned files from a work tree and schedule them for deletion
1207 from the repository in the next commit.
1214 Perform the operation even if a file contains local modifications.
1216 Keep affected files on disk.
1218 Permit recursion into directories.
1219 If this option is not specified,
1221 will refuse to run if a specified
1224 .It Fl s Ar status-codes
1225 Only delete files with a modification status matching one of the
1226 single-character status codes contained in the
1229 The following status codes may be specified:
1230 .Bl -column YXZ description
1231 .It M Ta modified file (this implies the
1234 .It ! Ta versioned file expected on disk but missing
1240 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1241 Revert any local changes in files at the specified paths in a work tree.
1242 File contents will be overwritten with those contained in the
1243 work tree's base commit.
1244 There is no way to bring discarded changes back after
1247 If a file was added with
1249 it will become an unversioned file again.
1250 If a file was deleted with
1252 it will be restored.
1259 Instead of reverting all changes in files, interactively select or reject
1260 changes to revert based on
1266 (quit reverting this file) responses.
1267 If a file is in modified status, individual patches derived from the
1268 modified file content can be reverted.
1269 Files in added or deleted status may only be reverted in their entirety.
1270 .It Fl F Ar response-script
1278 responses line-by-line from the specified
1280 file instead of prompting interactively.
1282 Permit recursion into directories.
1283 If this option is not specified,
1285 will refuse to run if a specified
1292 .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 ...
1293 Create a new commit in the repository from changes in a work tree
1294 and use this commit as the new base commit for the work tree.
1297 is specified, commit all changes in the work tree.
1298 Otherwise, commit changes at or within the specified paths.
1300 If changes have been explicitly staged for commit with
1302 only commit staged changes and reject any specified paths which
1303 have not been staged.
1306 opens a temporary file in an editor where a log message can be written
1314 options are used together.
1316 Show the status of each affected file, using the following status codes:
1317 .Bl -column YXZ description
1318 .It M Ta modified file
1319 .It D Ta file was deleted
1320 .It A Ta new file was added
1321 .It m Ta modified file modes (executable bit only)
1324 Files which are not part of the new commit will retain their previously
1325 recorded base commit.
1328 commands may refuse to run while the work tree contains files from
1329 multiple base commits.
1330 The base commit of such a work tree can be made consistent by running
1332 across the entire work tree.
1336 command requires the
1338 environment variable to be set,
1339 unless an author has been configured in
1345 configuration settings can be
1346 obtained from the repository's
1348 file or from Git's global
1357 Use the prepared log message stored in the file found at
1359 when creating the new commit.
1361 opens a temporary file in an editor where the prepared log message can be
1362 reviewed and edited further if needed.
1363 Cannot be used together with the
1367 Use the specified log message when creating the new commit.
1368 Cannot be used together with the
1372 This option prevents
1374 from opening the commit message in an editor.
1375 It has no effect unless it is used together with the
1377 option and is intended for non-interactive use such as scripting.
1379 Allow the addition of symbolic links which point outside of the path space
1380 that is under version control.
1383 will reject such symbolic links due to safety concerns.
1386 may decide to represent such a symbolic link as a regular file which contains
1387 the link's target path, rather than creating an actual symbolic link which
1388 points outside of the work tree.
1389 Use of this option is discouraged because external mechanisms such as
1391 are better suited for managing symbolic links to paths not under
1396 will refuse to run if certain preconditions are not met.
1397 If the work tree's current branch is not in the
1399 reference namespace, new commits may not be created on this branch.
1400 Local changes may only be committed if they are based on file content
1401 found in the most recent commit on the work tree's branch.
1402 If a path is found to be out of date,
1404 must be used first in order to merge local changes with changes made
1409 .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
1410 Send new changes to a remote repository.
1412 .Ar remote-repository
1416 The remote repository's URL is obtained from the corresponding entry in
1420 file of the local repository, as created by
1423 All objects corresponding to new changes will be written to a temporary
1424 pack file which is then uploaded to the server.
1425 Upon success, references in the
1427 reference namespace of the local repository will be updated to point at
1428 the commits which have been sent.
1430 By default, changes will only be sent if they are based on up-to-date
1431 copies of relevant branches in the remote repository.
1432 If any changes to be sent are based on out-of-date copies or would
1433 otherwise break linear history of existing branches, new changes must
1434 be fetched from the server with
1436 and local branches must be rebased with
1443 option can be used to make exceptions to these requirements.
1450 Send all branches from the local repository's
1452 reference namespace.
1455 option is equivalent to listing all branches with multiple
1458 Cannot be used together with the
1464 from the local repository's
1466 reference namespace.
1467 This option may be specified multiple times to build a list of branches
1469 If this option is not specified, default to the work tree's current branch
1470 if invoked in a work tree, or to the repository's HEAD reference.
1471 Cannot be used together with the
1475 Delete the specified
1477 from the remote repository's
1479 reference namespace.
1480 This option may be specified multiple times to build a list of branches
1483 Only references are deleted.
1484 Any commit, tree, tag, and blob objects belonging to deleted branches
1485 may become subject to deletion by Git's garbage collector running on
1488 Requesting deletion of branches results in an error if the server
1489 does not support this feature or disallows the deletion of branches
1490 based on its configuration.
1492 Attempt to force the server to overwrite existing branches or tags
1493 in the remote repository, even when
1497 would usually be required before changes can be sent.
1498 The server may reject forced requests regardless, depending on its
1501 Any commit, tree, tag, and blob objects belonging to overwritten branches
1502 or tags may become subject to deletion by Git's garbage collector running
1507 reference namespace is globally shared between all repositories.
1510 option to overwrite tags is discouraged because it can lead to
1511 inconsistencies between the tags present in different repositories.
1512 In general, creating a new tag with a different name is recommended
1513 instead of overwriting an existing tag.
1517 option is particularly discouraged if changes being sent are based
1518 on an out-of-date copy of a branch in the remote repository.
1519 Instead of using the
1521 option, new changes should
1524 and local branches should be rebased with
1526 followed by another attempt to send the changes.
1530 option should only be needed in situations where the remote repository's
1531 copy of a branch or tag is known to be out-of-date and is considered
1533 The risks of creating inconsistencies between different repositories
1534 should also be taken into account.
1535 .It Fl r Ar repository-path
1536 Use the repository at the specified path.
1537 If not specified, assume the repository is located at or above the current
1539 If this directory is a
1541 work tree, use the repository path associated with this work tree.
1545 from the local repository's
1547 reference namespace, in addition to any branches that are being sent.
1550 option may be specified multiple times to build a list of tags to send.
1551 No tags will be sent if the
1555 Raise an error if the specified
1557 already exists in the remote repository, unless the
1559 option is used to overwrite the server's copy of the tag.
1560 In general, creating a new tag with a different name is recommended
1561 instead of overwriting an existing tag.
1563 Cannot be used together with the
1567 Attempt to send all tags from the local repository's
1569 reference namespace.
1572 option is equivalent to listing all tags with multiple
1575 Cannot be used together with the
1579 Suppress progress reporting output.
1580 The same option will be passed to
1587 to print debugging messages to standard error output.
1588 The same option will be passed to
1591 Multiple -v options increase the verbosity.
1597 .It Cm cherrypick Ar commit
1598 Merge changes from a single
1603 should be on a different branch than the work tree's base commit.
1604 The expected argument is a reference or a commit ID SHA1 hash.
1605 An abbreviated hash argument will be expanded to a full SHA1 hash
1606 automatically, provided the abbreviation is unique.
1608 Show the status of each affected file, using the following status codes:
1609 .Bl -column YXZ description
1610 .It G Ta file was merged
1611 .It C Ta file was merged and conflicts occurred during merge
1612 .It ! Ta changes destined for a missing file were not merged
1613 .It D Ta file was deleted
1614 .It d Ta file's deletion was prevented by local modifications
1615 .It A Ta new file was added
1616 .It \(a~ Ta changes destined for a non-regular file were not merged
1617 .It ? Ta changes destined for an unversioned file were not merged
1620 The merged changes will appear as local changes in the work tree, which
1623 amended manually or with further
1628 or discarded again with
1632 will refuse to run if certain preconditions are not met.
1633 If the work tree contains multiple base commits it must first be updated
1634 to a single base commit with
1636 If any relevant files already contain merge conflicts, these
1637 conflicts must be resolved first.
1641 .It Cm backout Ar commit
1642 Reverse-merge changes from a single
1647 should be on the same branch as the work tree's base commit.
1648 The expected argument is a reference or a commit ID SHA1 hash.
1649 An abbreviated hash argument will be expanded to a full SHA1 hash
1650 automatically, provided the abbreviation is unique.
1652 Show the status of each affected file, using the following status codes:
1653 .Bl -column YXZ description
1654 .It G Ta file was merged
1655 .It C Ta file was merged and conflicts occurred during merge
1656 .It ! Ta changes destined for a missing file were not merged
1657 .It D Ta file was deleted
1658 .It d Ta file's deletion was prevented by local modifications
1659 .It A Ta new file was added
1660 .It \(a~ Ta changes destined for a non-regular file were not merged
1661 .It ? Ta changes destined for an unversioned file were not merged
1664 The reverse-merged changes will appear as local changes in the work tree,
1665 which may be viewed with
1667 amended manually or with further
1672 or discarded again with
1676 will refuse to run if certain preconditions are not met.
1677 If the work tree contains multiple base commits it must first be updated
1678 to a single base commit with
1680 If any relevant files already contain merge conflicts, these
1681 conflicts must be resolved first.
1685 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Oo Fl l Oc Oo Fl X Oc Op Ar branch
1686 Rebase commits on the specified
1688 onto the tip of the current branch of the work tree.
1691 must share common ancestry with the work tree's current branch.
1692 Rebasing begins with the first descendant commit of the youngest
1693 common ancestor commit shared by the specified
1695 and the work tree's current branch, and stops once the tip commit
1702 is used as intended, the specified
1704 represents a local commit history and may already contain changes
1705 that are not yet visible in any other repositories.
1706 The work tree's current branch, which must be set with
1710 operation, represents a branch from a remote repository which shares
1711 a common history with the specified
1713 but has progressed, and perhaps diverged, due to commits added to the
1716 Rebased commits are accumulated on a temporary branch which the work tree
1717 will remain switched to throughout the entire rebase operation.
1718 Commits on this branch represent the same changes with the same log
1719 messages as their counterparts on the original
1721 but with different commit IDs.
1722 Once rebasing has completed successfully, the temporary branch becomes
1723 the new version of the specified
1725 and the work tree is automatically switched to it.
1727 Old commits in their pre-rebase state are automatically backed up in the
1728 .Dq refs/got/backup/rebase
1729 reference namespace.
1730 As long as these references are not removed older versions of rebased
1731 commits will remain in the repository and can be viewed with the
1734 Removal of these references makes objects which become unreachable via
1735 any reference subject to removal by Git's garbage collector or
1736 .Cm gotadmin cleanup .
1738 While rebasing commits, show the status of each affected file,
1739 using the following status codes:
1740 .Bl -column YXZ description
1741 .It G Ta file was merged
1742 .It C Ta file was merged and conflicts occurred during merge
1743 .It ! Ta changes destined for a missing file were not merged
1744 .It D Ta file was deleted
1745 .It d Ta file's deletion was prevented by local modifications
1746 .It A Ta new file was added
1747 .It \(a~ Ta changes destined for a non-regular file were not merged
1748 .It ? Ta changes destined for an unversioned file were not merged
1751 If merge conflicts occur the rebase operation is interrupted and may
1752 be continued once conflicts have been resolved.
1753 If any files with destined changes are found to be missing or unversioned,
1754 or if files could not be deleted due to differences in deleted content,
1755 the rebase operation will be interrupted to prevent potentially incomplete
1756 changes from being committed to the repository without user intervention.
1757 The work tree may be modified as desired and the rebase operation can be
1758 continued once the changes present in the work tree are considered complete.
1759 Alternatively, the rebase operation may be aborted which will leave
1761 unmodified and the work tree switched back to its original branch.
1763 If a merge conflict is resolved in a way which renders the merged
1764 change into a no-op change, the corresponding commit will be elided
1765 when the rebase operation continues.
1768 will refuse to run if certain preconditions are not met.
1769 If the work tree is not yet fully updated to the tip commit of its
1770 branch then the work tree must first be updated with
1772 If changes have been staged with
1774 these changes must first be committed with
1778 If the work tree contains local changes, these changes must first be
1785 contains changes to files outside of the work tree's path prefix,
1786 the work tree cannot be used to rebase this branch.
1792 commands will refuse to run while a rebase operation is in progress.
1793 Other commands which manipulate the work tree may be used for
1794 conflict resolution purposes.
1801 Abort an interrupted rebase operation.
1802 If this option is used, no other command-line arguments are allowed.
1804 Continue an interrupted rebase operation.
1805 If this option is used, no other command-line arguments are allowed.
1807 Show a list of past rebase operations, represented by references in the
1808 .Dq refs/got/backup/rebase
1809 reference namespace.
1811 Display the author, date, and log message of each backed up commit,
1812 the object ID of the corresponding post-rebase commit, and
1813 the object ID of their common ancestor commit.
1814 Given these object IDs,
1821 options can be used to examine the history of either version of the branch,
1826 option can be used to create a new branch from a pre-rebase state if desired.
1830 is specified, only show commits which at some point in time represented this
1832 Otherwise, list all backed up commits for any branches.
1834 If this option is used,
1836 does not require a work tree.
1837 None of the other options can be used together with
1840 Delete backups created by past rebase operations, represented by references
1842 .Dq refs/got/backup/rebase
1843 reference namespace.
1847 is specified, only delete backups which at some point in time represented
1849 Otherwise, delete all references found within
1850 .Dq refs/got/backup/rebase .
1852 Any commit, tree, tag, and blob objects belonging to deleted backups
1853 remain in the repository and may be removed separately with
1854 Git's garbage collector or
1855 .Cm gotadmin cleanup .
1857 If this option is used,
1859 does not require a work tree.
1860 None of the other options can be used together with
1866 .It Cm histedit Oo Fl a Oc Oo Fl c Oc Oo Fl e 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
1867 Edit commit history between the work tree's current base commit and
1868 the tip commit of the work tree's current branch.
1872 operation the work tree's current branch must be set with
1874 to the branch which should be edited, unless this branch is already the
1875 current branch of the work tree.
1876 The tip of this branch represents the upper bound (inclusive) of commits
1881 Furthermore, the work tree's base commit
1884 to a point in this branch's commit history where editing should begin.
1885 This commit represents the lower bound (non-inclusive) of commits touched
1890 Editing of commit history is controlled via a
1892 which can be written in an editor based on a template, passed on the
1893 command line, or generated with the
1899 The format of the histedit script is line-based.
1900 Each line in the script begins with a command name, followed by
1901 whitespace and an argument.
1902 For most commands, the expected argument is a commit ID SHA1 hash.
1903 Any remaining text on the line is ignored.
1904 Lines which begin with the
1906 character are ignored entirely.
1908 The available commands are as follows:
1909 .Bl -column YXZ pick-commit
1910 .It pick Ar commit Ta Use the specified commit as it is.
1911 .It edit Ar commit Ta Use the specified commit but once changes have been
1912 merged into the work tree interrupt the histedit operation for amending.
1913 .It fold Ar commit Ta Combine the specified commit with the next commit
1914 listed further below that will be used.
1915 .It drop Ar commit Ta Remove this commit from the edited history.
1916 .It mesg Ar log-message Ta Use the specified single-line log message for
1917 the commit on the previous line.
1918 If the log message argument is left empty, open an editor where a new
1919 log message can be written.
1922 Every commit in the history being edited must be mentioned in the script.
1923 Lines may be re-ordered to change the order of commits in the edited history.
1924 No commit may be listed more than once.
1926 Edited commits are accumulated on a temporary branch which the work tree
1927 will remain switched to throughout the entire histedit operation.
1928 Once history editing has completed successfully, the temporary branch becomes
1929 the new version of the work tree's branch and the work tree is automatically
1932 Old commits in their pre-histedit state are automatically backed up in the
1933 .Dq refs/got/backup/histedit
1934 reference namespace.
1935 As long as these references are not removed older versions of edited
1936 commits will remain in the repository and can be viewed with the
1939 Removal of these references makes objects which become unreachable via
1940 any reference subject to removal by Git's garbage collector or
1941 .Cm gotadmin cleanup .
1943 While merging commits, show the status of each affected file,
1944 using the following status codes:
1945 .Bl -column YXZ description
1946 .It G Ta file was merged
1947 .It C Ta file was merged and conflicts occurred during merge
1948 .It ! Ta changes destined for a missing file were not merged
1949 .It D Ta file was deleted
1950 .It d Ta file's deletion was prevented by local modifications
1951 .It A Ta new file was added
1952 .It \(a~ Ta changes destined for a non-regular file were not merged
1953 .It ? Ta changes destined for an unversioned file were not merged
1956 If merge conflicts occur the histedit operation is interrupted and may
1957 be continued once conflicts have been resolved.
1958 If any files with destined changes are found to be missing or unversioned,
1959 or if files could not be deleted due to differences in deleted content,
1960 the histedit operation will be interrupted to prevent potentially incomplete
1961 changes from being committed to the repository without user intervention.
1962 The work tree may be modified as desired and the histedit operation can be
1963 continued once the changes present in the work tree are considered complete.
1964 Alternatively, the histedit operation may be aborted which will leave
1965 the work tree switched back to its original branch.
1967 If a merge conflict is resolved in a way which renders the merged
1968 change into a no-op change, the corresponding commit will be elided
1969 when the histedit operation continues.
1972 will refuse to run if certain preconditions are not met.
1973 If the work tree's current branch is not in the
1975 reference namespace, the history of the branch may not be edited.
1976 If the work tree contains multiple base commits it must first be updated
1977 to a single base commit with
1979 If changes have been staged with
1981 these changes must first be committed with
1985 If the work tree contains local changes, these changes must first be
1990 If the edited history contains changes to files outside of the work tree's
1991 path prefix, the work tree cannot be used to edit the history of this branch.
1998 commands will refuse to run while a histedit operation is in progress.
1999 Other commands which manipulate the work tree may be used, and the
2001 command may be used to commit arbitrary changes to the temporary branch
2002 while the histedit operation is interrupted.
2009 Abort an interrupted histedit operation.
2010 If this option is used, no other command-line arguments are allowed.
2012 Continue an interrupted histedit operation.
2013 If this option is used, no other command-line arguments are allowed.
2015 Interrupt the histedit operation for editing after merging each commit.
2016 This option is a quick equivalent to a histedit script which uses the
2018 command for all commits.
2021 option can only be used when starting a new histedit operation.
2022 If this option is used, no other command-line arguments are allowed.
2024 Fold all commits into a single commit.
2025 This option is a quick equivalent to a histedit script which folds all
2026 commits, combining them all into one commit.
2029 option can only be used when starting a new histedit operation.
2030 If this option is used, no other command-line arguments are allowed.
2031 .It Fl F Ar histedit-script
2034 instead of opening a temporary file in an editor where a histedit script
2037 Edit log messages only.
2038 This option is a quick equivalent to a histedit script which edits
2039 only log messages but otherwise leaves every picked commit as-is.
2042 option can only be used when starting a new histedit operation.
2043 If this option is used, no other command-line arguments are allowed.
2045 Show a list of past histedit operations, represented by references in the
2046 .Dq refs/got/backup/histedit
2047 reference namespace.
2049 Display the author, date, and log message of each backed up commit,
2050 the object ID of the corresponding post-histedit commit, and
2051 the object ID of their common ancestor commit.
2052 Given these object IDs,
2059 options can be used to examine the history of either version of the branch,
2064 option can be used to create a new branch from a pre-histedit state if desired.
2068 is specified, only show commits which at some point in time represented this
2070 Otherwise, list all backed up commits for any branches.
2072 If this option is used,
2074 does not require a work tree.
2075 None of the other options can be used together with
2078 Delete backups created by past histedit operations, represented by references
2080 .Dq refs/got/backup/histedit
2081 reference namespace.
2085 is specified, only delete backups which at some point in time represented
2087 Otherwise, delete all references found within
2088 .Dq refs/got/backup/histedit .
2090 Any commit, tree, tag, and blob objects belonging to deleted backups
2091 remain in the repository and may be removed separately with
2092 Git's garbage collector or
2093 .Cm gotadmin cleanup .
2095 If this option is used,
2097 does not require a work tree.
2098 None of the other options can be used together with
2104 .It Cm integrate Ar branch
2105 Integrate the specified
2107 into the work tree's current branch.
2108 Files in the work tree are updated to match the contents on the integrated
2110 and the reference of the work tree's branch is changed to point at the
2111 head commit of the integrated
2114 Both branches can be considered equivalent after integration since they
2115 will be pointing at the same commit.
2116 Both branches remain available for future work, if desired.
2117 In case the integrated
2119 is no longer needed it may be deleted with
2122 Show the status of each affected file, using the following status codes:
2123 .Bl -column YXZ description
2124 .It U Ta file was updated
2125 .It D Ta file was deleted
2126 .It A Ta new file was added
2127 .It \(a~ Ta versioned file is obstructed by a non-regular file
2128 .It ! Ta a missing versioned file was restored
2132 will refuse to run if certain preconditions are not met.
2133 Most importantly, the
2135 must have been rebased onto the work tree's current branch with
2137 before it can be integrated, in order to linearize commit history and
2138 resolve merge conflicts.
2139 If the work tree contains multiple base commits it must first be updated
2140 to a single base commit with
2142 If changes have been staged with
2144 these changes must first be committed with
2148 If the work tree contains local changes, these changes must first be
2156 .It Cm merge Oo Fl a Oc Oo Fl c Oc Oo Fl n Oc Op Ar branch
2157 Create a merge commit based on the current branch of the work tree and
2160 If a linear project history is desired, then use of
2162 should be preferred over
2164 However, even strictly linear projects may require merge commits in order
2165 to merge in new versions of third-party code stored on vendor branches
2169 Merge commits are commits based on multiple parent commits.
2170 The tip commit of the work tree's current branch, which must be set with
2174 operation, will be used as the first parent.
2175 The tip commit of the specified
2177 will be used as the second parent.
2179 No ancestral relationship between the two branches is required.
2180 If the two branches have already been merged previously, only new changes
2183 It is not possible to create merge commits with more than two parents.
2184 If more than one branch needs to be merged, then multiple merge commits
2185 with two parents each can be created in sequence.
2187 While merging changes found on the
2189 into the work tree, show the status of each affected file,
2190 using the following status codes:
2191 .Bl -column YXZ description
2192 .It G Ta file was merged
2193 .It C Ta file was merged and conflicts occurred during merge
2194 .It ! Ta changes destined for a missing file were not merged
2195 .It D Ta file was deleted
2196 .It d Ta file's deletion was prevented by local modifications
2197 .It A Ta new file was added
2198 .It \(a~ Ta changes destined for a non-regular file were not merged
2199 .It ? Ta changes destined for an unversioned file were not merged
2202 If merge conflicts occur, the merge operation is interrupted and conflicts
2203 must be resolved before the merge operation can continue.
2204 If any files with destined changes are found to be missing or unversioned,
2205 or if files could not be deleted due to differences in deleted content,
2206 the merge operation will be interrupted to prevent potentially incomplete
2207 changes from being committed to the repository without user intervention.
2208 The work tree may be modified as desired and the merge can be continued
2209 once the changes present in the work tree are considered complete.
2210 Alternatively, the merge operation may be aborted which will leave
2211 the work tree's current branch unmodified.
2213 If a merge conflict is resolved in a way which renders all merged
2214 changes into no-op changes, the merge operation cannot continue
2215 and must be aborted.
2218 will refuse to run if certain preconditions are not met.
2221 is based on the work tree's current branch, then no merge commit can
2224 may be used to integrate the
2227 If the work tree is not yet fully updated to the tip commit of its
2228 branch, then the work tree must first be updated with
2230 If the work tree contains multiple base commits it must first be updated
2231 to a single base commit with
2233 If changes have been staged with
2235 these changes must first be committed with
2239 If the work tree contains local changes, these changes must first be
2246 contains changes to files outside of the work tree's path prefix,
2247 the work tree cannot be used to merge this branch.
2257 commands will refuse to run while a merge operation is in progress.
2258 Other commands which manipulate the work tree may be used for
2259 conflict resolution purposes.
2266 Abort an interrupted merge operation.
2267 If this option is used, no other command-line arguments are allowed.
2269 Continue an interrupted merge operation.
2270 If this option is used, no other command-line arguments are allowed.
2272 Merge changes into the work tree as usual but do not create a merge
2274 The merge result can be adjusted as desired before a merge commit is
2277 Alternatively, the merge may be aborted with
2283 .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 ...
2284 Stage local changes for inclusion in the next commit.
2287 is specified, stage all changes in the work tree.
2288 Otherwise, stage changes at or within the specified paths.
2289 Paths may be staged if they are added, modified, or deleted according to
2292 Show the status of each affected file, using the following status codes:
2293 .Bl -column YXZ description
2294 .It A Ta file addition has been staged
2295 .It M Ta file modification has been staged
2296 .It D Ta file deletion has been staged
2299 Staged file contents are saved in newly created blob objects in the repository.
2300 These blobs will be referred to by tree objects once staged changes have been
2303 Staged changes affect the behaviour of
2308 While paths with staged changes exist, the
2310 command will refuse to commit any paths which do not have staged changes.
2311 Local changes created on top of staged changes can only be committed if
2312 the path is staged again, or if the staged changes are committed first.
2315 command will show both local changes and staged changes.
2318 command is able to display local changes relative to staged changes,
2319 and to display staged changes relative to the repository.
2322 command cannot revert staged changes but may be used to revert
2323 local changes created on top of staged changes.
2330 Instead of staging new changes, list paths which are already staged,
2331 along with the IDs of staged blob objects and stage status codes.
2332 If paths were provided in the command line show the staged paths
2333 among the specified paths.
2334 Otherwise, show all staged paths.
2336 Instead of staging the entire content of a changed file, interactively
2337 select or reject changes for staging based on
2341 (reject change), and
2343 (quit staging this file) responses.
2344 If a file is in modified status, individual patches derived from the
2345 modified file content can be staged.
2346 Files in added or deleted status may only be staged or rejected in
2348 .It Fl F Ar response-script
2356 responses line-by-line from the specified
2358 file instead of prompting interactively.
2360 Allow staging of symbolic links which point outside of the path space
2361 that is under version control.
2364 will reject such symbolic links due to safety concerns.
2367 may decide to represent such a symbolic link as a regular file which contains
2368 the link's target path, rather than creating an actual symbolic link which
2369 points outside of the work tree.
2370 Use of this option is discouraged because external mechanisms such as
2372 are better suited for managing symbolic links to paths not under
2377 will refuse to run if certain preconditions are not met.
2378 If a file contains merge conflicts, these conflicts must be resolved first.
2379 If a file is found to be out of date relative to the head commit on the
2380 work tree's current branch, the file must be updated with
2382 before it can be staged (however, this does not prevent the file from
2383 becoming out-of-date at some point after having been staged).
2390 commands will refuse to run while staged changes exist.
2391 If staged changes cannot be committed because a staged path
2392 is out of date, the path must be unstaged with
2394 before it can be updated with
2396 and may then be staged again if necessary.
2400 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
2401 Merge staged changes back into the work tree and put affected paths
2402 back into non-staged status.
2405 is specified, unstage all staged changes across the entire work tree.
2406 Otherwise, unstage changes at or within the specified paths.
2408 Show the status of each affected file, using the following status codes:
2409 .Bl -column YXZ description
2410 .It G Ta file was unstaged
2411 .It C Ta file was unstaged and conflicts occurred during merge
2412 .It ! Ta changes destined for a missing file were not merged
2413 .It D Ta file was staged as deleted and still is deleted
2414 .It d Ta file's deletion was prevented by local modifications
2415 .It \(a~ Ta changes destined for a non-regular file were not merged
2423 Instead of unstaging the entire content of a changed file, interactively
2424 select or reject changes for unstaging based on
2428 (keep change staged), and
2430 (quit unstaging this file) responses.
2431 If a file is staged in modified status, individual patches derived from the
2432 staged file content can be unstaged.
2433 Files staged in added or deleted status may only be unstaged in their entirety.
2434 .It Fl F Ar response-script
2442 responses line-by-line from the specified
2444 file instead of prompting interactively.
2449 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
2450 Parse and print contents of objects to standard output in a line-based
2452 Content of commit, tree, and tag objects is printed in a way similar
2453 to the actual content stored in such objects.
2454 Blob object contents are printed as they would appear in files on disk.
2456 Attempt to interpret each argument as a reference, a tag name, or
2457 an object ID SHA1 hash.
2458 References will be resolved to an object ID.
2459 Tag names will resolved to a tag object.
2460 An abbreviated hash argument will be expanded to a full SHA1 hash
2461 automatically, provided the abbreviation is unique.
2463 If none of the above interpretations produce a valid result, or if the
2465 option is used, attempt to interpret the argument as a path which will
2466 be resolved to the ID of an object found at this path in the repository.
2473 Look up paths in the specified
2475 If this option is not used, paths are looked up in the commit resolved
2476 via the repository's HEAD reference.
2477 The expected argument is a commit ID SHA1 hash or an existing reference
2478 or tag name which will be resolved to a commit ID.
2479 An abbreviated hash argument will be expanded to a full SHA1 hash
2480 automatically, provided the abbreviation is unique.
2481 .It Fl r Ar repository-path
2482 Use the repository at the specified path.
2483 If not specified, assume the repository is located at or above the current
2485 If this directory is a
2487 work tree, use the repository path associated with this work tree.
2489 Interpret all arguments as paths only.
2490 This option can be used to resolve ambiguity in cases where paths
2491 look like tag names, reference names, or object IDs.
2493 .It Cm info Op Ar path ...
2494 Display meta-data stored in a work tree.
2499 The work tree to use is resolved implicitly by walking upwards from the
2500 current working directory.
2504 arguments are specified, show additional per-file information for tracked
2505 files located at or within these paths.
2508 argument corresponds to the work tree's root directory, display information
2509 for all tracked files.
2512 .Bl -tag -width GOT_AUTHOR
2514 The author's name and email address for
2519 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
2522 may fail to parse commits without an email address in author data,
2526 environment variables with a missing email address.
2528 .Ev GOT_AUTHOR will be overridden by configuration settings in
2534 configuration settings in the repository's
2541 configuration settings contained in Git's global
2543 configuration file will only be used if neither
2547 environment variable provide author information.
2548 .It Ev VISUAL , EDITOR
2549 The editor spawned by
2557 text editor will be spawned in order to give
2559 the attention it deserves.
2560 .It Ev GOT_LOG_DEFAULT_LIMIT
2561 The default limit on the number of commits traversed by
2563 If set to zero, the limit is unbounded.
2564 This variable will be silently ignored if it is set to a non-numeric value.
2567 .Bl -tag -width packed-refs -compact
2569 Repository-wide configuration settings for
2573 configuration file located in the root directory of a Git repository
2574 supersedes any relevant settings in Git's
2578 .It Pa .got/got.conf
2579 Worktree-specific configuration settings for
2583 configuration file in the
2585 meta-data directory of a work tree supersedes any relevant settings in
2588 configuration file and Git's
2595 Enable tab-completion of
2600 .Dl $ set -A complete_got_1 -- $(got -h 2>&1 | sed -n s/commands://p)
2602 Clone an existing Git repository for use with
2606 .Dl $ got clone ssh://git@github.com/openbsd/src.git
2608 Use of HTTP URLs currently requires
2612 .Dl $ git clone --bare https://github.com/openbsd/src.git
2614 Alternatively, for quick and dirty local testing of
2616 a new Git repository could be created and populated with files,
2617 e.g. from a temporary CVS checkout located at
2620 .Dl $ got init /var/git/src.git
2621 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
2623 Check out a work tree from the Git repository to /usr/src:
2625 .Dl $ got checkout /var/git/src.git /usr/src
2627 View local changes in a work tree directory:
2629 .Dl $ got diff | less
2631 In a work tree, display files in a potentially problematic state:
2633 .Dl $ got status -s 'C!~?'
2635 Interactively revert selected local changes in a work tree directory:
2637 .Dl $ got revert -p -R\ .
2639 In a work tree or a git repository directory, list all branch references:
2643 In a work tree or a git repository directory, create a new branch called
2644 .Dq unified-buffer-cache
2645 which is forked off the
2649 .Dl $ got branch -c master unified-buffer-cache
2651 Switch an existing work tree to the branch
2652 .Dq unified-buffer-cache .
2653 Local changes in the work tree will be preserved and merged if necessary:
2655 .Dl $ got update -b unified-buffer-cache
2657 Create a new commit from local changes in a work tree directory.
2658 This new commit will become the head commit of the work tree's current branch:
2662 In a work tree or a git repository directory, view changes committed in
2663 the 3 most recent commits to the work tree's branch, or the branch resolved
2664 via the repository's HEAD reference, respectively:
2666 .Dl $ got log -p -l 3
2668 As above, but display changes in the order in which
2670 could apply them in sequence:
2672 .Dl $ got log -p -l 3 -R
2674 In a work tree or a git repository directory, log the history of a subdirectory:
2676 .Dl $ got log sys/uvm
2678 While operating inside a work tree, paths are specified relative to the current
2679 working directory, so this command will log the subdirectory
2682 .Dl $ cd sys/uvm && got log\ .
2684 And this command has the same effect:
2686 .Dl $ cd sys/dev/usb && got log ../../uvm
2688 And this command displays work tree meta-data about all tracked files:
2691 .Dl $ got info\ . | less
2693 Add new files and remove obsolete files in a work tree directory:
2695 .Dl $ got add sys/uvm/uvm_ubc.c
2696 .Dl $ got remove sys/uvm/uvm_vnode.c
2698 Create a new commit from local changes in a work tree directory
2699 with a pre-defined log message.
2701 .Dl $ got commit -m 'unify the buffer cache'
2703 Alternatively, create a new commit from local changes in a work tree
2704 directory with a log message that has been prepared in the file
2707 .Dl $ got commit -F /tmp/msg
2709 Update any work tree checked out from the
2710 .Dq unified-buffer-cache
2711 branch to the latest commit on this branch:
2715 Roll file content on the unified-buffer-cache branch back by one commit,
2716 and then fetch the rolled-back change into the work tree as a local change
2717 to be amended and perhaps committed again:
2719 .Dl $ got backout unified-buffer-cache
2720 .Dl $ got commit -m 'roll back previous'
2721 .Dl $ # now back out the previous backout :-)
2722 .Dl $ got backout unified-buffer-cache
2724 Fetch new changes on the remote repository's
2726 branch, making them visible on the local repository's
2733 In a repository created with a HTTP URL and
2734 .Cm git clone --bare
2737 command must be used instead:
2739 .Dl $ cd /var/git/src.git
2740 .Dl $ git fetch origin master:refs/remotes/origin/master
2744 branch to merge the new changes that are now visible on the
2749 .Dl $ got update -b origin/master
2750 .Dl $ got rebase master
2753 .Dq unified-buffer-cache
2754 branch on top of the new head commit of the
2758 .Dl $ got update -b master
2759 .Dl $ got rebase unified-buffer-cache
2761 Create a patch from all changes on the unified-buffer-cache branch.
2762 The patch can be mailed out for review and applied to
2766 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2768 Edit the entire commit history of the
2769 .Dq unified-buffer-cache
2772 .Dl $ got update -b unified-buffer-cache
2773 .Dl $ got update -c master
2776 Before working against existing branches in a repository cloned with
2777 .Cm git clone --bare
2782 must be configured to map all references in the remote repository
2785 namespace of the local repository.
2786 This can be achieved by setting Git's
2787 .Pa remote.origin.fetch
2788 configuration variable to the value
2789 .Dq +refs/heads/*:refs/remotes/origin/*
2794 .Dl $ cd /var/git/repo
2795 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2799 option must be disabled:
2801 .Dl $ cd /var/git/repo
2802 .Dl $ git config remote.origin.mirror false
2804 Alternatively, the following
2806 configuration item can be added manually to the Git repository's
2810 .Dl [remote \&"origin\&"]
2812 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2815 This configuration leaves the local repository's
2817 namespace free for use by local branches checked out with
2819 and, if needed, created with
2822 .Dq refs/remotes/origin
2823 namespace can now be updated with incoming changes from the remote
2828 without extra command line arguments.
2829 Newly fetched changes can be examined with
2832 Display changes on the remote repository's version of the
2834 branch, as of the last time
2838 .Dl $ got log -c origin/master | less
2840 As shown here, most commands accept abbreviated reference names such as
2843 .Dq refs/remotes/origin/master .
2844 The latter is only needed in case of ambiguity.
2847 must be used to merge changes which are visible on the
2852 This will also merge local changes, if any, with the incoming changes:
2854 .Dl $ got update -b origin/master
2855 .Dl $ got rebase master
2857 In order to make changes committed to the
2858 .Dq unified-buffer-cache
2862 .Dq unified-buffer-cache
2863 branch must first be rebased onto the
2867 .Dl $ got update -b master
2868 .Dl $ got rebase unified-buffer-cache
2871 .Dq unified-buffer-cache
2872 branch can now be made visible on the
2876 Because the rebase operation switched the work tree to the
2877 .Dq unified-buffer-cache
2878 branch the work tree must be switched back to the
2882 .Dl $ got update -b master
2883 .Dl $ got integrate unified-buffer-cache
2887 branch, log messages for local changes can now be amended with
2889 by other developers and any other important new information:
2891 .Dl $ got update -c origin/master
2892 .Dl $ got histedit -m
2894 If the remote repository offers write access local changes on the
2896 branch can be sent to the remote repository with
2900 can be run without further arguments.
2901 The arguments shown here match defaults, provided the work tree's
2902 current branch is the
2906 .Dl $ got send -b master origin
2908 If the remote repository requires the HTTPS protocol the
2910 command must be used instead:
2912 .Dl $ cd /var/git/src.git
2913 .Dl $ git push origin master
2917 .Xr git-repository 5 ,
2918 .Xr got-worktree 5 ,
2921 .An Stefan Sperling Aq Mt stsp@openbsd.org
2922 .An Martin Pieuchot Aq Mt mpi@openbsd.org
2923 .An Joshua Stein Aq Mt jcs@openbsd.org
2924 .An Ori Bernstein Aq Mt ori@openbsd.org
2927 is a work-in-progress and some features remain to be implemented.
2929 At present, the user has to fall back on
2931 to perform some tasks.
2935 Reading from remote repositories over HTTP or HTTPS protocols requires
2940 Writing to remote repositories over HTTP or HTTPS protocols requires
2943 The creation of merge commits with more than two parent commits requires
2946 In situations where files or directories were moved around
2948 will not automatically merge changes to new locations and
2950 will usually produce better results.