Blame


1 5c860e29 2018-03-12 stsp .\"
2 5c860e29 2018-03-12 stsp .\" Copyright (c) 2017 Martin Pieuchot
3 5d56da81 2019-01-13 stsp .\" Copyright (c) 2018, 2019 Stefan Sperling
4 5c860e29 2018-03-12 stsp .\"
5 5c860e29 2018-03-12 stsp .\" Permission to use, copy, modify, and distribute this software for any
6 5c860e29 2018-03-12 stsp .\" purpose with or without fee is hereby granted, provided that the above
7 5c860e29 2018-03-12 stsp .\" copyright notice and this permission notice appear in all copies.
8 5c860e29 2018-03-12 stsp .\"
9 5c860e29 2018-03-12 stsp .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 5c860e29 2018-03-12 stsp .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 5c860e29 2018-03-12 stsp .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 5c860e29 2018-03-12 stsp .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 5c860e29 2018-03-12 stsp .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 5c860e29 2018-03-12 stsp .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 5c860e29 2018-03-12 stsp .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 5c860e29 2018-03-12 stsp .\"
17 5c860e29 2018-03-12 stsp .Dd $Mdocdate$
18 5c860e29 2018-03-12 stsp .Dt GOT 1
19 5c860e29 2018-03-12 stsp .Os
20 5c860e29 2018-03-12 stsp .Sh NAME
21 5c860e29 2018-03-12 stsp .Nm got
22 eb7dbff5 2019-05-09 stsp .Nd game of trees
23 5c860e29 2018-03-12 stsp .Sh SYNOPSIS
24 0bb8a95e 2018-03-12 stsp .Nm
25 5c860e29 2018-03-12 stsp .Ar command
26 1b6b95a8 2018-03-12 stsp .Op Fl h
27 5c860e29 2018-03-12 stsp .Op Ar arg ...
28 5c860e29 2018-03-12 stsp .Sh DESCRIPTION
29 5c860e29 2018-03-12 stsp .Nm
30 4dfb2f0f 2019-03-26 stsp is a version control system which stores the history of tracked files
31 4dfb2f0f 2019-03-26 stsp in a Git repository, as used by the Git version control system.
32 285dc8a4 2018-03-13 stsp This repository format is described in
33 5e5560e1 2018-08-01 stsp .Xr git-repository 5 .
34 285dc8a4 2018-03-13 stsp .Pp
35 4129c201 2018-03-13 stsp .Nm
36 4129c201 2018-03-13 stsp is a
37 ae73e26f 2019-03-26 stsp .Dq distributed
38 4129c201 2018-03-13 stsp version control system because every copy of a repository is writeable.
39 4129c201 2018-03-13 stsp Modifications made to files can be synchronized between repositories
40 97925469 2018-03-17 stsp at any time.
41 4129c201 2018-03-13 stsp .Pp
42 285dc8a4 2018-03-13 stsp Files managed by
43 285dc8a4 2018-03-13 stsp .Nm
44 4129c201 2018-03-13 stsp must be checked out from the repository for modification.
45 285dc8a4 2018-03-13 stsp Checked out files are stored in a
46 285dc8a4 2018-03-13 stsp .Em work tree
47 c5867b47 2018-03-13 stsp which can be placed at an arbitrary directory in the filesystem hierarchy.
48 fb2921d0 2019-03-26 stsp The on-disk format of this work tree is described in
49 285dc8a4 2018-03-13 stsp .Xr got-worktree 5 .
50 285dc8a4 2018-03-13 stsp .Pp
51 285dc8a4 2018-03-13 stsp .Nm
52 285dc8a4 2018-03-13 stsp provides global and command-specific options.
53 285dc8a4 2018-03-13 stsp Global options must preceed the command name, and are as follows:
54 1b6b95a8 2018-03-12 stsp .Bl -tag -width tenletters
55 1b6b95a8 2018-03-12 stsp .It Fl h
56 1b6b95a8 2018-03-12 stsp Display usage information.
57 1b6b95a8 2018-03-12 stsp .El
58 1b6b95a8 2018-03-12 stsp .Pp
59 38e11793 2018-06-13 stsp The commands for
60 38e11793 2018-06-13 stsp .Nm
61 38e11793 2018-06-13 stsp are as follows:
62 0bb8a95e 2018-03-12 stsp .Bl -tag -width checkout
63 2c7829a4 2019-06-17 stsp .It Cm init Ar path
64 2c7829a4 2019-06-17 stsp Create a new empty repository at the specified
65 2c7829a4 2019-06-17 stsp .Ar path .
66 08573d5b 2019-05-14 stsp .It Cm checkout [ Fl b Ar branch ] [ Fl c Ar commit ] [ Fl p Ar path-prefix ] repository-path [ work-tree-path ]
67 0bb8a95e 2018-03-12 stsp Copy files from a repository into a new work tree.
68 5d7c1dab 2018-04-01 stsp If the
69 5d7c1dab 2018-04-01 stsp .Ar work tree path
70 c844a238 2019-02-06 stsp is not specified, either use the last component of
71 5d7c1dab 2018-04-01 stsp .Ar repository path ,
72 5d7c1dab 2018-04-01 stsp or if a
73 5d7c1dab 2018-04-01 stsp .Ar path prefix
74 c844a238 2019-02-06 stsp was specified use the last component of
75 5d7c1dab 2018-04-01 stsp .Ar path prefix .
76 38e11793 2018-06-13 stsp .Pp
77 38e11793 2018-06-13 stsp The options for
78 38e11793 2018-06-13 stsp .Cm got checkout
79 38e11793 2018-06-13 stsp are as follows:
80 38e11793 2018-06-13 stsp .Bl -tag -width Ds
81 08573d5b 2019-05-14 stsp .It Fl b Ar branch
82 08573d5b 2019-05-14 stsp Check out files from the specified
83 08573d5b 2019-05-14 stsp .Ar branch .
84 08573d5b 2019-05-14 stsp If this option is not specified, a branch resolved via the repository's HEAD
85 08573d5b 2019-05-14 stsp reference will be used.
86 8069f636 2019-01-12 stsp .It Fl c Ar commit
87 8069f636 2019-01-12 stsp Check out files from the specified
88 8069f636 2019-01-12 stsp .Ar commit .
89 08573d5b 2019-05-14 stsp If this option is not specified, the most recent commit on the selected
90 08573d5b 2019-05-14 stsp branch will be used.
91 38e11793 2018-06-13 stsp .It Fl p Ar path-prefix
92 38e11793 2018-06-13 stsp Restrict the work tree to a subset of the repository's tree hierarchy.
93 38e11793 2018-06-13 stsp Only files beneath the specified
94 38e11793 2018-06-13 stsp .Ar path-prefix
95 38e11793 2018-06-13 stsp will be checked out.
96 38e11793 2018-06-13 stsp .El
97 024e9686 2019-05-14 stsp .It Cm update [ Fl b Ar branch ] [ Fl c Ar commit ] [ Ar path ]
98 024e9686 2019-05-14 stsp Update an existing work tree to a different commit.
99 7f838b36 2019-02-08 stsp Show the status of each affected file, using the following status codes:
100 7f838b36 2019-02-08 stsp .Bl -column YXZ description
101 7f838b36 2019-02-08 stsp .It U Ta file was updated and contained no local changes
102 7f838b36 2019-02-08 stsp .It G Ta file was updated and local changes were merged cleanly
103 7f838b36 2019-02-08 stsp .It C Ta file was updated and conflicts occurred during merge
104 7f838b36 2019-02-08 stsp .It D Ta file was deleted
105 7f838b36 2019-02-08 stsp .It A Ta new file was added
106 7f838b36 2019-02-08 stsp .It ~ Ta versioned file is obstructed by a non-regular file
107 a378724f 2019-02-10 stsp .It ! Ta a missing versioned file was restored
108 7f838b36 2019-02-08 stsp .El
109 7f838b36 2019-02-08 stsp .Pp
110 c4cdcb68 2019-04-03 stsp If a
111 c4cdcb68 2019-04-03 stsp .Ar path
112 c4cdcb68 2019-04-03 stsp is specified, restrict the update operation to files at or within this path.
113 f2cf8fbb 2019-04-04 stsp The path is required to exist in the update operation's target commit.
114 f2cf8fbb 2019-04-04 stsp Files in the work tree outside this path will remain unchanged and will
115 f2cf8fbb 2019-04-04 stsp retain their previously recorded base commit.
116 f2cf8fbb 2019-04-04 stsp Some
117 f2cf8fbb 2019-04-04 stsp .Nm
118 f2cf8fbb 2019-04-04 stsp commands may refuse to run while the work tree contains files from
119 c4cdcb68 2019-04-03 stsp multiple base commits.
120 f2cf8fbb 2019-04-04 stsp The base commit of such a work tree can be made consistent by running
121 47ec7be7 2019-05-12 stsp .Cm got update
122 47ec7be7 2019-05-12 stsp across the entire work tree.
123 024e9686 2019-05-14 stsp Specifying a
124 024e9686 2019-05-14 stsp .Ar path
125 024e9686 2019-05-14 stsp is incompatible with the
126 024e9686 2019-05-14 stsp .Fl b
127 024e9686 2019-05-14 stsp option.
128 7f838b36 2019-02-08 stsp .Pp
129 507dc3bb 2018-12-29 stsp The options for
130 507dc3bb 2018-12-29 stsp .Cm got update
131 507dc3bb 2018-12-29 stsp are as follows:
132 507dc3bb 2018-12-29 stsp .Bl -tag -width Ds
133 024e9686 2019-05-14 stsp .It Fl b Ar branch
134 024e9686 2019-05-14 stsp Switch the work tree's branch reference to the specified
135 024e9686 2019-05-14 stsp .Ar branch
136 024e9686 2019-05-14 stsp before updating the work tree.
137 024e9686 2019-05-14 stsp This option requires that all paths in the work tree are updated.
138 507dc3bb 2018-12-29 stsp .It Fl c Ar commit
139 507dc3bb 2018-12-29 stsp Update the work tree to the specified
140 507dc3bb 2018-12-29 stsp .Ar commit .
141 0032ca71 2019-01-23 stsp The expected argument is a SHA1 hash which corresponds to a commit object.
142 024e9686 2019-05-14 stsp If this option is not specified, the most recent commit on the work tree's
143 024e9686 2019-05-14 stsp branch will be used.
144 507dc3bb 2018-12-29 stsp .El
145 927df6b7 2019-02-10 stsp .It Cm status [ Ar path ]
146 6cd959e6 2019-03-26 stsp Show the current modification status of files in a work tree,
147 6bad629b 2019-02-04 stsp using the following status codes:
148 6bad629b 2019-02-04 stsp .Bl -column YXZ description
149 6bad629b 2019-02-04 stsp .It M Ta modified file
150 079890a9 2019-03-26 stsp .It A Ta file scheduled for addition in next commit
151 079890a9 2019-03-26 stsp .It D Ta file scheduled for deletion in next commit
152 7154f6ce 2019-03-27 stsp .It C Ta modified or added file which contains merge conflicts
153 6bad629b 2019-02-04 stsp .It ! Ta versioned file was expected on disk but is missing
154 0dbc2271 2019-02-05 stsp .It ~ Ta versioned file is obstructed by a non-regular file
155 6bad629b 2019-02-04 stsp .It ? Ta unversioned item not tracked by
156 6bad629b 2019-02-04 stsp .Nm
157 6bad629b 2019-02-04 stsp .El
158 6bad629b 2019-02-04 stsp .Pp
159 927df6b7 2019-02-10 stsp If a
160 927df6b7 2019-02-10 stsp .Ar path
161 927df6b7 2019-02-10 stsp is specified, only show modifications within this path.
162 499d7ecc 2019-05-22 stsp .It Cm log [ Fl b ] [ Fl c Ar commit ] [ Fl C Ar number ] [ Fl l Ar N ] [ Fl p ] [ Fl r Ar repository-path ] [ path ]
163 38e11793 2018-06-13 stsp Display history of a repository.
164 04ca23f4 2018-07-16 stsp If a
165 04ca23f4 2018-07-16 stsp .Ar path
166 04ca23f4 2018-07-16 stsp is specified, show only commits which modified this path.
167 38e11793 2018-06-13 stsp .Pp
168 38e11793 2018-06-13 stsp The options for
169 38e11793 2018-06-13 stsp .Cm got log
170 38e11793 2018-06-13 stsp are as follows:
171 38e11793 2018-06-13 stsp .Bl -tag -width Ds
172 499d7ecc 2019-05-22 stsp .It Fl b
173 43205691 2019-05-22 stsp Show the linear line of history of the current branch.
174 43205691 2019-05-22 stsp This option restricts history traversal to the first parent of each commit.
175 43205691 2019-05-22 stsp Commits which the branch was based on and merge commits which affected the
176 43205691 2019-05-22 stsp branch will be shown, but individual commits created on parallel branches
177 43205691 2019-05-22 stsp will be omitted.
178 38e11793 2018-06-13 stsp .It Fl c Ar commit
179 38e11793 2018-06-13 stsp Start traversing history at the specified
180 38e11793 2018-06-13 stsp .Ar commit .
181 d1f2edc9 2018-06-13 stsp The expected argument is the name of a branch or a SHA1 hash which corresponds
182 1cfab718 2018-06-13 stsp to a commit object.
183 1cc14b9f 2019-05-14 stsp If this option is not specified, default to the work tree's current branch
184 1cc14b9f 2019-05-14 stsp if invoked in a work tree, or to the repository's HEAD reference.
185 c0cc5c62 2018-10-18 stsp .It Fl C Ar number
186 c0cc5c62 2018-10-18 stsp Set the number of context lines shown in diffs with
187 c0cc5c62 2018-10-18 stsp .Fl p .
188 c0cc5c62 2018-10-18 stsp By default, 3 lines of context are shown.
189 6238ee32 2018-06-13 stsp .It Fl l Ar N
190 6238ee32 2018-06-13 stsp Limit history traversal to a given number of commits.
191 6238ee32 2018-06-13 stsp .It Fl p
192 6238ee32 2018-06-13 stsp Display the patch of modifications made in each commit.
193 04ca23f4 2018-07-16 stsp .It Fl r Ar repository-path
194 04ca23f4 2018-07-16 stsp Use the repository at the specified path.
195 04ca23f4 2018-07-16 stsp If not specified, assume the repository is located at or above the current
196 04ca23f4 2018-07-16 stsp working directory.
197 e9cf2e30 2019-02-05 stsp If this directory is a
198 e9cf2e30 2019-02-05 stsp .Nm
199 e9cf2e30 2019-02-05 stsp work tree, use the repository path associated with this work tree.
200 38e11793 2018-06-13 stsp .El
201 927df6b7 2019-02-10 stsp .It Cm diff [ Fl C Ar number ] [ Fl r Ar repository-path ] [ Ar object1 Ar object2 | Ar path ]
202 927df6b7 2019-02-10 stsp When invoked within a work tree with less than two arguments, display
203 927df6b7 2019-02-10 stsp uncommitted changes in the work tree.
204 927df6b7 2019-02-10 stsp If a
205 927df6b7 2019-02-10 stsp .Ar path
206 927df6b7 2019-02-10 stsp is specified, only show changes within this path.
207 927df6b7 2019-02-10 stsp .Pp
208 e02e74af 2019-05-28 stsp If two arguments are provided, treat each argument as a reference,
209 e02e74af 2019-05-28 stsp or a SHA1 hash, which corresponds to an object in the repository,
210 e02e74af 2019-05-28 stsp and display differences between these objects.
211 3f8b7d6a 2018-04-01 stsp Both objects must be of the same type (blobs, trees, or commits).
212 c0cc5c62 2018-10-18 stsp .Pp
213 c0cc5c62 2018-10-18 stsp The options for
214 c0cc5c62 2018-10-18 stsp .Cm got diff
215 c0cc5c62 2018-10-18 stsp are as follows:
216 c0cc5c62 2018-10-18 stsp .Bl -tag -width Ds
217 c0cc5c62 2018-10-18 stsp .It Fl C Ar number
218 c0cc5c62 2018-10-18 stsp Set the number of context lines shown in the diff.
219 c0cc5c62 2018-10-18 stsp By default, 3 lines of context are shown.
220 b72f483a 2019-02-05 stsp .It Fl r Ar repository-path
221 b72f483a 2019-02-05 stsp Use the repository at the specified path.
222 b72f483a 2019-02-05 stsp If not specified, assume the repository is located at or above the current
223 b72f483a 2019-02-05 stsp working directory.
224 b72f483a 2019-02-05 stsp If this directory is a
225 b72f483a 2019-02-05 stsp .Nm
226 b72f483a 2019-02-05 stsp work tree, use the repository path associated with this work tree.
227 c0cc5c62 2018-10-18 stsp .El
228 1ff8e573 2018-08-02 stsp .It Cm blame [ Fl c Ar commit ] [ Fl r Ar repository-path ] Ar path
229 1ff8e573 2018-08-02 stsp Display line-by-line history of a file at the specified path.
230 1ff8e573 2018-08-02 stsp .Pp
231 1ff8e573 2018-08-02 stsp The options for
232 1ff8e573 2018-08-02 stsp .Cm got blame
233 1ff8e573 2018-08-02 stsp are as follows:
234 1ff8e573 2018-08-02 stsp .Bl -tag -width Ds
235 1ff8e573 2018-08-02 stsp .It Fl c Ar commit
236 1ff8e573 2018-08-02 stsp Start traversing history at the specified
237 1ff8e573 2018-08-02 stsp .Ar commit .
238 1ff8e573 2018-08-02 stsp The expected argument is the name of a branch or a SHA1 hash which corresponds
239 1ff8e573 2018-08-02 stsp to a commit object.
240 1ff8e573 2018-08-02 stsp .It Fl r Ar repository-path
241 1ff8e573 2018-08-02 stsp Use the repository at the specified path.
242 1ff8e573 2018-08-02 stsp If not specified, assume the repository is located at or above the current
243 1ff8e573 2018-08-02 stsp working directory.
244 0c06baac 2019-02-05 stsp If this directory is a
245 0c06baac 2019-02-05 stsp .Nm
246 0c06baac 2019-02-05 stsp work tree, use the repository path associated with this work tree.
247 5c860e29 2018-03-12 stsp .El
248 c1669e2e 2019-01-09 stsp .It Cm tree [ Fl c Ar commit ] [ Fl r Ar repository-path ] [ Fl i ] [ Fl R] [ Ar path ]
249 5de5890b 2018-10-18 stsp Display a listing of files and directories at the specified
250 5de5890b 2018-10-18 stsp directory path in the repository.
251 db0c2996 2019-02-10 stsp Entries shown in this listing may carry one of the following trailing
252 db0c2996 2019-02-10 stsp annotations:
253 db0c2996 2019-02-10 stsp .Bl -column YXZ description
254 db0c2996 2019-02-10 stsp .It / Ta entry is a directory
255 db0c2996 2019-02-10 stsp .It * Ta entry is an executable file
256 db0c2996 2019-02-10 stsp .El
257 db0c2996 2019-02-10 stsp .Pp
258 0c849583 2019-02-05 stsp If no
259 0c849583 2019-02-05 stsp .Ar path
260 0c849583 2019-02-05 stsp is specified, list the repository path corresponding to the current
261 0c849583 2019-02-05 stsp directory of the work tree, or the root directory of the repository
262 0c849583 2019-02-05 stsp if there is no work tree.
263 5de5890b 2018-10-18 stsp .Pp
264 5de5890b 2018-10-18 stsp The options for
265 5de5890b 2018-10-18 stsp .Cm got tree
266 5de5890b 2018-10-18 stsp are as follows:
267 5de5890b 2018-10-18 stsp .Bl -tag -width Ds
268 5de5890b 2018-10-18 stsp .It Fl c Ar commit
269 5de5890b 2018-10-18 stsp List files and directories as they appear in the specified
270 5de5890b 2018-10-18 stsp .Ar commit .
271 5de5890b 2018-10-18 stsp The expected argument is the name of a branch or a SHA1 hash which corresponds
272 5de5890b 2018-10-18 stsp to a commit object.
273 5de5890b 2018-10-18 stsp .It Fl r Ar repository-path
274 5de5890b 2018-10-18 stsp Use the repository at the specified path.
275 5de5890b 2018-10-18 stsp If not specified, assume the repository is located at or above the current
276 5de5890b 2018-10-18 stsp working directory.
277 0c849583 2019-02-05 stsp If this directory is a
278 0c849583 2019-02-05 stsp .Nm
279 0c849583 2019-02-05 stsp work tree, use the repository path associated with this work tree.
280 5de5890b 2018-10-18 stsp .It Fl i
281 5de5890b 2018-10-18 stsp Show object IDs of files (blob objects) and directories (tree objects).
282 c1669e2e 2019-01-09 stsp .It Fl R
283 0c849583 2019-02-05 stsp Recurse into sub-directories in the repository.
284 d0eebce4 2019-03-11 stsp .El
285 d83d9d5c 2019-05-13 stsp .It Cm ref [ Fl r Ar repository-path ] [ Fl l ] [ Fl d Ar name ] [ Ar name Ar target ]
286 d0eebce4 2019-03-11 stsp Manage references in a repository.
287 d0eebce4 2019-03-11 stsp .Pp
288 d0eebce4 2019-03-11 stsp If no options are passed, expect two arguments and attempt to create,
289 d0eebce4 2019-03-11 stsp or update, the reference with the given
290 d0eebce4 2019-03-11 stsp .Ar name ,
291 d0eebce4 2019-03-11 stsp and make it point at the given
292 d83d9d5c 2019-05-13 stsp .Ar target .
293 d83d9d5c 2019-05-13 stsp The target may be a SHA1 hash which corresponds to an existing object ID
294 d83d9d5c 2019-05-13 stsp in the repository, or an existing reference which will be resolved to an
295 d83d9d5c 2019-05-13 stsp object ID.
296 d0eebce4 2019-03-11 stsp .Pp
297 d0eebce4 2019-03-11 stsp The options for
298 d0eebce4 2019-03-11 stsp .Cm got ref
299 d0eebce4 2019-03-11 stsp are as follows:
300 d0eebce4 2019-03-11 stsp .Bl -tag -width Ds
301 d0eebce4 2019-03-11 stsp .It Fl r Ar repository-path
302 d0eebce4 2019-03-11 stsp Use the repository at the specified path.
303 d0eebce4 2019-03-11 stsp If not specified, assume the repository is located at or above the current
304 d0eebce4 2019-03-11 stsp working directory.
305 d0eebce4 2019-03-11 stsp If this directory is a
306 d0eebce4 2019-03-11 stsp .Nm
307 d0eebce4 2019-03-11 stsp work tree, use the repository path associated with this work tree.
308 d0eebce4 2019-03-11 stsp .It Fl l
309 d0eebce4 2019-03-11 stsp List all existing references in the repository.
310 d0eebce4 2019-03-11 stsp .It Fl d Ar name
311 d0eebce4 2019-03-11 stsp Delete the reference with the specified name from the repository.
312 4e759de4 2019-06-26 stsp .El
313 4e759de4 2019-06-26 stsp .It Cm branch [ Fl r Ar repository-path ] [ Fl l ] [ Fl d Ar name ] [ Ar name [ Ar base-branch ] ]
314 4e759de4 2019-06-26 stsp Manage branches in a repository.
315 4e759de4 2019-06-26 stsp .Pp
316 4e759de4 2019-06-26 stsp Branches are managed via references which live in the
317 4e759de4 2019-06-26 stsp .Dq refs/heads/
318 4e759de4 2019-06-26 stsp reference namespace.
319 4e759de4 2019-06-26 stsp The
320 4e759de4 2019-06-26 stsp .Cm got branch
321 4e759de4 2019-06-26 stsp command operates on references in this namespace only.
322 4e759de4 2019-06-26 stsp .Pp
323 4e759de4 2019-06-26 stsp If no options are passed, expect one or two arguments and attempt to create
324 4e759de4 2019-06-26 stsp a branch with the given
325 4e759de4 2019-06-26 stsp .Ar name ,
326 4e759de4 2019-06-26 stsp and make it point at the given
327 4e759de4 2019-06-26 stsp .Ar base-branch .
328 4e759de4 2019-06-26 stsp If no
329 4e759de4 2019-06-26 stsp .Ar base-branch
330 4e759de4 2019-06-26 stsp is specified, default to the work tree's current branch if invoked in a
331 4e759de4 2019-06-26 stsp work tree, or to the repository's HEAD reference.
332 4e759de4 2019-06-26 stsp .Pp
333 4e759de4 2019-06-26 stsp The options for
334 4e759de4 2019-06-26 stsp .Cm got branch
335 4e759de4 2019-06-26 stsp are as follows:
336 4e759de4 2019-06-26 stsp .Bl -tag -width Ds
337 4e759de4 2019-06-26 stsp .It Fl r Ar repository-path
338 4e759de4 2019-06-26 stsp Use the repository at the specified path.
339 4e759de4 2019-06-26 stsp If not specified, assume the repository is located at or above the current
340 4e759de4 2019-06-26 stsp working directory.
341 4e759de4 2019-06-26 stsp If this directory is a
342 4e759de4 2019-06-26 stsp .Nm
343 4e759de4 2019-06-26 stsp work tree, use the repository path associated with this work tree.
344 4e759de4 2019-06-26 stsp .It Fl l
345 4e759de4 2019-06-26 stsp List all existing branches in the repository.
346 4e759de4 2019-06-26 stsp .It Fl d Ar name
347 4e759de4 2019-06-26 stsp Delete the branch with the specified name from the repository.
348 5de5890b 2018-10-18 stsp .El
349 fbb7e5c7 2019-05-11 stsp .It Cm add Ar file-path ...
350 8125ddca 2019-05-11 stsp Schedule unversioned files in a work tree for addition to the
351 d00136be 2019-03-26 stsp repository in the next commit.
352 17ed4618 2019-06-02 stsp .It Cm rm Ar file-path ...
353 17ed4618 2019-06-02 stsp Remove versioned files from a work tree and schedule them for deletion
354 2ec1f75b 2019-03-26 stsp from the repository in the next commit.
355 2ec1f75b 2019-03-26 stsp .Pp
356 2ec1f75b 2019-03-26 stsp The options for
357 2ec1f75b 2019-03-26 stsp .Cm got rm
358 2ec1f75b 2019-03-26 stsp are as follows:
359 2ec1f75b 2019-03-26 stsp .Bl -tag -width Ds
360 2ec1f75b 2019-03-26 stsp .It Fl f
361 17ed4618 2019-06-02 stsp Perform the operation even if a file contains uncommitted modifications.
362 d0eebce4 2019-03-11 stsp .El
363 e20a8b6f 2019-06-04 stsp .It Cm revert Ar file-path ...
364 e20a8b6f 2019-06-04 stsp Revert any uncommited changes in files at the specified paths.
365 a129376b 2019-03-28 stsp File contents will be overwritten with those contained in the
366 a129376b 2019-03-28 stsp work tree's base commit. There is no way to bring discarded
367 a129376b 2019-03-28 stsp changes back after
368 a129376b 2019-03-28 stsp .Cm got revert !
369 a129376b 2019-03-28 stsp .Pp
370 e20a8b6f 2019-06-04 stsp If a file was added with
371 a129376b 2019-03-28 stsp .Cm got add
372 a129376b 2019-03-28 stsp it will become an unversioned file again.
373 e20a8b6f 2019-06-04 stsp If a file was deleted with
374 a129376b 2019-03-28 stsp .Cm got rm
375 a129376b 2019-03-28 stsp it will be restored.
376 74416c47 2019-05-09 stsp .It Cm commit [ Fl m Ar msg ] [ file-path ]
377 15cd91f7 2019-05-12 stsp Create a new commit in the repository from local changes in a work tree
378 15cd91f7 2019-05-12 stsp and use this commit as the new base commit for the work tree.
379 15cd91f7 2019-05-12 stsp .Pp
380 15cd91f7 2019-05-12 stsp Show the status of each affected file, using the following status codes:
381 15cd91f7 2019-05-12 stsp .Bl -column YXZ description
382 15cd91f7 2019-05-12 stsp .It M Ta modified file
383 15cd91f7 2019-05-12 stsp .It D Ta file was deleted
384 15cd91f7 2019-05-12 stsp .It A Ta new file was added
385 15cd91f7 2019-05-12 stsp .El
386 15cd91f7 2019-05-12 stsp .Pp
387 15cd91f7 2019-05-12 stsp Files without local changes will retain their previously recorded base
388 15cd91f7 2019-05-12 stsp commit.
389 15cd91f7 2019-05-12 stsp Some
390 15cd91f7 2019-05-12 stsp .Nm
391 15cd91f7 2019-05-12 stsp commands may refuse to run while the work tree contains files from
392 15cd91f7 2019-05-12 stsp multiple base commits.
393 15cd91f7 2019-05-12 stsp The base commit of such a work tree can be made consistent by running
394 47ec7be7 2019-05-12 stsp .Cm got update
395 47ec7be7 2019-05-12 stsp across the entire work tree.
396 15cd91f7 2019-05-12 stsp .Pp
397 15cd91f7 2019-05-12 stsp The
398 15cd91f7 2019-05-12 stsp .Cm got commit
399 15cd91f7 2019-05-12 stsp command requires the
400 74416c47 2019-05-09 stsp .Ev GOT_AUTHOR
401 74416c47 2019-05-09 stsp environment variable to be set.
402 74416c47 2019-05-09 stsp .Pp
403 74416c47 2019-05-09 stsp The options for
404 74416c47 2019-05-09 stsp .Cm got commit
405 74416c47 2019-05-09 stsp are as follows:
406 74416c47 2019-05-09 stsp .Bl -tag -width Ds
407 74416c47 2019-05-09 stsp .It Fl m Ar msg
408 74416c47 2019-05-09 stsp Use the specified log message when creating the new commit.
409 23594da9 2019-05-13 stsp Without the
410 23594da9 2019-05-13 stsp .Fl m
411 23594da9 2019-05-13 stsp option,
412 23594da9 2019-05-13 stsp .Cm got commit
413 23594da9 2019-05-13 stsp opens a temporary file in an editor where a log message can be written.
414 2ec1f75b 2019-03-26 stsp .El
415 234035bc 2019-06-01 stsp .It Cm cherrypick Ar commit
416 234035bc 2019-06-01 stsp Merge changes from a single
417 234035bc 2019-06-01 stsp .Ar commit
418 234035bc 2019-06-01 stsp into the work tree.
419 234035bc 2019-06-01 stsp The specified
420 234035bc 2019-06-01 stsp .Ar commit
421 234035bc 2019-06-01 stsp must be on a different branch than the work tree's base commit.
422 234035bc 2019-06-01 stsp The expected argument is a reference or a SHA1 hash which corresponds to
423 234035bc 2019-06-01 stsp a commit object.
424 234035bc 2019-06-01 stsp .Pp
425 234035bc 2019-06-01 stsp Show the status of each affected file, using the following status codes:
426 234035bc 2019-06-01 stsp .Bl -column YXZ description
427 234035bc 2019-06-01 stsp .It G Ta file was merged
428 234035bc 2019-06-01 stsp .It C Ta file was merged and conflicts occurred during merge
429 234035bc 2019-06-01 stsp .It ! Ta changes destined for a missing file were not merged
430 234035bc 2019-06-01 stsp .It D Ta file was deleted
431 2b92fad7 2019-06-02 stsp .It d Ta file's deletion was obstructed by local modifications
432 234035bc 2019-06-01 stsp .It A Ta new file was added
433 2b92fad7 2019-06-02 stsp .It ~ Ta changes destined for a non-regular file were not merged
434 74416c47 2019-05-09 stsp .El
435 234035bc 2019-06-01 stsp .Pp
436 234035bc 2019-06-01 stsp The merged changes will appear as local changes in the work tree, which
437 234035bc 2019-06-01 stsp may be viewed with
438 234035bc 2019-06-01 stsp .Cm got diff ,
439 234035bc 2019-06-01 stsp amended manually or with further
440 234035bc 2019-06-01 stsp .Cm got cherrypick
441 234035bc 2019-06-01 stsp comands,
442 234035bc 2019-06-01 stsp committed with
443 234035bc 2019-06-01 stsp .Cm got commit ,
444 234035bc 2019-06-01 stsp or discarded again with
445 234035bc 2019-06-01 stsp .Cm got revert .
446 234035bc 2019-06-01 stsp .Pp
447 234035bc 2019-06-01 stsp .Cm got cherrypick
448 234035bc 2019-06-01 stsp will refuse to run if certain preconditions are not met.
449 234035bc 2019-06-01 stsp If the work tree contains multiple base commits it must first be updated
450 234035bc 2019-06-01 stsp to a single base commit with
451 234035bc 2019-06-01 stsp .Cm got update .
452 234035bc 2019-06-01 stsp If the work tree already contains files with merge conflicts, these
453 234035bc 2019-06-01 stsp conflicts must be resolved first.
454 5ef14e63 2019-06-02 stsp .It Cm backout Ar commit
455 5ef14e63 2019-06-02 stsp Reverse-merge changes from a single
456 5ef14e63 2019-06-02 stsp .Ar commit
457 5ef14e63 2019-06-02 stsp into the work tree.
458 5ef14e63 2019-06-02 stsp The specified
459 5ef14e63 2019-06-02 stsp .Ar commit
460 5ef14e63 2019-06-02 stsp must be on the same branch as the work tree's base commit.
461 5ef14e63 2019-06-02 stsp The expected argument is a reference or a SHA1 hash which corresponds to
462 5ef14e63 2019-06-02 stsp a commit object.
463 5ef14e63 2019-06-02 stsp .Pp
464 5ef14e63 2019-06-02 stsp Show the status of each affected file, using the following status codes:
465 5ef14e63 2019-06-02 stsp .Bl -column YXZ description
466 5ef14e63 2019-06-02 stsp .It G Ta file was merged
467 5ef14e63 2019-06-02 stsp .It C Ta file was merged and conflicts occurred during merge
468 5ef14e63 2019-06-02 stsp .It ! Ta changes destined for a missing file were not merged
469 5ef14e63 2019-06-02 stsp .It D Ta file was deleted
470 5ef14e63 2019-06-02 stsp .It d Ta file's deletion was obstructed by local modifications
471 5ef14e63 2019-06-02 stsp .It A Ta new file was added
472 5ef14e63 2019-06-02 stsp .It ~ Ta changes destined for a non-regular file were not merged
473 234035bc 2019-06-01 stsp .El
474 5ef14e63 2019-06-02 stsp .Pp
475 5ef14e63 2019-06-02 stsp The reverse-merged changes will appear as local changes in the work tree,
476 5ef14e63 2019-06-02 stsp which may be viewed with
477 5ef14e63 2019-06-02 stsp .Cm got diff ,
478 5ef14e63 2019-06-02 stsp amended manually or with further
479 5ef14e63 2019-06-02 stsp .Cm got cherrypick
480 5ef14e63 2019-06-02 stsp comands,
481 5ef14e63 2019-06-02 stsp committed with
482 5ef14e63 2019-06-02 stsp .Cm got commit ,
483 5ef14e63 2019-06-02 stsp or discarded again with
484 5ef14e63 2019-06-02 stsp .Cm got revert .
485 5ef14e63 2019-06-02 stsp .Pp
486 92228c38 2019-06-02 stsp .Cm got backout
487 92228c38 2019-06-02 stsp will refuse to run if certain preconditions are not met.
488 92228c38 2019-06-02 stsp If the work tree contains multiple base commits it must first be updated
489 92228c38 2019-06-02 stsp to a single base commit with
490 92228c38 2019-06-02 stsp .Cm got update .
491 92228c38 2019-06-02 stsp If the work tree already contains files with merge conflicts, these
492 92228c38 2019-06-02 stsp conflicts must be resolved first.
493 5ef14e63 2019-06-02 stsp .El
494 74416c47 2019-05-09 stsp .Sh ENVIRONMENT
495 74416c47 2019-05-09 stsp .Bl -tag -width GOT_AUTHOR
496 74416c47 2019-05-09 stsp .It Ev GOT_AUTHOR
497 74416c47 2019-05-09 stsp The author's name and email address for
498 74416c47 2019-05-09 stsp .Cm got commit ,
499 74416c47 2019-05-09 stsp for example:
500 74416c47 2019-05-09 stsp .An Stefan Sperling Aq Mt stsp@openbsd.org
501 23594da9 2019-05-13 stsp .It Ev VISUAL, Ev EDITOR
502 23594da9 2019-05-13 stsp The editor spawned by
503 23594da9 2019-05-13 stsp .Cm got commit .
504 74416c47 2019-05-09 stsp .El
505 5c860e29 2018-03-12 stsp .Sh EXIT STATUS
506 5c860e29 2018-03-12 stsp .Ex -std got
507 97925469 2018-03-17 stsp .Sh EXAMPLES
508 97925469 2018-03-17 stsp .Pp
509 fa6e0e48 2019-05-23 stsp Clone an existing Git repository for use with
510 fa6e0e48 2019-05-23 stsp .Nm .
511 fa6e0e48 2019-05-23 stsp This step currently requires
512 fa6e0e48 2019-05-23 stsp .Xr git 1 :
513 d83d9d5c 2019-05-13 stsp .Pp
514 fa6e0e48 2019-05-23 stsp .Dl $ cd /var/git/
515 fa6e0e48 2019-05-23 stsp .Dl $ git clone --bare https://github.com/openbsd/src.git
516 fa6e0e48 2019-05-23 stsp .Pp
517 fa6e0e48 2019-05-23 stsp Check out a work tree from this Git repository to /usr/src:
518 fa6e0e48 2019-05-23 stsp .Pp
519 fa6e0e48 2019-05-23 stsp .Dl $ got checkout /var/git/src.git /usr/src
520 fa6e0e48 2019-05-23 stsp .Pp
521 e70c17ce 2019-05-22 stsp View local changes in a work tree directory:
522 e70c17ce 2019-05-22 stsp .Pp
523 e70c17ce 2019-05-22 stsp .Dl $ got status
524 e70c17ce 2019-05-22 stsp .Dl $ got diff | less
525 e70c17ce 2019-05-22 stsp .Pp
526 e70c17ce 2019-05-22 stsp In a work tree or a git repository directory, list all branch references:
527 e70c17ce 2019-05-22 stsp .Pp
528 4e759de4 2019-06-26 stsp .Dl $ got branch -l
529 e70c17ce 2019-05-22 stsp .Pp
530 fa6e0e48 2019-05-23 stsp In a work tree or a git repository directory, create a new branch called
531 e70c17ce 2019-05-22 stsp .Dq unified-buffer-cache
532 d83d9d5c 2019-05-13 stsp which is forked off the
533 d83d9d5c 2019-05-13 stsp .Dq master
534 d83d9d5c 2019-05-13 stsp branch:
535 d83d9d5c 2019-05-13 stsp .Pp
536 4e759de4 2019-06-26 stsp .Dl $ got branch unified-buffer-cache master
537 e70c17ce 2019-05-22 stsp .Pp
538 e70c17ce 2019-05-22 stsp Switch an existing work tree to the branch
539 e70c17ce 2019-05-22 stsp .Dq unified-buffer-cache .
540 e70c17ce 2019-05-22 stsp Local changes in the work tree will be preserved and merged if necessary:
541 e70c17ce 2019-05-22 stsp .Pp
542 e70c17ce 2019-05-22 stsp .Dl $ got update -b unified-buffer-cache
543 e70c17ce 2019-05-22 stsp .Pp
544 fa6e0e48 2019-05-23 stsp Create a new commit from local changes in a work tree directory.
545 fa6e0e48 2019-05-23 stsp This new commit will become the head commit of the work tree's current branch:
546 fa6e0e48 2019-05-23 stsp .Pp
547 fa6e0e48 2019-05-23 stsp .Dl $ got commit
548 fa6e0e48 2019-05-23 stsp .Pp
549 fa6e0e48 2019-05-23 stsp In a work tree or a git repository directory, view changes committed in
550 fa6e0e48 2019-05-23 stsp the 3 most recent commits to the work tree's branch, or the branch resolved
551 fa6e0e48 2019-05-23 stsp via the repository's HEAD reference, respectively:
552 fa6e0e48 2019-05-23 stsp .Pp
553 fa6e0e48 2019-05-23 stsp .Dl $ got log -p -l 3 -b
554 fa6e0e48 2019-05-23 stsp .Pp
555 e70c17ce 2019-05-22 stsp Add new files and remove obsolete files in a work tree directory:
556 e70c17ce 2019-05-22 stsp .Pp
557 fa6e0e48 2019-05-23 stsp .Dl $ got add sys/uvm/uvm_ubc.c
558 fa6e0e48 2019-05-23 stsp .Dl $ got rm sys/uvm/uvm_vnode.c
559 e70c17ce 2019-05-22 stsp .Pp
560 e70c17ce 2019-05-22 stsp Create a new commit from local changes in a work tree directory
561 e70c17ce 2019-05-22 stsp with a pre-defined log message.
562 e70c17ce 2019-05-22 stsp .Pp
563 e70c17ce 2019-05-22 stsp .Dl $ got commit -m 'unify the buffer cache'
564 e70c17ce 2019-05-22 stsp .Pp
565 e70c17ce 2019-05-22 stsp Update any work tree checked out from the
566 e70c17ce 2019-05-22 stsp .Dq unified-buffer-cache
567 e70c17ce 2019-05-22 stsp branch to the latest commit on this branch:
568 fa6e0e48 2019-05-23 stsp .Pp
569 fa6e0e48 2019-05-23 stsp .Dl $ got update
570 e70c17ce 2019-05-22 stsp .Pp
571 9221fb1e 2019-06-26 stsp Fetch new upstream commits into the local repository's master branch.
572 9221fb1e 2019-06-26 stsp This step currently requires
573 9221fb1e 2019-06-26 stsp .Xr git 1 :
574 fa6e0e48 2019-05-23 stsp .Pp
575 fa6e0e48 2019-05-23 stsp .Dl $ cd /var/git/src.git
576 fa6e0e48 2019-05-23 stsp .Dl $ git fetch origin master:master
577 fa6e0e48 2019-05-23 stsp .Pp
578 fa6e0e48 2019-05-23 stsp Rebase the
579 fa6e0e48 2019-05-23 stsp .Dq unified-buffer-cache
580 fa6e0e48 2019-05-23 stsp branch on top of the new head commit of the
581 fa6e0e48 2019-05-23 stsp .Dq master
582 fa6e0e48 2019-05-23 stsp branch.
583 fa6e0e48 2019-05-23 stsp This step currently requires
584 fa6e0e48 2019-05-23 stsp .Xr git 1 :
585 fa6e0e48 2019-05-23 stsp .Pp
586 fa6e0e48 2019-05-23 stsp .Dl $ git clone /var/git/src.git ~/src-git-wt
587 fa6e0e48 2019-05-23 stsp .Dl $ cd ~/src-git-wt
588 fa6e0e48 2019-05-23 stsp .Dl $ git checkout unified-buffer-cache
589 fa6e0e48 2019-05-23 stsp .Dl $ git rebase master
590 fa6e0e48 2019-05-23 stsp .Dl $ git push -f
591 e70c17ce 2019-05-22 stsp .Pp
592 fa6e0e48 2019-05-23 stsp Update the work tree to the newly rebased
593 fa6e0e48 2019-05-23 stsp .Dq unified-buffer-cache
594 fa6e0e48 2019-05-23 stsp branch:
595 fa6e0e48 2019-05-23 stsp .Pp
596 fa6e0e48 2019-05-23 stsp .Dl $ got update -b unified-buffer-cache
597 5c860e29 2018-03-12 stsp .Sh SEE ALSO
598 5e5560e1 2018-08-01 stsp .Xr git-repository 5
599 285dc8a4 2018-03-13 stsp .Xr got-worktree 5
600 1a208aaf 2018-04-01 stsp .Sh AUTHORS
601 1a208aaf 2018-04-01 stsp .An Stefan Sperling Aq Mt stsp@openbsd.org
602 1a208aaf 2018-04-01 stsp .An Martin Pieuchot Aq Mt mpi@openbsd.org
603 72e28b48 2019-05-14 stsp .An joshua stein Aq Mt jcs@openbsd.org
604 fa6e0e48 2019-05-23 stsp .Sh CAVEATS
605 fa6e0e48 2019-05-23 stsp .Nm
606 fa6e0e48 2019-05-23 stsp is a work-in-progress and many commands remain to be implemented.
607 fa6e0e48 2019-05-23 stsp At present, the user has to fall back on
608 fa6e0e48 2019-05-23 stsp .Xr git 1
609 fa6e0e48 2019-05-23 stsp to perform many basic tasks.
610 fa6e0e48 2019-05-23 stsp .Pp
611 fa6e0e48 2019-05-23 stsp When working against a repository created with
612 fa6e0e48 2019-05-23 stsp .Dq git clone --bare ,
613 fa6e0e48 2019-05-23 stsp local commits to the
614 fa6e0e48 2019-05-23 stsp .Dq master
615 fa6e0e48 2019-05-23 stsp branch are discouraged, for now, if changes committed to the upstream
616 fa6e0e48 2019-05-23 stsp repository need to be tracked.
617 fa6e0e48 2019-05-23 stsp See the EXAMPLES section.