Skip to content
yi-nologyPublic

About

GitFerry - 独立的 Git 仓库同步微服务

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

540 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitFerry

Chinese name 「摆渡」— ferry your code where it belongs: between intranets, out to the open-source world, and into backup harbors.

CI Release Go Report Card Go Version License Latest Release

中文文档

Why GitFerry · Capabilities · Install CLI · Quick Start · AI Agent Quick Start · Web Console · Ops & DR · History Sync · Agent Access · Configuration


Why GitFerry

Code hosting is fragmented: GitHub on the public internet, GitLab/Gitee on the intranet, backups scattered across scripts. The moment you need cross-platform sync, open-source publishing, cold backup / DR, or shipping intranet changes back out, you end up gluing several tools together.

GitFerry folds those jobs into one self-hosted hub:

Scenario Pain GitFerry
Cross-platform sync Scripts + cron + manual reconciliation Task-based sync: cron / webhook / manual, with auto-compensation
Open-source publish Module path rewrite, dual-repo identity clashes Mirror hub: identity-rewrite snapshots + pre-check / build gate / divergence confirm
Repo backup Git objects only; metadata lost Cold backup (bundle/tar) + issues/PR/releases snapshots that are restorable
Dual-repo round-trip Two trees diverge; changes can't travel back History sync: plan → conflict adjudication → transplant → push, fully audited
Ops & audit Black box, no health signal Health score / RPO / drift / audit hash chain / DR drills
Automation Web UI only CLI + MCP + Agent Skills — humans and agents

Borrowing mature patterns from gickup, ghorg, gitea-mirror, and github-backup-rust, then adding four differentiators: restorable metadata, Agent-Native access, module identity rewrite, and dual-repo content round-trip.

Capabilities

Sync

  • Platforms: GitHub / GitLab / Gitee / Gitea / Forgejo / GitCode / Tencent CODING / self-hosted
  • Triggers: cron, real-time webhook, manual / batch
  • Scope: branch globs, include allow-list, ignore refs/pull/* and other PR refs, tags, wiki, submodules, partial clone
  • Safety: force_push_policy (allow / block / backup_on_demand), prune, force-push approval flow
  • Resilience: runwatch auto-retry; exponential backoff on 403/429 rate limits

Mirror & backup

  • Mirror hub: open-source publishing (dual/multi-repo module identity rewrite snapshots), with version matrix and publish gates
  • Cold backup: git bundle or zip, backup_keep rotation, optional AES-256-GCM
  • Multi-destination: S3 / WebDAV / Azure / local fan-out
  • Metadata snapshot: issues (with comments) / PRs / labels / milestones / releases / gists / release assets
  • Metadata restore: metadata-restore, dry-run by default, selective kinds
  • Integrity: Merkle root manifest + verify; DR drill (restore + fsck + refs compare)
  • Git Smart HTTP: git clone cold backups over LAN without pushing to another forge first

History sync (dual-repo content publishing)

Publish the content delta between two git trees — typically intranet → public — while leaving the target repo's existing commits (and their hashes) untouched.

  • Channel-based config: source/target dirs, module path rewrite, host rewrite, scrub rules, and push targets (credentials encrypted at rest) all live in a channel
  • Plan → adjudicate → transplant → push: mechanical conflicts resolve automatically; humans/AI only adjudicate hold files
  • Gates: a pre-push preview exposes the full impact (commits to be created, force-push need, blockers)
  • Audit: every run is recorded with a hash chain — verifiable and rollback-able
  • See History Sync

Organization & ecosystem

  • Org mapping: preserve / single / flat / mixed bulk mapping to a target namespace
  • Starred import, public org anonymous mirror (GitHub)
  • post-exec hook: callback script after every sync (notify / alert / custom pipeline)

Ops & governance

  • Five-dimension health score (reliability / freshness / schedule / safety / completeness)
  • Inventory (orphan repos), RPO/RTO, drift detection, unified todo queue, trends
  • RBAC (admin/operator/readonly), OIDC JWT, audit export + hash chain, legal_hold
  • Prometheus metrics, ntfy/gotify/webhook notifications, success/fail heartbeats

Interfaces

  • Vue 3 web console (GitHub Enterprise / Linear-style calm ops UI)
  • RESTful API + OpenAPI (/swagger/)
  • gitferry CLI (Envelope output, confirmation gate for dangerous ops)
  • MCP Server (Streamable HTTP, same tool registry as the AI assistant)
  • Agent Skills (Claude Code / MiMo / Cursor)
  • AI ops assistant (built-in eino or an external AI coding tool, off by default)

Quick Start

Prerequisites

  • Node.js 14+ (npm/npx) — only for skill installation (npx skills add)
  • Platforms: macOS, Linux, Windows (x64/arm64)
  • Go 1.27+ — source builds only
  • Server runs standalone: Docker or Release binary

Install the CLI (humans)

AI assistants: if you are helping a user install, jump to Quick Start (AI Agent).

Option 1 — Release binary (recommended):

# Pick a platform asset on https://github.com/yi-nology/git-ferry/releases/latest
VER=1.37.0   # replace with the latest version
curl -fsSL -o gitferry.tgz \
  "https://github.com/yi-nology/git-ferry/releases/download/v${VER}/gitferry_${VER}_darwin_arm64.tar.gz"
tar -xzf gitferry.tgz && sudo mv gitferry /usr/local/bin/

Option 2 — Agent Skills (optional; for Claude Code / MiMo):

# Run inside a clone of this repository (requires Node.js)
npx skills add ./skills -y -g
# or: make install-skills

Option 3 — Source build / package managers / Docker:

git clone https://github.com/yi-nology/git-ferry.git
cd git-ferry
make build && make build-cli    # output/git-ferry + output/gitferry
make docker-build               # server image

# Package manager templates: examples/packaging/
# brew install yi-nology/tap/git-ferry   (after tap publish)

npm (not published yet): npm install -g gitferry-cli will start working once NPM_TOKEN is configured for the Release workflow — the package is not on the npm registry yet (the publish step currently skips silently). Until then, use Option 1.

Quick Start (humans)

# 1. Configure CLI (writes ~/.config/gitferry/config.yaml)
gitferry config init --base-url http://127.0.0.1:8890 --token <API_KEY>
# or via env:
export GITFERRY_BASE_URL=http://127.0.0.1:8890
export GITFERRY_TOKEN=<API_KEY>

# 2. Verify connectivity
gitferry auth status
gitferry task +list --format json

# 3. Start the server (if not running)
cp .env.example .env && openssl rand -base64 32   # set ENCRYPTION_KEY
cp conf/config.example.yaml conf/config.yaml && make run
# Open http://localhost:8890  (System → CLI / Agent has the command cheatsheet)

Quick Start (AI Agent)

Steps for Claude Code / MiMo / Cursor. The user must supply an API Key in the browser or CI.

Step 1 — Install

# 1) Install the CLI — follow "Option 1 — Release binary" above
#    (the npm package is not published yet)
# 2) Install Agent Skills from a clone of this repository:
npx skills add ./skills -y -g

Step 2 — Configure

gitferry config init --base-url http://127.0.0.1:8890 --token "$GITFERRY_TOKEN"
# or env only (CI / sandbox):
export GITFERRY_BASE_URL=http://127.0.0.1:8890
export GITFERRY_TOKEN=<API_KEY>

Step 3 — Verify

gitferry auth status
gitferry ops +todo --format json

API Key source: the server GIT_SYNC_API_KEY used by the web console, or the key bound to the signed-in session.

First sync in 3 minutes

  1. Platforms → add GitHub/GitLab credentials → test connection
  2. Repos → add source and target (or POST /ops/auto-discover)
  3. Sync tasks → create a task (cron / include_branches / force_push_policy)
  4. History → trigger manually, inspect steps; diagnose + retry on failure

CLI equivalent:

export GITFERRY_BASE_URL=http://127.0.0.1:8890
export GITFERRY_TOKEN=your-api-key

gitferry platform +list --format json
gitferry repo +list --format json
gitferry task +create --name demo \
  --source-repo gh/owner/repo --target-repo gl/owner/repo \
  --source-branch '*' --target-branch '*' --yes
gitferry task +run --key <task-key> --yes
gitferry history +list --task <task-key> --format json

Web Console

Vue 3 + Ant Design Vue. Visual anchor: GitHub Enterprise / Linear-style calm ops console — neutral palette first, restrained semantic colors, metric strips over loud icons.

Entry What it does
Dashboard Metrics + failed tasks “needs attention” + recent sync/repos
Sync tasks / History Task CRUD, filters, batch ops, run detail
Repos / Mirror hub Repo cards, unified config, publish & backup channels
Webhook rules / Events Trigger rules and inbound event stream
Ops center Health score, inventory, templates, deploy keys, cold backup & metadata restore
Operation logs Audit log query and export
AI assistant Floating ball / top bar; configure model under System
CLI / Agent System → CLI / Agent: install gitferry, Skills, command cheatsheet
Platforms Git host credentials and connection tests

Login Dashboard Sync tasks

More screenshots: docs/screenshots/. Frontend dev: frontend/README.md.


Ops & Disaster Recovery

Capability matrix

Capability Entry
Prometheus metrics GET /metrics
Failure compensation runwatch + auto retry; POST /ops/retry / retry-batch
Notifications ntfy / gotify + success/fail heartbeats (healthchecks.io)
Health score GET /ops/health-score (gold/silver/bronze/basic + 5 dimensions)
Inventory GET /ops/inventory (orphan repos)
Unified todo GET /ops/todo + dashboard card
Sync trends GET /ops/trends (success rate / duration)
Policy templates GET/POST /ops/templates + preview/apply (dry-run, inheritance)
Audit CSV export GET /ops/audit-report, hash chain GET /ops/audit-chain/verify
Secret injection GIT_SYNC_TOKEN_<NAME> / GIT_SYNC_TOKEN_CMD_<NAME>
Deploy keys POST /ops/deploy-key (Ed25519)
Cold backup git_bundle; sync.backup_format: bundle|zip + backup_keep
Bundle list / verify / restore GET /ops/bundles · /bundles/verify · POST /ops/bundles/restore
Metadata snapshot POST /ops/metadata-backup (issues/PR/releases/gists/assets, since incremental)
Metadata restore POST /ops/metadata-restore (dry-run default, selective kinds)
DR drill POST /ops/dr-drill (restore + fsck + refs); RPO GET /ops/rpo
Integrity Merkle root manifest + verify
Multi-destination sync.backup_destinations (s3/webdav/azure/local)
Git Smart HTTP git_serve — LAN git clone of cold backups
Lifecycle auto-discover, drift, upstream-deleted cleanup
force-push approval ops/force-push-approvals request / list / Admin approve
Org mapping POST /ops/org-mirror (preserve/single/flat/mixed) + resolve-org-target
Starred / public org POST /ops/import-starred / import-public-org
Governance RBAC, OIDC JWT, legal_hold
Rebuild POST /ops/rebuild
Filtered import POST /ops/sync-platform (exclude archived/fork, star/language/glob)
GitHub archive POST /ops/migration (Migration API tar.gz)
post-exec hook sync.post_exec_script with GITFERRY_TASK/RESULT/RUN_ID/TRIGGER

Frontend entry: Sidebar → Ops center. Config: conf/config.example.yaml.

Metadata recovery loop

Backup success ≠ recoverable. GitFerry closes the loop: snapshot → verify → restore.

# 1) Snapshot (incremental with since)
curl -X POST .../api/v1/ops/metadata-backup \
  -d '{"repo_key":"gh/owner/repo","with_issues":true,"with_prs":true}'

# 2) Preview restore plan (dry-run, no writes)
gitferry ops +metadata-restore --key gh/owner/repo --format json

# 3) Commit after review
gitferry ops +metadata-restore --key gh/owner/repo --kinds labels,milestones,issues --execute --yes

Restore order: labels → milestones → issues (comments + closed state) → PRs (as annotated issues) → releases.

LAN disaster recovery pickup

# conf/config.yaml
git_serve:
  enabled: true
  base_path: "/data/git-serve"   # empty = <sync.backup_dir>/git-serve
  public_read: false             # true only on trusted LAN
git clone http://gitferry:8890/git/github/octocat/hello.git

History Sync (dual-repo content publishing)

Ship the content delta between two git trees — typically intranet → public — while leaving the target repo's existing commits (and their hashes) untouched. New content is appended as new commits.

Typical cases: a fix landed on the intranet repo but never reached the public one, or the public repo was rewritten for open-source (module path change, domain masking) and the intranet-side work now needs to travel back.

Standard flow

channel-create → target-create (local mirror first) → plan → resolve
               → human/AI adjudicates hold files → apply → push
# ① Create a channel (source/target dirs + identity rewrite rules)
gitferry histsync +channel-create --name review-service \
  --source-dir /path/to/internal --target-dir /path/to/public \
  --module-from git.enjoye.top/enjoydream --module-to github.com/yi-nology \
  --host-from git.enjoye.top --host-to github.com

# ② Add push targets (the first is the local bare mirror; the rest publish)
gitferry histsync +target-create --channel-id 1 --name backup \
  --url /path/to/review-service.git --cred-type none
gitferry histsync +target-create --channel-id 1 --name github \
  --url https://github.com/yi-nology/review-service.git \
  --cred-type token --credential-file /path/to/token

# ③ Generate the plan (read-only, writes nothing)
gitferry histsync +plan --channel-id 1 --format json

# ④ Compute auto-resolutions + fetch the conflict dossier (read-only)
gitferry histsync +resolve --channel-id 1 --format json

# ⑤ Adjudicate hold files (keep_target / take_source / merged)
gitferry histsync +override-set --channel-id 1 --path AGENTS.md \
  --verdict keep_target --reason "mutually exclusive: describes which tree this is"

# ⑥ Preview the impact (does not push)
gitferry histsync +preview --channel-id 1

# ⑦ Transplant into the target tree (local, no push)
gitferry histsync +apply --channel-id 1

# ⑧ Push (stops on blockers; --force-push when the remote needs it)
gitferry histsync +push --channel-id 1

Disposition classes

Class Meaning Decided by
same Identical after identity rewrite + normalization automatic
port Source side is a superset — overwrite with source content automatic
port_with_scrub Needs scrub before transplanting automatic
preserve Protected — never overwritten during transplant automatic
exclude Matches an exclusion rule automatic
hold Both sides have unique content human / AI adjudication

Three verdicts exist: keep_target (keep the target side), take_source (take the source side), and merged (write a hand-composed result). Verdicts are written back to the channel and take effect on the next resolve.

Gates & traceability

  • Pre-push preview: +preview lays out the impact — which commits will be created, whether a force push is needed, and what is blocking
  • Credentials stay out of shell history: use --credential-file, not --credential
  • Audit chain: every run is recorded (+runs / +run-detail); the channel's hash chain is verifiable (+channel-audit)
  • Rollback: +rollback --run-id <ID> --ref <ref> returns the target tree to a given ref

Automation surface

History sync is also exposed through the MCP / AI assistant tool registry (plan_histsync_channel, resolve_histsync_channel, preview_histsync_channel, sync_histsync_channel, set_histsync_override, …), so agents can drive it directly. See skills/gitferry-histsync/.


Agent Access (CLI · MCP · Skills)

Three surfaces share one tool semantic — both humans and agents can operate GitFerry.

1. gitferry CLI

export GITFERRY_BASE_URL=http://127.0.0.1:8890
export GITFERRY_TOKEN=your-api-key        # maps to X-API-Key

gitferry auth status
gitferry task +list --format json
gitferry ops +health --with-drift --format json
gitferry ops +metadata-restore --key gh/o/r --format json
gitferry api GET /api/v1/system/status --format json
gitferry schema list && gitferry schema show ops
  • Unified Envelope: {ok, data, error, meta}; --format json|table|yaml
  • Dangerous shortcuts (task +run, ops +drill, ops +metadata-restore --execute) return 409 unless --yes
  • --all paginate, --dry-run preview, --csv export
  • Command groups: repo / task / history / histsync / ops / platform / webhook, plus auth / config / schema / api

Install: see Quick Start.

2. MCP Server (Claude Code / Cursor)

POST /mcp (Streamable HTTP) reuses the same tool registry as the built-in AI assistant:

# capability probe
curl -H "X-API-Key: $GITFERRY_TOKEN" http://127.0.0.1:8890/mcp

# Claude Code
claude mcp add gitferry --transport http http://127.0.0.1:8890/mcp \
  --header "X-API-Key: $GITFERRY_TOKEN"

Supports initialize / tools/list / tools/call / ping. Dangerous tools keep confirmation semantics.

3. Agent Skills

make install-skills
# or: npx skills add ./skills -y -g
Skill Covers
gitferry-shared Auth, Envelope, safety rules, troubleshooting
gitferry-repo / gitferry-task / gitferry-history Repos, tasks, run history
gitferry-ops / gitferry-workflow Ops checks, failure triage, DR, metadata restore
gitferry-histsync History sync: plan, conflict adjudication, transplant, push, audit chain

See skills/README.md for the full list and install notes.


AI Assistant

Built on CloudWeGo eino for the built-in backend, and driven over ACP for external AI coding tools. Disabled by default (returns 501 until enabled).

Enable under System → AI Assistant: pick a preset (OpenAI / DashScope / DeepSeek / Ollama / vLLM / custom) or set API Base URL, choose model (or fetch list), set API Key, Save (hot reload to data/ai-settings.json, no restart).

42 tools: queries, health, inventory, RPO, integrity, drift, audit, failure diagnosis, memory (plan_mode / remember / recall), deep_analyze, DR drills, history sync, delegate-to-external-agent. Read-only queries run directly; run_task, connection tests, and other dangerous ops require a UI confirmation card + one-shot token.

Safety: read-only by default; git credentials and model keys never enter prompts/logs; tool results are injected as data only (prompt-injection hardening).

Method Path Notes
GET /api/v1/ai/status 501 = disabled
GET /api/v1/ai/trace session execution trace (runs / slowest tool / failures / pause reason / usage); in-process, cleared on restart
POST /api/v1/ai/chat SSE chat
GET /api/v1/ai/config config (key masked)
POST /api/v1/ai/config save + hot reload
POST /api/v1/ai/config/test probe OpenAI-compatible endpoint
POST /api/v1/ai/models list models from endpoint (POST — the key travels in the body, never in the URL)

Swap in an external AI coding tool (ACP)

The assistant does not have to depend on a built-in model: ai.backend can point at a mature external AI coding tool (MiniMax Code / Claude Code / Codex / Gemini CLI / OpenCode…), driven over ACP (Agent Client Protocol — JSON-RPC over stdio).

Backend Shape Use when
internal built-in eino assistant, in-process OpenAI-compatible endpoint you already run in an in-cluster model / vLLM
internal + cluster_dsn_env same assistant, but the execution plane runs on a PostgreSQL-backed multi-replica cluster (task board / session history / side-effect gate in PG; replicas are stateless) you scale the API horizontally
acpx external agent via the acpx CLI one command surface for 20+ agents, no protocol code to write
stdio external agent, native ACP, we act as the client you need the permission card and the agent-side session id

What matters:

  • Cluster form of the built-in backend: set ai.cluster_dsn_env to the name of an environment variable holding a PostgreSQL DSN (the DSN itself never enters config files). Sessions, approval state and the idempotency gate move to PG; every replica can accept any chat. If the env var is missing the process refuses to start (no silent fallback). Streaming survives the hop (goagent-runtime v0.10.0 DeltaSink): the executing replica writes text deltas into a PG side table and the SSE replica polls it alongside the event face; request identity (role / permission mode) rides Task.Tenant and is injected back into the worker context before the approval gate — same gate code as single-machine.

  • No domain tools to rewrite: the external agent connects back to this service's /mcp over MCP, so all 42 tools (sync / mirror / ops / history sync) are available as-is.

  • Both backends mount this service's /mcp for the external agent (stdio via the ACP session/new, acpx via a temporary --mcp-config file) — so the domain tools are reachable either way. The remaining differences: stdio can raise the permission card and reports the agent-side session id; acpx is non-interactive (the ask permission mode is rejected) and keeps sessions in its own store.

  • Permission mode: ask (ask every time, default) / approve_reads / approve_all / deny.

  • Switching backend or changing the permission mode is a governance action — admin only (ordinary model parameters do not need admin).

  • Security: the external agent is a subprocess on this host, so its real boundary is OS-level (run user / working directory / container) — not the MCP role. What the code layer adds is defence in depth: the dedicated key for the mounted MCP is pinned to a read-only role (dangerous tools are not even visible to it), the subprocess environment is scrubbed (the service's ENCRYPTION_KEY and admin key are removed), and the working directory is the sandbox boundary. Real isolation belongs in the deployment (dedicated user / container / read-only mounts).

  • Several external agents at once: configure ai.external.agents as a list of named profiles (Claude Code + Codex…) — the conversation uses the one picked by current, and delegation picks by name.

  • Thinking process: the external agent's reasoning arrives as thinking events and is shown collapsed in the UI (collapsed by default, length-capped).

  • Delegation: the built-in assistant can hand a coding task to an external agent via the ai_code_delegate tool. Delegation is asynchronous: confirming returns a task id immediately (the external agent may run for minutes — waiting synchronously would hang the chat connection until the proxy times it out), and the result flows back into the session, where the UI polls for it. Delegation follows the profile's own transport: acpx runs acpx <agent> exec, stdio opens a one-shot ACP session (spawn → initialize → session/new → session/prompt → close).

  • Which backend to pick: both mount our /mcp into the external agent, so either one lets it call our domain tools (sync / mirror / ops) back through us. Pick stdio when you need the permission card or the agent-side session id; acpx is non-interactive (ask permission is rejected) and keeps sessions in its own store.

界面:AI 配置·外部后端

See docs/design/acp-external-agent-design.md.


Configuration

Environment

Variable Required Description
ENCRYPTION_KEY Yes AES-256-GCM key for credential storage
GITFERRY_TOKEN CLI API key for gitferry (X-API-Key)
GIT_SYNC_AI_API_KEY AI AI assistant key (optional)
GIT_SYNC_TOKEN_<NAME> Ops Injected platform tokens (never in request body)
GIT_SYNC_TOKEN_CMD_<NAME> Ops Command that prints a token (secrets manager)
GIT_SYNC_BACKUP_DIR Backup Cold backup output directory
GIT_SYNC_POST_EXEC_SCRIPT Hook Post-sync script path
cp .env.example .env
openssl rand -base64 32   # write into ENCRYPTION_KEY

Config file

conf/config.yaml (full example: conf/config.example.yaml; schema: conf/config.schema.json):

server:
  host: "0.0.0.0"
  port: 8890
  api_key: ""              # X-API-Key; set a strong value in production
  api_key_role: admin      # admin | operator | readonly

database:
  driver: sqlite           # sqlite | mysql
  dsn: "data/git_sync.db"

sync:
  backup_dir: "var/backup"
  backup_keep: 5
  backup_format: bundle    # bundle | tar
  post_exec_script: ""
  max_concurrent: 2

runwatch:
  interval_seconds: 30
  history_limit: 10
  retry:
    max_auto_retries: 2
    cooldown_minutes: 5

# notify:
#   ntfy: [{ url: "https://ntfy.sh", topic: "gitferry-alerts" }]
#   gotify: [{ url: "https://gotify.example.com", token: "..." }]
#   heartbeat:
#     success_urls: ["https://hc-ping.com/uuid"]
#     fail_urls: ["https://hc-ping.com/uuid"]

# git_serve:
#   enabled: false
#   base_path: ""          # empty = <sync.backup_dir>/git-serve
#   public_read: false     # true only on trusted LAN

Related Repositories

This is the public shell in a three-repo architecture; it depends on the engine as a Go module:

Repository Import path Role
git-ferry-core github.com/yi-nology/git-ferry-core Sync engine library (no HTTP)
git-ferry (this repo) github.com/yi-nology/git-ferry Public shell: hz API + Vue + CLI
git-ferry-intranet github.com/yi-nology/git-ferry-intranet Intranet shell (gateway/SSO auth) — private repo

Single-repo build works (git clone + go build). Local core workspace:

go work init . ../git-ferry-core   # do not commit go.work / replace

Architecture

flowchart TB
  subgraph Entry
    W[Web Console]
    C[gitferry CLI]
    M[MCP / Agent Skills]
    AI[AI Assistant]
  end
  subgraph Shell git-ferry
    H[hz REST API]
    OPS[Ops Center]
    MCP[mcp server]
    GW[git-serve read-only]
  end
  subgraph Engine git-ferry-core
    EX[executor sync/cold backup]
    SVC[service task/platform/gov]
    MIR[mirror publish/history sync]
  end
  W --> H
  C --> H
  M --> MCP
  AI --> H
  H --> SVC
  OPS --> SVC
  MCP --> SVC
  GW --> EX
  SVC --> EX
  SVC --> MIR
  EX --> P1[GitHub/GitLab/Gitee...]
  EX --> P2[S3/WebDAV/Azure]
Loading

Development

make tidy && make test && make lint
make build && make build-cli
make apidoc          # regenerate docs/openapi.json
cd frontend && npm ci && npm run build

Service-less CI mirror path: examples/ci/github-actions-mirror.yml.

Security

Please report vulnerabilities privately — see SECURITY.md. Credentials are AES-256-GCM encrypted; tokens enter only via env / secret commands; dangerous operations require confirmation by default.

Contributing

  1. Fork and branch (git checkout -b feature/amazing-feature)
  2. Keep make test / make lint green
  3. Open a PR using the template

AI agents start here: AGENTS.md — the house rules (oekit hard rules, single-entry-point discipline, release gates), each of them backed by a mechanical check in internal/convention/ and internal/release/.

License

MIT — see LICENSE.

Project Stats

Metric Value
Test Files 93
Total Tests 469

About

GitFerry - 独立的 Git 仓库同步微服务

Topics

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages