Last active
March 17, 2021 00:48
-
-
Save redraw/e0f11412c2983364e27b1a79299307c2 to your computer and use it in GitHub Desktop.
restore dotfiles script
This file contains hidden or 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
| #!/bin/bash | |
| # clone repo | |
| git clone --bare git@github.com:redraw/dotfiles.git $HOME/.dotfiles | |
| dotfiles () { git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME "$@"; } | |
| # backup | |
| for file in $(dotfiles ls-tree --name-only HEAD); do | |
| mv -vf $file $file.bak 2>/dev/null | |
| done | |
| # checkout | |
| dotfiles checkout | |
| dotfiles config status.showUntrackedFiles no | |
| echo -e "\e[1m setup running .bin/setup.sh \e[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment