chezmoi-dotfiles

Integrate upstream changes and resolve conflicts in chezmoi dotfiles repositories.

Updated Dec 7, 2025
One-click install
npx skills add https://github.com/harlanljones/dotfiles --skill chezmoi-dotfiles-harlanljones
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: chezmoi-dotfiles
Source: https://github.com/harlanljones/dotfiles/tree/main/dot_hermes/skills/devops/chezmoi-dotfiles
Command: npx skills add https://github.com/harlanljones/dotfiles --skill chezmoi-dotfiles-harlanljones

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Pulling upstream changes into a chezmoi-managed dotfiles repo risks clobbering local work, mis-merging generated files, and confusing runtime drift with real repo changes. This Skill provides a safe, repeatable procedure for fetching, merging, validating, and editing a chezmoi source tree without breaking the live checkout. ## Core Features & Use Cases - Safe upstream pulls: Inspect incoming commits with git log/diff, predict conflicts by intersecting touched files with local dirty files, and merge inside a throwaway git worktree before fast-forwarding the live checkout. - Conflict resolution rules: Handle generated files by regenerating instead of hand-merging, resolve rename/rename conflicts by identifying redesigns, and distinguish repo drift from runtime drift in app-rewritten config files. - Validation gates: Run chezmoi apply --dry-run --force for a true non-interactive pass/fail, shellcheck touched shell modules, and respect run_onchange hook re-execution. - Use Case: After weeks away, you pull upstream dotfiles changes that renamed a config into .chezmoitemplates while you edited the old file locally; the Skill guides you to take the redesign, verify nothing stash-only was lost, and validate with a forced dry-run. ## Quick Start Ask the assistant to pull the latest upstream changes into my chezmoi dotfiles repo and resolve any conflicts safely using a worktree.

Frequently Asked Questions about chezmoi-dotfiles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely pull upstream changes into a chezmoi dotfiles repo?▼

Fetch origin, review git log and diff --stat first, then intersect incoming touched files with your local dirty files to predict conflicts. Merge inside a git worktree sandbox, resolve and validate there, then fast-forward the live checkout with git merge --ff-only.

How to resolve merge conflicts in chezmoi generated files?▼

Never hand-merge generated files like index or README trees. Take one side wholesale, then regenerate with the repo's own generator after the merge; if your local work added no new tracked files, take the upstream version directly.

Why does chezmoi apply --dry-run prompt that a file changed since last write?▼

That prompt appears when an application rewrote its own config file at runtime, making the target differ from chezmoi's last recorded state. It is a pre-existing state condition, not a merge defect; use --force to bypass the prompt for a true non-interactive pass/fail.

What naming prefixes do new chezmoi source files need?▼

New files must use the correct source-name prefix such as dot_, private_dot_, executable_, or encrypted_*.age for secrets, plus .tmpl for templates. Secrets must only be stored via encrypted age files, never as plaintext.

Should shell configuration go in dot_bashrc or dot_zshrc?▼

No. rc files are pure loaders in this workflow; actual shell configuration belongs in the dedicated shell module directory. Putting config directly in dot_bashrc or dot_zshrc violates the repo's editing rules.