Skip to content

Instantly share code, notes, and snippets.

@vhenzl
Last active January 24, 2021 21:10
Show Gist options
  • Save vhenzl/d430f5e3387177fb22e9234438fc33d1 to your computer and use it in GitHub Desktop.
Save vhenzl/d430f5e3387177fb22e9234438fc33d1 to your computer and use it in GitHub Desktop.
Installation script for https://github.com/vhenzl/dotfiles
git clone --bare git@github.com:vhenzl/dotfiles.git $HOME/.dotfiles
function dotfiles {
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
mkdir -p .dotfiles-backup
dotfiles checkout
if [ $? = 0 ]; then
echo "Checked out dotfiles.";
else
echo "Backing up pre-existing dot files.";
dotfiles checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .dotfiles-backup/{}
fi;
dotfiles checkout
dotfiles config status.showUntrackedFiles no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment