Stow for dotfiles
2026-05-18
I need to keep multiple linux' in sync, but using Git for tracking the config files was too much overhead for me. So here's a super concise GNU Stow tutorial for myself:
The canonical place for configs is ~/Sync/dotfiles (arbitrary path i like today). Stow will be used to manage (create and delete) symlinks so our files living in that canonical path can be accessed from other places where programs expect them.
In theory, this isn't too hard to do with the "ln" command, but Stow saves us a lot of pain.
For any given "package" (usually this would be a program, its just a term Stow uses) we can create a directory in Sync/dotfiles, for example for sway, waybar, foot, bash, ssh....
Then we need to define where Stow should actually put the symlinks - in my case the target is our home dir (~) so in Sync/dotfiles we create a .stowrc containing "--target=~" to point it at the right place.
Now for any file we actually care about, we put it in the appropriate path in the "package" directory. for example for sway:
~/Sync/dotfiles/sway/.config/sway/config
for example bashrc is directly in ~ so:
~/Sync/dotfiles/bash/.bashrc
now being in that Sync/dotfiles directory and running "stow sway bash" will place the appropriate symlinks where they should be, pointing to our synced directory.
Note: symlink permissions appear to be always 777, the actual file permissions count.
For the future: when setting up a new pc, after syncing the directory, we should be able to run stow */ (double chek/test that syntax first)
there's also "stow --adopt" that can copy existing dotfiles into our synced dir, not sure how exactly it works though.