Skip to content

Instantly share code, notes, and snippets.

@dberstein
dberstein / git-dotfiles
Last active February 7, 2021 13:12
simple git alias for dotfiles management
# git-dotfiles: simple git alias for dotfiles management
# 1. configure dotfiles checkout location ...
git config --global --replace-all dotfiles.dir "$HOME/.dotfiles"
# 2. init dotfiles ...
git init --bare "$(git config --global dotfiles.dir)"
# 3. create git dotfiles alias ...
git config --global --replace-all alias.dotfiles '!git --git-dir="$(git config --global dotfiles.dir)" --work-tree="$HOME"'
# 4. (OPTIONAL)
echo \* >> $HOME/.gitignore