This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
My dotfiles are powering multiple machines, and overall I've been happy with them. They include hand-written shell scripts to create symlinks, download all desktop apps and CLI tools, and get my preferred system settings in place. But overall, they've become a Frankenstein over time because many random scripts are doing random things. And obviously, I failed to document what's going on properly.
Sure, scripts have to run to install stuff, but for config file management, most solutions I've seen seemed too complicated to keep some files in sync. And I really don't want to use a dotfile framework to pull some configuration files.
What if there is a way to tweak Git and track all the
and config
files?
"Dotfiles management" describes Git magic to track all files somewhere on your machine from a single
repository. Yes, your read that right. Any file and anywhere.
alias dotfiles='git --git-dir=/home/mx/.dotfiles --work-tree=/'
That's right; there's a
folder somewhere on your machine (/home/mx/
in the example), and it'll track all the files no matter where they're located, thanks to the --work-tree
argument. Then there's no symlink dance!
With some additional configuration, you can add and sync files across machines without scripts using dotfiles add
or dotfiles commit
. It's all just plain Git.
This dotfiles approach is by far the smartest I've seen, and I'll definitely give it a shot when I fiddle with my system config the next time.
Reply to Stefan
This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
Stefan Judis | Sciencx (2023-02-11T23:00:00+00:00) Git-based dotfile management without symlinks (#note). Retrieved from https://www.scien.cx/2023/02/11/git-based-dotfile-management-without-symlinks-note/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.