What 'push' invokes to ship a pack to the remote.
git send-pack is the client half of push — it negotiates with the remote's receive-pack, builds a pack of objects the remote lacks, and sends update lines of the form 'old-sha new-sha refname'.
Imagine a three-step handshake: receive ref advertisement, compute which refs to update with which old/new SHAs, ship the pack plus the update commands. The remote applies them atomically per-ref (or all-or-nothing with --atomic).
git send-pack [--all] [--mirror] [--dry-run] [--force]
[--receive-pack=<git-receive-pack>] [--verbose] [--thin]
[--atomic] [--[no-]signed | --signed=(true|false|if-asked)]
[--push-option=<string>] [--stdin]
[<host>:]<directory> [<ref>...]| Flag | What it does |
|---|---|
--all | Push every local branch |
--mirror | Push every ref under refs/ and delete remote refs that no longer exist locally |
--dry-run | Negotiate but do not actually update remote refs |
--force | ⚠️ Allow non-fast-forward updates — overwrites remote history |
--receive-pack=<path> | Override the path to git-receive-pack on the remote |
--verbose | Emit detailed progress to stderr |
--thin | Send a thin pack — smaller wire size, fattened on the receiver |
--atomic | Either all ref updates succeed or none do |
--signed | GPG-sign the push certificate so the server can verify the pusher |
--push-option=<string> | Pass an arbitrary string to server-side hooks (repeatable) |
--stdin | Read refspecs from standard input instead of arguments |
git send-pack --dry-run --verbose git://127.0.0.1/repo.git refs/heads/maingit send-pack --atomic origin refs/heads/main refs/heads/releasegit send-pack --mirror backup-mirrorprintf 'refs/heads/main\nrefs/tags/v1.0\n' | git send-pack --stdin originHit each option, then Check answers. Score is recorded; Next is always open.