Skip to content

Instantly share code, notes, and snippets.

@ewollesen
Last active April 5, 2018 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ewollesen/23a056b2fa2946e2285c8b5e542cd624 to your computer and use it in GitHub Desktop.
Save ewollesen/23a056b2fa2946e2285c8b5e542cd624 to your computer and use it in GitHub Desktop.
Clone my dotfiles setup
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 git@pain.xmtp.net: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