chezmoi

Many of us use more than one computer for work. And we use, if not identical, then overlapping sets of applications and tools that need the same configuration on every machine:

These configuration files are usually called dotfiles — their names start with a dot (.), which in the world of Unix-like systems makes a file hidden.

These files describe the configuration of the utilities you use. They need to be kept current across all of your machines.

The simplest solution is most often creating a git repository named dotfiles and dumping the files into it as is. That brings up a few problems:

Dotfile managers

There are plenty of dotfile managers out there, but a while back I settled on chezmoi.

Why is this manager convenient?

Below is a short example of how to get started with chezmoi. For details, refer to the official documentation.

# Create a repository for your dotfiles (default: ~/.local/share/chezmoi)
chezmoi init

# Track a file
chezmoi add ~/.vimrc

# cd into the repository to add the file under version control if you want it available on other machines
chezmoi cd
git add .
git ci -m "Add .vimrc"

# Publish the changes
git remote add origin https://github.com/$GITHUB_USERNAME/dotfiles.git
git push -u

Your personal dotfiles repository can be private, or hosted on any service you like.

The first steps with chezmoi may feel a bit non-obvious or unfamiliar. But the deeper you go and the more actively you use this dotfile manager’s features, the more it opens up.

Good luck syncing!

References