.\" .\" Copyright (c) 2020 Stefan Sperling .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .Dd $Mdocdate$ .Dt GOT.CONF 5 .Os .Sh NAME .Nm got.conf .Nd Game of Trees configuration file .Sh DESCRIPTION .Nm is the run-time configuration file for .Xr got 1 . .Pp .Nm may be present in the root directory of a Git repository for repository-wide settings, or in the .Pa .got meta-data directory of a work tree to override repository-wide settings for .Xr got 1 commands executed within this work tree. .Pp The file format is line-based, with one configuration directive per line. Any lines beginning with a .Sq # are treated as comments and ignored. .Pp The available configuration directives are as follows: .Bl -tag -width Ds .It Ic author Dq Real Name Configure the author's name and email address for .Cm got commit and .Cm got import when operating on this repository. Author information specified here overrides the .Ev GOT_AUTHOR environment variable. .Pp Because .Xr git 1 may fail to parse commits without an email address in author data, .Xr got 1 attempts to reject author information with a missing email address. .It Ic signer_id Pa signer-id Configure a .Ar signer-id to sign tag objects. This key will be used to sign all tag objects unless overridden by .Cm got tag Fl s Ar signer-id . .Pp For SSH-based signatures, .Ar signer-id is the path to a file which may refer to either a private SSH key, or a public SSH key with the private half available via .Xr ssh-agent 1 . .It Ic allowed_signers Pa path Configure a .Ar path to the "allowed signers" file which contains a list of trusted SSH signer identities. The file will be passed to .Xr ssh-keygen 1 during verification of SSH-based signatures with .Cm got tag Fl V . The format of the "allowed signers" file is documented in the ALLOWED SIGNERS section of .Xr ssh-keygen 1 . .Pp Verification of SSH-based signatures is impossible unless the .Ic allowed_signers option is set in .Nm . .It Ic revoked_signers Pa path Configure a .Ar path to the optional "revoked signers" file, which contains a list of revoked SSH signer identities. This file is passed to .Xr ssh-keygen 1 during signature verification with .Cm got tag Fl V . Revoked identities are no longer considered trustworthy and verification of relevant signatures will fail. .It Ic remote Ar name Brq ... Define a remote repository. The specified .Ar name can be used to refer to the remote repository on the command line of .Cm got fetch and .Cm got send . .Pp When repositories are shared between multiple users on the system, it is recommended that users configure their trusted remote repositories in each of their work-trees' .Nm files, overriding corresponding repository-wide settings. This can avoid potentially undesirable connections to remote repositories placed into the shared repository's .Nm file by other users. .Pp Information about a repository is declared in a block of options enclosed in curly brackets: .Bl -tag -width Ds .It Ic server Ar hostname Defines the hostname to use for contacting the remote repository's server. .It Ic repository Ar path Defines the path to the repository on the remote repository's server. .It Ic protocol Ar scheme Defines the protocol to use for communicating with the remote repository's server. .Pp The following protocol schemes are supported: .Bl -tag -width git+ssh .It git The Git protocol as implemented by the .Xr git-daemon 1 server. Use of this protocol is discouraged since it supports neither authentication nor encryption. .It git+ssh The Git protocol wrapped in an authenticated and encrypted .Xr ssh 1 tunnel. With this protocol the hostname may contain an embedded username for .Xr ssh 1 to use: .Mt user@hostname .It ssh Short alias for git+ssh. .El .It Ic port Ar port Defines the port to use for connecting to the remote repository's server. The .Ar port can be specified by number or name. The port name to number mappings are found in the file .Pa /etc/services ; see .Xr services 5 for details. If not specified, the default port of the specified .Cm protocol will be used. .It Ic branch Brq Ar branch ... Specify one or more branches which .Cm got fetch and .Cm got send should fetch from and send to the remote repository by default. The list of branches specified here can be overridden at the .Cm got fetch and .Cm got send command lines with the .Fl b option. .It Ic fetch_all_branches Ar yes | no This option controls whether .Cm got fetch will fetch all branches from the remote repository by default. If enabled, this behaviour can be overridden at the .Cm got fetch command line with the .Fl b option, and any .Cm branch configuration settings for this remote repository will be ignored. .It Ic reference Brq Ar reference ... Specify one or more arbitrary references which .Cm got fetch should fetch by default, in addition to the branches and tags that will be fetched. The list of references specified here can be overridden at the .Cm got fetch command line with the .Fl R option. .Cm got fetch will refuse to fetch references from the remote repository's .Dq refs/remotes/ or .Dq refs/got/ namespace. In any case, references in the .Dq refs/tags/ namespace will always be fetched and mapped directly to local references in the same namespace. .It Ic mirror_references Ar yes | no This option controls the behaviour of .Cm got fetch when updating references. .Sy Enabling this option can lead to the loss of local commits. Maintaining custom changes in a mirror repository is therefore discouraged. .Pp If this option is not specified or set to .Ar no , .Cm got fetch will map references of the remote repository into the local repository's .Dq refs/remotes/ namespace. .Pp If this option is set to .Ar yes , all branches in the .Dq refs/heads/ namespace will be updated directly to match the corresponding branches in the remote repository. .It Ic fetch Brq ... An optional .Ic fetch block may contain any of the following configuration settings for use by .Cm got fetch , overriding corresponding settings in the containing .Ic remote Ar name Brq ... block. .Bl -bullet .It .Ic server Ar hostname .It .Ic repository Ar path .It .Ic protocol Ar scheme .It .Ic port Ar port .It .Ic branch Brq Ar branch ... .El .It Ic send Brq ... An optional .Ic send block may contain any of the following configuration settings for use by .Cm got send , overriding corresponding settings in the containing .Ic remote Ar name Brq ... block. .Bl -bullet .It .Ic server Ar hostname .It .Ic repository Ar path .It .Ic protocol Ar scheme .It .Ic port Ar port .It .Ic branch Brq Ar branch ... .El .El .El .Sh FILES .Bl -tag -width Ds -compact .It Pa got.conf If present, .Nm located in the root directory of a Git repository supersedes any relevant settings in Git's .Pa config file. .Pp .It Pa .got/got.conf If present, .Nm located in the .Pa .got meta-data directory of a .Xr got 1 work tree supersedes any relevant settings in the repository's .Nm configuration file and Git's .Pa config file. .El .Sh EXAMPLES Configure author information: .Bd -literal -offset indent author "Flan Hacker " .Ed .Pp Remote repository specification for the Game of Trees repository: .Bd -literal -offset indent remote "origin" { server git.gameoftrees.org protocol git repository got branch { "main" } } .Ed .Pp Mirror the .Ox src repository from Github: .Bd -literal -offset indent remote "origin" { repository "openbsd/src" server git@github.com protocol git+ssh mirror_references yes } .Ed .Pp Fetch changes via the Git protocol and send changes via the SSH protocol: .Bd -literal -offset indent remote "origin" { repository my_repo server git.example.com protocol git send { server git@git.example.com protocol ssh } } .Ed .Sh SEE ALSO .Xr got 1 , .Xr git-repository 5 , .Xr got-worktree 5 .Sh CAVEATS .Nm offers no way to configure the editor spawned by .Cm got commit , .Cm got histedit , .Cm got import , or .Cm got tag . This is deliberate and prevents potential arbitrary command execution as another user when repositories or work trees are shared between users. Users should set their .Ev VISUAL or .Ev EDITOR environment variables instead.