Skip to content

Instantly share code, notes, and snippets.

@Lacrymology
Last active August 21, 2018 11:34
Show Gist options
  • Save Lacrymology/73b98c5104f2c38d5b1c531a16121b80 to your computer and use it in GitHub Desktop.
Save Lacrymology/73b98c5104f2c38d5b1c531a16121b80 to your computer and use it in GitHub Desktop.
Setup my config
git clone --bare git@bitbucket.org:Lacrymology/dotfiles.git $HOME/.cfg.git
function config {
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@
}
mkdir -p .config-backup
config checkout
if [ $? = 0 ]; then
echo "Checked out config.";
else
echo "Backing up pre-existing dot files.";
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{}
fi;
config checkout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment