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
206 Fetch all branches from the remote repository's
209 If this option is not specified, a branch resolved via the remote
210 repository's HEAD reference will be fetched.
211 Cannot be used together with the
217 from the remote repository's
220 This option may be specified multiple times to build a list of branches
222 If the branch corresponding to the remote repository's HEAD reference is not
223 in this list, the cloned repository's HEAD reference will be set to the first
224 branch which was fetched.
225 If this option is not specified, a branch resolved via the remote
226 repository's HEAD reference will be fetched.
227 Cannot be used together with the
231 List branches and tags available for fetching from the remote repository
232 and exit immediately.
233 Cannot be used together with any of the other options except
236 Create the cloned repository as a mirror of the original repository.
237 This is useful if the cloned repository will not be used to store
238 locally created commits.
244 files will be set up with the
246 option enabled, such that
250 will write incoming changes directly to branches in the
252 reference namespace, rather than to branches in the
255 This avoids the usual requirement of having to run
259 in order to make incoming changes appear on branches in the
262 But maintaining custom changes in the cloned repository becomes difficult
263 since such changes will be at risk of being discarded whenever incoming
266 Suppress progress reporting output.
267 The same option will be passed to
274 to print debugging messages to standard error output.
275 This option will be passed to
278 Multiple -v options increase the verbosity.
280 .It Fl R Ar reference
281 In addition to the branches and tags that will be fetched, fetch an arbitrary
283 from the remote repository's
286 This option may be specified multiple times to build a list of additional
290 may either be a path to a specific reference, or a reference namespace
291 which will cause all references in this namespace to be fetched.
293 Each reference will be mapped into the cloned repository's
295 namespace, unless the
297 option is used to mirror references directly into the cloned repository's
302 will refuse to fetch references from the remote repository's
311 .It Cm fetch Oo Fl a Oc Oo Fl b Ar branch Oc Oo Fl d Oc Oo Fl l Oc Oo Fl r Ar repository-path Oc Oo Fl t Oc Oo Fl q Oc Oo Fl v Oc Oo Fl R Ar reference Oc Op Ar remote-repository
312 Fetch new changes from a remote repository.
314 .Ar remote-repository
318 The remote repository's URL is obtained from the corresponding entry in
322 file of the local repository, as created by
325 New changes will be stored in a separate pack file downloaded from the server.
326 Optionally, separate pack files stored in the repository can be combined with
329 By default, branch references in the
331 reference namespace will be updated to point at the newly fetched commits.
334 command can then be used to make new changes visible on branches in the
336 namespace, merging incoming changes with the changes on those branches
339 If the repository was created as a mirror with
341 then all branches in the
343 namespace will be updated directly to match the corresponding branches in
344 the remote repository.
345 If those branches contained local commits, these commits will no longer be
346 reachable via a reference and will therefore be at risk of being discarded
347 by Git's garbage collector.
348 Maintaining custom changes in a mirror repository is therefore discouraged.
350 In any case, references in the
352 namespace will always be fetched and mapped directly to local references
353 in the same namespace.
360 Fetch all branches from the remote repository's
363 If this option is not specified, a branch resolved via the remote
364 repository's HEAD reference will be fetched.
365 Cannot be used together with the
371 from the remote repository's
374 This option may be specified multiple times to build a list of branches
376 If this option is not specified, a branch resolved via the remote
377 repository's HEAD reference will be fetched.
378 Cannot be used together with the
382 Delete branches and tags from the local repository which are no longer
383 present in the remote repository.
384 Only references are deleted.
385 Any commit, tree, tag, and blob objects belonging to deleted branches or
386 tags remain in the repository and may be removed separately with
387 Git's garbage collector.
389 List branches and tags available for fetching from the remote repository
390 and exit immediately.
391 Cannot be used together with any of the other options except
396 Allow existing references in the
398 namespace to be updated if they have changed on the server.
399 If not specified, only new tag references will be created.
400 .It Fl r Ar repository-path
401 Use the repository at the specified path.
402 If not specified, assume the repository is located at or above the current
404 If this directory is a
406 work tree, use the repository path associated with this work tree.
408 Suppress progress reporting output.
409 The same option will be passed to
416 to print debugging messages to standard error output.
417 The same option will be passed to
420 Multiple -v options increase the verbosity.
422 .It Fl R Ar reference
423 In addition to the branches and tags that will be fetched, fetch an arbitrary
425 from the remote repository's
428 This option may be specified multiple times to build a list of additional
432 may either be a path to a specific reference, or a reference namespace
433 which will cause all references in this namespace to be fetched.
435 Each reference will be mapped into the local repository's
437 namespace, unless the local repository was created as a mirror with
439 in which case references will be mapped directly into the local repository's
443 Once a reference has been fetched, a branch based on it can be created with
448 will refuse to fetch references from the remote repository's
457 .It Cm checkout Oo Fl E Oc Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Oo Fl p Ar path-prefix Oc Ar repository-path Op Ar work-tree-path
458 Copy files from a repository into a new work tree.
459 Show the status of each affected file, using the following status codes:
460 .Bl -column YXZ description
461 .It A Ta new file was added
462 .It E Ta file already exists in work tree's meta-data
467 is not specified, either use the last component of
468 .Ar repository path ,
471 was specified use the last component of
479 Proceed with the checkout operation even if the directory at
482 Existing files will be left intact.
484 Check out files from a commit on the specified
486 If this option is not specified, a branch resolved via the repository's HEAD
487 reference will be used.
489 Check out files from the specified
491 on the selected branch.
492 The expected argument is a commit ID SHA1 hash or an existing reference
493 or tag name which will be resolved to a commit ID.
494 An abbreviated hash argument will be expanded to a full SHA1 hash
495 automatically, provided the abbreviation is unique.
496 If this option is not specified, the most recent commit on the selected
501 is not contained in the selected branch, a different branch which contains
502 this commit must be specified with the
505 If no such branch is known a new branch must be created for this
511 Checking out work trees with an unknown branch is intentionally not supported.
512 .It Fl p Ar path-prefix
513 Restrict the work tree to a subset of the repository's tree hierarchy.
514 Only files beneath the specified
521 .It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Op Ar path ...
522 Update an existing work tree to a different
524 Change existing files in the work tree as necessary to match file contents
526 Preserve any local changes in the work tree and merge them with the
529 Files which already contain merge conflicts will not be updated to avoid
530 further complications.
531 Such files will be updated when
533 is run again after merge conflicts have been resolved.
534 If the conflicting changes are no longer needed affected files can be
541 Show the status of each affected file, using the following status codes:
542 .Bl -column YXZ description
543 .It U Ta file was updated and contained no local changes
544 .It G Ta file was updated and local changes were merged cleanly
545 .It C Ta file was updated and conflicts occurred during merge
546 .It D Ta file was deleted
547 .It A Ta new file was added
548 .It \(a~ Ta versioned file is obstructed by a non-regular file
549 .It ! Ta a missing versioned file was restored
550 .It # Ta file was not updated because it contains merge conflicts
551 .It ? Ta changes destined for an unversioned file were not merged
556 is specified, update the entire work tree.
557 Otherwise, restrict the update operation to files at or within the
559 Each path is required to exist in the update operation's target commit.
560 Files in the work tree outside specified paths will remain unchanged and
561 will retain their previously recorded base commit.
564 commands may refuse to run while the work tree contains files from
565 multiple base commits.
566 The base commit of such a work tree can be made consistent by running
568 across the entire work tree.
571 is incompatible with the
576 cannot update paths with staged changes.
577 If changes have been staged with
579 these changes must first be committed with
589 Switch the work tree's branch reference to the specified
591 before updating the work tree.
592 This option requires that all paths in the work tree are updated.
594 As usual, any local changes in the work tree will be preserved.
595 This can be useful when switching to a newly created branch in order
596 to commit existing local changes to this branch.
598 Any local changes must be dealt with separately in order to obtain a
599 work tree with pristine file contents corresponding exactly to the specified
601 Such changes could first be committed to a different branch with
603 or could be discarded with
606 Update the work tree to the specified
608 The expected argument is a commit ID SHA1 hash or an existing reference
609 or tag name which will be resolved to a commit ID.
610 An abbreviated hash argument will be expanded to a full SHA1 hash
611 automatically, provided the abbreviation is unique.
612 If this option is not specified, the most recent commit on the work tree's
618 .It Cm status Oo Fl s Ar status-codes Oc Op Ar path ...
619 Show the current modification status of files in a work tree,
620 using the following status codes:
621 .Bl -column YXZ description
622 .It M Ta modified file
623 .It A Ta file scheduled for addition in next commit
624 .It D Ta file scheduled for deletion in next commit
625 .It C Ta modified or added file which contains merge conflicts
626 .It ! Ta versioned file was expected on disk but is missing
627 .It \(a~ Ta versioned file is obstructed by a non-regular file
628 .It ? Ta unversioned item not tracked by
630 .It m Ta modified file modes (executable bit only)
631 .It N Ta non-existent
633 specified on the command line
638 is specified, show modifications in the entire work tree.
639 Otherwise, show modifications at or within the specified paths.
641 If changes have been staged with
643 staged changes are shown in the second output column, using the following
645 .Bl -column YXZ description
646 .It M Ta file modification is staged
647 .It A Ta file addition is staged
648 .It D Ta file deletion is staged
651 Changes created on top of staged changes are indicated in the first column:
652 .Bl -column YXZ description
653 .It MM Ta file was modified after earlier changes have been staged
654 .It MA Ta file was modified after having been staged for addition
661 .It Fl s Ar status-codes
662 Only show files with a modification status matching any of the
663 single-character status codes contained in the
666 Any combination of codes from the above list of possible status codes
668 For staged files, status codes displayed in either column will be matched.
671 For compatibility with
682 files in each traversed directory and will not display unversioned files
683 which match these patterns.
688 supports consecutive asterisks,
690 which will match an arbitrary amount of directories.
694 only supports a single ignore pattern per line.
698 does not support negated ignore patterns prefixed with
700 and gives no special significance to the location of path component separators,
706 .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
707 Display history of a repository.
710 is specified, show only commits which modified this path.
711 If invoked in a work tree, the
713 is interpreted relative to the current working directory,
714 and the work tree's path prefix is implicitly prepended.
715 Otherwise, the path is interpreted relative to the repository root.
722 Display individual commits which were merged into the current branch
726 shows the linear history of the current branch only.
728 Start traversing history at the specified
730 The expected argument is a commit ID SHA1 hash or an existing reference
731 or tag name which will be resolved to a commit ID.
732 An abbreviated hash argument will be expanded to a full SHA1 hash
733 automatically, provided the abbreviation is unique.
734 If this option is not specified, default to the work tree's current branch
735 if invoked in a work tree, or to the repository's HEAD reference.
737 Set the number of context lines shown in diffs with
739 By default, 3 lines of context are shown.
741 Limit history traversal to a given number of commits.
742 If this option is not specified, a default limit value of zero is used,
743 which is treated as an unbounded limit.
745 .Ev GOT_LOG_DEFAULT_LIMIT
746 environment variable may be set to change this default value.
748 Display the patch of modifications made in each commit.
751 is specified, only show the patch of modifications at or within this path.
753 Display the list of file paths changed in each commit, using the following
755 .Bl -column YXZ description
756 .It M Ta modified file
757 .It D Ta file was deleted
758 .It A Ta new file was added
759 .It m Ta modified file modes (executable bit only)
761 .It Fl s Ar search-pattern
762 If specified, show only commits with a log message matched by the extended
765 When used together with
767 then the file paths changed by a commit can be matched as well.
768 Regular expression syntax is documented in
770 .It Fl r Ar repository-path
771 Use the repository at the specified path.
772 If not specified, assume the repository is located at or above the current
774 If this directory is a
776 work tree, use the repository path associated with this work tree.
778 Determine a set of commits to display as usual, but display these commits
781 Stop traversing commit history as soon as the specified
784 This option has no effect if the specified
788 .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
789 When invoked within a work tree with less than two arguments, display
790 local changes in the work tree.
793 is specified, only show changes within this path.
795 If two arguments are provided, treat each argument as a reference, a tag
796 name, or an object ID SHA1 hash, and display differences between the
797 corresponding objects.
798 Both objects must be of the same type (blobs, trees, or commits).
799 An abbreviated hash argument will be expanded to a full SHA1 hash
800 automatically, provided the abbreviation is unique.
807 Treat file contents as ASCII text even if binary data is detected.
809 Set the number of context lines shown in the diff.
810 By default, 3 lines of context are shown.
811 .It Fl r Ar repository-path
812 Use the repository at the specified path.
813 If not specified, assume the repository is located at or above the current
815 If this directory is a
817 work tree, use the repository path associated with this work tree.
819 Show changes staged with
821 instead of showing local changes in the work tree.
822 This option is only valid when
824 is invoked in a work tree.
826 Ignore whitespace-only changes.
831 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
832 Display line-by-line history of a file at the specified path.
839 Start traversing history at the specified
841 The expected argument is a commit ID SHA1 hash or an existing reference
842 or tag name which will be resolved to a commit ID.
843 An abbreviated hash argument will be expanded to a full SHA1 hash
844 automatically, provided the abbreviation is unique.
845 .It Fl r Ar repository-path
846 Use the repository at the specified path.
847 If not specified, assume the repository is located at or above the current
849 If this directory is a
851 work tree, use the repository path associated with this work tree.
856 .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
857 Display a listing of files and directories at the specified
858 directory path in the repository.
859 Entries shown in this listing may carry one of the following trailing
861 .Bl -column YXZ description
862 .It @ Ta entry is a symbolic link
863 .It / Ta entry is a directory
864 .It * Ta entry is an executable file
865 .It $ Ta entry is a Git submodule
868 Symbolic link entries are also annotated with the target path of the link.
872 is specified, list the repository path corresponding to the current
873 directory of the work tree, or the root directory of the repository
874 if there is no work tree.
881 List files and directories as they appear in the specified
883 The expected argument is a commit ID SHA1 hash or an existing reference
884 or tag name which will be resolved to a commit ID.
885 An abbreviated hash argument will be expanded to a full SHA1 hash
886 automatically, provided the abbreviation is unique.
887 .It Fl r Ar repository-path
888 Use the repository at the specified path.
889 If not specified, assume the repository is located at or above the current
891 If this directory is a
893 work tree, use the repository path associated with this work tree.
895 Show object IDs of files (blob objects) and directories (tree objects).
897 Recurse into sub-directories in the repository.
902 .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
903 Manage references in a repository.
905 References may be listed, created, deleted, and changed.
906 When creating, deleting, or changing a reference the specified
908 must be an absolute reference name, i.e. it must begin with
915 .It Fl r Ar repository-path
916 Use the repository at the specified path.
917 If not specified, assume the repository is located at or above the current
919 If this directory is a
921 work tree, use the repository path associated with this work tree.
923 List references in the repository.
926 is specified, list all existing references in the repository.
929 is a reference namespace, list all references in this namespace.
930 Otherwise, show only the reference with the given
932 Cannot be used together with any other options except
935 Create a reference or change an existing reference.
936 The reference with the specified
938 will point at the specified
942 argument is a ID SHA1 hash or an existing reference or tag name which will
943 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
944 Cannot be used together with any other options except
946 .It Fl s Ar reference
947 Create a symbolic reference, or change an existing symbolic reference.
948 The symbolic reference with the specified
950 will point at the specified
952 which must already exist in the repository.
953 Care should be taken not to create loops between references when
955 Cannot be used together with any other options except
958 Delete the reference with the specified
961 Cannot be used together with any other options except
964 .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
965 Create, list, or delete branches.
967 Branches are managed via references which live in the
972 command operates on references in this namespace only.
974 If invoked in a work tree without any arguments, print the name of the
975 work tree's current branch.
979 argument is passed, attempt to create a branch reference with the given name.
980 By default the new branch reference will point at the latest commit on the
981 work tree's current branch if invoked in a work tree, and otherwise to a commit
982 resolved via the repository's HEAD reference.
984 If invoked in a work tree, once the branch was created successfully
985 switch the work tree's head reference to the newly created branch and
986 update files across the entire work tree, just like
987 .Cm got update -b Ar name
989 Show the status of each affected file, using the following status codes:
990 .Bl -column YXZ description
991 .It U Ta file was updated and contained no local changes
992 .It G Ta file was updated and local changes were merged cleanly
993 .It C Ta file was updated and conflicts occurred during merge
994 .It D Ta file was deleted
995 .It A Ta new file was added
996 .It \(a~ Ta versioned file is obstructed by a non-regular file
997 .It ! Ta a missing versioned file was restored
1005 Make a newly created branch reference point at the specified
1009 argument is a commit ID SHA1 hash or an existing reference
1010 or tag name which will be resolved to a commit ID.
1011 .It Fl r Ar repository-path
1012 Use the repository at the specified path.
1013 If not specified, assume the repository is located at or above the current
1015 If this directory is a
1017 work tree, use the repository path associated with this work tree.
1019 List all existing branches in the repository.
1020 If invoked in a work tree, the work tree's current branch is shown
1021 with one the following annotations:
1022 .Bl -column YXZ description
1023 .It * Ta work tree's base commit matches the branch tip
1024 .It \(a~ Ta work tree's base commit is out-of-date
1027 Delete the branch with the specified name from the repository.
1028 Only the branch reference is deleted.
1029 Any commit, tree, and blob objects belonging to the branch
1030 remain in the repository and may be removed separately with
1031 Git's garbage collector.
1033 Do not switch and update the work tree after creating a new branch.
1038 .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
1039 Manage tags in a repository.
1041 Tags are managed via references which live in the
1043 reference namespace.
1046 command operates on references in this namespace only.
1047 References in this namespace point at tag objects which contain a pointer
1048 to another object, a tag message, as well as author and timestamp information.
1050 Attempt to create a tag with the given
1052 and make this tag point at the given
1054 If no commit is specified, default to the latest commit on the work tree's
1055 current branch if invoked in a work tree, and to a commit resolved via
1056 the repository's HEAD reference otherwise.
1063 Make the newly created tag reference point at the specified
1067 argument is a commit ID SHA1 hash or an existing reference or tag name which
1068 will be resolved to a commit ID.
1069 An abbreviated hash argument will be expanded to a full SHA1 hash
1070 automatically, provided the abbreviation is unique.
1072 Use the specified tag message when creating the new tag.
1077 opens a temporary file in an editor where a tag message can be written.
1078 .It Fl r Ar repository-path
1079 Use the repository at the specified path.
1080 If not specified, assume the repository is located at or above the current
1082 If this directory is a
1084 work tree, use the repository path associated with this work tree.
1086 List all existing tags in the repository instead of creating a new tag.
1087 If this option is used, no other command-line arguments are allowed.
1092 command will not delete tags or change existing tags.
1093 If a tag must be deleted, the
1095 command may be used to delete a tag's reference.
1096 This should only be done if the tag has not already been copied to
1098 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1099 Schedule unversioned files in a work tree for addition to the
1100 repository in the next commit.
1107 Permit recursion into directories.
1108 If this option is not specified,
1110 will refuse to run if a specified
1114 With -R, add files even if they match a
1118 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
1119 Remove versioned files from a work tree and schedule them for deletion
1120 from the repository in the next commit.
1127 Perform the operation even if a file contains local modifications.
1129 Keep affected files on disk.
1131 Permit recursion into directories.
1132 If this option is not specified,
1134 will refuse to run if a specified
1137 .It Fl s Ar status-codes
1138 Only delete files with a modification status matching one of the
1139 single-character status codes contained in the
1142 The following status codes may be specified:
1143 .Bl -column YXZ description
1144 .It M Ta modified file (this implies the
1147 .It ! Ta versioned file expected on disk but missing
1153 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1154 Revert any local changes in files at the specified paths in a work tree.
1155 File contents will be overwritten with those contained in the
1156 work tree's base commit.
1157 There is no way to bring discarded changes back after
1160 If a file was added with
1162 it will become an unversioned file again.
1163 If a file was deleted with
1165 it will be restored.
1172 Instead of reverting all changes in files, interactively select or reject
1173 changes to revert based on
1179 (quit reverting this file) responses.
1180 If a file is in modified status, individual patches derived from the
1181 modified file content can be reverted.
1182 Files in added or deleted status may only be reverted in their entirety.
1183 .It Fl F Ar response-script
1191 responses line-by-line from the specified
1193 file instead of prompting interactively.
1195 Permit recursion into directories.
1196 If this option is not specified,
1198 will refuse to run if a specified
1205 .It Cm commit Oo Fl m Ar message Oc Oo Fl S Oc Op Ar path ...
1206 Create a new commit in the repository from changes in a work tree
1207 and use this commit as the new base commit for the work tree.
1210 is specified, commit all changes in the work tree.
1211 Otherwise, commit changes at or within the specified paths.
1213 If changes have been explicitly staged for commit with
1215 only commit staged changes and reject any specified paths which
1216 have not been staged.
1218 Show the status of each affected file, using the following status codes:
1219 .Bl -column YXZ description
1220 .It M Ta modified file
1221 .It D Ta file was deleted
1222 .It A Ta new file was added
1223 .It m Ta modified file modes (executable bit only)
1226 Files which are not part of the new commit will retain their previously
1227 recorded base commit.
1230 commands may refuse to run while the work tree contains files from
1231 multiple base commits.
1232 The base commit of such a work tree can be made consistent by running
1234 across the entire work tree.
1238 command requires the
1240 environment variable to be set,
1241 unless an author has been configured in
1247 configuration settings can be
1248 obtained from the repository's
1250 file or from Git's global
1259 Use the specified log message when creating the new commit.
1264 opens a temporary file in an editor where a log message can be written.
1266 Allow the addition of symbolic links which point outside of the path space
1267 that is under version control.
1270 will reject such symbolic links due to safety concerns.
1273 may decide to represent such a symbolic link as a regular file which contains
1274 the link's target path, rather than creating an actual symbolic link which
1275 points outside of the work tree.
1276 Use of this option is discouraged because external mechanisms such as
1278 are better suited for managing symbolic links to paths not under
1283 will refuse to run if certain preconditions are not met.
1284 If the work tree's current branch is not in the
1286 reference namespace, new commits may not be created on this branch.
1287 Local changes may only be committed if they are based on file content
1288 found in the most recent commit on the work tree's branch.
1289 If a path is found to be out of date,
1291 must be used first in order to merge local changes with changes made
1296 .It Cm cherrypick Ar commit
1297 Merge changes from a single
1302 must be on a different branch than the work tree's base commit.
1303 The expected argument is a reference or a commit ID SHA1 hash.
1304 An abbreviated hash argument will be expanded to a full SHA1 hash
1305 automatically, provided the abbreviation is unique.
1307 Show the status of each affected file, using the following status codes:
1308 .Bl -column YXZ description
1309 .It G Ta file was merged
1310 .It C Ta file was merged and conflicts occurred during merge
1311 .It ! Ta changes destined for a missing file were not merged
1312 .It D Ta file was deleted
1313 .It d Ta file's deletion was obstructed by local modifications
1314 .It A Ta new file was added
1315 .It \(a~ Ta changes destined for a non-regular file were not merged
1316 .It ? Ta changes destined for an unversioned file were not merged
1319 The merged changes will appear as local changes in the work tree, which
1322 amended manually or with further
1327 or discarded again with
1331 will refuse to run if certain preconditions are not met.
1332 If the work tree contains multiple base commits it must first be updated
1333 to a single base commit with
1335 If the work tree already contains files with merge conflicts, these
1336 conflicts must be resolved first.
1340 .It Cm backout Ar commit
1341 Reverse-merge changes from a single
1346 must be on the same branch as the work tree's base commit.
1347 The expected argument is a reference or a commit ID SHA1 hash.
1348 An abbreviated hash argument will be expanded to a full SHA1 hash
1349 automatically, provided the abbreviation is unique.
1351 Show the status of each affected file, using the following status codes:
1352 .Bl -column YXZ description
1353 .It G Ta file was merged
1354 .It C Ta file was merged and conflicts occurred during merge
1355 .It ! Ta changes destined for a missing file were not merged
1356 .It D Ta file was deleted
1357 .It d Ta file's deletion was obstructed by local modifications
1358 .It A Ta new file was added
1359 .It \(a~ Ta changes destined for a non-regular file were not merged
1360 .It ? Ta changes destined for an unversioned file were not merged
1363 The reverse-merged changes will appear as local changes in the work tree,
1364 which may be viewed with
1366 amended manually or with further
1371 or discarded again with
1375 will refuse to run if certain preconditions are not met.
1376 If the work tree contains multiple base commits it must first be updated
1377 to a single base commit with
1379 If the work tree already contains files with merge conflicts, these
1380 conflicts must be resolved first.
1384 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Op Ar branch
1385 Rebase commits on the specified
1387 onto the tip of the current branch of the work tree.
1390 must share common ancestry with the work tree's current branch.
1391 Rebasing begins with the first descendant commit of the youngest
1392 common ancestor commit shared by the specified
1394 and the work tree's current branch, and stops once the tip commit
1401 is used as intended, the specified
1403 represents a local commit history and may already contain changes
1404 that are not yet visible in any other repositories.
1405 The work tree's current branch, which must be set with
1409 operation, represents a branch from a remote repository which shares
1410 a common history with the specified
1412 but has progressed, and perhaps diverged, due to commits added to the
1415 Rebased commits are accumulated on a temporary branch which the work tree
1416 will remain switched to throughout the entire rebase operation.
1417 Commits on this branch represent the same changes with the same log
1418 messages as their counterparts on the original
1420 but with different commit IDs.
1421 Once rebasing has completed successfully, the temporary branch becomes
1422 the new version of the specified
1424 and the work tree is automatically switched to it.
1426 While rebasing commits, show the status of each affected file,
1427 using the following status codes:
1428 .Bl -column YXZ description
1429 .It G Ta file was merged
1430 .It C Ta file was merged and conflicts occurred during merge
1431 .It ! Ta changes destined for a missing file were not merged
1432 .It D Ta file was deleted
1433 .It d Ta file's deletion was obstructed by local modifications
1434 .It A Ta new file was added
1435 .It \(a~ Ta changes destined for a non-regular file were not merged
1436 .It ? Ta changes destined for an unversioned file were not merged
1439 If merge conflicts occur the rebase operation is interrupted and may
1440 be continued once conflicts have been resolved.
1441 Alternatively, the rebase operation may be aborted which will leave
1443 unmodified and the work tree switched back to its original branch.
1445 If a merge conflict is resolved in a way which renders the merged
1446 change into a no-op change, the corresponding commit will be elided
1447 when the rebase operation continues.
1450 will refuse to run if certain preconditions are not met.
1451 If the work tree is not yet fully updated to the tip commit of its
1452 branch then the work tree must first be updated with
1454 If changes have been staged with
1456 these changes must first be committed with
1460 If the work tree contains local changes, these changes must first be
1467 contains changes to files outside of the work tree's path prefix,
1468 the work tree cannot be used to rebase this branch.
1474 commands will refuse to run while a rebase operation is in progress.
1475 Other commands which manipulate the work tree may be used for
1476 conflict resolution purposes.
1483 Abort an interrupted rebase operation.
1484 If this option is used, no other command-line arguments are allowed.
1486 Continue an interrupted rebase operation.
1487 If this option is used, no other command-line arguments are allowed.
1492 .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
1493 Edit commit history between the work tree's current base commit and
1494 the tip commit of the work tree's current branch.
1498 operation the work tree's current branch must be set with
1500 to the branch which should be edited, unless this branch is already the
1501 current branch of the work tree.
1502 The tip of this branch represents the upper bound (inclusive) of commits
1507 Furthermore, the work tree's base commit
1510 to a point in this branch's commit history where editing should begin.
1511 This commit represents the lower bound (non-inclusive) of commits touched
1516 Editing of commit history is controlled via a
1518 which can be written in an editor based on a template, passed on the
1519 command line, or generated with the
1525 The format of the histedit script is line-based.
1526 Each line in the script begins with a command name, followed by
1527 whitespace and an argument.
1528 For most commands, the expected argument is a commit ID SHA1 hash.
1529 Any remaining text on the line is ignored.
1530 Lines which begin with the
1532 character are ignored entirely.
1534 The available commands are as follows:
1535 .Bl -column YXZ pick-commit
1536 .It pick Ar commit Ta Use the specified commit as it is.
1537 .It edit Ar commit Ta Use the specified commit but once changes have been
1538 merged into the work tree interrupt the histedit operation for amending.
1539 .It fold Ar commit Ta Combine the specified commit with the next commit
1540 listed further below that will be used.
1541 .It drop Ar commit Ta Remove this commit from the edited history.
1542 .It mesg Ar log-message Ta Use the specified single-line log message for
1543 the commit on the previous line.
1544 If the log message argument is left empty, open an editor where a new
1545 log message can be written.
1548 Every commit in the history being edited must be mentioned in the script.
1549 Lines may be re-ordered to change the order of commits in the edited history.
1550 No commit may be listed more than once.
1552 Edited commits are accumulated on a temporary branch which the work tree
1553 will remain switched to throughout the entire histedit operation.
1554 Once history editing has completed successfully, the temporary branch becomes
1555 the new version of the work tree's branch and the work tree is automatically
1558 While merging commits, show the status of each affected file,
1559 using the following status codes:
1560 .Bl -column YXZ description
1561 .It G Ta file was merged
1562 .It C Ta file was merged and conflicts occurred during merge
1563 .It ! Ta changes destined for a missing file were not merged
1564 .It D Ta file was deleted
1565 .It d Ta file's deletion was obstructed by local modifications
1566 .It A Ta new file was added
1567 .It \(a~ Ta changes destined for a non-regular file were not merged
1568 .It ? Ta changes destined for an unversioned file were not merged
1571 If merge conflicts occur the histedit operation is interrupted and may
1572 be continued once conflicts have been resolved.
1573 Alternatively, the histedit operation may be aborted which will leave
1574 the work tree switched back to its original branch.
1576 If a merge conflict is resolved in a way which renders the merged
1577 change into a no-op change, the corresponding commit will be elided
1578 when the histedit operation continues.
1581 will refuse to run if certain preconditions are not met.
1582 If the work tree's current branch is not in the
1584 reference namespace, the history of the branch may not be edited.
1585 If the work tree contains multiple base commits it must first be updated
1586 to a single base commit with
1588 If changes have been staged with
1590 these changes must first be committed with
1594 If the work tree contains local changes, these changes must first be
1599 If the edited history contains changes to files outside of the work tree's
1600 path prefix, the work tree cannot be used to edit the history of this branch.
1607 commands will refuse to run while a histedit operation is in progress.
1608 Other commands which manipulate the work tree may be used, and the
1610 command may be used to commit arbitrary changes to the temporary branch
1611 while the histedit operation is interrupted.
1618 Abort an interrupted histedit operation.
1619 If this option is used, no other command-line arguments are allowed.
1621 Continue an interrupted histedit operation.
1622 If this option is used, no other command-line arguments are allowed.
1624 Fold all commits into a single commit.
1625 This option is a quick equivalent to a histedit script which folds all
1626 commits, combining them all into one commit.
1629 option can only be used when starting a new histedit operation.
1630 If this option is used, no other command-line arguments are allowed.
1631 .It Fl F Ar histedit-script
1634 instead of opening a temporary file in an editor where a histedit script
1637 Edit log messages only.
1638 This option is a quick equivalent to a histedit script which edits
1639 only log messages but otherwise leaves every picked commit as-is.
1642 option can only be used when starting a new histedit operation.
1643 If this option is used, no other command-line arguments are allowed.
1648 .It Cm integrate Ar branch
1649 Integrate the specified
1651 into the work tree's current branch.
1652 Files in the work tree are updated to match the contents on the integrated
1654 and the reference of the work tree's branch is changed to point at the
1655 head commit of the integrated
1658 Both branches can be considered equivalent after integration since they
1659 will be pointing at the same commit.
1660 Both branches remain available for future work, if desired.
1661 In case the integrated
1663 is no longer needed it may be deleted with
1666 Show the status of each affected file, using the following status codes:
1667 .Bl -column YXZ description
1668 .It U Ta file was updated
1669 .It D Ta file was deleted
1670 .It A Ta new file was added
1671 .It \(a~ Ta versioned file is obstructed by a non-regular file
1672 .It ! Ta a missing versioned file was restored
1676 will refuse to run if certain preconditions are not met.
1677 Most importantly, the
1679 must have been rebased onto the work tree's current branch with
1681 before it can be integrated, in order to linearize commit history and
1682 resolve merge conflicts.
1683 If the work tree contains multiple base commits it must first be updated
1684 to a single base commit with
1686 If changes have been staged with
1688 these changes must first be committed with
1692 If the work tree contains local changes, these changes must first be
1700 .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 ...
1701 Stage local changes for inclusion in the next commit.
1704 is specified, stage all changes in the work tree.
1705 Otherwise, stage changes at or within the specified paths.
1706 Paths may be staged if they are added, modified, or deleted according to
1709 Show the status of each affected file, using the following status codes:
1710 .Bl -column YXZ description
1711 .It A Ta file addition has been staged
1712 .It M Ta file modification has been staged
1713 .It D Ta file deletion has been staged
1716 Staged file contents are saved in newly created blob objects in the repository.
1717 These blobs will be referred to by tree objects once staged changes have been
1720 Staged changes affect the behaviour of
1725 While paths with staged changes exist, the
1727 command will refuse to commit any paths which do not have staged changes.
1728 Local changes created on top of staged changes can only be committed if
1729 the path is staged again, or if the staged changes are committed first.
1732 command will show both local changes and staged changes.
1735 command is able to display local changes relative to staged changes,
1736 and to display staged changes relative to the repository.
1739 command cannot revert staged changes but may be used to revert
1740 local changes created on top of staged changes.
1747 Instead of staging new changes, list paths which are already staged,
1748 along with the IDs of staged blob objects and stage status codes.
1749 If paths were provided in the command line show the staged paths
1750 among the specified paths.
1751 Otherwise, show all staged paths.
1753 Instead of staging the entire content of a changed file, interactively
1754 select or reject changes for staging based on
1758 (reject change), and
1760 (quit staging this file) responses.
1761 If a file is in modified status, individual patches derived from the
1762 modified file content can be staged.
1763 Files in added or deleted status may only be staged or rejected in
1765 .It Fl F Ar response-script
1773 responses line-by-line from the specified
1775 file instead of prompting interactively.
1777 Allow staging of symbolic links which point outside of the path space
1778 that is under version control.
1781 will reject such symbolic links due to safety concerns.
1784 may decide to represent such a symbolic link as a regular file which contains
1785 the link's target path, rather than creating an actual symbolic link which
1786 points outside of the work tree.
1787 Use of this option is discouraged because external mechanisms such as
1789 are better suited for managing symbolic links to paths not under
1794 will refuse to run if certain preconditions are not met.
1795 If a file contains merge conflicts, these conflicts must be resolved first.
1796 If a file is found to be out of date relative to the head commit on the
1797 work tree's current branch, the file must be updated with
1799 before it can be staged (however, this does not prevent the file from
1800 becoming out-of-date at some point after having been staged).
1807 commands will refuse to run while staged changes exist.
1808 If staged changes cannot be committed because a staged path
1809 is out of date, the path must be unstaged with
1811 before it can be updated with
1813 and may then be staged again if necessary.
1817 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
1818 Merge staged changes back into the work tree and put affected paths
1819 back into non-staged status.
1822 is specified, unstage all staged changes across the entire work tree.
1823 Otherwise, unstage changes at or within the specified paths.
1825 Show the status of each affected file, using the following status codes:
1826 .Bl -column YXZ description
1827 .It G Ta file was unstaged
1828 .It C Ta file was unstaged and conflicts occurred during merge
1829 .It ! Ta changes destined for a missing file were not merged
1830 .It D Ta file was staged as deleted and still is deleted
1831 .It d Ta file's deletion was obstructed by local modifications
1832 .It \(a~ Ta changes destined for a non-regular file were not merged
1840 Instead of unstaging the entire content of a changed file, interactively
1841 select or reject changes for unstaging based on
1845 (keep change staged), and
1847 (quit unstaging this file) responses.
1848 If a file is staged in modified status, individual patches derived from the
1849 staged file content can be unstaged.
1850 Files staged in added or deleted status may only be unstaged in their entirety.
1851 .It Fl F Ar response-script
1859 responses line-by-line from the specified
1861 file instead of prompting interactively.
1866 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
1867 Parse and print contents of objects to standard output in a line-based
1869 Content of commit, tree, and tag objects is printed in a way similar
1870 to the actual content stored in such objects.
1871 Blob object contents are printed as they would appear in files on disk.
1873 Attempt to interpret each argument as a reference, a tag name, or
1874 an object ID SHA1 hash.
1875 References will be resolved to an object ID.
1876 Tag names will resolved to a tag object.
1877 An abbreviated hash argument will be expanded to a full SHA1 hash
1878 automatically, provided the abbreviation is unique.
1880 If none of the above interpretations produce a valid result, or if the
1882 option is used, attempt to interpret the argument as a path which will
1883 be resolved to the ID of an object found at this path in the repository.
1890 Look up paths in the specified
1892 If this option is not used, paths are looked up in the commit resolved
1893 via the repository's HEAD reference.
1894 The expected argument is a commit ID SHA1 hash or an existing reference
1895 or tag name which will be resolved to a commit ID.
1896 An abbreviated hash argument will be expanded to a full SHA1 hash
1897 automatically, provided the abbreviation is unique.
1898 .It Fl r Ar repository-path
1899 Use the repository at the specified path.
1900 If not specified, assume the repository is located at or above the current
1902 If this directory is a
1904 work tree, use the repository path associated with this work tree.
1906 Interpret all arguments as paths only.
1907 This option can be used to resolve ambiguity in cases where paths
1908 look like tag names, reference names, or object IDs.
1910 .It Cm info Op Ar path ...
1911 Display meta-data stored in a work tree.
1916 The work tree to use is resolved implicitly by walking upwards from the
1917 current working directory.
1921 arguments are specified, show additional per-file information for tracked
1922 files located at or within these paths.
1925 argument corresponds to the work tree's root directory, display information
1926 for all tracked files.
1929 .Bl -tag -width GOT_AUTHOR
1931 The author's name and email address for
1936 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
1939 may fail to parse commits without an email address in author data,
1943 environment variables with a missing email address.
1945 .Ev GOT_AUTHOR will be overriden by configuration settings in
1951 configuration settings in the repository's
1958 configuration settings contained in Git's global
1960 configuration file will only be used if neither
1964 environment variable provide author information.
1965 .It Ev VISUAL , EDITOR
1966 The editor spawned by
1974 text editor will be spawned in order to give
1976 the attention it deserves.
1977 .It Ev GOT_LOG_DEFAULT_LIMIT
1978 The default limit on the number of commits traversed by
1980 If set to zero, the limit is unbounded.
1981 This variable will be silently ignored if it is set to a non-numeric value.
1984 .Bl -tag -width packed-refs -compact
1986 Repository-wide configuration settings for
1990 configuration file located in the root directory of a Git repository
1991 supersedes any relevant settings in Git's
1995 .It Pa .got/got.conf
1996 Worktree-specific configuration settings for
2000 configuration file in the
2002 meta-data directory of a work tree supersedes any relevant settings in
2005 configuration file and Git's
2012 Clone an existing Git repository for use with
2016 .Dl $ got clone ssh://git@github.com/openbsd/src.git
2018 Use of HTTP URLs currently requires
2022 .Dl $ git clone --bare https://github.com/openbsd/src.git
2024 Alternatively, for quick and dirty local testing of
2026 a new Git repository could be created and populated with files,
2027 e.g. from a temporary CVS checkout located at
2030 .Dl $ got init /var/git/src.git
2031 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
2033 Check out a work tree from the Git repository to /usr/src:
2035 .Dl $ got checkout /var/git/src.git /usr/src
2037 View local changes in a work tree directory:
2039 .Dl $ got diff | less
2041 In a work tree, display files in a potentially problematic state:
2043 .Dl $ got status -s 'C!~?'
2045 Interactively revert selected local changes in a work tree directory:
2047 .Dl $ got revert -p -R\ .
2049 In a work tree or a git repository directory, list all branch references:
2053 In a work tree or a git repository directory, create a new branch called
2054 .Dq unified-buffer-cache
2055 which is forked off the
2059 .Dl $ got branch unified-buffer-cache master
2061 Switch an existing work tree to the branch
2062 .Dq unified-buffer-cache .
2063 Local changes in the work tree will be preserved and merged if necessary:
2065 .Dl $ got update -b unified-buffer-cache
2067 Create a new commit from local changes in a work tree directory.
2068 This new commit will become the head commit of the work tree's current branch:
2072 In a work tree or a git repository directory, view changes committed in
2073 the 3 most recent commits to the work tree's branch, or the branch resolved
2074 via the repository's HEAD reference, respectively:
2076 .Dl $ got log -p -l 3
2078 As above, but display changes in the order in which
2080 could apply them in sequence:
2082 .Dl $ got log -p -l 3 -R
2084 In a work tree or a git repository directory, log the history of a subdirectory:
2086 .Dl $ got log sys/uvm
2088 While operating inside a work tree, paths are specified relative to the current
2089 working directory, so this command will log the subdirectory
2092 .Dl $ cd sys/uvm && got log\ .
2094 And this command has the same effect:
2096 .Dl $ cd sys/dev/usb && got log ../../uvm
2098 And this command displays work tree meta-data about all tracked files:
2101 .Dl $ got info\ . | less
2103 Add new files and remove obsolete files in a work tree directory:
2105 .Dl $ got add sys/uvm/uvm_ubc.c
2106 .Dl $ got remove sys/uvm/uvm_vnode.c
2108 Create a new commit from local changes in a work tree directory
2109 with a pre-defined log message.
2111 .Dl $ got commit -m 'unify the buffer cache'
2113 Alternatively, create a new commit from local changes in a work tree
2114 directory with a log message that has been prepared in the file
2121 can be read into the buffer for review:
2126 Update any work tree checked out from the
2127 .Dq unified-buffer-cache
2128 branch to the latest commit on this branch:
2132 Roll file content on the unified-buffer-cache branch back by one commit,
2133 and then fetch the rolled-back change into the work tree as a local change
2134 to be amended and perhaps committed again:
2136 .Dl $ got backout unified-buffer-cache
2137 .Dl $ got commit -m 'roll back previous'
2138 .Dl $ # now back out the previous backout :-)
2139 .Dl $ got backout unified-buffer-cache
2141 Fetch new upstream commits into the local repository's
2148 In a repository created with a HTTP URL and
2149 .Cm git clone --bare
2152 command must be used instead:
2154 .Dl $ cd /var/git/src.git
2155 .Dl $ git fetch origin master:refs/remotes/origin/master
2159 branch to merge the new changes that are now visible on the
2164 .Dl $ got update -b origin/master
2165 .Dl $ got rebase master
2168 .Dq unified-buffer-cache
2169 branch on top of the new head commit of the
2173 .Dl $ got update -b master
2174 .Dl $ got rebase unified-buffer-cache
2176 Create a patch from all changes on the unified-buffer-cache branch.
2177 The patch can be mailed out for review and applied to
2181 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2183 Edit the entire commit history of the
2184 .Dq unified-buffer-cache
2187 .Dl $ got update -b unified-buffer-cache
2188 .Dl $ got update -c master
2191 In order to merge changes committed to the
2192 .Dq unified-buffer-cache
2193 branch back into the
2196 .Dq unified-buffer-cache
2197 branch must first be rebased onto the
2201 .Dl $ got update -b master
2202 .Dl $ got rebase unified-buffer-cache
2205 .Dq unified-buffer-cache
2206 branch can now be made visible on the
2210 Because the rebase operation switched the work tree to the
2211 .Dq unified-buffer-cache
2212 branch, the work tree must be switched back to the
2215 .Dq unified-buffer-cache
2216 branch can be integrated into
2219 .Dl $ got update -b master
2220 .Dl $ got integrate unified-buffer-cache
2222 Additional steps may be necessary if local changes need to be pushed back
2223 to the remote repository, which currently requires
2225 Before working against existing branches in a repository cloned with
2226 .Cm git clone --bare
2231 must be configured to map all references in the remote repository
2234 namespace of the local repository.
2235 This can achieved by setting Git's
2236 .Pa remote.origin.fetch
2237 configuration variable to the value
2238 .Dq +refs/heads/*:refs/remotes/origin/*
2243 .Dl $ cd /var/git/repo
2244 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2248 option must be disabled:
2250 .Dl $ cd /var/git/repo
2251 .Dl $ git config remote.origin.mirror false
2253 Alternatively, the following
2255 configuration item can be added manually to the Git repository's
2259 .Dl [remote "origin"]
2261 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2264 This configuration leaves the local repository's
2266 namespace free for use by local branches checked out with
2268 and, if needed, created with
2273 namespace can now be updated with incoming changes from the remote
2278 without extra command line arguments:
2280 .Dl $ cd /var/git/repo
2283 To make changes fetched from the remote repository appear on the
2287 branch must be rebased onto the
2290 This will also merge local changes, if any, with the incoming changes:
2292 .Dl $ got update -b origin/master
2293 .Dl $ got rebase master
2297 branch, log messages for local changes can now be amended with
2299 by other developers and any other important new information:
2301 .Dl $ got update -c origin/master
2302 .Dl $ got histedit -m
2304 Local changes on the
2306 branch can then be pushed to the remote
2310 .Dl $ cd /var/git/repo
2311 .Dl $ git push origin master
2314 .Xr git-repository 5 ,
2315 .Xr got-worktree 5 ,
2318 .An Stefan Sperling Aq Mt stsp@openbsd.org
2319 .An Martin Pieuchot Aq Mt mpi@openbsd.org
2320 .An Joshua Stein Aq Mt jcs@openbsd.org
2321 .An Ori Bernstein Aq Mt ori@openbsd.org
2324 is a work-in-progress and many commands remain to be implemented.
2325 At present, the user has to fall back on
2327 to perform many tasks, in particular tasks related to repository
2328 administration and tasks which require a network connection.