Skip to main content

Synchronize GitHub repositories when git access is blocked

Project description

GitBridge - GitHub Repository Synchronization Tool

CI GitHub Release PyPI Version PyPI Downloads 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.

🎉 v1.0.0 Released! - First stable release now available on PyPI

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

From PyPI (Recommended)

# Basic installation
pip install gitbridge

# With browser automation support
pip install gitbridge[browser]

# For development
pip install gitbridge[dev]

Windows Users

Windows dependencies (pypac, wincertstore, pywin32) are automatically installed when you install GitBridge on Windows.

From Source

Using uv:

# Clone the repository
git clone https://github.com/nevedomski/gitbridge.git
cd gitbridge

# Install with uv
uv pip install -e .

# Or with all extras
uv pip install -e ".[all]"

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-1.0.4.tar.gz (60.1 kB view details)

Uploaded Source

Built Distribution

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

gitbridge-1.0.4-py3-none-any.whl (71.1 kB view details)

Uploaded Python 3

File details

Details for the file gitbridge-1.0.4.tar.gz.

File metadata

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

File hashes

Hashes for gitbridge-1.0.4.tar.gz
Algorithm Hash digest
SHA256 5907cb275da31cb9850f3bdb4856b74d6d0a7e89e875e3a40d18a8970a74750a
MD5 5a8d2ae3ecb0b3157b76fb30e5d23119
BLAKE2b-256 891868f74254d826aff3cbf55922b0d66d3a36aba187ad90f34fee4e5e44962a

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitbridge-1.0.4.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-1.0.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for gitbridge-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 16ce6763d3d2e2e4ff597fd792d827886de0a450bfae47d2d0947e067b63bf95
MD5 bf25a90004adeaf543d869c0cae0ef36
BLAKE2b-256 22b89438a9511d037abbd78239deaa06ebcea40cff643121bbfd9b01a6888d21

See more details on using hashes here.

Provenance

The following attestation bundles were made for gitbridge-1.0.4-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