This uses a git bare repo. To start:
alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
echo ".dotfiles" >> .gitignore
git clone --bare <ssh-or-https-url-to-clone> $HOME/.dotfiles
dotfiles config --local status.showUntrackedFiles no
dotfiles reset HEAD
dotfiles restore .
Step explanations:
- This sets up an alias for the bare repo
- We want to put this into our gitignore or else we could self reference
- Ignore untracked files
- Self explanatory clone the repo, but make sure it is bare
- Restores the actual content from .dotfiles to our home directory. Be sure to address conflicts
There is a history of old dotfiles on commit 0f8cf1f4bae3f4baf5d9a7938e3043514d672f47
where I used stow.