Guardy
🔄 Sync

⚙️ Options

Sync-specific configuration options

See Configuration for the complete configuration system (hierarchy, file discovery, merging).

Repository Configuration

Repository URL

Specify the repository to sync from.

sync:
  repo: "https://github.com/org/team-hooks"
export GUARDY_SYNC_REPO="https://github.com/org/team-hooks"
guardy sync --repo https://github.com/org/team-hooks

Version

Specific tag, branch, or commit to sync from.

sync:
  version: "main"
export GUARDY_SYNC_VERSION="main"
guardy sync --version main

Source Path

Directory in remote repository to sync from.

sync:
  source_path: "hooks"
export GUARDY_SYNC_SOURCE_PATH="hooks"
guardy sync --source-path hooks

Destination Path

Local directory to sync files to.

sync:
  dest_path: ".git/hooks"
export GUARDY_SYNC_DEST_PATH=".git/hooks"
guardy sync --dest-path .git/hooks

File Filtering

Include Patterns

Patterns for files to include in sync.

sync:
  include:
    - "pre-commit"
    - "commit-msg"
guardy sync --include "pre-commit,commit-msg"

Exclude Patterns

Patterns for files to skip during sync.

sync:
  exclude:
    - "*.bak"
    - "*.tmp"
guardy sync --exclude "*.bak,*.tmp"

Sync Behavior

Force Update

Bypass interactive mode and force update.

Default: false

sync:
  force: true
export GUARDY_SYNC_FORCE=true
guardy sync --force

Auto Update

Automatically update without confirmation.

Default: false

sync:
  auto_update: true
export GUARDY_SYNC_AUTO_UPDATE=true

Interactive Mode

Prompt before updating files.

Default: true

sync:
  interactive: true
export GUARDY_SYNC_INTERACTIVE=true

Show Diff

Display diffs before updating.

Default: true

sync:
  show_diff: true
export GUARDY_SYNC_SHOW_DIFF=true

Diff Context Lines

Number of context lines in diffs.

Default: 3

sync:
  diff_context_lines: 3
export GUARDY_SYNC_DIFF_CONTEXT=3

Advanced Options

Git Timeout

Git operation timeout in seconds.

Default: 30

sync:
  git_timeout_seconds: 60
export GUARDY_SYNC_GIT_TIMEOUT=60

Cache Directory

Cache directory path.

Default: .guardy/cache

sync:
  cache_dir: ".guardy/cache"
export GUARDY_SYNC_CACHE_DIR=".guardy/cache"

Multi-Repository Configuration

For syncing multiple repositories, use the repolist configuration (config file only).

sync:
  # Global settings apply to all repos
  interactive: true
  show_diff: true
  git_timeout_seconds: 60

  # Multiple repository configurations
  repolist:
    - name: "team-hooks"
      repo: "https://github.com/org/team-hooks"
      version: "main"
      source_path: "hooks"
      dest_path: ".git/hooks"
      include:
        - "pre-commit"
        - "commit-msg"
      protected: true

    - name: "shared-config"
      repo: "https://github.com/org/shared-config"
      version: "v2.1.0"
      source_path: "."
      dest_path: ".guardy/shared"
      exclude:
        - "*.draft.*"

Repository Config Fields

FieldDescriptionRequired
nameUnique identifier for this repository
repoRepository URL (HTTPS or SSH)
versionTag, branch, or commit to sync
source_pathDirectory in remote repo to sync from
dest_pathLocal directory to sync files to
includePatterns for files to include
excludePatterns for files to skip
protectedMake synced files read-only

Complete Example

sync:
  # Single repository mode
  repo: "https://github.com/org/guardy-config"
  version: "main"
  source_path: "config/shared"
  dest_path: ".guardy"

  # File filtering
  include:
    - "*.yml"
    - "hooks/**"
  exclude:
    - "*.local.*"

  # Behavior
  interactive: true
  show_diff: true
  auto_update: false
  force: false

  # Advanced
  git_timeout_seconds: 30
  diff_context_lines: 3
  cache_dir: ".guardy/cache"