You could use a dotfiles manager like https://yadm.io/
It's more or less a wrapper of git, but it comes with a bunch of features that allow you to do the things you describe.
It's more or less a wrapper of git, but it comes with a bunch of features that allow you to do the things you describe.
yadm_diff=$(yadm --no-pager diff --name-only --exit-code)
if [ $? -ne 0 ]; then
echo -e "\e[1m\e[91m[yadm] \e[0m\e[92mThese config files have been modified:\e[39m"
echo "$yadm_diff"
fi