Skip to content

v1.0.3 - Python Rewrite Release

Choose a tag to compare

@JasonW404 JasonW404 released this 07 May 02:59
· 28 commits to main since this release

Summary

Complete rewrite from Node.js to Python, enabling single-file executable deployment without pip/npm on target machines.

Features

Auth & Config

  • Config path: default /etc/git-sync/config.yaml, CLI --config override
  • Storage: ./state and ./repos (relative paths, no permission issues)
  • Auth redesigned: URL prefix-based
    • SSH: git@host:path with ssh_private_key path
    • HTTPS: https://host/path with username + password (env vars via ${VAR})
  • CLI --log-level override (DEBUG/INFO/WARN/ERROR)
  • Structured logging throughout sync pipeline

Technical Stack

Component Technology
CLI Click
TUI Textual
Config Pydantic + YAML
State sqlite3 (stdlib)
Git ops subprocess
Author rewrite git-filter-repo (bundled)

System Requirements

  • Ubuntu x86_64
  • git CLI (required)

Installation

# Download and extract
wget https://github.com/JasonW404/Git-Sync/releases/download/v1.0.3/git-sync-1.0.3-linux-x86_64.tar.gz
tar -xzf git-sync-1.0.3-linux-x86_64.tar.gz

# Create config directory
sudo mkdir -p /etc/git-sync

# Copy example config
sudo cp git-sync.yaml.example /etc/git-sync/config.yaml

# Edit config
sudo nano /etc/git-sync/config.yaml

# Run
./git-sync-1.0.3-linux-x86_64 sync

Config Example

version: 1

settings:
  state_dir: ./state
  repo_dir: ./repos
  log_level: INFO

author_mappings:
  - match_email: "alice@personal.com"
    internal_name: "Alice Wang"
    internal_email: "alice.wang@internal.corp"

sync_tasks:
  - name: production-services
    repos:
      - id: api-service
        source:
          url: git@github.com:org/api-service.git
          ssh_private_key: ~/.ssh/id_rsa
        destination:
          url: https://git.internal.corp/mirrors/api-service.git
          username: sync-bot
          password: ${SYNC_PASSWORD}
        branches: ["main"]
        tags: true

CLI Usage

# Show help
git-sync --help

# Sync all repos
git-sync sync

# Sync specific repo
git-sync sync -r api-service

# Validate config
git-sync config validate

# Show config
git-sync config show

# Debug logging
git-sync -l DEBUG sync

# Start daemon
git-sync daemon

Breaking Changes

  • Old config format (github_url, internal_url, auth.type) no longer supported
  • Use new source/destination format with URL prefix-based auth