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 .Pp
65 Information about this repository is declared in a block of options
66 enclosed in curly brackets:
67 .Bl -tag -width Ds
68 .It Ic server Ar hostname
69 Defines the hostname to use for contacting the remote repository's server.
70 .It Ic repository Ar path
71 Defines the path to the repository on the remote repository's server.
72 .It Ic protocol Ar scheme
73 Defines the protocol to use for communicating with the remote repository's
74 server.
75 .Pp
76 The following protocol schemes are supported:
77 .Bl -tag -width git+ssh
78 .It git
79 The Git protocol as implemented by the
80 .Xr git-daemon 1
81 server.
82 Use of this protocol is discouraged since it supports neither authentication
83 nor encryption.
84 .It git+ssh
85 The Git protocol wrapped in an authenticated and encrypted
86 .Xr ssh 1
87 tunnel.
88 With this protocol the hostname may contain an embedded username for
89 .Xr ssh 1
90 to use:
91 .Mt user@hostname
92 .It ssh
93 Short alias for git+ssh.
94 .El
95 .It Ic port Ar port
96 Defines the port to use for connecting to the remote repository's server.
97 The
98 .Ar port
99 can be specified by number or name.
100 The port name to number mappings are found in the file
101 .Pa /etc/services ;
102 see
103 .Xr services 5
104 for details.
105 If not specified, the default port of the specified
106 .Cm protocol
107 will be used.
108 .It Ic mirror-references Ar yes | no
109 This option controls the behaviour of
110 .Cm got fetch
111 when updating references.
112 .Sy Enabling this option can lead to the loss of local commits.
113 Maintaining custom changes in a mirror repository is therefore discouraged.
114 .Pp
115 If this option is not specified or set to
116 .Ar no ,
117 .Cm got fetch
118 will map references of the remote repository into the local repository's
119 .Dq refs/remotes/
120 namespace.
121 .Pp
122 If this option is set to
123 .Ar yes ,
124 all branches in the
125 .Dq refs/heads/
126 namespace will be updated directly to match the corresponding branches in
127 the remote repository.
128 .El
129 .Sh EXAMPLES
130 Configure author information:
131 .Bd -literal -offset indent
132 author "Flan Hacker <flan_hacker@openbsd.org>"
133 .Ed
134 .Pp
135 Remote repository specification for the Game of Trees repository:
136 .Bd -literal -offset indent
137 remote "origin" {
138 server git.gameoftrees.org
139 protocol git
140 repository got
142 .Ed
143 .Pp
144 Mirror the OpenBSD src repository from Github:
145 .Bd -literal -offset indent
146 remote "origin" {
147 repository "openbsd/src"
148 server git@github.com
149 protocol git+ssh
150 mirror-references yes
152 .Ed
153 .Sh FILES
154 .Bl -tag -width Ds -compact
155 .It Pa got.conf
156 If present,
157 .Nm
158 located in the root directory of a Git repository supersedes any relevant
159 settings in Git's
160 .Pa config
161 file.
162 .Pp
163 .It Pa .got/got.conf
164 If present,
165 .Nm
166 located in the
167 .Pa .got
168 meta-data directory of a
169 .Xr got 1
170 work tree supersedes any relevant settings in the repository's
171 .Nm
172 configuration file and Git's
173 .Pa config
174 file.
175 .El
176 .Sh SEE ALSO
177 .Xr got 1 ,
178 .Xr git-repository 5 ,
179 .Xr got-worktree 5
180 .Sh CAVEATS
181 .Nm
182 offers no way to configure the editor spawned by
183 .Cm got commit ,
184 .Cm got histedit ,
185 .Cm got import ,
186 or
187 .Cm got tag .
188 This is deliberate and prevents potential arbitrary command execution
189 as another user when repositories or work trees are shared between users.
190 Users should set their
191 .Ev VISUAL
192 or
193 .Ev EDITOR
194 environment variables instead.