Skip to content

Instantly share code, notes, and snippets.

@aicherc
Last active June 21, 2017 00:04
Show Gist options
  • Save aicherc/8fd82fd29549135194bed3aa7d2d6484 to your computer and use it in GitHub Desktop.
Save aicherc/8fd82fd29549135194bed3aa7d2d6484 to your computer and use it in GitHub Desktop.
git clone --bare https://github.com/aicherc/dotfiles.git $HOME/dotfiles
function gitdot() {
/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME $@
}
mkdir -p $HOME/dotfiles-backup
if [ -e README.md ]; then
echo "Moving README.md to backup";
mv $HOME/README.md $HOME/dotfiles-backup/
fi;
gitdot checkout
if [ $? = 0 ]; then
echo "Checked out dotfiles.";
else
echo "Backing up pre-existing dot files.";
gitdot checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} $HOME/dotfiles-backup/{}
fi;
gitdot checkout
gitdot config status.showUntrackedFiles no
@aicherc
Copy link
Author

aicherc commented Jun 21, 2017

Need to fix error with .bashrc and .bash_profile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment