1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Repository synchronization module
//!
//! This module provides functionality for keeping files synchronized across repositories.
//! It allows you to maintain consistent configurations by syncing files from upstream sources.
//!
//! ## Features
//!
//! - Version pinning to specific tags, branches, or commits
//! - Selective sync with include/exclude patterns
//! - Automatic restoration of modified protected files
//! - Multi-repository configuration support
//!
//! ## Hook Integration
//!
//! Sync can be integrated into git hooks for automatic synchronization:
//!
//! ```yaml
//! sync:
//! repos:
//! - name: "shared-configs"
//! repo: "https://github.com/org/shared-configs"
//! version: "v1.0.0"
//! source_path: ".github"
//! dest_path: "./.github"
//! include: ["**/*"]
//! exclude: ["*.md"]
//!
//! hooks:
//! pre-push:
//! enabled: true
//! custom:
//! - command: "guardy sync update --force --config ./guardy.yaml"
//! description: "Sync protected files before push"
//! fail_on_error: true
//! ```
//!
//! ## Usage
//!
//! ```bash
//! # Check sync status
//! guardy sync status
//!
//! # Interactive sync with diffs
//! guardy sync
//!
//! # Force sync all changes
//! guardy sync update --force
//! ```