Skip to content

Instantly share code, notes, and snippets.

@EduardoRodriguesF
Last active April 9, 2023 13:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EduardoRodriguesF/600ed2f94ad4bdba947fbdf0ca698a9e to your computer and use it in GitHub Desktop.
Save EduardoRodriguesF/600ed2f94ad4bdba947fbdf0ca698a9e to your computer and use it in GitHub Desktop.
Install my Dotfiles
#!/usr/bin/env bash
git clone --bare https://github.com/EduardoRodriguesF/dotfiles $HOME/.dotfiles
function dotfiles {
/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
dotfiles checkout
if [ $? = 0 ]; then
echo "Checked out dotfiles.";
else
echo "Backing up pre-existing dot files.";
mkdir -p .dotfiles-backup
dotfiles checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .dotfiles-backup/{}
fi;
dotfiles checkout
dotfiles submodule init
dotfiles submodule update
dotfiles config status.showUntrackedFiles no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment