# originally here: https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/ # # install: # curl -Lks https://gist.githubusercontent.com/jimray/dad38720ddcfbca58e8f5a1ac1af00d7/raw | /bin/bash git clone --bare https://github.com/jimray/config.git $HOME/.cfg function config { local git_path git_path=$(which git) # Get the path to the user's installed Git if [ -n "$git_path" ]; then $git_path --git-dir=$HOME/.cfg/ --work-tree=$HOME "$@" else echo "Git is not installed or not found in your PATH." fi } 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