yadm-gitconfig
Manage Git configuration within yadm managed dotfiles
TLDR
Update or set a Git configuration value
Get a value from yadm's Git configuration
Unset a value in yadm's Git configuration
List all values in yadm's Git configuration
SYNOPSIS
yadm gitconfig [options...]
PARAMETERS
options...
All arguments and options provided to yadm gitconfig are passed directly to the standard git config command. These include options to specify the configuration level (e.g., --local, --global, --system, --file <file>), actions to perform (e.g., --get, --add, --unset, --list, --edit), and key-value pairs to set or modify configuration entries.
--local
Operate on the local Git configuration file of the yadm repository. This is the default behavior if no scope option is provided.
--global
Operate on the global Git configuration file (`~/.gitconfig` or equivalent). Note that this affects your entire Git installation, not just yadm's behavior.
--system
Operate on the system-wide Git configuration file. This affects all users and repositories on the system.
--add key value
Add a new line to the option (allows multiple values for a single key).
--get key
Get the value for a given configuration key.
--list
List all variables set in the configuration file.
--edit
Open an editor to manually edit the configuration file.
DESCRIPTION
The yadm-gitconfig command is a specialized subcommand within the yadm (Yet Another Dotfiles Manager) utility. Its primary function is to invoke the standard Git git config command directly within the context of the yadm repository. This means any configuration changes made using yadm gitconfig will apply specifically to how yadm's underlying Git repository operates, rather than affecting your global or system-wide Git configuration by default.
Users can leverage this command to set Git-specific options relevant to their dotfile management, such as `user.name`, `user.email`, `core.editor`, or `diff.tool`, ensuring that yadm's Git operations are tailored to their preferences. It acts as a convenient wrapper, passing all provided arguments directly to git config, thereby providing full access to its extensive capabilities without needing to manually navigate into yadm's internal Git directory.
CAVEATS
When using yadm gitconfig, be mindful of the scope of your changes. By default, it operates on the yadm repository's local Git configuration. If you intend to modify your user's global Git configuration or system-wide settings, you must explicitly use the `--global` or `--system` options, respectively. Changes made with `--global` or `--system` will affect all Git operations on your system, not just those performed by yadm. Understanding the nuances of git config and its different configuration levels is crucial to avoid unintended side effects.
CONFIGURATION SCOPE
By default, yadm gitconfig operates on the 'local' configuration of yadm's internal Git repository. This means settings changed here are specific to how yadm interacts with its own version-controlled dotfiles. However, by explicitly passing `--global` or `--system` options, you can direct yadm gitconfig to modify your user's global Git configuration file (e.g., `~/.gitconfig`) or the system-wide Git configuration file, respectively. These latter options will affect all Git repositories and operations on your system, not just those managed by yadm.
BEHIND THE SCENES
Functionally, yadm gitconfig executes the git config command after changing the current working directory to yadm's internal Git repository. This ensures that any Git configuration operations (like setting `user.name` or `core.editor`) are performed on the `.git/config` file within yadm's managed repository, unless a different scope (global or system) is specified.
HISTORY
The yadm project, created by John Goerzen, emerged as a robust solution for managing dotfiles using Git's powerful version control capabilities. Given yadm's deep reliance on Git for its core functionality (cloning, tracking, committing changes), providing direct access to Git commands within the yadm context was a natural and necessary design choice. The yadm-gitconfig command was integrated early in yadm's development to empower users to fine-tune the Git repository yadm manages, ensuring that the underlying Git operations align perfectly with their workflow and preferences.
SEE ALSO
yadm(1), git(1), git-config(1)