Skip to main content

Edit your dotfiles

Edit managed files using the chezmoi edit command:
chezmoi edit $FILENAME
This opens the source file in your editor. Changes aren’t applied until you run chezmoi apply.
You don’t have to use chezmoi edit. You can edit files directly in the source directory (~/.local/share/chezmoi) and apply changes later.

Pull the latest changes from your repo and apply them

chezmoi update

Pull and preview changes without applying

1

Pull changes and preview

chezmoi git pull -- --autostash --rebase && chezmoi diff
This shows what would change without modifying your files.
2

Apply if satisfied

chezmoi apply

Automatically commit and push changes to your repo

Enable auto-commit and auto-push in your config file:
[git]
    autoCommit = true
    autoPush = true
Behavior:
  • autoCommit = true: Commits changes with auto-generated messages
  • autoPush = true: Commits and pushes (implies autoCommit)
  • Custom templates: Prompt for messages or use template files
Be careful with autoPush on public repos. Accidentally committing secrets in plain text will push them immediately.

Install chezmoi and your dotfiles on a new machine with a single command

For a repo named dotfiles on GitHub:
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply $GITHUB_USERNAME
This installs chezmoi, runs chezmoi init, and applies your dotfiles in one command.
The one-shot mode is perfect for Docker containers or cloud shells where you need your config temporarily.

Build docs developers (and LLMs) love