Quick Start Guide #
chezmoi stores the desired state of your dotfiles in the directory
~/.local/share/chezmoi. When you run
chezmoi apply, chezmoi calculates the
desired contents and permissions for each dotfile and then makes any changes
necessary so that your dotfiles match that state.
Start using chezmoi on your current machine #
This will create a new git repository in
0700 where chezmoi will store the source state. chezmoi only
modifies files in the working copy. It is your responsibility to commit changes.
Manage an existing file with chezmoi:
chezmoi add ~/.bashrc
This will copy
~/.local/share/chezmoi/dot_bashrc. If you want
to add a whole folder to chezmoi, you have to add the
-r argument after
Edit the source state:
chezmoi edit ~/.bashrc
This will open
~/.local/share/chezmoi/dot_bashrc in your
$EDITOR. Make some
changes and save them.
See what changes chezmoi would make:
Apply the changes:
chezmoi -v apply
All chezmoi commands accept the
-v (verbose) flag to print out exactly what
changes they will make to the file system, and the
-n (dry run) flag to not
make any actual changes. The combination
-v is very useful if you want to
see exactly what changes would be made.
Finally, open a shell in the source directory, commit your changes, and return to where you were:
chezmoi cd git add dot_bashrc git commit -m "Add .bashrc" exit
Using chezmoi across multiple machines #
chezmoi init https://github.com/username/dotfiles.git
This will check out the repo and any submodules and optionally create a chezmoi config file for you. It won’t make any changes to your home directory until you run:
On any machine, you can pull and apply the latest changes from your repo with:
Next steps #
For a full list of commands run:
chezmoi has much more functionality. Read the how-to guide to explore.