Where Does chezmoi Keep Source State and Config?
Where chezmoi keeps its source state, config file, and local cache on Linux, macOS, and Windows.
Last updated
chezmoi splits dotfiles into source state and destination. The source lives in ~/.local/share/chezmoi (a git repo of templates), and chezmoi apply renders it into your home directory. Its own settings sit in ~/.config/chezmoi/chezmoi.toml.
New users edit the wrong copy first. Changes belong in the source state, never in the home files they generate. The doctor command prints every live path, which settles most where did my edit go mysteries in one run. The status command previews pending diffs before apply.
Where chezmoi stores this, by platform
~/.local/share/chezmoi
Source state repo plus config in the sibling .config tree. XDG variables relocate both when set. The cache/ subdirectory holds temp copies; deleting it only forces a re render.
~/.local/share/chezmoi
Same layout as Linux via Homebrew installs. The source dir is a normal git repo, so dotfile repos clone straight into it. Machine specific templates read the hostname automatically.
%USERPROFILE%\.local\share\chezmoi
Source state defaults to %USERPROFILE%\.local\share\chezmoi with config in %USERPROFILE%\.config\chezmoi. Paste either into Explorer. Line ending handling matters here, so keep .gitattributes explicit.
Frequently asked questions
do i edit files in home or in chezmoi source
Edit files in ~/.local/share/chezmoi (the source state), then run chezmoi apply to write them home. Editing the home copy directly gets overwritten on the next apply. chezmoi edit opens the source file for exactly this reason.
where is the chezmoi config file
In ~/.config/chezmoi/chezmoi.toml (or YAML/JSON equivalents). It sets sourceDir, interpreters, and hooks. chezmoi doctor reports the live paths when something looks off, which beats guessing.
how do i migrate chezmoi to a new machine
Push the source directory to git and clone it on the new machine with chezmoi init <repo>, then apply. Secrets stay out of the repo via templates and a password manager, so the clone step is safe to share.
Notice an outdated path? Let us know.