Getting Started — apply
guisu apply materialises the source state into the destination directory, applying templates, decrypting, and respecting conflict rules. It is the command you will run most often — usually via guisu update which is git pull + apply.
Basic usage
guisu apply # apply everything
guisu apply --dry-run # show what would change, do not write
guisu apply --interactive # prompt for conflicts in a TUI
guisu apply --force # overwrite destination without asking
guisu apply path1 path2 # apply only specific paths
guisu apply --include 'dot_*' --exclude '*.tmp'
How status is determined
For each file, Guisu compares three sources of truth:
- Target — the rendered, decrypted content the source state wants.
- Destination — the file currently on disk.
- Database — the content hash stored the last time
applysucceeded (in<source>/.guisu-state.db).
The result is one of Synced, Added, Modified, Removed, or Conflict.
| Target | Destination | Database | Status | Default action |
|---|---|---|---|---|
| A | A | A | Synced | Skip |
| A | B | A | Modified (by you) | Overwrite |
| A | A | B | Modified (in source) | Apply |
| A | B | C | Conflict | Prompt (--interactive) or overwrite |
| A | — | — | Added | Create |
| — | B | B | Removed | Delete |
| — | B | A | Modified + Removed | Conflict |
Interactive mode
--interactive opens a TUI for every conflict, showing a side-by-side diff and four actions: Overwrite, Skip, View Diff, Quit.
guisu apply --interactive
Tip
Pipe-friendly output
guisu apply --dry-runprints a list of planned changes. Combine withguisu infofor a complete preview before a real apply.
Exit codes
| Code | Meaning |
|---|---|
0 | All changes applied (or nothing to do). |
1 | An error occurred. |
Non-zero with --dry-run | A planned change would have been made. |
Hooks
apply runs pre- and post-hooks from .guisu/hooks/{pre,post}/{always,once,onchange}/ around the apply. See Hooks.
Next step
Read the User Guide for the file-attribute conventions, or jump to Templates if your dotfiles need environment-specific rendering.