Expand description
Get, set, and unset git config values, scoped to one of git’s config files.
Enums§
- Config
Scope - Which config file
git configoperates on.
Functions§
- get
- Read a single config value from the given scope. Returns
Ok(None)if the key isn’t set, or if the scope itself isn’t readable here:git config --localexits 128 outside any repo, exits 129 (“only one config file at a time”) whenGIT_CONFIGis also set, and any scope exits 128 when env-vars likeGIT_WORK_TREEpoint at a missing path. Treating all of those as “no value” matches upstream’scfg.Git.Get(key)semantics —git lfs envdistinguishes a configured value from an unconfigured one, but not between “key not set” and “scope unreachable.” - get_
effective - Look up
keyacross.lfsconfig(committed; lowest priority) and the standard git config scopes (local → global → system). Returns the first match. - get_
from_ file - Read a single config value from a specific file (e.g.
.lfsconfig). ReturnsOk(None)if the file doesn’t exist or the key isn’t set. - get_
from_ lfsconfig - Look up
keyin.lfsconfig, applying the safe-key allowlist. - set
- Set
key = valuein the given scope. - unset
- Unset
keyin the given scope. Idempotent: if the key isn’t there, returnsOk(())rather than erroring.