My macOS and Linux shell and application configuration files, managed with Chezmoi.
Install Chezmoi with a package manager, then run:
git clone https://github.com/matheuseabra/dotfiles.git ~/dotfiles
chezmoi init --source="$HOME/dotfiles"
chezmoi diff
chezmoi applyEdit files in ~/dotfiles, not the generated files under $HOME:
chezmoi diff
chezmoi apply
chezmoi source-path ~/.zshrc
chezmoi updateChezmoi prefixes such as dot_, private_, and executable_ control target names and permissions. Templates (.tmpl) are rendered before they are applied.
Enable the safety hook once:
git config core.hooksPath .githooksIt checks the working tree and applies Chezmoi before each commit. A target conflict stops the commit instead of overwriting local changes.
Chezmoi also automatically stages, commits, and pushes source changes through
its git.autoAdd, git.autoCommit, and git.autoPush settings. These are
triggered by Chezmoi operations that change the source state, such as
chezmoi add; they are not a background watcher for arbitrary edits. Check
git status before running a source-mutating command because autoPush can
publish all local commits currently ahead of the remote. Do not add secrets to
the source repository: automatic pushes publish them immediately.
On macOS, preview or switch supported themes with:
change_theme <theme> --dry-run
change_theme <theme>change_theme edits the live configuration files and batches their
chezmoi add operations into one automatic commit and push. Use --dry-run
first when you do not intend to publish a theme change immediately.
Keep credentials, private keys, and local environment files out of Git. Use Chezmoi encryption or a password manager when a managed file needs a secret.