Examples from GNU Stow for Dotfiles.
~/dotfiles/
├── bash/
│ ├── .bashrc
│ └── .bashrc.d/
│ ├── 10-aliases.sh
│ └── 20-prompt.sh
├── git/
│ ├── .gitconfig
│ └── .gitignore.global
└── tmux/
└── .tmux.conf
Each top-level directory is a package. Contents mirror your home directory.
# Install a package
cd ~/dotfiles && stow bash
# Remove a package
cd ~/dotfiles && stow -D bash
# Install multiple packages
cd ~/dotfiles && stow bash git tmux
# Preview (dry run)
cd ~/dotfiles && stow -n bash# 1. Create repo
mkdir ~/dotfiles && cd ~/dotfiles && git init
# 2. Move first config
mkdir bash && mv ~/.bashrc bash/ && stow bash
# 3. Verify
ls -la ~/.bashrc # should show symlinkCreate .stow-local-ignore in any package (Perl regex):
^README\.md$
^\.git
- Secrets management
- Machine-specific configs
- Templating
- Package installation
For those, see the next article on Ansible + Stow.