Skip to content

Git configuration ​

[bootstrap.settings.git] sets keys in your global Git configuration, the file git config --global writes: $GIT_CONFIG_GLOBAL, ~/.gitconfig, or $XDG_CONFIG_HOME/git/config (by default ~/.config/git/config) when only that one exists. mise reads each key with git config, compares it with your value, and writes only the keys that differ. Keys you don't declare are left alone, so Git, other tools, and your own edits can keep using the same file.

When both ~/.gitconfig and the XDG file exist, Git reads both but writes ~/.gitconfig. mise reads a key from both files, as Git does. When it writes a key to ~/.gitconfig, it then removes the key from the XDG file, so Git sees only your value. A ~/.gitconfig that is a symlink to the XDG file is one file, so mise only writes it.

A relative $GIT_CONFIG_GLOBAL names a file in the directory you run mise in.

Unlike bootstrap settings plugins, this section is not experimental.

Declare keys ​

Each TOML key is one level of the Git key: the section, then the subsection if there is one, then the name. Write them as dotted keys or as tables:

[bootstrap.settings.git]
init.defaultBranch = "main"
pull.rebase = true
safe.directory = ["/srv/app", "/srv/web"]

[bootstrap.settings.git.user]
email = "me@example.com"

[bootstrap.settings.git.url."git@github.com:"]
insteadOf = "https://github.com/"

user.email = … under [bootstrap.settings.git] and email = … under [bootstrap.settings.git.user] set the same key. Quote only a subsection, such as url."git@github.com:" or http."https://example.com/", since it can hold dots. A quoted "user.email" is one TOML key, not a section and a name, so mise rejects it and prints the spelling to use instead.

As in Git, the section and the key name ignore case, but a subsection does not: init.defaultBranch and init.defaultbranch are one key, so a more local config file that spells it differently still overrides it.

A value is a string, a boolean, or an integer. mise compares booleans and integers the way Git reads them, so a config file that already has autocrlf = yes matches core.autocrlf = true. Quote other numbers, such as "1.5".

An array sets a key that Git allows more than once, such as safe.directory or url.<base>.insteadOf. It lists every value the key has: mise removes the values it doesn't list, and [] removes the key.

Preview and apply ​

mise bootstrap applies the section in its settings step, after [tools] and after dotfiles, so a ~/.gitconfig that mise also creates is in place first. You can also apply it on its own:

sh
mise bootstrap settings status git
mise bootstrap settings apply git --dry-run
mise bootstrap settings apply git

A dry run prints each key that would change, with its current value:

text
mise would set git: init.defaultBranch (unset) -> "main"
mise would set git: safe.directory ["/old"] -> ["/srv/app","/srv/web"]

mise prints (hidden) instead of the value of a key that likely holds a credential: one whose name contains extraHeader, password, token, or secret, or ends in pass, such as sendemail.smtpPass.

mise bootstrap settings status --missing exits with status 1 when a key differs from the config, for example after someone runs git config --global by hand. mise looks for git on PATH and among your global [tools], so [tools] can install it in the same run. Without it, the section is skipped and listed in the bootstrap: follow-up output.

Sections merge across config files key by key, and a more local file's value wins, as for the rest of [bootstrap]. A global config can set user.name while a work machine's config sets only user.email.

With a managed ~/.gitconfig ​

mise writes keys into the file Git uses. When [dotfiles] also manages that file, a key written here changes the dotfile: Git writes through a symlinked ~/.gitconfig into its source, and a copied one no longer matches its source.

Give each key one owner. A common split keeps the shared settings in the dotfile and declares only the keys that vary by machine, such as user.email, here, with the dotfile leaving them out.

Install hk's Git hooks ​

hk installs its Git hooks into the global Git configuration with hk install --global, so every repository with an hk.pkl runs them. Run it from a bootstrap hook once [tools] has installed hk:

[tools]
hk = "latest"

[bootstrap.hooks.post-tools]
description = "Install hk's Git hooks for every repository"
run = "mise exec -- hk install --global --mise"

hk install --global needs Git 2.54 or newer. --mise runs each hook through mise exec, so a repository's linters come from its own [tools].

MIT LicenseCopyright © 2026jdx.dev