Last active
January 21, 2024 10:33
-
-
Save Dax89/c7781d5dacbd02f80c55d2b19ee50dc5 to your computer and use it in GitHub Desktop.
Init Dotfiles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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