Skip to content

Instantly share code, notes, and snippets.

@s33dunda
Created December 5, 2018 16:16
Show Gist options
  • Save s33dunda/ba567ef50d1e32296f06214a72db39a2 to your computer and use it in GitHub Desktop.
Save s33dunda/ba567ef50d1e32296f06214a72db39a2 to your computer and use it in GitHub Desktop.
Install configuration files from git
git clone --bare https://github.com/s33dunda/.cfg.git $HOME/.cfg
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
config config status.showUntrackedFiles no
@s33dunda
Copy link
Author

s33dunda commented Dec 5, 2018

curl -Lks http://bit.do/install-config | /bin/zsh

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