These are my dotfiles, but not are absolutely not all mine because I steal from the best.
- https://github.com/chorn/dotfiles
- https://github.com/garybernhardt/dotfiles
- https://github.com/erichs/dotfiles
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 directorygit add .- Loop between
git stand editing .gitignore until you are satisfied - Commit!
- Push up the repo wherever: or just maintain a local git repo if you only have one machine.
git initthe home directorygit remote add origin path/to/repoORgit remote add readonly path/to/readonlygit fetch origin(orgit fetch readonly)git reset --hard origin/main(orgit reset --hard readonly/main)
I use "readonly" when I'm on a machine just I just want to configure.
Basically: setup the repo, create a branch for the machine, commit the dotfiles, pull down the "main" dotfiles, and merge them with the local dotfiles.
git initthe home directory.git co -b machine-name- Do the
git stand .gitignore loop. - Commit!
git co maingit remote add origin path/to/repogit fetch origingit reset --hard origin/maingit co machine-namegit rebase main- Fix any conflicts.
git co maingit merge --no-ff machine-name