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 97925469 2018-03-17 stsp .Nd version control system
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 97925469 2018-03-17 stsp is a version control system which prioritizes ease of use and simplicity
31 97925469 2018-03-17 stsp over flexibility.
32 5c860e29 2018-03-12 stsp .Pp
33 285dc8a4 2018-03-13 stsp .Nm
34 70f9e387 2018-04-01 stsp stores the history of tracked files in a repository which uses
35 97925469 2018-03-17 stsp the same on-disk format as
36 285dc8a4 2018-03-13 stsp .Dq bare
37 70f9e387 2018-04-01 stsp repositories used by the Git version control system.
38 285dc8a4 2018-03-13 stsp This repository format is described in
39 5e5560e1 2018-08-01 stsp .Xr git-repository 5 .
40 285dc8a4 2018-03-13 stsp .Pp
41 4129c201 2018-03-13 stsp .Nm
42 4129c201 2018-03-13 stsp is a
43 97925469 2018-03-17 stsp .Em distributed
44 4129c201 2018-03-13 stsp version control system because every copy of a repository is writeable.
45 4129c201 2018-03-13 stsp Modifications made to files can be synchronized between repositories
46 97925469 2018-03-17 stsp at any time.
47 4129c201 2018-03-13 stsp .Pp
48 285dc8a4 2018-03-13 stsp Files managed by
49 285dc8a4 2018-03-13 stsp .Nm
50 4129c201 2018-03-13 stsp must be checked out from the repository for modification.
51 285dc8a4 2018-03-13 stsp Checked out files are stored in a
52 285dc8a4 2018-03-13 stsp .Em work tree
53 c5867b47 2018-03-13 stsp which can be placed at an arbitrary directory in the filesystem hierarchy.
54 97925469 2018-03-17 stsp The on-disk format of a
55 285dc8a4 2018-03-13 stsp .Nm
56 285dc8a4 2018-03-13 stsp work tree is described in
57 285dc8a4 2018-03-13 stsp .Xr got-worktree 5 .
58 285dc8a4 2018-03-13 stsp .Pp
59 285dc8a4 2018-03-13 stsp .Nm
60 285dc8a4 2018-03-13 stsp provides global and command-specific options.
61 285dc8a4 2018-03-13 stsp Global options must preceed the command name, and are as follows:
62 1b6b95a8 2018-03-12 stsp .Bl -tag -width tenletters
63 1b6b95a8 2018-03-12 stsp .It Fl h
64 1b6b95a8 2018-03-12 stsp Display usage information.
65 1b6b95a8 2018-03-12 stsp .El
66 1b6b95a8 2018-03-12 stsp .Pp
67 38e11793 2018-06-13 stsp The commands for
68 38e11793 2018-06-13 stsp .Nm
69 38e11793 2018-06-13 stsp are as follows:
70 0bb8a95e 2018-03-12 stsp .Bl -tag -width checkout
71 8069f636 2019-01-12 stsp .It Cm checkout [ Fl c Ar commit ] [ Fl p Ar path-prefix ] repository-path [ work-tree-path ]
72 0bb8a95e 2018-03-12 stsp Copy files from a repository into a new work tree.
73 5d7c1dab 2018-04-01 stsp If the
74 5d7c1dab 2018-04-01 stsp .Ar work tree path
75 c844a238 2019-02-06 stsp is not specified, either use the last component of
76 5d7c1dab 2018-04-01 stsp .Ar repository path ,
77 5d7c1dab 2018-04-01 stsp or if a
78 5d7c1dab 2018-04-01 stsp .Ar path prefix
79 c844a238 2019-02-06 stsp was specified use the last component of
80 5d7c1dab 2018-04-01 stsp .Ar path prefix .
81 38e11793 2018-06-13 stsp .Pp
82 38e11793 2018-06-13 stsp The options for
83 38e11793 2018-06-13 stsp .Cm got checkout
84 38e11793 2018-06-13 stsp are as follows:
85 38e11793 2018-06-13 stsp .Bl -tag -width Ds
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 c844a238 2019-02-06 stsp If this option is not specified, a commit resolved via the repository's HEAD
90 c844a238 2019-02-06 stsp reference 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 507dc3bb 2018-12-29 stsp .It Cm update [ Fl c Ar commit ] [ work-tree-path ]
98 0032ca71 2019-01-23 stsp Update an existing work tree to another commit on the current branch.
99 507dc3bb 2018-12-29 stsp By default, the latest commit on the current branch is assumed.
100 507dc3bb 2018-12-29 stsp If the
101 507dc3bb 2018-12-29 stsp .Ar work tree path
102 507dc3bb 2018-12-29 stsp is omitted, use the current working directory.
103 507dc3bb 2018-12-29 stsp .Pp
104 507dc3bb 2018-12-29 stsp The options for
105 507dc3bb 2018-12-29 stsp .Cm got update
106 507dc3bb 2018-12-29 stsp are as follows:
107 507dc3bb 2018-12-29 stsp .Bl -tag -width Ds
108 507dc3bb 2018-12-29 stsp .It Fl c Ar commit
109 507dc3bb 2018-12-29 stsp Update the work tree to the specified
110 507dc3bb 2018-12-29 stsp .Ar commit .
111 0032ca71 2019-01-23 stsp The expected argument is a SHA1 hash which corresponds to a commit object.
112 507dc3bb 2018-12-29 stsp .El
113 6bad629b 2019-02-04 stsp .It Cm status [ Ar worktree-path ]
114 6bad629b 2019-02-04 stsp Show the current modification status of files in a worktree,
115 6bad629b 2019-02-04 stsp using the following status codes:
116 6bad629b 2019-02-04 stsp .Bl -column YXZ description
117 6bad629b 2019-02-04 stsp .It M Ta modified file
118 6bad629b 2019-02-04 stsp .It ! Ta versioned file was expected on disk but is missing
119 0dbc2271 2019-02-05 stsp .It ~ Ta versioned file is obstructed by a non-regular file
120 6bad629b 2019-02-04 stsp .It ? Ta unversioned item not tracked by
121 6bad629b 2019-02-04 stsp .Nm
122 6bad629b 2019-02-04 stsp .El
123 6bad629b 2019-02-04 stsp .Pp
124 6bad629b 2019-02-04 stsp If the
125 6bad629b 2019-02-04 stsp .Ar work tree path
126 6bad629b 2019-02-04 stsp is omitted, use the current working directory.
127 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 ]
128 38e11793 2018-06-13 stsp Display history of a repository.
129 04ca23f4 2018-07-16 stsp If a
130 04ca23f4 2018-07-16 stsp .Ar path
131 04ca23f4 2018-07-16 stsp is specified, show only commits which modified this path.
132 38e11793 2018-06-13 stsp .Pp
133 38e11793 2018-06-13 stsp The options for
134 38e11793 2018-06-13 stsp .Cm got log
135 38e11793 2018-06-13 stsp are as follows:
136 38e11793 2018-06-13 stsp .Bl -tag -width Ds
137 38e11793 2018-06-13 stsp .It Fl c Ar commit
138 38e11793 2018-06-13 stsp Start traversing history at the specified
139 38e11793 2018-06-13 stsp .Ar commit .
140 d1f2edc9 2018-06-13 stsp The expected argument is the name of a branch or a SHA1 hash which corresponds
141 1cfab718 2018-06-13 stsp to a commit object.
142 c0cc5c62 2018-10-18 stsp .It Fl C Ar number
143 c0cc5c62 2018-10-18 stsp Set the number of context lines shown in diffs with
144 c0cc5c62 2018-10-18 stsp .Fl p .
145 c0cc5c62 2018-10-18 stsp By default, 3 lines of context are shown.
146 38e11793 2018-06-13 stsp .It Fl f
147 38e11793 2018-06-13 stsp Restrict history traversal to the first parent of each commit.
148 38e11793 2018-06-13 stsp This shows the linear history of the current branch only.
149 38e11793 2018-06-13 stsp Merge commits which affected the current branch will be shown but
150 38e11793 2018-06-13 stsp individual commits which originated on other branches will be omitted.
151 6238ee32 2018-06-13 stsp .It Fl l Ar N
152 6238ee32 2018-06-13 stsp Limit history traversal to a given number of commits.
153 6238ee32 2018-06-13 stsp .It Fl p
154 6238ee32 2018-06-13 stsp Display the patch of modifications made in each commit.
155 04ca23f4 2018-07-16 stsp .It Fl r Ar repository-path
156 04ca23f4 2018-07-16 stsp Use the repository at the specified path.
157 04ca23f4 2018-07-16 stsp If not specified, assume the repository is located at or above the current
158 04ca23f4 2018-07-16 stsp working directory.
159 e9cf2e30 2019-02-05 stsp If this directory is a
160 e9cf2e30 2019-02-05 stsp .Nm
161 e9cf2e30 2019-02-05 stsp work tree, use the repository path associated with this work tree.
162 38e11793 2018-06-13 stsp .El
163 b72f483a 2019-02-05 stsp .It Cm diff [ Fl C Ar number ] [ Fl r Ar repository-path ] [ Ar object1 Ar object2 ]
164 b72f483a 2019-02-05 stsp Display differences between blobs in the repository and files in the
165 b72f483a 2019-02-05 stsp work tree, or between two specified objects in a repository.
166 b72f483a 2019-02-05 stsp If specified, each
167 21294684 2018-04-01 stsp .Ar object
168 21294684 2018-04-01 stsp argument is a SHA1 hash which corresponds to the object.
169 3f8b7d6a 2018-04-01 stsp Both objects must be of the same type (blobs, trees, or commits).
170 c0cc5c62 2018-10-18 stsp .Pp
171 c0cc5c62 2018-10-18 stsp The options for
172 c0cc5c62 2018-10-18 stsp .Cm got diff
173 c0cc5c62 2018-10-18 stsp are as follows:
174 c0cc5c62 2018-10-18 stsp .Bl -tag -width Ds
175 c0cc5c62 2018-10-18 stsp .It Fl C Ar number
176 c0cc5c62 2018-10-18 stsp Set the number of context lines shown in the diff.
177 c0cc5c62 2018-10-18 stsp By default, 3 lines of context are shown.
178 b72f483a 2019-02-05 stsp .It Fl r Ar repository-path
179 b72f483a 2019-02-05 stsp Use the repository at the specified path.
180 b72f483a 2019-02-05 stsp If not specified, assume the repository is located at or above the current
181 b72f483a 2019-02-05 stsp working directory.
182 b72f483a 2019-02-05 stsp If this directory is a
183 b72f483a 2019-02-05 stsp .Nm
184 b72f483a 2019-02-05 stsp work tree, use the repository path associated with this work tree.
185 c0cc5c62 2018-10-18 stsp .El
186 1ff8e573 2018-08-02 stsp .It Cm blame [ Fl c Ar commit ] [ Fl r Ar repository-path ] Ar path
187 1ff8e573 2018-08-02 stsp Display line-by-line history of a file at the specified path.
188 1ff8e573 2018-08-02 stsp .Pp
189 1ff8e573 2018-08-02 stsp The options for
190 1ff8e573 2018-08-02 stsp .Cm got blame
191 1ff8e573 2018-08-02 stsp are as follows:
192 1ff8e573 2018-08-02 stsp .Bl -tag -width Ds
193 1ff8e573 2018-08-02 stsp .It Fl c Ar commit
194 1ff8e573 2018-08-02 stsp Start traversing history at the specified
195 1ff8e573 2018-08-02 stsp .Ar commit .
196 1ff8e573 2018-08-02 stsp The expected argument is the name of a branch or a SHA1 hash which corresponds
197 1ff8e573 2018-08-02 stsp to a commit object.
198 1ff8e573 2018-08-02 stsp .It Fl r Ar repository-path
199 1ff8e573 2018-08-02 stsp Use the repository at the specified path.
200 1ff8e573 2018-08-02 stsp If not specified, assume the repository is located at or above the current
201 1ff8e573 2018-08-02 stsp working directory.
202 0c06baac 2019-02-05 stsp If this directory is a
203 0c06baac 2019-02-05 stsp .Nm
204 0c06baac 2019-02-05 stsp work tree, use the repository path associated with this work tree.
205 5c860e29 2018-03-12 stsp .El
206 c1669e2e 2019-01-09 stsp .It Cm tree [ Fl c Ar commit ] [ Fl r Ar repository-path ] [ Fl i ] [ Fl R] [ Ar path ]
207 5de5890b 2018-10-18 stsp Display a listing of files and directories at the specified
208 5de5890b 2018-10-18 stsp directory path in the repository.
209 0c849583 2019-02-05 stsp If no
210 0c849583 2019-02-05 stsp .Ar path
211 0c849583 2019-02-05 stsp is specified, list the repository path corresponding to the current
212 0c849583 2019-02-05 stsp directory of the work tree, or the root directory of the repository
213 0c849583 2019-02-05 stsp if there is no work tree.
214 5de5890b 2018-10-18 stsp .Pp
215 5de5890b 2018-10-18 stsp The options for
216 5de5890b 2018-10-18 stsp .Cm got tree
217 5de5890b 2018-10-18 stsp are as follows:
218 5de5890b 2018-10-18 stsp .Bl -tag -width Ds
219 5de5890b 2018-10-18 stsp .It Fl c Ar commit
220 5de5890b 2018-10-18 stsp List files and directories as they appear in the specified
221 5de5890b 2018-10-18 stsp .Ar commit .
222 5de5890b 2018-10-18 stsp The expected argument is the name of a branch or a SHA1 hash which corresponds
223 5de5890b 2018-10-18 stsp to a commit object.
224 5de5890b 2018-10-18 stsp .It Fl r Ar repository-path
225 5de5890b 2018-10-18 stsp Use the repository at the specified path.
226 5de5890b 2018-10-18 stsp If not specified, assume the repository is located at or above the current
227 5de5890b 2018-10-18 stsp working directory.
228 0c849583 2019-02-05 stsp If this directory is a
229 0c849583 2019-02-05 stsp .Nm
230 0c849583 2019-02-05 stsp work tree, use the repository path associated with this work tree.
231 5de5890b 2018-10-18 stsp .It Fl i
232 5de5890b 2018-10-18 stsp Show object IDs of files (blob objects) and directories (tree objects).
233 c1669e2e 2019-01-09 stsp .It Fl R
234 0c849583 2019-02-05 stsp Recurse into sub-directories in the repository.
235 5de5890b 2018-10-18 stsp .El
236 5c860e29 2018-03-12 stsp .Sh EXIT STATUS
237 5c860e29 2018-03-12 stsp .Ex -std got
238 97925469 2018-03-17 stsp .Sh EXAMPLES
239 97925469 2018-03-17 stsp Check out a work tree of
240 97925469 2018-03-17 stsp .Ox
241 97925469 2018-03-17 stsp kernel sources from a Git repository at /var/repo/openbsd-src to ~/sys:
242 97925469 2018-03-17 stsp .Pp
243 97925469 2018-03-17 stsp .Dl $ got checkout -p sys /var/repo/openbsd-src ~/sys
244 5c860e29 2018-03-12 stsp .Sh SEE ALSO
245 5e5560e1 2018-08-01 stsp .Xr git-repository 5
246 285dc8a4 2018-03-13 stsp .Xr got-worktree 5
247 1a208aaf 2018-04-01 stsp .Sh AUTHORS
248 1a208aaf 2018-04-01 stsp .An Stefan Sperling Aq Mt stsp@openbsd.org
249 1a208aaf 2018-04-01 stsp .An Martin Pieuchot Aq Mt mpi@openbsd.org