Last active
April 5, 2018 15:14
-
-
Save ewollesen/23a056b2fa2946e2285c8b5e542cd624 to your computer and use it in GitHub Desktop.
Clone my dotfiles setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -e | |
[ -d ~/.dotfiles ] && mv ~/.dotfiles{,-pre-git} | |
function config { | |
/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "$@" | |
} | |
alias config='/usr/bin/git --git-dir="$HOME/.dotfiles/" --work-tree=$HOME' | |
git clone --bare [email protected]:df.git "$HOME/.dotfiles" | |
config checkout || { | |
mkdir -p .dotfiles-backup && \ | |
config checkout 2>&1 | egrep "\s+\." | awk '{print $1}' | \ | |
xargs -I{} mv {} .dotfiles-backup/{} | |
} | |
config checkout | |
config config --local status.showUntrackedFiles no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment