This repository is used to manage my dotfiles and other configuration files. It integrates with chezmoi to manage these files.
To set up a new machine, first install chezmoi:
brew install chezmoiOther installation options can be found here.
Next, run the following command to apply the dotfiles:
chezmoi init --apply Jeph^ This will overwrite existing files so make sure to take a backup if there are any with content you care about.
After applying, create a local git config at ~/.gitconfig.local for
your machine-specific identity/signing settings (this file is not
managed by chezmoi):
[user]
name = Your Name
email = you@example.com
signingkey = YOUR_SSH_SIGNING_KEY
[gpg]
format = ssh
[gpg "ssh"]
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
[commit]
gpgsign = trueOptional: create ~/.zshrc.local for machine-specific shell config.
~/.zshrc sources it if it exists, and it is not managed by chezmoi.
(The .local suffix here just means “local overrides”; it’s unrelated to
the ~/.local/ directory.)
# ~/.zshrc.local
# Example:
# export PATH="/opt/homebrew/bin:$PATH"Alternatively, if you want to see what changes chezmoi will make, you can run:
chezmoi init Jeph # Initiate chezmoi without applying changes
chezmoi diffIf you are happy with the changes that chezmoi will make then run:
chezmoi apply -vYou can edit files using the edit command:
chezmoi edit $FILEor you can simply edit the files directly. chezmoi stores the files
in ~/.local/share/chezmoi/ by default.
You can also use the following command to navigate to the chezmoi directory, but be aware that this will also open a new shell:
chezmoi cdYou can pull and apply the latest changes from your repo with:
chezmoi update -vUse the add command to add a new file to chezmoi or an existing file's
changes:
chezmoi add $FILEUse the apply command to update the working files with the source
files:
chezmoi apply -vAs long as you already have initiated chezmoi and applied before, chezmoi should warn you if there are any conflicts.
To resolve conflicts, you can use the diff command to see the
differences:
chezmoi diffYou can use the merge command to resolve the conflicts:
chezmoi merge $FILE