Skip to content

Instantly share code, notes, and snippets.

View cleggatt's full-sized avatar

Chris Leggatt cleggatt

  • Sydney, Australia
View GitHub Profile
@cleggatt
cleggatt / get-dotfiles.sh
Last active October 26, 2017 00:56
Install existing dotfiles on a new machine
#!/bin/bash
git clone --bare git@github.com:cleggatt/dotfiles.git $HOME/.dotfiles
function dotfiles {
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
mkdir -p .dotfiles-backup
dotfiles checkout
if [ $? = 0 ]; then
echo "Checked out .dotfiles";
else
@cleggatt
cleggatt / new-dotfiles.sh
Last active October 26, 2017 00:56
Initialise dotfiles for the first time
#!/bin/bash
git init --bare $HOME/.dotfiles
alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
echo "alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.bash_profile
dotfiles config --local status.showUntrackedFiles no