Blob


1 .\"
2 .\" Copyright (c) 2020 Stefan Sperling <stsp@openbsd.org>
3 .\"
4 .\" Permission to use, copy, modify, and distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
7 .\"
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 .\"
16 .Dd $Mdocdate$
17 .Dt GOT.CONF 5
18 .Os
19 .Sh NAME
20 .Nm got.conf
21 .Nd Game of Trees configuration file
22 .Sh DESCRIPTION
23 .Nm
24 is the run-time configuration file for
25 .Xr got 1 .
26 .Pp
27 .Nm
28 may be present in the root directory of a Git repository for
29 repository-wide settings, or in the
30 .Pa .got
31 meta-data directory of a work tree to override repository-wide
32 settings for
33 .Xr got 1
34 commands executed within this work tree.
35 .Pp
36 The file format is line-based, with one configuration directive per line.
37 Any lines beginning with a
38 .Sq #
39 are treated as comments and ignored.
40 .Pp
41 The available configuration directives are as follows:
42 .Bl -tag -width Ds
43 .It Ic author Dq Real Name <email address>
44 Configure the author's name and email address for
45 .Cm got commit
46 and
47 .Cm got import
48 when operating on this repository.
49 Author information specified here overrides the
50 .Ev GOT_AUTHOR
51 environment variable.
52 .Pp
53 Because
54 .Xr git 1
55 may fail to parse commits without an email address in author data,
56 .Xr got 1
57 attempts to reject author information with a missing email address.
58 .It Ic remote Ar name Brq ...
59 Define a remote repository.
60 The specified
61 .Ar name
62 can be used to refer to the remote repository on the command line of
63 .Cm got fetch
64 and
65 .Cm got send .
66 .Pp
67 Information about this repository is declared in a block of options
68 enclosed in curly brackets:
69 .Bl -tag -width Ds
70 .It Ic server Ar hostname
71 Defines the hostname to use for contacting the remote repository's server.
72 .It Ic repository Ar path
73 Defines the path to the repository on the remote repository's server.
74 .It Ic protocol Ar scheme
75 Defines the protocol to use for communicating with the remote repository's
76 server.
77 .Pp
78 The following protocol schemes are supported:
79 .Bl -tag -width git+ssh
80 .It git
81 The Git protocol as implemented by the
82 .Xr git-daemon 1
83 server.
84 Use of this protocol is discouraged since it supports neither authentication
85 nor encryption.
86 .It git+ssh
87 The Git protocol wrapped in an authenticated and encrypted
88 .Xr ssh 1
89 tunnel.
90 With this protocol the hostname may contain an embedded username for
91 .Xr ssh 1
92 to use:
93 .Mt user@hostname
94 .It ssh
95 Short alias for git+ssh.
96 .El
97 .It Ic port Ar port
98 Defines the port to use for connecting to the remote repository's server.
99 The
100 .Ar port
101 can be specified by number or name.
102 The port name to number mappings are found in the file
103 .Pa /etc/services ;
104 see
105 .Xr services 5
106 for details.
107 If not specified, the default port of the specified
108 .Cm protocol
109 will be used.
110 .It Ic branch Brq Ar branch ...
111 Specify one or more branches which
112 .Cm got fetch
113 and
114 .Cm got send
115 should fetch from and send to the remote repository by default.
116 The list of branches specified here can be overridden at the
117 .Cm got fetch
118 and
119 .Cm got send
120 command lines with the
121 .Fl b
122 option.
123 .It Ic fetch-all-branches Ar yes | no
124 This option controls whether
125 .Cm got fetch
126 will fetch all branches from the remote repository by default.
127 If enabled, this behaviour can be overridden at the
128 .Cm got fetch
129 command line with the
130 .Fl b
131 option, and any
132 .Cm branch
133 configuration settings for this remote repository will be ignored.
134 .It Ic reference Brq Ar reference ...
135 Specify one or more arbitrary references which
136 .Cm got fetch
137 should fetch by default, in addition to the branches and tags that will
138 be fetched.
139 The list of references specified here can be overridden at the
140 .Cm got fetch
141 command line with the
142 .Fl R
143 option.
144 .Cm got fetch
145 will refuse to fetch references from the remote repository's
146 .Dq refs/remotes/
147 or
148 .Dq refs/got/
149 namespace.
150 In any case, references in the
151 .Dq refs/tags/
152 namespace will always be fetched and mapped directly to local references
153 in the same namespace.
154 .It Ic mirror-references Ar yes | no
155 This option controls the behaviour of
156 .Cm got fetch
157 when updating references.
158 .Sy Enabling this option can lead to the loss of local commits.
159 Maintaining custom changes in a mirror repository is therefore discouraged.
160 .Pp
161 If this option is not specified or set to
162 .Ar no ,
163 .Cm got fetch
164 will map references of the remote repository into the local repository's
165 .Dq refs/remotes/
166 namespace.
167 .Pp
168 If this option is set to
169 .Ar yes ,
170 all branches in the
171 .Dq refs/heads/
172 namespace will be updated directly to match the corresponding branches in
173 the remote repository.
174 .It Ic fetch Brq ...
175 An optional
176 .Ic fetch
177 block may contain any of the following configuration settings
178 for use by
179 .Cm got fetch ,
180 overriding corresponding settings in the containing
181 .Ic remote Ar name Brq ...
182 block.
183 .Bl -bullet
184 .It
185 .Ic server Ar hostname
186 .It
187 .Ic repository Ar path
188 .It
189 .Ic protocol Ar scheme
190 .It
191 .Ic port Ar port
192 .It
193 .Ic branch Brq Ar branch ...
194 .El
195 .It Ic send Brq ...
196 An optional
197 .Ic send
198 block may contain any of the following configuration settings
199 for use by
200 .Cm got send ,
201 overriding corresponding settings in the containing
202 .Ic remote Ar name Brq ...
203 block.
204 .Bl -bullet
205 .It
206 .Ic server Ar hostname
207 .It
208 .Ic repository Ar path
209 .It
210 .Ic protocol Ar scheme
211 .It
212 .Ic port Ar port
213 .It
214 .Ic branch Brq Ar branch ...
215 .El
216 .El
217 .El
218 .Sh EXAMPLES
219 Configure author information:
220 .Bd -literal -offset indent
221 author "Flan Hacker <flan_hacker@openbsd.org>"
222 .Ed
223 .Pp
224 Remote repository specification for the Game of Trees repository:
225 .Bd -literal -offset indent
226 remote "origin" {
227 server git.gameoftrees.org
228 protocol git
229 repository got
230 branch { "main" }
232 .Ed
233 .Pp
234 Mirror the
235 .Ox
236 src repository from Github:
237 .Bd -literal -offset indent
238 remote "origin" {
239 repository "openbsd/src"
240 server git@github.com
241 protocol git+ssh
242 mirror-references yes
244 .Ed
245 .Pp
246 Fetch changes via the Git protocol and send changes via the SSH protocol:
247 .Bd -literal -offset indent
248 remote "origin" {
249 repository my_repo
250 server git.example.com
251 protocol git
252 send {
253 server git@git.example.com
254 protocol ssh
257 .Ed
258 .Sh FILES
259 .Bl -tag -width Ds -compact
260 .It Pa got.conf
261 If present,
262 .Nm
263 located in the root directory of a Git repository supersedes any relevant
264 settings in Git's
265 .Pa config
266 file.
267 .Pp
268 .It Pa .got/got.conf
269 If present,
270 .Nm
271 located in the
272 .Pa .got
273 meta-data directory of a
274 .Xr got 1
275 work tree supersedes any relevant settings in the repository's
276 .Nm
277 configuration file and Git's
278 .Pa config
279 file.
280 .El
281 .Sh SEE ALSO
282 .Xr got 1 ,
283 .Xr git-repository 5 ,
284 .Xr got-worktree 5
285 .Sh CAVEATS
286 .Nm
287 offers no way to configure the editor spawned by
288 .Cm got commit ,
289 .Cm got histedit ,
290 .Cm got import ,
291 or
292 .Cm got tag .
293 This is deliberate and prevents potential arbitrary command execution
294 as another user when repositories or work trees are shared between users.
295 Users should set their
296 .Ev VISUAL
297 or
298 .Ev EDITOR
299 environment variables instead.