Skip to content
/ sink Public

GitHub Sync is a lightweight tool to sync folders across multiple devices using Git. It automates repository setup, authentication, and file syncing, ensuring smooth updates with minimal configuration. Perfect for seamless cross-device workflows.

License

Notifications You must be signed in to change notification settings

urngmi/sink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔄 GitHub Sync

GitHub Sync Banner

Rust GitHub License: MIT

Seamlessly sync your files across devices using Git under the hood 🚀


✨ Features

  • 🔐 Secure: Uses SSH authentication with GitHub
  • 🚀 Fast: Written in Rust for maximum performance
  • 🤖 Automated: Zero Git knowledge required
  • 🔄 Real-time: Instant sync with smart batching
  • 🌐 Cross-platform: Works on Linux, macOS, and Windows
  • 🎯 Simple: Just one command to start syncing

🚀 Quick Start

1. Installation

# Install using cargo
cargo install github-sync

# Or build from source
git clone https://github.com/yourusername/github-sync
cd github-sync
cargo install --path .

# Install systemd service (Linux only)
sudo ./install/install.sh

2. Authentication

# Set up GitHub authentication
ghs auth <your-github-token>

🔑 Get your token from GitHub Settings with 'repo' scope

3. Start Syncing

# Start syncing a new folder
ghs start -n my-folder

# Your files will be in:
~/.github-sync/my-folder

🎮 Commands

Command Description
ghs auth <token> Set up GitHub authentication
ghs start -n <name> Create and sync a new folder
ghs stop Stop the sync service
ghs status Show sync status
ghs config Configure sync settings

🏗️ Architecture

graph TD
    A[File System Events] -->|Notify| B[File Watcher]
    B -->|Smart Batching| C[Git Operations]
    C -->|SSH| D[GitHub]
    E[Config] -->|Settings| B
    E -->|Auth| C
Loading

Key Components

  • 🔍 File Watcher: Monitors file changes with smart batching
  • 🔄 Git Operations: Handles all Git interactions seamlessly
  • 🔐 Auth Manager: Secure GitHub token management
  • ⚙️ Config: User settings and sync preferences

🛠️ Technical Details

Smart Batching

const BATCH_WINDOW: Duration = Duration::from_secs(2);
const MIN_SYNC_INTERVAL: Duration = Duration::from_secs(5);
  • Changes are batched for 2 seconds
  • Minimum 5-second interval between syncs
  • Automatic conflict resolution with backup branches

File Organization

~/.github-sync/           # Main Git Repository
├── project1/              # Your first folder
├── project2/              # Your second folder
└── .git/                 # Single Git repository

System Integration

Linux (systemd)

  • Runs as a user service with [email protected]
  • Starts automatically on system boot
  • Manages process lifecycle and restarts on failures
  • Install: sudo ./install/install.sh
  • Uninstall: sudo ./install/uninstall.sh

Windows

  • Runs as a Windows Service
  • Starts automatically on system boot
  • Manages process lifecycle and restarts on failures
  • Install: Run install\windows\install.ps1 as Administrator
  • Uninstall: Run install\windows\uninstall.ps1 as Administrator

🤝 Contributing

We love contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments


Made with ❤️ by Omkar Bhor

⭐ Star on GitHub | 🐛 Report Bug | ✨ Request Feature

About

GitHub Sync is a lightweight tool to sync folders across multiple devices using Git. It automates repository setup, authentication, and file syncing, ensuring smooth updates with minimal configuration. Perfect for seamless cross-device workflows.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published