Migrate from Symlink-Based Managers
Many dotfile managers (like GNU Stow, rcm, and bare git setups) use symbolic links to connect your dotfiles to a centralized directory. chezmoi takes a different approach by copying files directly to their target locations, which enables advanced features like templates, encryption, and per-machine customization.Using the --follow Flag
When migrating from a symlink-based system, use the --follow option with chezmoi add. This tells chezmoi to add the file that the symlink points to, rather than the symlink itself.
Migration Process
When you runchezmoi apply, chezmoi will replace the symlinks with actual files containing the correct content. Here’s a typical migration workflow:
-
Initialize chezmoi (if not already done):
-
Add your dotfiles with
--follow: -
Review the changes:
-
Apply the changes (this replaces symlinks with files):
-
Clean up your old dotfile manager (optional):
- Remove the old centralized dotfiles directory
- Uninstall the old dotfile manager
- Update any scripts that referenced the old setup
Comparing Dotfile Managers
chezmoi vs. GNU Stow
GNU Stow uses symlinks to create a layer of indirection between your dotfiles’ locations and their contents. Key differences:- chezmoi: Files are regular files in their final location
- GNU Stow: Files are symlinks pointing to a central directory
- Support for templates (machine-specific configurations)
- Built-in encryption for sensitive files
- Executable and private file permissions
- Works better on Windows (no symlink permission issues)
- No “special” files that reveal your dotfile management setup
chezmoi vs. yadm
yadm (Yet Another Dotfiles Manager) uses a bare git repository in your home directory. Key differences:- chezmoi: Uses a separate source directory (
~/.local/share/chezmoi) - yadm: Stores dotfiles directly in your home directory
- Password manager integration (1Password, Bitwarden, etc.)
- More powerful templating with custom variables
- Easier to manage files outside your home directory
- Better handling of machine-to-machine differences
chezmoi vs. dotbot
dotbot is a Python-based tool that uses a configuration file to set up symlinks. Key differences:- chezmoi: Single binary, no dependencies
- dotbot: Requires Python and git
- No runtime dependencies
- Cross-platform (Linux, macOS, Windows, BSD)
- Built-in diff viewing before applying changes
- Encryption support
- More flexible templating
Feature Comparison Table
| Feature | chezmoi | GNU Stow | yadm | dotbot | bare git |
|---|---|---|---|---|---|
| Distribution | Single binary | Package | Single script | Python package | Manual |
| Bootstrap requirements | None | Perl | git | Python, git | git |
| Windows support | ✅ | ❌ | ✅ | ✅ | ✅ |
| Files are… | Regular files | Symlinks | Regular files | Symlinks | Regular files |
| Templates | ✅ | ❌ | ✅ (limited) | ❌ | ❌ |
| Encryption | ✅ | ❌ | ✅ | ❌ | ❌ |
| Password managers | ✅ | ❌ | ❌ | ❌ | ❌ |
| Diff before apply | ✅ | ❌ | ✅ | ❌ | ✅ |
| Run scripts | ✅ | ❌ | ✅ | ✅ | ❌ |
| Private files | ✅ | ❌ | ✅ | ❌ | ❌ |
Migration Examples
From GNU Stow
If you have a typical GNU Stow setup with structure like:From yadm
If you’re using yadm, your dotfiles are already in your home directory:From bare git
If you’re using the bare git approach:Post-Migration Tips
Take Advantage of Templates
Now that you’re using chezmoi, you can add machine-specific logic:Add Encryption for Secrets
Protect sensitive files with age or gpg encryption:Set Up Automatic Updates
Configure git auto-commit and auto-push:Create Run Scripts
Automate setup tasks with scripts:Troubleshooting Migration
Symlinks Still Exist After Apply
If symlinks persist after runningchezmoi apply, ensure you used --follow when adding: