Skip to main content

Synchronize GitHub repositories when git access is blocked

Project description

GitBridge - GitHub Repository Synchronization Tool

CI GitHub Release PyPI Version Python Versions codecov Tests Known Vulnerabilities Ruff Format Ruff Lint MyPy License Docs

Production-ready tool to synchronize GitHub repositories when direct git access is blocked.

🎯 Status: Security beta release v0.6.3b1 - All critical security issues fixed ✅

Features

  • GitHub API Sync: Uses GitHub's REST API for efficient repository synchronization
  • Browser Automation Fallback: Falls back to Playwright-based browser automation if API access is blocked
  • Incremental Updates: Only downloads changed files after initial sync
  • Configuration Support: Flexible configuration via YAML files
  • Command-Line Interface: Easy-to-use CLI for various sync operations
  • Progress Tracking: Visual progress bars and detailed logging
  • Automatic Proxy Detection: Auto-detects proxy settings from Windows/Chrome PAC scripts
  • Corporate Environment Support: Works with SSL certificates and proxy configurations
  • Cross-Platform: Works on Windows, Linux, and macOS
  • Comprehensive Testing: 502+ tests with 83% code coverage

Installation

Using uv:

# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install the project
uv pip install -e .

# Or install with development dependencies
uv pip install -e ".[dev]"

# Install with PAC proxy support (Windows)
uv pip install -e ".[pac]"

Quick Start

  1. Create a configuration file (config.yaml):
repository:
  url: https://github.com/username/repo
  branch: main

local:
  path: /path/to/local/folder

auth:
  token: your_github_personal_access_token

sync:
  method: api  # or 'browser'
  incremental: true
  1. Run the sync:
gitbridge sync --config config.yaml

Usage

Basic Sync

gitbridge sync --repo https://github.com/username/repo --local /path/to/local

With Personal Access Token

gitbridge sync --repo https://github.com/username/repo --local /path/to/local --token YOUR_TOKEN

Force Browser Mode

gitbridge sync --repo https://github.com/username/repo --local /path/to/local --method browser

Check Repository Status

gitbridge status --config config.yaml

Corporate Environment Support

For Windows users in corporate environments:

# Auto-detect proxy from Chrome/Windows settings
gitbridge sync --repo https://github.com/username/repo --local /path/to/local --auto-proxy

# Auto-detect certificates from Windows certificate store
gitbridge sync --repo https://github.com/username/repo --local /path/to/local --auto-cert

# Use both auto-detection features together
gitbridge sync --config config.yaml --auto-proxy --auto-cert

# Last resort: disable SSL verification
gitbridge sync --config config.yaml --auto-proxy --no-ssl-verify

Or add to your configuration file:

sync:
  auto_proxy: true   # Auto-detect proxy from PAC
  auto_cert: true    # Auto-detect certificates from Windows
  # verify_ssl: false  # Only if absolutely necessary

The tool will automatically:

  • Extract proxy settings from Windows/Chrome PAC scripts
  • Export trusted certificates from Windows certificate store
  • Combine them with certifi's default bundle
  • Configure requests to use both proxy and certificates

Configuration

Environment Variables

  • GITHUB_TOKEN: GitHub Personal Access Token
  • GITSYNC_CONFIG: Default configuration file path

Configuration File Format

See config.example.yaml for a complete example.

Requirements

  • Python 3.10+ (recommended: 3.11+)
  • uv for dependency management
  • For browser mode: Chrome/Chromium and ChromeDriver

Development

# Install development dependencies
make install-dev

# Format code
make format

# Run linting
make lint

# Type checking
make type-check

# Run tests
make test

Limitations

  • Binary files larger than 100MB may fail with API method
  • Browser method is significantly slower than API method
  • Some GitHub Enterprise features may not be supported

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitbridge-0.7.0b1.tar.gz (59.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitbridge-0.7.0b1-py3-none-any.whl (70.7 kB view details)

Uploaded Python 3

File details

Details for the file gitbridge-0.7.0b1.tar.gz.

File metadata

  • Download URL: gitbridge-0.7.0b1.tar.gz
  • Upload date:
  • Size: 59.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gitbridge-0.7.0b1.tar.gz
Algorithm Hash digest
SHA256 b7c929c81a71ee78d11e5186d4f4b2eb16800d0d3eb498e9d8b020b19cfafd9e
MD5 b9c9b9317c85a838e591cc94638b8796
BLAKE2b-256 3a2d457334214fedae080dd7fea9d90e5abb6c3a271eaf8d3eaed03b94bf26fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitbridge-0.7.0b1.tar.gz:

Publisher: publish.yml on nevedomski/gitBridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gitbridge-0.7.0b1-py3-none-any.whl.

File metadata

  • Download URL: gitbridge-0.7.0b1-py3-none-any.whl
  • Upload date:
  • Size: 70.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gitbridge-0.7.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 c14a5d60e4b1baeacce0af7eef016a914171bcbb4cfea06b4ac992ad1f923eca
MD5 997574e8e1c08646ab401985716c437e
BLAKE2b-256 cb97901e8c387580fdfa6dadc9470e5aa529cd0a29658b865a569c358b4d07a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitbridge-0.7.0b1-py3-none-any.whl:

Publisher: publish.yml on nevedomski/gitBridge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page