How vmvarela/gh-replicate works
gh-replicate is a GitHub CLI extension that copies selected repository content into an existing GitHub repository. The main workflow parses the command, preflights source and destination, then applies selected refs, metadata, labels and releases; LFS objects are scanned, transferred and verified before refs are published. Release assets use a persistent journal to support safe retries. The orchestration is concentrated in replicate.go. Relationships for unsampled replication stages are limited to those documented in the README; the graph does not imply a transaction across stages.
Main entry points: replicate.go Run orchestration · lfs_transfer.go Object transfer · safeguards.go History scan safeguards · main.go Command entry
Components 17
Command and orchestration
- Command entry
main.go - Run orchestration
replicate.go - Accounts and preflight
replicate.go
Repository replication
- Refs replication
replicate.go - Metadata replication
replicate.go - Labels replication
replicate.go
Git LFS transfer
- History scan safeguards
safeguards.go - Pointer parsing
lfs_pointer.go - Isolated LFS repository
lfs_auxiliary.go - Object transfer
lfs_transfer.go - Object verification
lfs_objects.go
Release assets and state
- Release replication
replicate.go - Asset journal
journal.go
Other components
- CLI user
- GitHub API
- Git remotes
- GitHub LFS
Connections 20
- CLI user → Command entry: runs command
README.md - Command entry → Run orchestration: calls run
main.go - Run orchestration → Accounts and preflight: preflights
README.md - Accounts and preflight → GitHub API: reads repositories
README.md - Run orchestration → Refs replication: replicates refs
README.md - Run orchestration → Metadata replication: replicates metadata
README.md - Run orchestration → Labels replication: replicates labels
README.md - Run orchestration → Release replication: replicates releases
README.md - Refs replication → Git remotes: pushes refs
README.md - Metadata replication → GitHub API: writes metadata
README.md - Labels replication → GitHub API: writes labels
README.md - Release replication → GitHub API: reads and writes
README.md - Release replication → Asset journal: records staged assets
replicate.go - Run orchestration → History scan safeguards: guards history scan
replicate.go - History scan safeguards → Pointer parsing: classifies pointers
- History scan safeguards → Isolated LFS repository: prepares transfer
- Object transfer → Isolated LFS repository: runs Git LFS
lfs_transfer.go - Object transfer → Object verification: verifies downloads
lfs_transfer.go - Object transfer → GitHub LFS: fetches and pushes
README.md - Run orchestration → Object transfer: transfers before refs
README.md