What Are Dotfiles?

Dotfiles are hidden configuration files in your home directory: .bashrc, .zshrc, .gitconfig, .vimrc, .tmux.conf. They define your shell aliases, editor settings, Git configuration, and tool preferences. Without them, every new machine requires hours of manual setup. With managed dotfiles, you're productive in minutes.

Version Control with Git

Create a ~/.dotfiles repository. Store all your configuration files there. The challenge: these files need to live in specific locations (~/.bashrc, ~/.config/nvim/init.lua). Solutions: symlinks (manual or automated), GNU Stow, chezmoi, or a bare Git repo.

GNU Stow: Simple Symlinks

Stow creates symlinks from a source directory to a target. Organize dotfiles by tool: dotfiles/bash/.bashrc, dotfiles/git/.gitconfig, dotfiles/nvim/.config/nvim/init.lua. Run stow bash git nvim to create all symlinks. It's simple, dependency-free, and available on every Linux distribution.

chezmoi: Advanced Management

chezmoi handles templates (different configs per machine), secrets (1Password/Bitwarden integration), and file encryption. It supports machine-specific configurations — work laptop vs personal machine. More complex than Stow but necessary for developers managing multiple machines with different requirements.

Bootstrap Scripts

A bootstrap.sh script installs tools, clones your dotfiles, and sets up your environment. Use it for new machine setup: install Homebrew/apt packages, clone the dotfiles repo, run Stow/chezmoi, install Neovim plugins, and configure SSH keys. One command, fully configured machine.

Best Practices

Keep dotfiles modular — one directory per tool. Document what each config does with comments. Never commit secrets (API keys, tokens) — use .gitignore and environment variables. Test your bootstrap script periodically in a fresh Docker container. Share your dotfiles publicly on GitHub — it helps others and forces good habits.

Conclusion

Managed dotfiles transform machine setup from a day-long ordeal to a 10-minute process. Start simple: put your .gitconfig and shell config in a Git repo with Stow. Expand to include editor configs, tmux, and bootstrap scripts. Your future self (and your next laptop) will thank you.