This is my attempt at using stow to backup my dotfiles. Stow is a GNU symlink farm manager which helps to manage symbolic links.
Each subfolder in the .dotfiles
repository is stores a dotfile for a particular program (e.g. zsh/nvim)
- If the original dotfile is stored at
~/.config/nvim/lua/init.lua
, then create the folder~/.dotfiles/neovim/.config/nvim/lua/init.lua
cd ~/.dotfiles
stow -vt ~ [app]
.
cd ~/.dotfiles
stow -Dt ~ [app]
- Clone the repo
cd ~/dotfiles
stow -vt ~ */
- -v is verbose
- -t is target directory (The next argument is the target directory, usually
~
) - ending argument is which directories to use for symlinks
- -n flag is to see what stow intends to execute (by reading the verbose output). Remove the flag to actually execute the command.
- --adopt to firstly move the file over to .dotfiles and then create a symlink from there (useful for setting up stow)
- e.g. the git package only tracks
.gitconfig
Runstow --adopt -nv git
(moves .gitconfig into .dotfiles/git/.gitconfig and then create symlink)