2 5c860e29 2018-03-12 stsp .\" Copyright (c) 2017 Martin Pieuchot
3 5d56da81 2019-01-13 stsp .\" Copyright (c) 2018, 2019 Stefan Sperling
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.
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.
17 5c860e29 2018-03-12 stsp .Dd $Mdocdate$
22 97925469 2018-03-17 stsp .Nd version control system
23 5c860e29 2018-03-12 stsp .Sh SYNOPSIS
27 5c860e29 2018-03-12 stsp .Op Ar arg ...
28 5c860e29 2018-03-12 stsp .Sh DESCRIPTION
30 5531f75d 2019-03-26 stsp is a version control system which stores the history of tracked files in a
32 5531f75d 2019-03-26 stsp Git repository, as used by the Git version control system.
33 285dc8a4 2018-03-13 stsp This repository format is described in
34 5e5560e1 2018-08-01 stsp .Xr git-repository 5 .
38 ae73e26f 2019-03-26 stsp .Dq distributed
39 4129c201 2018-03-13 stsp version control system because every copy of a repository is writeable.
40 4129c201 2018-03-13 stsp Modifications made to files can be synchronized between repositories
41 97925469 2018-03-17 stsp at any time.
43 285dc8a4 2018-03-13 stsp Files managed by
45 4129c201 2018-03-13 stsp must be checked out from the repository for modification.
46 285dc8a4 2018-03-13 stsp Checked out files are stored in a
47 285dc8a4 2018-03-13 stsp .Em work tree
48 c5867b47 2018-03-13 stsp which can be placed at an arbitrary directory in the filesystem hierarchy.
49 97925469 2018-03-17 stsp The on-disk format of a
51 285dc8a4 2018-03-13 stsp work tree is described in
52 285dc8a4 2018-03-13 stsp .Xr got-worktree 5 .
55 285dc8a4 2018-03-13 stsp provides global and command-specific options.
56 285dc8a4 2018-03-13 stsp Global options must preceed the command name, and are as follows:
57 1b6b95a8 2018-03-12 stsp .Bl -tag -width tenletters
59 1b6b95a8 2018-03-12 stsp Display usage information.
62 38e11793 2018-06-13 stsp The commands for
64 38e11793 2018-06-13 stsp are as follows:
65 0bb8a95e 2018-03-12 stsp .Bl -tag -width checkout
66 8069f636 2019-01-12 stsp .It Cm checkout [ 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.
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 ,
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 .
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 8069f636 2019-01-12 stsp .It Fl c Ar commit
82 8069f636 2019-01-12 stsp Check out files from the specified
83 8069f636 2019-01-12 stsp .Ar commit .
84 c844a238 2019-02-06 stsp If this option is not specified, a commit resolved via the repository's HEAD
85 c844a238 2019-02-06 stsp reference will be used.
86 38e11793 2018-06-13 stsp .It Fl p Ar path-prefix
87 38e11793 2018-06-13 stsp Restrict the work tree to a subset of the repository's tree hierarchy.
88 38e11793 2018-06-13 stsp Only files beneath the specified
89 38e11793 2018-06-13 stsp .Ar path-prefix
90 38e11793 2018-06-13 stsp will be checked out.
92 507dc3bb 2018-12-29 stsp .It Cm update [ Fl c Ar commit ] [ work-tree-path ]
93 0032ca71 2019-01-23 stsp Update an existing work tree to another commit on the current branch.
94 507dc3bb 2018-12-29 stsp By default, the latest commit on the current branch is assumed.
95 7f838b36 2019-02-08 stsp Show the status of each affected file, using the following status codes:
96 7f838b36 2019-02-08 stsp .Bl -column YXZ description
97 7f838b36 2019-02-08 stsp .It U Ta file was updated and contained no local changes
98 7f838b36 2019-02-08 stsp .It G Ta file was updated and local changes were merged cleanly
99 7f838b36 2019-02-08 stsp .It C Ta file was updated and conflicts occurred during merge
100 7f838b36 2019-02-08 stsp .It D Ta file was deleted
101 7f838b36 2019-02-08 stsp .It A Ta new file was added
102 7f838b36 2019-02-08 stsp .It ~ Ta versioned file is obstructed by a non-regular file
103 a378724f 2019-02-10 stsp .It ! Ta a missing versioned file was restored
107 507dc3bb 2018-12-29 stsp .Ar work tree path
108 507dc3bb 2018-12-29 stsp is omitted, use the current working directory.
111 507dc3bb 2018-12-29 stsp The options for
112 507dc3bb 2018-12-29 stsp .Cm got update
113 507dc3bb 2018-12-29 stsp are as follows:
114 507dc3bb 2018-12-29 stsp .Bl -tag -width Ds
115 507dc3bb 2018-12-29 stsp .It Fl c Ar commit
116 507dc3bb 2018-12-29 stsp Update the work tree to the specified
117 507dc3bb 2018-12-29 stsp .Ar commit .
118 0032ca71 2019-01-23 stsp The expected argument is a SHA1 hash which corresponds to a commit object.
120 927df6b7 2019-02-10 stsp .It Cm status [ Ar path ]
121 6cd959e6 2019-03-26 stsp Show the current modification status of files in a work tree,
122 6bad629b 2019-02-04 stsp using the following status codes:
123 6bad629b 2019-02-04 stsp .Bl -column YXZ description
124 6bad629b 2019-02-04 stsp .It M Ta modified file
125 079890a9 2019-03-26 stsp .It A Ta file scheduled for addition in next commit
126 079890a9 2019-03-26 stsp .It D Ta file scheduled for deletion in next commit
127 6bad629b 2019-02-04 stsp .It ! Ta versioned file was expected on disk but is missing
128 0dbc2271 2019-02-05 stsp .It ~ Ta versioned file is obstructed by a non-regular file
129 6bad629b 2019-02-04 stsp .It ? Ta unversioned item not tracked by
135 927df6b7 2019-02-10 stsp is specified, only show modifications within this path.
136 ae9f01af 2018-10-18 stsp .It Cm log [ Fl c Ar commit ] [ Fl C Ar number ] [ Fl f ] [ Fl l Ar N ] [ Fl p ] [ Fl r Ar repository-path ] [ path ]
137 38e11793 2018-06-13 stsp Display history of a repository.
140 04ca23f4 2018-07-16 stsp is specified, show only commits which modified this path.
142 38e11793 2018-06-13 stsp The options for
143 38e11793 2018-06-13 stsp .Cm got log
144 38e11793 2018-06-13 stsp are as follows:
145 38e11793 2018-06-13 stsp .Bl -tag -width Ds
146 38e11793 2018-06-13 stsp .It Fl c Ar commit
147 38e11793 2018-06-13 stsp Start traversing history at the specified
148 38e11793 2018-06-13 stsp .Ar commit .
149 d1f2edc9 2018-06-13 stsp The expected argument is the name of a branch or a SHA1 hash which corresponds
150 1cfab718 2018-06-13 stsp to a commit object.
151 c0cc5c62 2018-10-18 stsp .It Fl C Ar number
152 c0cc5c62 2018-10-18 stsp Set the number of context lines shown in diffs with
154 c0cc5c62 2018-10-18 stsp By default, 3 lines of context are shown.
156 38e11793 2018-06-13 stsp Restrict history traversal to the first parent of each commit.
157 38e11793 2018-06-13 stsp This shows the linear history of the current branch only.
158 38e11793 2018-06-13 stsp Merge commits which affected the current branch will be shown but
159 38e11793 2018-06-13 stsp individual commits which originated on other branches will be omitted.
160 6238ee32 2018-06-13 stsp .It Fl l Ar N
161 6238ee32 2018-06-13 stsp Limit history traversal to a given number of commits.
163 6238ee32 2018-06-13 stsp Display the patch of modifications made in each commit.
164 04ca23f4 2018-07-16 stsp .It Fl r Ar repository-path
165 04ca23f4 2018-07-16 stsp Use the repository at the specified path.
166 04ca23f4 2018-07-16 stsp If not specified, assume the repository is located at or above the current
167 04ca23f4 2018-07-16 stsp working directory.
168 e9cf2e30 2019-02-05 stsp If this directory is a
170 e9cf2e30 2019-02-05 stsp work tree, use the repository path associated with this work tree.
172 927df6b7 2019-02-10 stsp .It Cm diff [ Fl C Ar number ] [ Fl r Ar repository-path ] [ Ar object1 Ar object2 | Ar path ]
173 927df6b7 2019-02-10 stsp When invoked within a work tree with less than two arguments, display
174 927df6b7 2019-02-10 stsp uncommitted changes in the work tree.
177 927df6b7 2019-02-10 stsp is specified, only show changes within this path.
179 927df6b7 2019-02-10 stsp If two arguments are provided, treat each argument as a SHA1 hash which
180 927df6b7 2019-02-10 stsp corresponds to an object in the repository, and display differences
181 927df6b7 2019-02-10 stsp between these objects.
182 3f8b7d6a 2018-04-01 stsp Both objects must be of the same type (blobs, trees, or commits).
184 c0cc5c62 2018-10-18 stsp The options for
185 c0cc5c62 2018-10-18 stsp .Cm got diff
186 c0cc5c62 2018-10-18 stsp are as follows:
187 c0cc5c62 2018-10-18 stsp .Bl -tag -width Ds
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 the diff.
190 c0cc5c62 2018-10-18 stsp By default, 3 lines of context are shown.
191 b72f483a 2019-02-05 stsp .It Fl r Ar repository-path
192 b72f483a 2019-02-05 stsp Use the repository at the specified path.
193 b72f483a 2019-02-05 stsp If not specified, assume the repository is located at or above the current
194 b72f483a 2019-02-05 stsp working directory.
195 b72f483a 2019-02-05 stsp If this directory is a
197 b72f483a 2019-02-05 stsp work tree, use the repository path associated with this work tree.
199 1ff8e573 2018-08-02 stsp .It Cm blame [ Fl c Ar commit ] [ Fl r Ar repository-path ] Ar path
200 1ff8e573 2018-08-02 stsp Display line-by-line history of a file at the specified path.
202 1ff8e573 2018-08-02 stsp The options for
203 1ff8e573 2018-08-02 stsp .Cm got blame
204 1ff8e573 2018-08-02 stsp are as follows:
205 1ff8e573 2018-08-02 stsp .Bl -tag -width Ds
206 1ff8e573 2018-08-02 stsp .It Fl c Ar commit
207 1ff8e573 2018-08-02 stsp Start traversing history at the specified
208 1ff8e573 2018-08-02 stsp .Ar commit .
209 1ff8e573 2018-08-02 stsp The expected argument is the name of a branch or a SHA1 hash which corresponds
210 1ff8e573 2018-08-02 stsp to a commit object.
211 1ff8e573 2018-08-02 stsp .It Fl r Ar repository-path
212 1ff8e573 2018-08-02 stsp Use the repository at the specified path.
213 1ff8e573 2018-08-02 stsp If not specified, assume the repository is located at or above the current
214 1ff8e573 2018-08-02 stsp working directory.
215 0c06baac 2019-02-05 stsp If this directory is a
217 0c06baac 2019-02-05 stsp work tree, use the repository path associated with this work tree.
219 c1669e2e 2019-01-09 stsp .It Cm tree [ Fl c Ar commit ] [ Fl r Ar repository-path ] [ Fl i ] [ Fl R] [ Ar path ]
220 5de5890b 2018-10-18 stsp Display a listing of files and directories at the specified
221 5de5890b 2018-10-18 stsp directory path in the repository.
222 db0c2996 2019-02-10 stsp Entries shown in this listing may carry one of the following trailing
223 db0c2996 2019-02-10 stsp annotations:
224 db0c2996 2019-02-10 stsp .Bl -column YXZ description
225 db0c2996 2019-02-10 stsp .It / Ta entry is a directory
226 db0c2996 2019-02-10 stsp .It * Ta entry is an executable file
231 0c849583 2019-02-05 stsp is specified, list the repository path corresponding to the current
232 0c849583 2019-02-05 stsp directory of the work tree, or the root directory of the repository
233 0c849583 2019-02-05 stsp if there is no work tree.
235 5de5890b 2018-10-18 stsp The options for
236 5de5890b 2018-10-18 stsp .Cm got tree
237 5de5890b 2018-10-18 stsp are as follows:
238 5de5890b 2018-10-18 stsp .Bl -tag -width Ds
239 5de5890b 2018-10-18 stsp .It Fl c Ar commit
240 5de5890b 2018-10-18 stsp List files and directories as they appear in the specified
241 5de5890b 2018-10-18 stsp .Ar commit .
242 5de5890b 2018-10-18 stsp The expected argument is the name of a branch or a SHA1 hash which corresponds
243 5de5890b 2018-10-18 stsp to a commit object.
244 5de5890b 2018-10-18 stsp .It Fl r Ar repository-path
245 5de5890b 2018-10-18 stsp Use the repository at the specified path.
246 5de5890b 2018-10-18 stsp If not specified, assume the repository is located at or above the current
247 5de5890b 2018-10-18 stsp working directory.
248 0c849583 2019-02-05 stsp If this directory is a
250 0c849583 2019-02-05 stsp work tree, use the repository path associated with this work tree.
252 5de5890b 2018-10-18 stsp Show object IDs of files (blob objects) and directories (tree objects).
254 0c849583 2019-02-05 stsp Recurse into sub-directories in the repository.
256 d0eebce4 2019-03-11 stsp .It Cm ref [ Fl r Ar repository-path ] [ Fl l ] [ Fl d Ar name ] [ Ar name Ar object ]
257 d0eebce4 2019-03-11 stsp Manage references in a repository.
259 d0eebce4 2019-03-11 stsp If no options are passed, expect two arguments and attempt to create,
260 d0eebce4 2019-03-11 stsp or update, the reference with the given
262 d0eebce4 2019-03-11 stsp and make it point at the given
263 d0eebce4 2019-03-11 stsp .Ar object .
264 d0eebce4 2019-03-11 stsp The object argument is a SHA1 hash which corresponds to an existing
265 d0eebce4 2019-03-11 stsp object in the repository.
267 d0eebce4 2019-03-11 stsp The options for
268 d0eebce4 2019-03-11 stsp .Cm got ref
269 d0eebce4 2019-03-11 stsp are as follows:
270 d0eebce4 2019-03-11 stsp .Bl -tag -width Ds
271 d0eebce4 2019-03-11 stsp .It Fl r Ar repository-path
272 d0eebce4 2019-03-11 stsp Use the repository at the specified path.
273 d0eebce4 2019-03-11 stsp If not specified, assume the repository is located at or above the current
274 d0eebce4 2019-03-11 stsp working directory.
275 d0eebce4 2019-03-11 stsp If this directory is a
277 d0eebce4 2019-03-11 stsp work tree, use the repository path associated with this work tree.
279 d0eebce4 2019-03-11 stsp List all existing references in the repository.
280 d0eebce4 2019-03-11 stsp .It Fl d Ar name
281 d0eebce4 2019-03-11 stsp Delete the reference with the specified name from the repository.
283 d00136be 2019-03-26 stsp .It Cm add Ar file-path
284 d00136be 2019-03-26 stsp Schedule an unversioned file in a work tree for addition to the
285 d00136be 2019-03-26 stsp repository in the next commit.
286 2ec1f75b 2019-03-26 stsp .It Cm rm Ar file-path
287 2ec1f75b 2019-03-26 stsp Remove a versioned file from a work tree and schedule it for deletion
288 2ec1f75b 2019-03-26 stsp from the repository in the next commit.
290 2ec1f75b 2019-03-26 stsp The options for
292 2ec1f75b 2019-03-26 stsp are as follows:
293 2ec1f75b 2019-03-26 stsp .Bl -tag -width Ds
295 2ec1f75b 2019-03-26 stsp Perform the operation even if the file contains uncommitted modifications.
298 5c860e29 2018-03-12 stsp .Sh EXIT STATUS
299 5c860e29 2018-03-12 stsp .Ex -std got
300 97925469 2018-03-17 stsp .Sh EXAMPLES
301 97925469 2018-03-17 stsp Check out a work tree of
303 97925469 2018-03-17 stsp kernel sources from a Git repository at /var/repo/openbsd-src to ~/sys:
305 97925469 2018-03-17 stsp .Dl $ got checkout -p sys /var/repo/openbsd-src ~/sys
306 5c860e29 2018-03-12 stsp .Sh SEE ALSO
307 5e5560e1 2018-08-01 stsp .Xr git-repository 5
308 285dc8a4 2018-03-13 stsp .Xr got-worktree 5
309 1a208aaf 2018-04-01 stsp .Sh AUTHORS
310 1a208aaf 2018-04-01 stsp .An Stefan Sperling Aq Mt stsp@openbsd.org
311 1a208aaf 2018-04-01 stsp .An Martin Pieuchot Aq Mt mpi@openbsd.org