Keeping configuration in a dotfiles repository
Configuration files tend to accumulate in unrelated places: a shell file in
the home directory, editor settings under .config, and application-specific
files somewhere else again. I keep the versions I care about in one dotfiles
Git repository. That gives them history, makes changes reviewable, and makes a
new machine easier to set up.
The applications still expect their files at the usual paths, so I symlink each one from the repository into its expected location. For example:
ln -s ~/dotfiles/zsh/.zshrc ~/.zshrc
ln -s ~/dotfiles/git/config ~/.config/git/config
I prefer explicit links over a large setup framework. It is immediately clear where each file comes from, and adding one configuration does not require changing a complicated installer. The trade-off is that the initial setup is a little manual, and an existing file must be inspected or moved safely before a link takes its place.
The repository becomes the source of truth: edits happen there, while the symlinks only expose those files where programs expect them. Before committing, I also check for machine-specific paths, credentials, and tokens—configuration is useful to publish; secrets are not.