Chezmoi is a fancy way to use git to store and sync your dotfiles. It allows you to manage your dotfiles in a single repository, and then symlink them to your home directory. This way, you can keep all your dotfiles in one place and easily sync them across multiple machines.
To install chezmoi, run the following command:
sh -c "$(curl -fsLS get.chezmoi.io)"
Then initialise chezmoi with your git repository:
chezmoi init
You can then add your dotfiles to chezmoi:
chezmoi add .vimrc
chezmoi add .zshrc
chezmoi add .config/tmux/tmux.conf
To set up a remote git repository, you can run:
chezmoi cd
git remote add origin [email protected]:$GITHUB_USERNAME/dotfiles.git
git branch -M main
git push -u origin main
Then on another machine, after installing Chezmoi, you can clone your dotfiles repository and apply them with chezmoi:
chezmoi init https://github.com/$GITHUB_USERNAME/dotfiles.git
chezmoi apply