Skip to content

GNU Stow

Keeps dotfiles in one Git repository and symlinks them into place, one package at a time.

Homebrew formula

What it does

Stow takes a directory that mirrors the layout of a target tree and creates symlinks for everything in it. For dotfiles that means ~/dotfiles/zsh/.zshrc becomes ~/.zshrc, with the real file still under version control.

cd ~/dotfiles
stow zsh tmux starship   # link these packages into $HOME
stow -D tmux             # unlink one
stow -R zsh              # relink after adding files

Why it holds up

There is no database, no daemon and no custom format — just symlinks and a directory convention. Any machine with stow and the repository reproduces the configuration, and git status in the repository shows exactly what has drifted.

Alternative to

AlternativeTypeTrade-off
chezmoiOpen sourceTemplating, secrets and per-machine differences; the usual choice for complex setups
yadmOpen sourceGit wrapped around $HOME directly, no symlinks
A bare Git repo with an alias—The same as yadm, assembled by hand
dotbotOpen sourceA declarative YAML installer instead of a symlink convention
Nix home-managerOpen sourceReproducible to the byte, and a much larger commitment

Install

brew install stow

Links

This post is licensed under CC BY 4.0 by the author.
Last updated on