15 lines
409 B
Bash
15 lines
409 B
Bash
git clone --bare <url> $HOME/.git
|
|
function dots {
|
|
/usr/bin/git --git-dir=$HOME/.git/ --work-tree=$HOME $@
|
|
}
|
|
mkdir -p .config-backup
|
|
dots 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;
|
|
dots checkout
|
|
dots config status.showUntrackedFiles no
|