This uses a git bare repo. To start:
alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'echo ".dotfiles" >> .gitignoregit clone --bare <ssh-or-https-url-to-clone> $HOME/.dotfilesdotfiles config --local status.showUntrackedFiles nodotfiles reset HEADdotfiles 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.