Blob


1 .\"
2 .\" Copyright (c) 2017 Martin Pieuchot
3 .\" Copyright (c) 2018 Stefan Sperling
4 .\"
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
8 .\"
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 .\"
17 .Dd $Mdocdate$
18 .Dt GOT 1
19 .Os
20 .Sh NAME
21 .Nm got
22 .Nd version control system
23 .Sh SYNOPSIS
24 .Nm
25 .Ar command
26 .Op Fl h
27 .Op Ar arg ...
28 .Sh DESCRIPTION
29 .Nm
30 is a version control system which prioritizes ease of use and simplicity
31 over flexibility.
32 .Pp
33 .Nm
34 stores the history of tracked files in a repository which uses
35 the same on-disk format as
36 .Dq bare
37 repositories used by the Git version control system.
38 This repository format is described in
39 .Xr git-repository 5 .
40 .Pp
41 .Nm
42 is a
43 .Em distributed
44 version control system because every copy of a repository is writeable.
45 Modifications made to files can be synchronized between repositories
46 at any time.
47 .Pp
48 Files managed by
49 .Nm
50 must be checked out from the repository for modification.
51 Checked out files are stored in a
52 .Em work tree
53 which can be placed at an arbitrary directory in the filesystem hierarchy.
54 The on-disk format of a
55 .Nm
56 work tree is described in
57 .Xr got-worktree 5 .
58 .Pp
59 .Nm
60 provides global and command-specific options.
61 Global options must preceed the command name, and are as follows:
62 .Bl -tag -width tenletters
63 .It Fl h
64 Display usage information.
65 .El
66 .Pp
67 The commands for
68 .Nm
69 are as follows:
70 .Bl -tag -width checkout
71 .It Cm checkout [ Fl p Ar path-prefix ] repository-path [ work-tree-path ]
72 Copy files from a repository into a new work tree.
73 If the
74 .Ar work tree path
75 is not specified, either use the base name of the
76 .Ar repository path ,
77 or if a
78 .Ar path prefix
79 was specified use the base name of the
80 .Ar path prefix .
81 .Pp
82 The options for
83 .Cm got checkout
84 are as follows:
85 .Bl -tag -width Ds
86 .It Fl p Ar path-prefix
87 Restrict the work tree to a subset of the repository's tree hierarchy.
88 Only files beneath the specified
89 .Ar path-prefix
90 will be checked out.
91 .El
92 .It Cm update [ Fl c Ar commit ] [ work-tree-path ]
93 Update an existing work tree to another commit.
94 By default, the latest commit on the current branch is assumed.
95 If the
96 .Ar work tree path
97 is omitted, use the current working directory.
98 .Pp
99 The options for
100 .Cm got update
101 are as follows:
102 .Bl -tag -width Ds
103 .It Fl c Ar commit
104 Update the work tree to the specified
105 .Ar commit .
106 The expected argument is the name of a branch or a SHA1 hash which corresponds
107 to a commit object.
108 .El
109 .\".It Cm status
110 .\"Show current status of files.
111 .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 ]
112 Display history of a repository.
113 If a
114 .Ar path
115 is specified, show only commits which modified this path.
116 .Pp
117 The options for
118 .Cm got log
119 are as follows:
120 .Bl -tag -width Ds
121 .It Fl c Ar commit
122 Start traversing history at the specified
123 .Ar commit .
124 The expected argument is the name of a branch or a SHA1 hash which corresponds
125 to a commit object.
126 .It Fl C Ar number
127 Set the number of context lines shown in diffs with
128 .Fl p .
129 By default, 3 lines of context are shown.
130 .It Fl f
131 Restrict history traversal to the first parent of each commit.
132 This shows the linear history of the current branch only.
133 Merge commits which affected the current branch will be shown but
134 individual commits which originated on other branches will be omitted.
135 .It Fl l Ar N
136 Limit history traversal to a given number of commits.
137 .It Fl p
138 Display the patch of modifications made in each commit.
139 .It Fl r Ar repository-path
140 Use the repository at the specified path.
141 If not specified, assume the repository is located at or above the current
142 working directory.
143 .El
144 .It Cm diff [ Fl C Ar number ] [ Ar repository-path ] Ar object1 Ar object2
145 Display the differences between two objects in the repository.
146 Each
147 .Ar object
148 argument is a SHA1 hash which corresponds to the object.
149 Both objects must be of the same type (blobs, trees, or commits).
150 If the
151 .Ar repository path
152 is omitted, use the current working directory.
153 .Pp
154 The options for
155 .Cm got diff
156 are as follows:
157 .Bl -tag -width Ds
158 .It Fl C Ar number
159 Set the number of context lines shown in the diff.
160 By default, 3 lines of context are shown.
161 .El
162 .It Cm blame [ Fl c Ar commit ] [ Fl r Ar repository-path ] Ar path
163 Display line-by-line history of a file at the specified path.
164 .Pp
165 The options for
166 .Cm got blame
167 are as follows:
168 .Bl -tag -width Ds
169 .It Fl c Ar commit
170 Start traversing history at the specified
171 .Ar commit .
172 The expected argument is the name of a branch or a SHA1 hash which corresponds
173 to a commit object.
174 .It Fl r Ar repository-path
175 Use the repository at the specified path.
176 If not specified, assume the repository is located at or above the current
177 working directory.
178 .El
179 .It Cm tree [ Fl c Ar commit ] [ Fl r Ar repository-path ] [ Fl i ] [ Ar path ]
180 Display a listing of files and directories at the specified
181 directory path in the repository.
182 If no path is specified, the root directory is listed.
183 .Pp
184 The options for
185 .Cm got tree
186 are as follows:
187 .Bl -tag -width Ds
188 .It Fl c Ar commit
189 List files and directories as they appear in the specified
190 .Ar commit .
191 The expected argument is the name of a branch or a SHA1 hash which corresponds
192 to a commit object.
193 .It Fl r Ar repository-path
194 Use the repository at the specified path.
195 If not specified, assume the repository is located at or above the current
196 working directory.
197 .It Fl i
198 Show object IDs of files (blob objects) and directories (tree objects).
199 .El
200 .Sh EXIT STATUS
201 .Ex -std got
202 .Sh EXAMPLES
203 Check out a work tree of
204 .Ox
205 kernel sources from a Git repository at /var/repo/openbsd-src to ~/sys:
206 .Pp
207 .Dl $ got checkout -p sys /var/repo/openbsd-src ~/sys
208 .Sh SEE ALSO
209 .Xr git-repository 5
210 .Xr got-worktree 5
211 .Sh AUTHORS
212 .An Stefan Sperling Aq Mt stsp@openbsd.org
213 .An Martin Pieuchot Aq Mt mpi@openbsd.org