#!/bin/bash DIRS=$(ls -d */) #stow -d # First make hidden files not wildcardable shopt -u dotglob # Loop the directories for i in "${DIRS[@]}" do echo $i # Stow adopt, like -d, but it replaces the content in stow dir with # what already exists stow --adopt $i --target ~/ done # Now to revert the --adopt, and make it act like -d # !Make sure there's nothing new/uncommited in dotfiles dir first git reset --hard