Ramblings of an aging IT geek
← Ramblings of an aging IT geek
tooling

dotfiles in a git repo, at last, after years of meaning to

Finally moving my shell, vim and tmux config into a single tracked repo with GNU stow, and why the bare-repo trick wasn't for me.

A keyboard lit by a terminal

I have been meaning to do this for about five years. Every time I set up a new machine I'd hand-copy my .zshrc, forget half the aliases, and rediscover three weeks later that the one I actually rely on lives only on the laptop I left at the office. The quiet days between Christmas and New Year are good for exactly this kind of tidying, so I finally did it.

The structure is the boring obvious one. A dotfiles repo on GitHub, one directory per program, and GNU stow to symlink it all into place:

~/dotfiles
  zsh/.zshrc
  vim/.vimrc
  tmux/.tmux.conf
  git/.gitconfig

Then stow zsh tmux vim git from inside the repo and everything lands where it belongs as symlinks. New machine, clone, stow, done in under a minute.

I looked at the bare-repo-with-an-alias approach that's been doing the rounds, and it's clever, but it asks me to remember a custom config command and treats my whole home directory as a work tree. Stow keeps things explicit and visible, which suits how forgetful I am. The real win isn't the tool anyway. It's that the config now has history, so when I break my prompt at midnight I can git diff and see what past-me thought he was doing.