Last active
June 21, 2017 00:04
-
-
Save aicherc/8fd82fd29549135194bed3aa7d2d6484 to your computer and use it in GitHub Desktop.
This file contains 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Need to fix error with
.bashrc
and.bash_profile