3 ms·
I've found that stock git works great for managing dotfiles, without any extra tools needed. Just a few lines of gitconfig and a shell alias is enough. It's all
by colonwqbang 3y ago
I've found that stock git works great for managing dotfiles, without any extra tools needed. Just a few lines of gitconfig and a shell alias is enough. It's all explained here: https://www.atlassian.com/git/tutorials/dotfiles https://www.atlassian.com/git/tutorials/dotfiles
Perhaps other people have more complex use cases than me.
- kstrauser 3y agoThere's nothing wrong with that setup. It falls over when you start pushing it across multiple machines with substantial differences. Then Chezmoi's templating is so handy. For example, 99% of my config is the same between my desktop Mac and my various Linux servers, but I use different ssh_config settings on the 2 OSes. Chezmoi makes that very easy. Stock git doesn't. I could script something up to do handle that for me automatically, and before I knew about Chezmoi, that's exactly what I did. Now I'd prefer to let someone else write and maintain all that for me so I can move on to working on other things.
- markstos 3y agoI evaluated Stow and tried Chezmoi for a while but settled on YADM. It’s the bare git repo idea with a little more sugar sprinkled on top. Perfect for my needs.
- dngray 3y agoI switched from Yadm to Chezmoi. The main reason was because there invariably is always something slightly sensitive you don't want in a dotfile and the rest of the file is okay. Yadm uses third party tools to do jinja templating. The first one envtpl stopped being maintained, and the second one j2cli (both jinja2 templaters) aren't very well maintained either. With chezmoi I just use the golang text/template templater. I know it will always be maintained. The integrated password manager functionality for chezmoi also works awesome too. I did initially use stow, but symlinks is just bad. You end up with all sorts of problems with that I can't even remember. My whole dotfiles is 7MB, so if a copy is made from a "source tree" to my home dir that's okay. Chezmoi also encouraged me to do things more deterministically based on hosts and reduce the number of "scripts" that I run significantly, which led to less bugs. I use the same set of dotfiles across a number of my systems.
- rajishx 3y agoI use yadm with the default templating system which is based on awk... https://yadm.io/docs/templates https://yadm.io/docs/templates i like yadm because it has simply no dependencies and can be installed literally anywhere on any archs (which is important to me).... the yadm/awk templating system is good enough for me, it let you do some if host then output this or output that kind of things..... i never had a need for more.
- tambourine_man 3y agohttps://yadm.io/ https://yadm.io/
- Ferret7446 3y agoThat's what branches are for. I have two personal machines and two work machines, all of which have diverging configs, which I push to two remotes (one work specific), and I merge changes between them. This is how Git was designed to be used.
- _ikke_ 3y agoUntil you want to introduce a change that affects both machines. You need to start rewriting history or cherry-pick the changes on both branches. The further the history diverges, the harder this becomes. Using branches for this does not scale.
- lillecarl 3y agoThis is where a VCS like Pijul or Darcs would shine, since patches commute across "branches" without a new hash.
- gravescale 3y agoHow does that work if there's a conflict? Whether or not there's a hash involved, you still have to manually apply the patch to each branch, would you not? If there's no conflict, merging each branch up in git is not hard at all, but it's still a tedious extra 'n - 1' operations that you don't need in chezmoi. For example, say I have a line "export FOO=bar" in my .bashrc on one machine and "export FOO=baz" on another. If I then indent the line on the bar branch and try to merge to the other one, something has to tell the baz branch that the right line is both differences: " export FOO=baz". Except the conflict may not be so obvious to resolve as that! And whatever you do, you'll either have a "trellis" of 'n' branches if you merge, or 'n' parallel linear branches if you cherry pick everything. Both of those history layouts quickly become very hard (to me at least) to make sure they all contain everything they should and nothing they shouldn't. Whereas with chezmoi, the bashrc file is a template that is the same on all machines that simply says "export FOO={{ fooval }}" and chezmoi does the templating. So you can just indent the line and fast-forward/apply on other machines and that's it.
- blueflow 3y agoWith `Match exec ...` you can define arbitrary machine-specific sections. I had more problems with differences between versions than with differences between machines. tmux is the sort of program where the available config directives change every major release and there is no full backwards compatibility.
- tambourine_man 3y agoI think I heard about it before, but haven’t tried it. https://www.chezmoi.io/ https://www.chezmoi.io/
- eternityforest 3y agoI currently use Borg in Vorta to manage my dotfiles. I only have about 5, and half of them have secrets. I could do it all with shell... but every few likes of custom scripting and config I can ditch is one less thing to worry about, and I don't really need VCS for just a few kb that rarely change. I've been using a lot more VSCode extensions lately though, so perhaps I'll want to do something for that.
- wdfx 3y agoyadm https://yadm.io/ https://yadm.io/ uses git for file management, but also provides some convenience on top of that
- kuschkufan 3y agoCan recommend this setup as well, it's great.