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.0.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.0-py3-none-any.whl (71.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gitbridge-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 e884c88b4c71879feaf5a3ceb9cfe0126c921809e552692beda66797d73f5232
MD5 61eab9332ddd84322ac23c4123101993
BLAKE2b-256 cb208186ec4edfabc042299b88b1a0f099e8f9719e6155c65b9ac6dba676b310

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gitbridge-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b72e9ed21bb6bc974823e68956b36249fbc4d75c353cc277731f58be066f1cf
MD5 fe4f1307a07ca06e1ceafc9399e1104f
BLAKE2b-256 3f8d2c06286fdcbe2eea920b902caf2d694c397f7e6c11e5f7180921da1f1bd8

See more details on using hashes here.

Provenance

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