These are the dotfiles I use across various Linux/Mac machines. I use a git working directory, mentioned here and here to manage the dotfiles.
Clone the files into a .dotfiles and set a temporary alias to manage the dotfiles.
git clone --bare --recursive https://github.com/RichGuk/dotfiles.git $HOME/.dotfiles
alias dots='/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
dots checkout
dots submodule update
dots config --local status.showUntrackedFiles no
We hide untracked files, i.e. only files we manually add in the home dir are tracked.
To add these files, use the normal git commands via the alias.
dots add .config/new-config-file
dots add .new-dotfile-to-track
dots commit -m 'Added new config files'
dots push
To remove a file from being tracked, but keep it locally, use:
dots rm --cached .remove-this-dotfile
dots push
There are some files part of this repo that I don't actually want in my home dir. e.g. README.md. You can remove it, and tell git to assume it has no changes:
dots update-index --assume-unchanged README.md
rm README.md
(can always do updates via web)
To undo this:
dots update-index --no-assume-unchanged README.md
dots checkout README.md
dots add README.md
dots commit -m 'Updated README.md'
dots push