Skip to content

Instantly share code, notes, and snippets.

@Dax89
Last active January 21, 2024 10:33
Show Gist options
  • Save Dax89/c7781d5dacbd02f80c55d2b19ee50dc5 to your computer and use it in GitHub Desktop.
Save Dax89/c7781d5dacbd02f80c55d2b19ee50dc5 to your computer and use it in GitHub Desktop.
Init Dotfiles
#!/bin/sh
dotfiles() {
git --git-dir="$HOME"/.dotfiles --work-tree="$HOME" "$@"
}
error() {
echo "ERROR: $1"
exit 1
}
cd "$HOME" || error "cannot change to home directory"
git clone --bare https://github.com/Dax89/dotfiles.git "$HOME"/.dotfiles
if dotfiles checkout; then
echo "Checked out dotfiles"
else
error "dotfiles checkout failed"
fi
dotfiles config status.showUntrackedFiles no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment