Dotfile Management II
Chezmoi

Getting started

chezmoi doctor                          - checks for common problems. If you encounter something unexpected, run this first.
chezmoi init                            - creates chezmoi's source directory and a git repo on a new machine.

Daily commands

chezmoi add $FILE                       - adds $FILEfrom your home directory to the source directory.
chezmoi edit $FILE                      - opens your editor with the file in the source directory that corresponds to $FILE.
chezmoi status                          - gives a quick summary of what files would change if you ran chezmoi apply.
chezmoi diff                            - shows the changes that chezmoi apply would make to your home directory.
chezmoi apply                           - updates your dotfiles from the source directory.
chezmoi edit --apply $FILE              - is like chezmoi edit $FILE but also runs chezmoi apply $FILE afterwards.
chezmoi cd                              - opens a subshell in the source directory.

Using chezmoi across multiple machines

chezmoi init $GITHUB_USERNAME           - clones your dotfiles from GitHub into the source directory.
chezmoi init --apply $GITHUB_USERNAME   - clones your dotfiles from GitHub into the source directory and runs chezmoi apply.
chezmoi update                          - pulls the latest changes from your remote repo and runs chezmoi apply.

Working with templates

chezmoi data                            - prints the available template data.
chezmoi add --template $FILE            - adds $FILE as a template.
chezmoi chattr +template $FILE          - makes an existing file a template.
chezmoi cat $FILE                       - prints the target contents of $FILE, without changing $FILE.
chezmoi execute-template                - is useful for testing and debugging templates.Use normal git commands to add, commit, and push changes to your remote repo.

License

The MIT License (MIT)

Copyright (c) 2018-2022 Tom Payne

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author: madam

Created: 2022-10-04 Di 22:41