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