Save the history of your configuration files, or use mise to copy, link, and generate them.

3 points•kstrauser•about 3 hours ago•1 comment•

1 comment

kstrauserabout 3 hours ago
I've been using Chezmoi for quite a while to track various config (and other) files. The main problem is that I often forget to use it, meaning that I too often end up with a lot of merge conflict between two hosts.

I started using Mise a couple years ago to run scripts, kind of like I'd used Just before it, but I preferred the syntax. Then I started using it to manage tools and do things like use Rust version a.b.c in one directory and Rust x.y.z in another. It seems Mise just added its own dotfile management that improves on Chezmoi in two specific ways I like:

1. You can manage entire directories, and when you add a file to that directory, Mise automatically knows about it and tracks it without explicitly adding the new file.

2. Mise automatically birectionally syncs with Git.

Say I'm using Chezmoi, and I add a new file to ~/.config/fish/functions on host A. I have to run `chezmoi add ...; chezmoi cd; git add .; git commit -m 'whatever'; git push`, and then on host B I have to run `chezmoi cd; git pull; chezmoi apply`.

Now say I'm using Mise, and I've already run `mise dot track ~/.config/fish/functions`. I add a new file. Mise's file watcher sees the change, adds it to Mise's local git repo, commits it, and pushes it to the configured remote. Then its daemon on host B will do its periodic git pull and install the new file on its filesystem.

In short, it has the same Git-powered change tracking of Chezmoi, but ones it's configured, it does everything else automatically and I don't have to remember to manually sync changes.

I'm loving this so much.

Read the full thread on Hacker News →

Related stories