mise dotfiles add
- Usage:
mise dotfiles add [FLAGS] [TARGET]… - Effect: modifies state
- Source code:
src/cli/dotfiles/add.rs
Start deploying a file, or copy its edits back to the source
For a target that is not managed yet, saves its contents as a source under dotfiles.root (or at the path given with --source), adds a [dotfiles] entry, and applies it unless you pass --no-apply. For a target that is already managed, updates its source from the live file. --dry-run previews the source and config changes without writing them.
A target inside the tree of a dotfile group is captured into that group's source instead, without a new [dotfiles] entry: the deepest group whose target contains it, or the one named with --group.
Arguments
[TARGET]…— Targets to add or update
Flags
--changed— Update the sources of every changed file managed in copy mode-f --force— Overwrite existing sources without prompting-g --global— Write to the global config (the default)New entries go to the
write_targets.dotfilesfile when that setting is set.-l --local— Write to the project config instead of the global config-m --mode <MODE>— Mode for a target that is not managed yet: symlink, symlink-each, copy, or template (default: thedotfiles.default_modesetting)A target that is already managed keeps its mode.
-n --dry-run— Print the config and source changes without writing anything--no-apply— Add the entry without applying it-p --path <PATH>— Write to this config file or directory-s --source <PATH>— Source path to use for a single target-y --yes— Skip the confirmation prompt--prompt-secrets— Prompt for[bootstrap.secrets]values that templates need and the environment does not set--group <NAME>— Capture into the tree of this dotfile group-h --help— Print help
Examples
Start managing ~/.zshrc from your dotfiles directory
mise dot add ~/.zshrcCopy the file into place instead of symlinking it
mise dot add --mode copy ~/.config/starship.tomlChoose where the source is stored
mise dot add --source dotfiles/gitconfig ~/.gitconfigCapture the file into a dotfile group's tree
mise dot add --group home ~/.config/starship.tomlCopy edits of every changed copy-mode file back to its source
mise dot add --changed