Repository navigation
Open
Description
push --mirror
Client (Mirror) Server
--------------------------------------------------------
Step 1: Connect to server
| |
| --- git-receive-pack /repo.git ---------->|
| |
Step 2: Capability handshake
| |
| <-- server advertises capabilities ------|
| capabilities: report-status delete-refs side-band-64k
| |
Step 3: Client sends refs update request (mirror mode)
| |
| --- push all refs: |
| refs/heads/main -> refs/heads/main |
| refs/heads/feature-x -> refs/heads/feature-x
| refs/tags/v1.0 -> refs/tags/v1.0 |
| |
Step 4: Server validates and applies updates
| |
| <-- server sends status for each ref ----|
| ok refs/heads/main
| ok refs/heads/feature-x
| ok refs/tags/v1.0
| |
Step 5: Update complete
| |
| Mirror repo on server now exactly matches client
| refs/* = all client refs
clone --mirror
Client (Normal Clone) Server
------------------------------------------------------
Step 1: Connect to server
| --- git-upload-pack /repo.git ------->|
| |
Step 2: Capability handshake (v1/v2)
| <--- refs + capabilities ------------|
| refs/heads/main
| refs/heads/feature-x
| refs/tags/v1.0
| capabilities: multi_ack thin-pack ofs-delta
Step 3: Client requests pack for default + needed refs
| --- request pack ------------------->|
Step 4: Server sends pack
| <--- pack with requested objects ----|
Step 5: Update local repo
| refs/remotes/origin/main <-- tracked remote branch
| refs/remotes/origin/feature-x
| refs/tags/v1.0 <-- local tags
Client (Mirror Clone) Server
------------------------------------------------------
Step 1: Connect to server
| --- git-upload-pack /repo.git ------->|
Step 2: Capability handshake (v1/v2)
| <--- refs + capabilities ------------|
| refs/heads/main
| refs/heads/feature-x
| refs/tags/v1.0
| capabilities: multi_ack thin-pack ofs-delta
Step 3: Client requests pack (mirror mode)
| --- request all refs using capabilities -->|
Step 4: Server sends pack with ALL objects
| <--- pack containing all refs ------------|
Step 5: Update mirror repo
| refs/heads/main <-- exactly mirrors origin
| refs/heads/feature-x <-- exactly mirrors origin
| refs/tags/v1.0 <-- exactly mirrors origin
| refs/* <-- everything mirroredMetadata
Metadata
Assignees
Labels
No labels
Activity