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
198 arguments for future use by
208 Fetch all branches from the remote repository's
210 reference namespace and set
211 .Cm fetch-all-branches
212 in the cloned repository's
214 file for future use by
216 If this option is not specified, a branch resolved via the remote
217 repository's HEAD reference will be fetched.
218 Cannot be used together with the
224 from the remote repository's
227 This option may be specified multiple times to build a list of branches
229 If the branch corresponding to the remote repository's HEAD reference is not
230 in this list, the cloned repository's HEAD reference will be set to the first
231 branch which was fetched.
232 If this option is not specified, a branch resolved via the remote
233 repository's HEAD reference will be fetched.
234 Cannot be used together with the
238 List branches and tags available for fetching from the remote repository
239 and exit immediately.
240 Cannot be used together with any of the other options except
243 Create the cloned repository as a mirror of the original repository.
244 This is useful if the cloned repository will not be used to store
245 locally created commits.
251 files will be set up with the
253 option enabled, such that
257 will write incoming changes directly to branches in the
259 reference namespace, rather than to branches in the
262 This avoids the usual requirement of having to run
266 in order to make incoming changes appear on branches in the
269 But maintaining custom changes in the cloned repository becomes difficult
270 since such changes will be at risk of being discarded whenever incoming
273 Suppress progress reporting output.
274 The same option will be passed to
281 to print debugging messages to standard error output.
282 This option will be passed to
285 Multiple -v options increase the verbosity.
287 .It Fl R Ar reference
288 In addition to the branches and tags that will be fetched, fetch an arbitrary
290 from the remote repository's
293 This option may be specified multiple times to build a list of additional
297 may either be a path to a specific reference, or a reference namespace
298 which will cause all references in this namespace to be fetched.
300 Each reference will be mapped into the cloned repository's
302 namespace, unless the
304 option is used to mirror references directly into the cloned repository's
309 will refuse to fetch references from the remote repository's
318 .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
319 Fetch new changes from a remote repository.
321 .Ar remote-repository
325 The remote repository's URL is obtained from the corresponding entry in
329 file of the local repository, as created by
332 New changes will be stored in a separate pack file downloaded from the server.
333 Optionally, separate pack files stored in the repository can be combined with
336 By default, branch references in the
338 reference namespace will be updated to point at the newly fetched commits.
341 command can then be used to make new changes visible on branches in the
343 namespace, merging incoming changes with the changes on those branches
346 If the repository was created as a mirror with
348 then all branches in the
350 namespace will be updated directly to match the corresponding branches in
351 the remote repository.
352 If those branches contained local commits, these commits will no longer be
353 reachable via a reference and will therefore be at risk of being discarded
354 by Git's garbage collector.
355 Maintaining custom changes in a mirror repository is therefore discouraged.
357 In any case, references in the
359 namespace will always be fetched and mapped directly to local references
360 in the same namespace.
367 Fetch all branches from the remote repository's
370 This option can be enabled by default for specific repositories in
372 If this option is not specified, a branch resolved via the remote
373 repository's HEAD reference will be fetched.
374 Cannot be used together with the
380 from the remote repository's
383 This option may be specified multiple times to build a list of branches
385 If this option is not specified, a branch resolved via the remote
386 repository's HEAD reference will be fetched.
387 Cannot be used together with the
391 Delete branches and tags from the local repository which are no longer
392 present in the remote repository.
393 Only references are deleted.
394 Any commit, tree, tag, and blob objects belonging to deleted branches or
395 tags remain in the repository and may be removed separately with
396 Git's garbage collector.
398 List branches and tags available for fetching from the remote repository
399 and exit immediately.
400 Cannot be used together with any of the other options except
406 Allow existing references in the
408 namespace to be updated if they have changed on the server.
409 If not specified, only new tag references will be created.
410 .It Fl r Ar repository-path
411 Use the repository at the specified path.
412 If not specified, assume the repository is located at or above the current
414 If this directory is a
416 work tree, use the repository path associated with this work tree.
418 Suppress progress reporting output.
419 The same option will be passed to
426 to print debugging messages to standard error output.
427 The same option will be passed to
430 Multiple -v options increase the verbosity.
432 .It Fl R Ar reference
433 In addition to the branches and tags that will be fetched, fetch an arbitrary
435 from the remote repository's
438 This option may be specified multiple times to build a list of additional
442 may either be a path to a specific reference, or a reference namespace
443 which will cause all references in this namespace to be fetched.
445 Each reference will be mapped into the local repository's
447 namespace, unless the local repository was created as a mirror with
449 in which case references will be mapped directly into the local repository's
453 Once a reference has been fetched, a branch based on it can be created with
458 will refuse to fetch references from the remote repository's
467 .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
468 Copy files from a repository into a new work tree.
469 Show the status of each affected file, using the following status codes:
470 .Bl -column YXZ description
471 .It A Ta new file was added
472 .It E Ta file already exists in work tree's meta-data
477 is not specified, either use the last component of
478 .Ar repository path ,
481 was specified use the last component of
489 Proceed with the checkout operation even if the directory at
492 Existing files will be left intact.
494 Check out files from a commit on the specified
496 If this option is not specified, a branch resolved via the repository's HEAD
497 reference will be used.
499 Check out files from the specified
501 on the selected branch.
502 The expected argument is a commit ID SHA1 hash or an existing reference
503 or tag name which will be resolved to a commit ID.
504 An abbreviated hash argument will be expanded to a full SHA1 hash
505 automatically, provided the abbreviation is unique.
506 If this option is not specified, the most recent commit on the selected
511 is not contained in the selected branch, a different branch which contains
512 this commit must be specified with the
515 If no such branch is known a new branch must be created for this
521 Checking out work trees with an unknown branch is intentionally not supported.
522 .It Fl p Ar path-prefix
523 Restrict the work tree to a subset of the repository's tree hierarchy.
524 Only files beneath the specified
531 .It Cm update Oo Fl b Ar branch Oc Oo Fl c Ar commit Oc Op Ar path ...
532 Update an existing work tree to a different
534 Change existing files in the work tree as necessary to match file contents
536 Preserve any local changes in the work tree and merge them with the
539 Files which already contain merge conflicts will not be updated to avoid
540 further complications.
541 Such files will be updated when
543 is run again after merge conflicts have been resolved.
544 If the conflicting changes are no longer needed affected files can be
551 Show the status of each affected file, using the following status codes:
552 .Bl -column YXZ description
553 .It U Ta file was updated and contained no local changes
554 .It G Ta file was updated and local changes were merged cleanly
555 .It C Ta file was updated and conflicts occurred during merge
556 .It D Ta file was deleted
557 .It A Ta new file was added
558 .It \(a~ Ta versioned file is obstructed by a non-regular file
559 .It ! Ta a missing versioned file was restored
560 .It # Ta file was not updated because it contains merge conflicts
561 .It ? Ta changes destined for an unversioned file were not merged
566 is specified, update the entire work tree.
567 Otherwise, restrict the update operation to files at or within the
569 Each path is required to exist in the update operation's target commit.
570 Files in the work tree outside specified paths will remain unchanged and
571 will retain their previously recorded base commit.
574 commands may refuse to run while the work tree contains files from
575 multiple base commits.
576 The base commit of such a work tree can be made consistent by running
578 across the entire work tree.
581 is incompatible with the
586 cannot update paths with staged changes.
587 If changes have been staged with
589 these changes must first be committed with
599 Switch the work tree's branch reference to the specified
601 before updating the work tree.
602 This option requires that all paths in the work tree are updated.
604 As usual, any local changes in the work tree will be preserved.
605 This can be useful when switching to a newly created branch in order
606 to commit existing local changes to this branch.
608 Any local changes must be dealt with separately in order to obtain a
609 work tree with pristine file contents corresponding exactly to the specified
611 Such changes could first be committed to a different branch with
613 or could be discarded with
616 Update the work tree to the specified
618 The expected argument is a commit ID SHA1 hash or an existing reference
619 or tag name which will be resolved to a commit ID.
620 An abbreviated hash argument will be expanded to a full SHA1 hash
621 automatically, provided the abbreviation is unique.
622 If this option is not specified, the most recent commit on the work tree's
628 .It Cm status Oo Fl s Ar status-codes Oc Op Ar path ...
629 Show the current modification status of files in a work tree,
630 using the following status codes:
631 .Bl -column YXZ description
632 .It M Ta modified file
633 .It A Ta file scheduled for addition in next commit
634 .It D Ta file scheduled for deletion in next commit
635 .It C Ta modified or added file which contains merge conflicts
636 .It ! Ta versioned file was expected on disk but is missing
637 .It \(a~ Ta versioned file is obstructed by a non-regular file
638 .It ? Ta unversioned item not tracked by
640 .It m Ta modified file modes (executable bit only)
641 .It N Ta non-existent
643 specified on the command line
648 is specified, show modifications in the entire work tree.
649 Otherwise, show modifications at or within the specified paths.
651 If changes have been staged with
653 staged changes are shown in the second output column, using the following
655 .Bl -column YXZ description
656 .It M Ta file modification is staged
657 .It A Ta file addition is staged
658 .It D Ta file deletion is staged
661 Changes created on top of staged changes are indicated in the first column:
662 .Bl -column YXZ description
663 .It MM Ta file was modified after earlier changes have been staged
664 .It MA Ta file was modified after having been staged for addition
671 .It Fl s Ar status-codes
672 Only show files with a modification status matching any of the
673 single-character status codes contained in the
676 Any combination of codes from the above list of possible status codes
678 For staged files, status codes displayed in either column will be matched.
681 For compatibility with
692 files in each traversed directory and will not display unversioned files
693 which match these patterns.
698 supports consecutive asterisks,
700 which will match an arbitrary amount of directories.
704 only supports a single ignore pattern per line.
708 does not support negated ignore patterns prefixed with
710 and gives no special significance to the location of path component separators,
716 .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
717 Display history of a repository.
720 is specified, show only commits which modified this path.
721 If invoked in a work tree, the
723 is interpreted relative to the current working directory,
724 and the work tree's path prefix is implicitly prepended.
725 Otherwise, the path is interpreted relative to the repository root.
732 Display individual commits which were merged into the current branch
736 shows the linear history of the current branch only.
738 Start traversing history at the specified
740 The expected argument is a commit ID SHA1 hash or an existing reference
741 or tag name which will be resolved to a commit ID.
742 An abbreviated hash argument will be expanded to a full SHA1 hash
743 automatically, provided the abbreviation is unique.
744 If this option is not specified, default to the work tree's current branch
745 if invoked in a work tree, or to the repository's HEAD reference.
747 Set the number of context lines shown in diffs with
749 By default, 3 lines of context are shown.
751 Limit history traversal to a given number of commits.
752 If this option is not specified, a default limit value of zero is used,
753 which is treated as an unbounded limit.
755 .Ev GOT_LOG_DEFAULT_LIMIT
756 environment variable may be set to change this default value.
758 Display the patch of modifications made in each commit.
761 is specified, only show the patch of modifications at or within this path.
763 Display the list of file paths changed in each commit, using the following
765 .Bl -column YXZ description
766 .It M Ta modified file
767 .It D Ta file was deleted
768 .It A Ta new file was added
769 .It m Ta modified file modes (executable bit only)
771 .It Fl s Ar search-pattern
772 If specified, show only commits with a log message matched by the extended
775 When used together with
777 then the file paths changed by a commit can be matched as well.
778 Regular expression syntax is documented in
780 .It Fl r Ar repository-path
781 Use the repository at the specified path.
782 If not specified, assume the repository is located at or above the current
784 If this directory is a
786 work tree, use the repository path associated with this work tree.
788 Determine a set of commits to display as usual, but display these commits
791 Stop traversing commit history as soon as the specified
794 This option has no effect if the specified
798 .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
799 When invoked within a work tree with less than two arguments, display
800 local changes in the work tree.
803 is specified, only show changes within this path.
805 If two arguments are provided, treat each argument as a reference, a tag
806 name, or an object ID SHA1 hash, and display differences between the
807 corresponding objects.
808 Both objects must be of the same type (blobs, trees, or commits).
809 An abbreviated hash argument will be expanded to a full SHA1 hash
810 automatically, provided the abbreviation is unique.
817 Treat file contents as ASCII text even if binary data is detected.
819 Set the number of context lines shown in the diff.
820 By default, 3 lines of context are shown.
821 .It Fl r Ar repository-path
822 Use the repository at the specified path.
823 If not specified, assume the repository is located at or above the current
825 If this directory is a
827 work tree, use the repository path associated with this work tree.
829 Show changes staged with
831 instead of showing local changes in the work tree.
832 This option is only valid when
834 is invoked in a work tree.
836 Ignore whitespace-only changes.
841 .It Cm blame Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Ar path
842 Display line-by-line history of a file at the specified path.
849 Start traversing history at the specified
851 The expected argument is a commit ID SHA1 hash or an existing reference
852 or tag name which will be resolved to a commit ID.
853 An abbreviated hash argument will be expanded to a full SHA1 hash
854 automatically, provided the abbreviation is unique.
855 .It Fl r Ar repository-path
856 Use the repository at the specified path.
857 If not specified, assume the repository is located at or above the current
859 If this directory is a
861 work tree, use the repository path associated with this work tree.
866 .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
867 Display a listing of files and directories at the specified
868 directory path in the repository.
869 Entries shown in this listing may carry one of the following trailing
871 .Bl -column YXZ description
872 .It @ Ta entry is a symbolic link
873 .It / Ta entry is a directory
874 .It * Ta entry is an executable file
875 .It $ Ta entry is a Git submodule
878 Symbolic link entries are also annotated with the target path of the link.
882 is specified, list the repository path corresponding to the current
883 directory of the work tree, or the root directory of the repository
884 if there is no work tree.
891 List files and directories as they appear in the specified
893 The expected argument is a commit ID SHA1 hash or an existing reference
894 or tag name which will be resolved to a commit ID.
895 An abbreviated hash argument will be expanded to a full SHA1 hash
896 automatically, provided the abbreviation is unique.
897 .It Fl r Ar repository-path
898 Use the repository at the specified path.
899 If not specified, assume the repository is located at or above the current
901 If this directory is a
903 work tree, use the repository path associated with this work tree.
905 Show object IDs of files (blob objects) and directories (tree objects).
907 Recurse into sub-directories in the repository.
912 .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
913 Manage references in a repository.
915 References may be listed, created, deleted, and changed.
916 When creating, deleting, or changing a reference the specified
918 must be an absolute reference name, i.e. it must begin with
925 .It Fl r Ar repository-path
926 Use the repository at the specified path.
927 If not specified, assume the repository is located at or above the current
929 If this directory is a
931 work tree, use the repository path associated with this work tree.
933 List references in the repository.
936 is specified, list all existing references in the repository.
939 is a reference namespace, list all references in this namespace.
940 Otherwise, show only the reference with the given
942 Cannot be used together with any other options except
945 Create a reference or change an existing reference.
946 The reference with the specified
948 will point at the specified
952 argument is a ID SHA1 hash or an existing reference or tag name which will
953 be resolved to the ID of a corresponding commit, tree, tag, or blob object.
954 Cannot be used together with any other options except
956 .It Fl s Ar reference
957 Create a symbolic reference, or change an existing symbolic reference.
958 The symbolic reference with the specified
960 will point at the specified
962 which must already exist in the repository.
963 Care should be taken not to create loops between references when
965 Cannot be used together with any other options except
968 Delete the reference with the specified
971 Cannot be used together with any other options except
974 .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
975 Create, list, or delete branches.
977 Branches are managed via references which live in the
982 command operates on references in this namespace only.
984 If invoked in a work tree without any arguments, print the name of the
985 work tree's current branch.
989 argument is passed, attempt to create a branch reference with the given name.
990 By default the new branch reference will point at the latest commit on the
991 work tree's current branch if invoked in a work tree, and otherwise to a commit
992 resolved via the repository's HEAD reference.
994 If invoked in a work tree, once the branch was created successfully
995 switch the work tree's head reference to the newly created branch and
996 update files across the entire work tree, just like
997 .Cm got update -b Ar name
999 Show the status of each affected file, using the following status codes:
1000 .Bl -column YXZ description
1001 .It U Ta file was updated and contained no local changes
1002 .It G Ta file was updated and local changes were merged cleanly
1003 .It C Ta file was updated and conflicts occurred during merge
1004 .It D Ta file was deleted
1005 .It A Ta new file was added
1006 .It \(a~ Ta versioned file is obstructed by a non-regular file
1007 .It ! Ta a missing versioned file was restored
1015 Make a newly created branch reference point at the specified
1019 argument is a commit ID SHA1 hash or an existing reference
1020 or tag name which will be resolved to a commit ID.
1021 .It Fl r Ar repository-path
1022 Use the repository at the specified path.
1023 If not specified, assume the repository is located at or above the current
1025 If this directory is a
1027 work tree, use the repository path associated with this work tree.
1029 List all existing branches in the repository.
1030 If invoked in a work tree, the work tree's current branch is shown
1031 with one the following annotations:
1032 .Bl -column YXZ description
1033 .It * Ta work tree's base commit matches the branch tip
1034 .It \(a~ Ta work tree's base commit is out-of-date
1037 Delete the branch with the specified name from the repository.
1038 Only the branch reference is deleted.
1039 Any commit, tree, and blob objects belonging to the branch
1040 remain in the repository and may be removed separately with
1041 Git's garbage collector.
1043 Do not switch and update the work tree after creating a new branch.
1048 .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
1049 Manage tags in a repository.
1051 Tags are managed via references which live in the
1053 reference namespace.
1056 command operates on references in this namespace only.
1057 References in this namespace point at tag objects which contain a pointer
1058 to another object, a tag message, as well as author and timestamp information.
1060 Attempt to create a tag with the given
1062 and make this tag point at the given
1064 If no commit is specified, default to the latest commit on the work tree's
1065 current branch if invoked in a work tree, and to a commit resolved via
1066 the repository's HEAD reference otherwise.
1073 Make the newly created tag reference point at the specified
1077 argument is a commit ID SHA1 hash or an existing reference or tag name which
1078 will be resolved to a commit ID.
1079 An abbreviated hash argument will be expanded to a full SHA1 hash
1080 automatically, provided the abbreviation is unique.
1082 Use the specified tag message when creating the new tag.
1087 opens a temporary file in an editor where a tag message can be written.
1088 .It Fl r Ar repository-path
1089 Use the repository at the specified path.
1090 If not specified, assume the repository is located at or above the current
1092 If this directory is a
1094 work tree, use the repository path associated with this work tree.
1096 List all existing tags in the repository instead of creating a new tag.
1097 If this option is used, no other command-line arguments are allowed.
1102 command will not delete tags or change existing tags.
1103 If a tag must be deleted, the
1105 command may be used to delete a tag's reference.
1106 This should only be done if the tag has not already been copied to
1108 .It Cm add Oo Fl R Oc Oo Fl I Oc Ar path ...
1109 Schedule unversioned files in a work tree for addition to the
1110 repository in the next commit.
1117 Permit recursion into directories.
1118 If this option is not specified,
1120 will refuse to run if a specified
1124 With -R, add files even if they match a
1128 .It Cm remove Oo Fl f Oc Oo Fl k Oc Oo Fl R Oc Oo Fl s Ar status-codes Oc Ar path ...
1129 Remove versioned files from a work tree and schedule them for deletion
1130 from the repository in the next commit.
1137 Perform the operation even if a file contains local modifications.
1139 Keep affected files on disk.
1141 Permit recursion into directories.
1142 If this option is not specified,
1144 will refuse to run if a specified
1147 .It Fl s Ar status-codes
1148 Only delete files with a modification status matching one of the
1149 single-character status codes contained in the
1152 The following status codes may be specified:
1153 .Bl -column YXZ description
1154 .It M Ta modified file (this implies the
1157 .It ! Ta versioned file expected on disk but missing
1163 .It Cm revert Oo Fl p Oc Oo Fl F Ar response-script Oc Oo Fl R Oc Ar path ...
1164 Revert any local changes in files at the specified paths in a work tree.
1165 File contents will be overwritten with those contained in the
1166 work tree's base commit.
1167 There is no way to bring discarded changes back after
1170 If a file was added with
1172 it will become an unversioned file again.
1173 If a file was deleted with
1175 it will be restored.
1182 Instead of reverting all changes in files, interactively select or reject
1183 changes to revert based on
1189 (quit reverting this file) responses.
1190 If a file is in modified status, individual patches derived from the
1191 modified file content can be reverted.
1192 Files in added or deleted status may only be reverted in their entirety.
1193 .It Fl F Ar response-script
1201 responses line-by-line from the specified
1203 file instead of prompting interactively.
1205 Permit recursion into directories.
1206 If this option is not specified,
1208 will refuse to run if a specified
1215 .It Cm commit Oo Fl m Ar message Oc Oo Fl S Oc Op Ar path ...
1216 Create a new commit in the repository from changes in a work tree
1217 and use this commit as the new base commit for the work tree.
1220 is specified, commit all changes in the work tree.
1221 Otherwise, commit changes at or within the specified paths.
1223 If changes have been explicitly staged for commit with
1225 only commit staged changes and reject any specified paths which
1226 have not been staged.
1228 Show the status of each affected file, using the following status codes:
1229 .Bl -column YXZ description
1230 .It M Ta modified file
1231 .It D Ta file was deleted
1232 .It A Ta new file was added
1233 .It m Ta modified file modes (executable bit only)
1236 Files which are not part of the new commit will retain their previously
1237 recorded base commit.
1240 commands may refuse to run while the work tree contains files from
1241 multiple base commits.
1242 The base commit of such a work tree can be made consistent by running
1244 across the entire work tree.
1248 command requires the
1250 environment variable to be set,
1251 unless an author has been configured in
1257 configuration settings can be
1258 obtained from the repository's
1260 file or from Git's global
1269 Use the specified log message when creating the new commit.
1274 opens a temporary file in an editor where a log message can be written.
1276 Allow the addition of symbolic links which point outside of the path space
1277 that is under version control.
1280 will reject such symbolic links due to safety concerns.
1283 may decide to represent such a symbolic link as a regular file which contains
1284 the link's target path, rather than creating an actual symbolic link which
1285 points outside of the work tree.
1286 Use of this option is discouraged because external mechanisms such as
1288 are better suited for managing symbolic links to paths not under
1293 will refuse to run if certain preconditions are not met.
1294 If the work tree's current branch is not in the
1296 reference namespace, new commits may not be created on this branch.
1297 Local changes may only be committed if they are based on file content
1298 found in the most recent commit on the work tree's branch.
1299 If a path is found to be out of date,
1301 must be used first in order to merge local changes with changes made
1306 .It Cm cherrypick Ar commit
1307 Merge changes from a single
1312 must be on a different branch than the work tree's base commit.
1313 The expected argument is a reference or a commit ID SHA1 hash.
1314 An abbreviated hash argument will be expanded to a full SHA1 hash
1315 automatically, provided the abbreviation is unique.
1317 Show the status of each affected file, using the following status codes:
1318 .Bl -column YXZ description
1319 .It G Ta file was merged
1320 .It C Ta file was merged and conflicts occurred during merge
1321 .It ! Ta changes destined for a missing file were not merged
1322 .It D Ta file was deleted
1323 .It d Ta file's deletion was obstructed by local modifications
1324 .It A Ta new file was added
1325 .It \(a~ Ta changes destined for a non-regular file were not merged
1326 .It ? Ta changes destined for an unversioned file were not merged
1329 The merged changes will appear as local changes in the work tree, which
1332 amended manually or with further
1337 or discarded again with
1341 will refuse to run if certain preconditions are not met.
1342 If the work tree contains multiple base commits it must first be updated
1343 to a single base commit with
1345 If the work tree already contains files with merge conflicts, these
1346 conflicts must be resolved first.
1350 .It Cm backout Ar commit
1351 Reverse-merge changes from a single
1356 must be on the same branch as the work tree's base commit.
1357 The expected argument is a reference or a commit ID SHA1 hash.
1358 An abbreviated hash argument will be expanded to a full SHA1 hash
1359 automatically, provided the abbreviation is unique.
1361 Show the status of each affected file, using the following status codes:
1362 .Bl -column YXZ description
1363 .It G Ta file was merged
1364 .It C Ta file was merged and conflicts occurred during merge
1365 .It ! Ta changes destined for a missing file were not merged
1366 .It D Ta file was deleted
1367 .It d Ta file's deletion was obstructed by local modifications
1368 .It A Ta new file was added
1369 .It \(a~ Ta changes destined for a non-regular file were not merged
1370 .It ? Ta changes destined for an unversioned file were not merged
1373 The reverse-merged changes will appear as local changes in the work tree,
1374 which may be viewed with
1376 amended manually or with further
1381 or discarded again with
1385 will refuse to run if certain preconditions are not met.
1386 If the work tree contains multiple base commits it must first be updated
1387 to a single base commit with
1389 If the work tree already contains files with merge conflicts, these
1390 conflicts must be resolved first.
1394 .It Cm rebase Oo Fl a Oc Oo Fl c Oc Op Ar branch
1395 Rebase commits on the specified
1397 onto the tip of the current branch of the work tree.
1400 must share common ancestry with the work tree's current branch.
1401 Rebasing begins with the first descendant commit of the youngest
1402 common ancestor commit shared by the specified
1404 and the work tree's current branch, and stops once the tip commit
1411 is used as intended, the specified
1413 represents a local commit history and may already contain changes
1414 that are not yet visible in any other repositories.
1415 The work tree's current branch, which must be set with
1419 operation, represents a branch from a remote repository which shares
1420 a common history with the specified
1422 but has progressed, and perhaps diverged, due to commits added to the
1425 Rebased commits are accumulated on a temporary branch which the work tree
1426 will remain switched to throughout the entire rebase operation.
1427 Commits on this branch represent the same changes with the same log
1428 messages as their counterparts on the original
1430 but with different commit IDs.
1431 Once rebasing has completed successfully, the temporary branch becomes
1432 the new version of the specified
1434 and the work tree is automatically switched to it.
1436 While rebasing commits, show the status of each affected file,
1437 using the following status codes:
1438 .Bl -column YXZ description
1439 .It G Ta file was merged
1440 .It C Ta file was merged and conflicts occurred during merge
1441 .It ! Ta changes destined for a missing file were not merged
1442 .It D Ta file was deleted
1443 .It d Ta file's deletion was obstructed by local modifications
1444 .It A Ta new file was added
1445 .It \(a~ Ta changes destined for a non-regular file were not merged
1446 .It ? Ta changes destined for an unversioned file were not merged
1449 If merge conflicts occur the rebase operation is interrupted and may
1450 be continued once conflicts have been resolved.
1451 Alternatively, the rebase operation may be aborted which will leave
1453 unmodified and the work tree switched back to its original branch.
1455 If a merge conflict is resolved in a way which renders the merged
1456 change into a no-op change, the corresponding commit will be elided
1457 when the rebase operation continues.
1460 will refuse to run if certain preconditions are not met.
1461 If the work tree is not yet fully updated to the tip commit of its
1462 branch then the work tree must first be updated with
1464 If changes have been staged with
1466 these changes must first be committed with
1470 If the work tree contains local changes, these changes must first be
1477 contains changes to files outside of the work tree's path prefix,
1478 the work tree cannot be used to rebase this branch.
1484 commands will refuse to run while a rebase operation is in progress.
1485 Other commands which manipulate the work tree may be used for
1486 conflict resolution purposes.
1493 Abort an interrupted rebase operation.
1494 If this option is used, no other command-line arguments are allowed.
1496 Continue an interrupted rebase operation.
1497 If this option is used, no other command-line arguments are allowed.
1502 .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
1503 Edit commit history between the work tree's current base commit and
1504 the tip commit of the work tree's current branch.
1508 operation the work tree's current branch must be set with
1510 to the branch which should be edited, unless this branch is already the
1511 current branch of the work tree.
1512 The tip of this branch represents the upper bound (inclusive) of commits
1517 Furthermore, the work tree's base commit
1520 to a point in this branch's commit history where editing should begin.
1521 This commit represents the lower bound (non-inclusive) of commits touched
1526 Editing of commit history is controlled via a
1528 which can be written in an editor based on a template, passed on the
1529 command line, or generated with the
1535 The format of the histedit script is line-based.
1536 Each line in the script begins with a command name, followed by
1537 whitespace and an argument.
1538 For most commands, the expected argument is a commit ID SHA1 hash.
1539 Any remaining text on the line is ignored.
1540 Lines which begin with the
1542 character are ignored entirely.
1544 The available commands are as follows:
1545 .Bl -column YXZ pick-commit
1546 .It pick Ar commit Ta Use the specified commit as it is.
1547 .It edit Ar commit Ta Use the specified commit but once changes have been
1548 merged into the work tree interrupt the histedit operation for amending.
1549 .It fold Ar commit Ta Combine the specified commit with the next commit
1550 listed further below that will be used.
1551 .It drop Ar commit Ta Remove this commit from the edited history.
1552 .It mesg Ar log-message Ta Use the specified single-line log message for
1553 the commit on the previous line.
1554 If the log message argument is left empty, open an editor where a new
1555 log message can be written.
1558 Every commit in the history being edited must be mentioned in the script.
1559 Lines may be re-ordered to change the order of commits in the edited history.
1560 No commit may be listed more than once.
1562 Edited commits are accumulated on a temporary branch which the work tree
1563 will remain switched to throughout the entire histedit operation.
1564 Once history editing has completed successfully, the temporary branch becomes
1565 the new version of the work tree's branch and the work tree is automatically
1568 While merging commits, show the status of each affected file,
1569 using the following status codes:
1570 .Bl -column YXZ description
1571 .It G Ta file was merged
1572 .It C Ta file was merged and conflicts occurred during merge
1573 .It ! Ta changes destined for a missing file were not merged
1574 .It D Ta file was deleted
1575 .It d Ta file's deletion was obstructed by local modifications
1576 .It A Ta new file was added
1577 .It \(a~ Ta changes destined for a non-regular file were not merged
1578 .It ? Ta changes destined for an unversioned file were not merged
1581 If merge conflicts occur the histedit operation is interrupted and may
1582 be continued once conflicts have been resolved.
1583 Alternatively, the histedit operation may be aborted which will leave
1584 the work tree switched back to its original branch.
1586 If a merge conflict is resolved in a way which renders the merged
1587 change into a no-op change, the corresponding commit will be elided
1588 when the histedit operation continues.
1591 will refuse to run if certain preconditions are not met.
1592 If the work tree's current branch is not in the
1594 reference namespace, the history of the branch may not be edited.
1595 If the work tree contains multiple base commits it must first be updated
1596 to a single base commit with
1598 If changes have been staged with
1600 these changes must first be committed with
1604 If the work tree contains local changes, these changes must first be
1609 If the edited history contains changes to files outside of the work tree's
1610 path prefix, the work tree cannot be used to edit the history of this branch.
1617 commands will refuse to run while a histedit operation is in progress.
1618 Other commands which manipulate the work tree may be used, and the
1620 command may be used to commit arbitrary changes to the temporary branch
1621 while the histedit operation is interrupted.
1628 Abort an interrupted histedit operation.
1629 If this option is used, no other command-line arguments are allowed.
1631 Continue an interrupted histedit operation.
1632 If this option is used, no other command-line arguments are allowed.
1634 Fold all commits into a single commit.
1635 This option is a quick equivalent to a histedit script which folds all
1636 commits, combining them all into one commit.
1639 option can only be used when starting a new histedit operation.
1640 If this option is used, no other command-line arguments are allowed.
1641 .It Fl F Ar histedit-script
1644 instead of opening a temporary file in an editor where a histedit script
1647 Edit log messages only.
1648 This option is a quick equivalent to a histedit script which edits
1649 only log messages but otherwise leaves every picked commit as-is.
1652 option can only be used when starting a new histedit operation.
1653 If this option is used, no other command-line arguments are allowed.
1658 .It Cm integrate Ar branch
1659 Integrate the specified
1661 into the work tree's current branch.
1662 Files in the work tree are updated to match the contents on the integrated
1664 and the reference of the work tree's branch is changed to point at the
1665 head commit of the integrated
1668 Both branches can be considered equivalent after integration since they
1669 will be pointing at the same commit.
1670 Both branches remain available for future work, if desired.
1671 In case the integrated
1673 is no longer needed it may be deleted with
1676 Show the status of each affected file, using the following status codes:
1677 .Bl -column YXZ description
1678 .It U Ta file was updated
1679 .It D Ta file was deleted
1680 .It A Ta new file was added
1681 .It \(a~ Ta versioned file is obstructed by a non-regular file
1682 .It ! Ta a missing versioned file was restored
1686 will refuse to run if certain preconditions are not met.
1687 Most importantly, the
1689 must have been rebased onto the work tree's current branch with
1691 before it can be integrated, in order to linearize commit history and
1692 resolve merge conflicts.
1693 If the work tree contains multiple base commits it must first be updated
1694 to a single base commit with
1696 If changes have been staged with
1698 these changes must first be committed with
1702 If the work tree contains local changes, these changes must first be
1710 .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 ...
1711 Stage local changes for inclusion in the next commit.
1714 is specified, stage all changes in the work tree.
1715 Otherwise, stage changes at or within the specified paths.
1716 Paths may be staged if they are added, modified, or deleted according to
1719 Show the status of each affected file, using the following status codes:
1720 .Bl -column YXZ description
1721 .It A Ta file addition has been staged
1722 .It M Ta file modification has been staged
1723 .It D Ta file deletion has been staged
1726 Staged file contents are saved in newly created blob objects in the repository.
1727 These blobs will be referred to by tree objects once staged changes have been
1730 Staged changes affect the behaviour of
1735 While paths with staged changes exist, the
1737 command will refuse to commit any paths which do not have staged changes.
1738 Local changes created on top of staged changes can only be committed if
1739 the path is staged again, or if the staged changes are committed first.
1742 command will show both local changes and staged changes.
1745 command is able to display local changes relative to staged changes,
1746 and to display staged changes relative to the repository.
1749 command cannot revert staged changes but may be used to revert
1750 local changes created on top of staged changes.
1757 Instead of staging new changes, list paths which are already staged,
1758 along with the IDs of staged blob objects and stage status codes.
1759 If paths were provided in the command line show the staged paths
1760 among the specified paths.
1761 Otherwise, show all staged paths.
1763 Instead of staging the entire content of a changed file, interactively
1764 select or reject changes for staging based on
1768 (reject change), and
1770 (quit staging this file) responses.
1771 If a file is in modified status, individual patches derived from the
1772 modified file content can be staged.
1773 Files in added or deleted status may only be staged or rejected in
1775 .It Fl F Ar response-script
1783 responses line-by-line from the specified
1785 file instead of prompting interactively.
1787 Allow staging of symbolic links which point outside of the path space
1788 that is under version control.
1791 will reject such symbolic links due to safety concerns.
1794 may decide to represent such a symbolic link as a regular file which contains
1795 the link's target path, rather than creating an actual symbolic link which
1796 points outside of the work tree.
1797 Use of this option is discouraged because external mechanisms such as
1799 are better suited for managing symbolic links to paths not under
1804 will refuse to run if certain preconditions are not met.
1805 If a file contains merge conflicts, these conflicts must be resolved first.
1806 If a file is found to be out of date relative to the head commit on the
1807 work tree's current branch, the file must be updated with
1809 before it can be staged (however, this does not prevent the file from
1810 becoming out-of-date at some point after having been staged).
1817 commands will refuse to run while staged changes exist.
1818 If staged changes cannot be committed because a staged path
1819 is out of date, the path must be unstaged with
1821 before it can be updated with
1823 and may then be staged again if necessary.
1827 .It Cm unstage Oo Fl p Oc Oo Fl F Ar response-script Oc Op Ar path ...
1828 Merge staged changes back into the work tree and put affected paths
1829 back into non-staged status.
1832 is specified, unstage all staged changes across the entire work tree.
1833 Otherwise, unstage changes at or within the specified paths.
1835 Show the status of each affected file, using the following status codes:
1836 .Bl -column YXZ description
1837 .It G Ta file was unstaged
1838 .It C Ta file was unstaged and conflicts occurred during merge
1839 .It ! Ta changes destined for a missing file were not merged
1840 .It D Ta file was staged as deleted and still is deleted
1841 .It d Ta file's deletion was obstructed by local modifications
1842 .It \(a~ Ta changes destined for a non-regular file were not merged
1850 Instead of unstaging the entire content of a changed file, interactively
1851 select or reject changes for unstaging based on
1855 (keep change staged), and
1857 (quit unstaging this file) responses.
1858 If a file is staged in modified status, individual patches derived from the
1859 staged file content can be unstaged.
1860 Files staged in added or deleted status may only be unstaged in their entirety.
1861 .It Fl F Ar response-script
1869 responses line-by-line from the specified
1871 file instead of prompting interactively.
1876 .It Cm cat Oo Fl c Ar commit Oc Oo Fl r Ar repository-path Oc Oo Fl P Oc Ar arg ...
1877 Parse and print contents of objects to standard output in a line-based
1879 Content of commit, tree, and tag objects is printed in a way similar
1880 to the actual content stored in such objects.
1881 Blob object contents are printed as they would appear in files on disk.
1883 Attempt to interpret each argument as a reference, a tag name, or
1884 an object ID SHA1 hash.
1885 References will be resolved to an object ID.
1886 Tag names will resolved to a tag object.
1887 An abbreviated hash argument will be expanded to a full SHA1 hash
1888 automatically, provided the abbreviation is unique.
1890 If none of the above interpretations produce a valid result, or if the
1892 option is used, attempt to interpret the argument as a path which will
1893 be resolved to the ID of an object found at this path in the repository.
1900 Look up paths in the specified
1902 If this option is not used, paths are looked up in the commit resolved
1903 via the repository's HEAD reference.
1904 The expected argument is a commit ID SHA1 hash or an existing reference
1905 or tag name which will be resolved to a commit ID.
1906 An abbreviated hash argument will be expanded to a full SHA1 hash
1907 automatically, provided the abbreviation is unique.
1908 .It Fl r Ar repository-path
1909 Use the repository at the specified path.
1910 If not specified, assume the repository is located at or above the current
1912 If this directory is a
1914 work tree, use the repository path associated with this work tree.
1916 Interpret all arguments as paths only.
1917 This option can be used to resolve ambiguity in cases where paths
1918 look like tag names, reference names, or object IDs.
1920 .It Cm info Op Ar path ...
1921 Display meta-data stored in a work tree.
1926 The work tree to use is resolved implicitly by walking upwards from the
1927 current working directory.
1931 arguments are specified, show additional per-file information for tracked
1932 files located at or within these paths.
1935 argument corresponds to the work tree's root directory, display information
1936 for all tracked files.
1939 .Bl -tag -width GOT_AUTHOR
1941 The author's name and email address for
1946 .Dq An Flan Hacker Aq Mt flan_hacker@openbsd.org .
1949 may fail to parse commits without an email address in author data,
1953 environment variables with a missing email address.
1955 .Ev GOT_AUTHOR will be overriden by configuration settings in
1961 configuration settings in the repository's
1968 configuration settings contained in Git's global
1970 configuration file will only be used if neither
1974 environment variable provide author information.
1975 .It Ev VISUAL , EDITOR
1976 The editor spawned by
1984 text editor will be spawned in order to give
1986 the attention it deserves.
1987 .It Ev GOT_LOG_DEFAULT_LIMIT
1988 The default limit on the number of commits traversed by
1990 If set to zero, the limit is unbounded.
1991 This variable will be silently ignored if it is set to a non-numeric value.
1994 .Bl -tag -width packed-refs -compact
1996 Repository-wide configuration settings for
2000 configuration file located in the root directory of a Git repository
2001 supersedes any relevant settings in Git's
2005 .It Pa .got/got.conf
2006 Worktree-specific configuration settings for
2010 configuration file in the
2012 meta-data directory of a work tree supersedes any relevant settings in
2015 configuration file and Git's
2022 Clone an existing Git repository for use with
2026 .Dl $ got clone ssh://git@github.com/openbsd/src.git
2028 Use of HTTP URLs currently requires
2032 .Dl $ git clone --bare https://github.com/openbsd/src.git
2034 Alternatively, for quick and dirty local testing of
2036 a new Git repository could be created and populated with files,
2037 e.g. from a temporary CVS checkout located at
2040 .Dl $ got init /var/git/src.git
2041 .Dl $ got import -r /var/git/src.git -I CVS -I obj /tmp/src
2043 Check out a work tree from the Git repository to /usr/src:
2045 .Dl $ got checkout /var/git/src.git /usr/src
2047 View local changes in a work tree directory:
2049 .Dl $ got diff | less
2051 In a work tree, display files in a potentially problematic state:
2053 .Dl $ got status -s 'C!~?'
2055 Interactively revert selected local changes in a work tree directory:
2057 .Dl $ got revert -p -R\ .
2059 In a work tree or a git repository directory, list all branch references:
2063 In a work tree or a git repository directory, create a new branch called
2064 .Dq unified-buffer-cache
2065 which is forked off the
2069 .Dl $ got branch unified-buffer-cache master
2071 Switch an existing work tree to the branch
2072 .Dq unified-buffer-cache .
2073 Local changes in the work tree will be preserved and merged if necessary:
2075 .Dl $ got update -b unified-buffer-cache
2077 Create a new commit from local changes in a work tree directory.
2078 This new commit will become the head commit of the work tree's current branch:
2082 In a work tree or a git repository directory, view changes committed in
2083 the 3 most recent commits to the work tree's branch, or the branch resolved
2084 via the repository's HEAD reference, respectively:
2086 .Dl $ got log -p -l 3
2088 As above, but display changes in the order in which
2090 could apply them in sequence:
2092 .Dl $ got log -p -l 3 -R
2094 In a work tree or a git repository directory, log the history of a subdirectory:
2096 .Dl $ got log sys/uvm
2098 While operating inside a work tree, paths are specified relative to the current
2099 working directory, so this command will log the subdirectory
2102 .Dl $ cd sys/uvm && got log\ .
2104 And this command has the same effect:
2106 .Dl $ cd sys/dev/usb && got log ../../uvm
2108 And this command displays work tree meta-data about all tracked files:
2111 .Dl $ got info\ . | less
2113 Add new files and remove obsolete files in a work tree directory:
2115 .Dl $ got add sys/uvm/uvm_ubc.c
2116 .Dl $ got remove sys/uvm/uvm_vnode.c
2118 Create a new commit from local changes in a work tree directory
2119 with a pre-defined log message.
2121 .Dl $ got commit -m 'unify the buffer cache'
2123 Alternatively, create a new commit from local changes in a work tree
2124 directory with a log message that has been prepared in the file
2131 can be read into the buffer for review:
2136 Update any work tree checked out from the
2137 .Dq unified-buffer-cache
2138 branch to the latest commit on this branch:
2142 Roll file content on the unified-buffer-cache branch back by one commit,
2143 and then fetch the rolled-back change into the work tree as a local change
2144 to be amended and perhaps committed again:
2146 .Dl $ got backout unified-buffer-cache
2147 .Dl $ got commit -m 'roll back previous'
2148 .Dl $ # now back out the previous backout :-)
2149 .Dl $ got backout unified-buffer-cache
2151 Fetch new upstream commits into the local repository's
2158 In a repository created with a HTTP URL and
2159 .Cm git clone --bare
2162 command must be used instead:
2164 .Dl $ cd /var/git/src.git
2165 .Dl $ git fetch origin master:refs/remotes/origin/master
2169 branch to merge the new changes that are now visible on the
2174 .Dl $ got update -b origin/master
2175 .Dl $ got rebase master
2178 .Dq unified-buffer-cache
2179 branch on top of the new head commit of the
2183 .Dl $ got update -b master
2184 .Dl $ got rebase unified-buffer-cache
2186 Create a patch from all changes on the unified-buffer-cache branch.
2187 The patch can be mailed out for review and applied to
2191 .Dl $ got diff master unified-buffer-cache > /tmp/ubc.diff
2193 Edit the entire commit history of the
2194 .Dq unified-buffer-cache
2197 .Dl $ got update -b unified-buffer-cache
2198 .Dl $ got update -c master
2201 In order to merge changes committed to the
2202 .Dq unified-buffer-cache
2203 branch back into the
2206 .Dq unified-buffer-cache
2207 branch must first be rebased onto the
2211 .Dl $ got update -b master
2212 .Dl $ got rebase unified-buffer-cache
2215 .Dq unified-buffer-cache
2216 branch can now be made visible on the
2220 Because the rebase operation switched the work tree to the
2221 .Dq unified-buffer-cache
2222 branch, the work tree must be switched back to the
2225 .Dq unified-buffer-cache
2226 branch can be integrated into
2229 .Dl $ got update -b master
2230 .Dl $ got integrate unified-buffer-cache
2232 Additional steps may be necessary if local changes need to be pushed back
2233 to the remote repository, which currently requires
2235 Before working against existing branches in a repository cloned with
2236 .Cm git clone --bare
2241 must be configured to map all references in the remote repository
2244 namespace of the local repository.
2245 This can achieved by setting Git's
2246 .Pa remote.origin.fetch
2247 configuration variable to the value
2248 .Dq +refs/heads/*:refs/remotes/origin/*
2253 .Dl $ cd /var/git/repo
2254 .Dl $ git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
2258 option must be disabled:
2260 .Dl $ cd /var/git/repo
2261 .Dl $ git config remote.origin.mirror false
2263 Alternatively, the following
2265 configuration item can be added manually to the Git repository's
2269 .Dl [remote "origin"]
2271 .Dl fetch = +refs/heads/*:refs/remotes/origin/*
2274 This configuration leaves the local repository's
2276 namespace free for use by local branches checked out with
2278 and, if needed, created with
2283 namespace can now be updated with incoming changes from the remote
2288 without extra command line arguments:
2290 .Dl $ cd /var/git/repo
2293 To make changes fetched from the remote repository appear on the
2297 branch must be rebased onto the
2300 This will also merge local changes, if any, with the incoming changes:
2302 .Dl $ got update -b origin/master
2303 .Dl $ got rebase master
2307 branch, log messages for local changes can now be amended with
2309 by other developers and any other important new information:
2311 .Dl $ got update -c origin/master
2312 .Dl $ got histedit -m
2314 Local changes on the
2316 branch can then be pushed to the remote
2320 .Dl $ cd /var/git/repo
2321 .Dl $ git push origin master
2324 .Xr git-repository 5 ,
2325 .Xr got-worktree 5 ,
2328 .An Stefan Sperling Aq Mt stsp@openbsd.org
2329 .An Martin Pieuchot Aq Mt mpi@openbsd.org
2330 .An Joshua Stein Aq Mt jcs@openbsd.org
2331 .An Ori Bernstein Aq Mt ori@openbsd.org
2334 is a work-in-progress and some features remain to be implemented.
2336 At present, the user has to fall back on
2338 to perform some tasks.
2342 Reading from remote repositories over HTTP or HTTPS protocols requires
2347 Writing to remote repositories, over any protocol, requires
2350 Packing repositories, which reduces disk space consumption and improves
2351 read-access performance, requires
2354 Exporting data from repositories requires
2355 .Xr git-fast-export 1 .
2357 Importing data into repositories requires
2358 .Xr git-fast-import 1 .
2360 Reducing the size of repositories by removing redundant or unreferenced
2364 The creation of merge commits, i.e. commits with two or more parent commits,
2368 In situations where files or directories were moved around
2370 will not automatically merge changes to new locations and
2372 will usually produce better results.