Smart Merge Engine

When multiple machines push changes, Git may produce merge conflicts. DaemonHound understands file content — not just raw text.

How it works

  1. Engine identifies the file type
  2. Selects the appropriate merge driver
  3. Performs a 3-way merge (base | local | remote)
  4. If a true conflict remains (same key changed), flags for manual resolution

Merge drivers

DriverFile typesStrategy
EnvDriver.env, .env.localKey-value aware. Both sides modify same key = true conflict.
JSONDriver.jsonStructural merge at property level.
CSVDriver.csvRow-level merge.
SecretDriverSecret TOMLVersion-aware. Latest version wins.
StateDriverstate.toml.ageVault state merge (highest priority).
TextDriverPlaintextLine-based fallback.

Example: .env merge

Machine A adds STRIPE_KEY, Machine B rotates API_KEY:

Merge
# Machine A added STRIPE_KEY
DATABASE_URL=postgres://localhost/mydb
REDIS_URL=redis://localhost:6379
API_KEY=sk-old
STRIPE_KEY=pk_test_a

# Machine B rotated API_KEY
DATABASE_URL=postgres://localhost/mydb
REDIS_URL=redis://localhost:6379
API_KEY=sk-new

# Smart merged result:
DATABASE_URL=postgres://localhost/mydb
REDIS_URL=redis://localhost:6379
API_KEY=sk-new
STRIPE_KEY=pk_test_a

Both changes apply cleanly — different keys. No manual intervention needed.

Resolving conflicts

CLI

Shell
dhd conflicts list
dhd conflicts show .env.local
dhd conflicts resolve .env.local --strategy local
dhd conflicts resolve .env.local --strategy remote
dhd conflicts clear

Web UI

Run dhd ui — 3-way diff view with side-by-side comparison.

Interactive TUI

Shell
dhd merge resolve

Git integration

Shell
dhd git setup      # Configure merge drivers, diff, filters
dhd git hook       # Install pre-commit, post-merge hooks