This repository manages dotfiles using chezmoi.
# macOS
brew install chezmoi
# Ubuntu/Debian
sudo apt update
sudo apt install -y chezmoi
# Ubuntu (snap)
sudo snap install chezmoi --classic
# Or install from binary (all Linux distributions)
sh -c "$(curl -fsLS get.chezmoi.io)"
# Other platforms: https://www.chezmoi.io/install/# Clone and apply dotfiles
chezmoi init --apply https://github.com/dakesan/mydotfiles.gitEdit ~/.local/share/chezmoi/.chezmoidata.toml to set machine-specific values:
# Machine-specific data for chezmoi templates
obsidian_vault_path = "~/Documents/YourVaultName"# Show differences between dotfiles and target files
chezmoi diff# Apply all pending changes
chezmoi apply
# Apply with verbose output
chezmoi apply -v# Edit a file with your $EDITOR
chezmoi edit ~/.zshrc
# Edit and apply immediately
chezmoi edit --apply ~/.zshrc# Add a file to chezmoi management
chezmoi add ~/.newconfig
# Add a file as private (600 permissions)
chezmoi add --template ~/.config/secret/config.yml# Pull latest changes and apply (recommended)
chezmoi update
# Or use chezmoi git wrapper
chezmoi git pull
chezmoi apply
# Or manually
cd ~/.local/share/chezmoi
git pull
chezmoi apply# Using chezmoi git wrapper (recommended)
chezmoi git status # Check status
chezmoi git add . # Stage changes
chezmoi git commit -m "Description" # Commit changes
chezmoi git push # Push to remote
# Or manually navigate to source directory
cd ~/.local/share/chezmoi
git status
git add .
git commit -m "Description of changes"
git pushdot_filename→.filenamein home directoryprivate_dot_filename→.filenamewith 600 permissionssymlink_filename→ symlink managementexecutable_filename→ executable filefilename.tmpl→ template file (processed with Go templates)
Templates use Go template syntax with variables from .chezmoidata.toml:
path = "{{ .obsidian_vault_path | default "~/Documents/notes" }}".chezmoiignore specifies files excluded from Git tracking:
.codex/config.toml
.claude/commands/
.claude/skills/
.codex/AGENTS.md
These files are still managed by chezmoi locally but won't be committed to the repository.
.chezmoidata.toml- Machine-specific template variables (not tracked in Git).chezmoiignore- Files to exclude from Git trackingdot_codex/private_config.base.toml- Shared configuration templateprivate_dot_config/nvim/lua/personal.lua.tmpl- nvim personal config template
chezmoi re-add# Show what chezmoi would do
chezmoi apply --dry-run --verbose# Open merge tool for conflicts
chezmoi merge ~/.zshrc# Remove a file from chezmoi management
chezmoi forget ~/.oldconfigchezmoi statuschezmoi managed# Show how a template would be rendered
chezmoi cat ~/.config/nvim/lua/personal.lua# WARNING: This will discard local changes
cd ~/.local/share/chezmoi
git reset --hard origin/main
chezmoi applyIf migrating from a traditional ~/dotfiles directory:
-
Remove old symlinks:
# Find and remove dotfile symlinks find ~ -maxdepth 1 -type l -exec ls -l {} \; | grep dotfiles
-
Add real files to chezmoi:
chezmoi add ~/.zshrc ~/.bashrc ~/.config/nvim
-
Verify and apply:
chezmoi diff chezmoi apply