datalad configuration(1) | General Commands Manual | datalad configuration(1) |
datalad configuration - get and set dataset, dataset-clone-local, or global configuration
datalad configuration [-h] [--scope {global|local|branch}] [-d DATASET] [-r] [-R LEVELS] [--version] [{dump|get|set|unset}] [name[=value] ...]
This command works similar to git-config, but some features are not supported (e.g., modifying system configuration), while other features are not available in git-config (e.g., multi-configuration queries).
Query and modification of three distinct configuration scopes is supported:
- 'branch': the persistent configuration in .datalad/config of a dataset
Modifications of the persistent 'branch' configuration will not be saved by this command, but have to be committed with a subsequent SAVE call.
Rules of precedence regarding different configuration scopes are the same as in Git, with two exceptions: 1) environment variables can be used to override any datalad configuration, and have precedence over any other configuration scope (see below). 2) the 'branch' scope is considered in addition to the standard git configuration scopes. Its content has lower precedence than Git configuration scopes, but it is committed to a branch, hence can be used to ship (default and branch-specific) configuration with a dataset.
Besides storing configuration settings statically via this command or ``git config``, DataLad also reads any DATALAD_* environment on process startup or import, and maps it to a configuration item. Their values take precedence over any other specification. In variable names ``_`` encodes a ``.`` in the configuration name, and ``__`` encodes a ``-``, such that ``DATALAD_SOME__VAR`` is mapped to ``datalad.some-var``. Additionally, a DATALAD_CONFIG_OVERRIDES_JSON environment variable is queried, which may contain configuration key-value mappings as a JSON-formatted string of a JSON-object::
DATALAD_CONFIG_OVERRIDES_JSON='{"datalad.credential.example_com.user": "jane", ...}'
This is useful when characters are part of the configuration key that cannot be encoded into an environment variable name. If both individual configuration variables *and* JSON-overrides are used, the former take precedent over the latter, overriding the respective *individual* settings from configurations declared in the JSON-overrides.
This command supports recursive operation for querying and modifying configuration across a hierarchy of datasets.
Dump the effective configuration, including an annotation for common items::
% datalad configuration
Query two configuration items::
% datalad configuration get user.name user.email
Recursively set configuration in all (sub)dataset repositories::
% datalad configuration -r set my.config=value
Modify the persistent branch configuration (changes are not committed)::
% datalad configuration --scope branch set my.config=value
datalad is developed by The DataLad Team and Contributors <team@datalad.org>.
2023-01-25 | datalad configuration 0.18.1 |