#!/bin/bash set -e # Based on: # https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/ # Clone a bare repository: git clone --recurse-submodules --bare https://github.com/joshpencheon/dotfiles $HOME/.cfg function config { /usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ } # Checkout into $HOME: config checkout # Set up remotes: config config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* config fetch # Update any initialised submodules config submodule update # Ignore untracked files (i.e. contents of $HOME) config config --local status.showUntrackedFiles no echo "Initialisation complete; you may want to run ~/.dot/script/setup now."