Skip to content

LReyes21/github-travel-sync-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitHub Travel Sync Template πŸš€

License: MIT PowerShell Bash Platform Template

A development-safe automated synchronization template for keeping GitHub repositories in sync between your development machine, travel server, and GitHub - regardless of network location.

🎯 Use this template to create your own customized sync solution in minutes!

🌟 Why This Template?

  • πŸ›‘οΈ Safety First: Never overwrites uncommitted work or active development
  • 🌐 Network Agnostic: Works on university, home, mobile, VPN networks automatically
  • ⚑ One-Click Setup: Automated installation scripts for all dependencies
  • πŸ”§ Fully Customizable: Easy configuration for your repositories and network
  • πŸ“Š Professional Monitoring: Comprehensive logging and status reporting
  • πŸš€ Production Ready: Used in real development workflows

πŸ—οΈ Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Development   β”‚    β”‚     GitHub      β”‚    β”‚ Travel Server   β”‚
β”‚    Machine      │◄──►│   Repositories  │◄──►│  (Any Linux)    β”‚
β”‚                 β”‚    β”‚                 β”‚    β”‚                 β”‚
β”‚ Windows/macOS/  β”‚    β”‚  Source of      β”‚    β”‚ Raspberry Pi    β”‚
β”‚     Linux       β”‚    β”‚  Truth          β”‚    β”‚ ZimaBoard, etc. β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β–²                        β–²                        β–²
         β”‚                        β”‚                        β”‚
    Auto-discovery            Safety checks            Systemd
    Network patterns          Before every sync        automation

πŸš€ Quick Start (5 Minutes)

1. Create Your Repository

# Use this template to create your own repository
# Click "Use this template" button on GitHub, or:
gh repo create my-sync-solution --template LReyes21/github-travel-sync-template
cd my-sync-solution

2. Install Dependencies

Choose your platform and run the appropriate script:

Windows (PowerShell as Administrator)

.\setup\install-windows.ps1

macOS

./setup/install-macos.sh

Linux (Development Machine)

./setup/install-linux-desktop.sh

Linux (Server/Travel Device)

./setup/install-linux-server.sh

3. Configure Your Setup

# Copy and edit configuration templates
cp config/laptop-config.example.ps1 config/laptop-config.ps1
cp config/server-config.example.sh config/server-config.sh

# Edit with your GitHub username, repositories, and server details
nano config/laptop-config.ps1      # Windows/macOS users
nano config/server-config.sh       # Server configuration

4. Deploy and Test

# Install on your development machine
./scripts/auto-sync-safe.ps1 -Install    # Windows
./scripts/auto-sync-safe.sh -install     # Linux/macOS

# Install on your server
scp -r . user@yourserver:~/sync-setup/
ssh user@yourserver "cd sync-setup && sudo ./setup/install-linux-server.sh"

πŸ“‹ Requirements & Dependencies

Automatic Installation Scripts

This template includes automated setup scripts that install all required dependencies:

Windows Requirements

  • PowerShell 5.1+ (included in Windows 10+)
  • Git for Windows
  • GitHub CLI
  • OpenSSH Client (Windows 10+)

Auto-install script: setup/install-windows.ps1

macOS Requirements

  • Homebrew package manager
  • Git
  • GitHub CLI
  • SSH client (built-in)

Auto-install script: setup/install-macos.sh

Linux Desktop Requirements

  • Bash 4.0+
  • Git
  • GitHub CLI
  • SSH client
  • curl/wget

Auto-install script: setup/install-linux-desktop.sh

Linux Server Requirements

  • Bash 4.0+
  • Git
  • GitHub CLI
  • SSH server/client
  • systemd (for automation)

Auto-install script: setup/install-linux-server.sh

Manual Installation (if needed)

Click to expand manual installation instructions

Windows Manual Setup

# Install Git for Windows
winget install Git.Git

# Install GitHub CLI
winget install GitHub.cli

# Verify PowerShell version (should be 5.1+)
$PSVersionTable.PSVersion

macOS Manual Setup

# Install Homebrew if not present
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install dependencies
brew install git gh

Linux Manual Setup

# Ubuntu/Debian
sudo apt update
sudo apt install git curl

# Install GitHub CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh

# CentOS/RHEL/Fedora
sudo dnf install git gh

πŸ“ Template Structure

github-travel-sync-template/
β”œβ”€β”€ README.md                          # This file
β”œβ”€β”€ LICENSE                            # MIT License
β”œβ”€β”€ CHANGELOG.md                       # Version history
β”‚
β”œβ”€β”€ setup/                             # Automated installation scripts
β”‚   β”œβ”€β”€ install-windows.ps1           # Windows dependency installer
β”‚   β”œβ”€β”€ install-macos.sh              # macOS dependency installer  
β”‚   β”œβ”€β”€ install-linux-desktop.sh      # Linux desktop installer
β”‚   β”œβ”€β”€ install-linux-server.sh       # Linux server installer
β”‚   └── verify-setup.ps1              # Setup verification script
β”‚
β”œβ”€β”€ scripts/                           # Main sync scripts
β”‚   β”œβ”€β”€ auto-sync-safe.ps1            # Windows/PowerShell client
β”‚   β”œβ”€β”€ auto-sync-safe.sh             # Linux/macOS client
β”‚   β”œβ”€β”€ server-sync-safe.sh           # Server-side sync script
β”‚   └── network-discovery.ps1         # Network discovery utilities
β”‚
β”œβ”€β”€ config/                           # Configuration templates
β”‚   β”œβ”€β”€ laptop-config.example.ps1    # Client configuration template
β”‚   β”œβ”€β”€ server-config.example.sh     # Server configuration template
β”‚   β”œβ”€β”€ repositories.example.txt     # Repository list template
β”‚   └── ssh-config.example           # SSH configuration example
β”‚
β”œβ”€β”€ systemd/                          # Linux service definitions
β”‚   β”œβ”€β”€ github-sync.service          # Systemd service
β”‚   └── github-sync.timer            # Systemd timer
β”‚
β”œβ”€β”€ docs/                             # Documentation
β”‚   β”œβ”€β”€ SETUP-GUIDE.md               # Step-by-step setup
β”‚   β”œβ”€β”€ TROUBLESHOOTING.md           # Common issues
β”‚   β”œβ”€β”€ CUSTOMIZATION.md             # Advanced customization
β”‚   └── EXAMPLES.md                  # Real-world examples
β”‚
└── examples/                         # Example configurations
    β”œβ”€β”€ university-setup/             # University network example
    β”œβ”€β”€ home-office/                  # Home office setup
    └── mobile-developer/             # Mobile developer setup

πŸ›‘οΈ Safety Features

What Gets Protected

  • βœ… Uncommitted changes - Modified files not yet committed
  • βœ… Untracked files - New files not added to Git
  • βœ… Recent activity - Files modified in configurable time window
  • βœ… Merge operations - Active merge conflicts or rebases
  • βœ… Stashed changes - Work saved in Git stash
  • βœ… Branch state - Prevents sync during branch operations

Smart Detection

  • πŸ” Pre-sync analysis of every repository
  • πŸ“Š Detailed status reporting on what's safe vs. risky
  • ⚠️ Clear warnings when sync is skipped
  • 🚨 Force override available when needed
  • πŸ“ Comprehensive logging of all operations

πŸ”§ Customization

Repository Configuration

# config/laptop-config.ps1
$GitHubUser = "YourUsername"
$Repos = @("repo1", "repo2", "repo3")
$ServerPatterns = @("server.local", "192.168.1.100")

Network Discovery

# Add your network patterns
$ServerPatterns = @(
    "myserver.local",           # mDNS/Bonjour
    "myserver.university.edu",  # University network
    "myserver.company.com",     # Work VPN
    "192.168.1.100",           # Home network
    "10.0.0.100"               # Custom network
)

Safety Settings

$SafetySettings = @{
    RecentActivityThresholdMinutes = 30  # Adjust sensitivity
    ForceOverride = $false               # Allow/disallow force sync
    BackupBeforeSync = $true             # Enable automatic backups
}

πŸ“Š Example Use Cases

πŸŽ“ University Researcher

  • Development Machine: University lab workstation
  • Travel Server: Raspberry Pi in dorm room
  • Sync: Research code, papers, and data analysis scripts
  • Networks: Campus WiFi, dorm ethernet, library connections

πŸ’Ό Remote Developer

  • Development Machine: Home office laptop
  • Travel Server: ZimaBoard portable server
  • Sync: Client projects, personal tools, configuration files
  • Networks: Home WiFi, coffee shop hotspots, client offices

πŸš— Digital Nomad

  • Development Machine: MacBook for development
  • Travel Server: Mini PC in RV/hotel
  • Sync: Portfolio projects, client work, backup repositories
  • Networks: Mobile hotspot, campground WiFi, coworking spaces

πŸ”— Integration Examples

VS Code Integration

// .vscode/tasks.json
{
    "label": "Sync Repositories",
    "type": "shell",
    "command": "./scripts/auto-sync-safe.ps1",
    "args": ["-Sync"],
    "group": "build"
}

Git Hooks

#!/bin/bash
# .git/hooks/pre-push
./scripts/auto-sync-safe.sh --pre-push-check

Cron Alternative (Linux)

# For systems without systemd
*/120 * * * * /path/to/scripts/auto-sync-safe.sh --cron

πŸ§ͺ Testing Your Setup

Verify Installation

./setup/verify-setup.ps1          # Windows
./setup/verify-setup.sh           # Linux/macOS

Test Network Discovery

./scripts/network-discovery.ps1 --test

Dry Run Sync

./scripts/auto-sync-safe.ps1 --dry-run

🀝 Contributing

This is a template repository! Contributions help everyone:

  1. Fork this template
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

Areas for Contribution

  • πŸ”§ Additional platform support
  • πŸ“± Mobile device integration
  • πŸ”’ Enhanced security features
  • πŸ“Š Monitoring and alerting
  • 🎨 UI/dashboard development

πŸ“ž Support & Community

πŸ“„ License

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

πŸ™ Acknowledgments

  • Inspired by the need for reliable development synchronization across diverse network environments
  • Built for developers who work from anywhere with any device
  • Designed with safety and simplicity as core principles

πŸš€ Ready to Get Started?

  1. Use this template to create your repository
  2. Run the setup script for your platform
  3. Configure your repositories and server details
  4. Deploy and enjoy seamless synchronization everywhere!

Made with ❀️ for developers who code everywhere.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published