dolt-config
Configure Dolt databases and repositories
TLDR
List all local and global configuration options and their values
Display the value of a local or global configuration variable
Modify the value of a local configuration variable, creating it if it doesn't exist
Modify the value of a global configuration variable, creating it if it doesn't exist
Delete a local configuration variable
Delete a global configuration variable
SYNOPSIS
dolt config [scope-options] subcommand [arguments]
Examples of scope-options:
--global
--local
--system
--file=<path>
Examples of subcommands:
--add <key> <value>
--get <key>
--set <key> <value>
--list
--edit
--unset <key>
PARAMETERS
--global
Operates on the user's global configuration file, typically located at ~/.doltconfig.
--local
Operates on the current repository's local configuration file, located at <repo>/.dolt/config. This is the default scope if no scope option is provided.
--system
Operates on the system-wide configuration file, typically found at /etc/dolt/config.
--file=<path>
Operates on the configuration file specified by <path>, overriding default scope locations.
--add <key> <value>
Adds a new line to the configuration file with the specified key and value. Useful for keys that can have multiple values.
--get <key>
Retrieves the value for the specified configuration key.
--get-all <key>
Retrieves all values for a configuration key that may appear multiple times.
--set <key> <value>
Sets or updates the value for the specified configuration key. If the key exists, its value is updated; otherwise, it's added.
--list
Lists all configuration keys and their values across all active scopes (local, global, system), showing which file each value comes from.
--edit
Opens the specified configuration file (or the default local config if no scope is specified) in a text editor for manual editing.
--unset <key>
Removes the specified configuration key and its value from the relevant configuration file.
--unset-all <key>
Removes all occurrences of the specified configuration key and its values.
--rename-section <old-section> <new-section>
Renames a configuration section (e.g., 'user' to 'author').
--remove-section <section>
Removes an entire configuration section and all its keys.
--get-bool <key>
Retrieves a boolean configuration key, returning 'true' or 'false'.
--get-int <key>
Retrieves an integer configuration key.
--set-int <key> <value>
Sets an integer configuration key to the specified value.
DESCRIPTION
The dolt config command is used to read, write, and manage configuration options for Dolt repositories. Similar to git config, it allows users to customize Dolt's behavior at different levels: system-wide, globally for a user, or locally for a specific Dolt repository.
These configuration settings control various aspects of Dolt, such as user identity (name and email for commits), default text editors, remote URLs, and other operational preferences. The hierarchical nature of configuration means that local settings override global settings, which in turn override system-wide settings, providing flexibility in how Dolt behaves in different contexts. It's an essential tool for personalizing and standardizing Dolt environments.
CAVEATS
When setting configuration values, Dolt applies them to the current scope (local by default, or specified by --global, --system, or --file). When getting values, Dolt searches in a specific order: local, then global, then system, returning the first value found. Be mindful of this precedence when troubleshooting configuration issues, as a value set in a more specific scope will override one in a broader scope. Ensuring a valid text editor is configured (e.g., via the core.editor key) is crucial for using the --edit command.
CONFIGURATION FILE LOCATIONS AND PRECEDENCE
Dolt looks for configuration files in a specific order and applies settings based on precedence, with more specific scopes overriding broader ones:
1. Local: <repo>/.dolt/config - Specific to the current Dolt repository.
2. Global: ~/.doltconfig - Applies to the current user across all Dolt repositories.
3. System: /etc/dolt/config - Applies to all users on the system.
When resolving a configuration key, Dolt will return the value found in the most specific scope first. For example, a setting in .dolt/config will override the same setting in ~/.doltconfig.
HISTORY
The Dolt project, developed by Liquidata, began in 2018 with the goal of bringing Git-like version control to SQL databases. The dolt config command was included from early versions, mirroring the functionality and hierarchical configuration model of Git's well-established git config command. This design choice aimed to provide a familiar and powerful way for users to manage their Dolt environment and customize database versioning behavior, consistent with best practices from distributed version control systems.
SEE ALSO
git config(1): The primary inspiration for Dolt's configuration system, sharing much of its design and functionality., dolt init(1): Initializes a Dolt repository, which creates the local configuration file in .dolt/config., dolt remote(1): Manages sets of tracked repositories, often involving configuration settings for remote URLs (e.g., remote.<name>.url)., dolt user(1): A convenience command to set user identity configurations (user.name and user.email) globally or locally.