These are my dotfiles, but not are absolutely not all mine because I steal from the best.
These dotfiles are also my home directory.
Seriously. Check out the .gitignore file. Anything look familiar?
Because it's easy! If anything changes or creates a new dotfile or subdirectory in my home directory it's extremely easy for me to see what changed and how much.
Before I did this I was always annoyed with scripts and installations that helpfully modified my files. I'd always forget exactly what was my configuration and what was generated.
For sure. Since the entire home directory is inside the git repo you have to be extra double sure that you don't push anything sensitive.
In practice, that means adding lots to the .gitignore file that you don't want to be included as part of the dotfiles repo.
I also maintain a .local_zshrc file on each machine since I invariably have machine specific settings.
If you'd like to try this out:
git initin your home directory
git add .
- Loop between
git stand editing .gitignore until you are satisfied
- Push up the repo wherever: or just maintain a local git repo if you only have one machine.
Second, etc. machines with dotfiles you DON'T care about
git initthe home directory
git remote add origin path/to/repoOR
git remote add readonly path/to/readonly
git fetch origin(or
git fetch readonly)
git reset --hard origin/master(or
git reset --hard readonly/master)
I use "readonly" when I'm on a machine just I just want to configure.
Second, etc. machines with dotfiles you DO care about
Basically: setup the repo, create a branch for the machine, commit the dotfiles, pull down the "master" dotfiles, and merge them with the local dotfiles.
git initthe home directory.
git co -b machine-name
- Do the
git stand .gitignore loop.
git co master
git remote add origin path/to/repo
git fetch origin
git reset --hard origin/master
git co machine-name
git rebase master
- Fix any conflicts.
git co master
git merge --no-ff machine-name