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 init
in your home directorygit add .
- Loop between
git st
and 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 init
the home directorygit remote add origin path/to/repo
ORgit remote add readonly path/to/readonly
git 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 init
the home directory.git co -b machine-name
- Do the
git st
and .gitignore loop. - Commit!
git co main
git remote add origin path/to/repo
git fetch origin
git reset --hard origin/main
git co machine-name
git rebase main
- Fix any conflicts.
git co main
git merge --no-ff machine-name