Skip to content

Instantly share code, notes, and snippets.

@mfrinnstrom
Created May 6, 2016 10:05
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 mfrinnstrom/0f2817a09eda431e79197c173c5cb319 to your computer and use it in GitHub Desktop.
Save mfrinnstrom/0f2817a09eda431e79197c173c5cb319 to your computer and use it in GitHub Desktop.
git clone --bare git@github.com:mfrinnstrom/dotfiles.git $HOME/.dotfiles
function dotfiles {
/usr/bin/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 dotfiles.";
config 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