My dotfiles are managed by means of GNU Stow (see documentation here).
Clone this repo, install GNU Stow and execute it:
git clone https://github.com/Samuele-Paglia/dotfiles.git ~/.dotfiles
brew install stow
cd ~/.dotfiles
stow .
GNU Stow installation for MacOS:
brew install stow
Using the .stowrc
file in order to pass flags to stow, the only command to be executed after this repo clone and stow installation (if required) will be:
stow .
To show what stow will do without any change applied, the following could be executed:
stow --adopt --simulate --verbose . # or
stow --adopt -nv .
Verbosity levels can be set from 0 to 5 (i.e., verbose=3
).
Note: The --adopt
flag could be used if the file to symlink already exists in the target directory. This flag enables the overwrite in the stow directory of the file with the one in the target directory.
To "de-stow" (unlink) only a specific file / directory, the -D
(its opposite flag is -S
to "stow" files, and it's the default behaviour) could be used:
stow -nvDt ~/.config bash
stow -nDt ~/.config bash
For the provided example the bash directory in the target ~/.config
directory, that was symlinked with the one present in the stow directory, will be removed.
Multiple stow directories passing are actually supported:
stow -v -t ~/.config tmux nvim