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 Coverage Tests Ruff Format Type License Docs Security

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

🎯 Status: Feature complete, pending security fixes before 1.0.0 release

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.6.2b1.tar.gz (55.5 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.6.2b1-py3-none-any.whl (66.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gitbridge-0.6.2b1.tar.gz
Algorithm Hash digest
SHA256 7405c5a1fed4b84ca9ab6036bab36f54c1535c094f7af071329257e2cff7a223
MD5 dbb08fa5744026081d861679509c170c
BLAKE2b-256 7b678f4ff1895a187701c77d5fac9dab95067c21c8b13f16ca9592a244c65388

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: gitbridge-0.6.2b1-py3-none-any.whl
  • Upload date:
  • Size: 66.4 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.6.2b1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b4d148a9baafb11d76d963a4d622384678765139fe9d34e4c7f2e3b07761953
MD5 9d080906deb007c287ecd2fdd204b4ff
BLAKE2b-256 15ff4146cd3889893c1487917595da3e346d5d9cc29570e5c3cc839276f5614b

See more details on using hashes here.

Provenance

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