GIT-SEND-PACK(1)
π GIT-SEND-PACK(1) β the git manual, but make it make sense
okay so bestie, welcome to git-send-pack, straight out of the Git Manual π . This is the low-level little gremlin that actually shoves your objects over the Git protocol into another repo. Buckle up, it's giving plumbing π«Ά
πΈ NAME πΈ
git-send-pack β push objects over Git protocol to another repository
β¨ SYNOPSIS β¨
git send-pack [--mirror] [--dry-run] [--force]
[--receive-pack=<git-receive-pack>]
[--verbose] [--thin] [--atomic]
[--[no-]signed | --signed=(true|false|if-asked)]
[<host>:]<directory> (--all | <ref>...)
π DESCRIPTION π
ngl, most of the time you do not want to be here. You want git push, which is the higher-level wrapper around this command β the main character, if you will π. Peep git-push(1) for that.
But if you're curious what's under the hood: this command invokes git-receive-pack on a possibly-remote repository, and updates it from the current repository, sending the named refs. That's it, that's the vibe π«
π OPTIONS π
--receive-pack=<git-receive-pack>β the path to thegit-receive-packprogram on the remote end. Super handy when you're pushing to a remote repo over ssh and the program just isn't chilling in a directory on the default$PATHπ--exec=<git-receive-pack>β literally the same thing as--receive-pack=<git-receive-pack>. twins fr fr π―--allβ instead of listing which refs to update one by one, just update all the heads that exist locally. slay, do the whole thing β¨--stdinβ take the list of refs from stdin, one per line. And if you've also got refs on the command line besides this option, bestie, the stdin refs get processed after the command-line ones, in that order π«‘- if
--stateless-rpcis specified together with this option, then the list of refs must be in packet format (pkt-line). Each ref has to be in a separate packet, and the list must end with a flush packet. no skipping this, it's the rules π
- if
--dry-runβ do everything except actually send the updates. a little dress rehearsal, a little run-through, zero commitment π--forceβ usually the command refuses to update a remote ref that isn't an ancestor of the local ref used to overwrite it. This flag disables that check. Which means: the remote repository can lose commits. use it with care, genuinely πβ οΈ--verboseβ run verbosely. it's giving chatty π¬--thinβ send a "thin" pack, which records objects in deltified form based on objects not included in the pack, to reduce network traffic. skinny legend behavior π¦--atomicβ use an atomic transaction for updating the refs. If any of the refs fails to update, then the entire push will fail without changing any refs. all-or-nothing, periodt π--signed,--no-signed,--signed=(true|false|if-asked)β GPG-sign the push request to update refs on the receiving side, so it can be checked by the hooks and/or be logged π- if
falseor--no-signed, no signing will be attempted π - if
trueor--signed, the push will fail if the server does not support signed pushes π¬ - if set to
if-asked, sign if and only if the server supports signed pushes. chill, conditional, respectful πΈ - the push will also fail if the actual call to
gpg --signfails. also seegit-receive-pack(1)for the details on the receiving end π
- if
--push-option=<string>β pass the specified string as a push option for consumption by hooks on the server side. If the server doesn't support push options, error out. Seegit-push(1)andgithooks(5)for details π¬<host>β a remote host to house the repository. When this part is specified,git-receive-packis invoked via ssh π₯οΈ<directory>β the repository to update<ref>...β the remote refs to update
π¦ SPECIFYING THE REFS π¦
okay so there are three ways to specify which refs get updated on the remote end. pick your fighter:
With the --all flag, all refs that exist locally are transferred to the remote side. And no, you cannot specify any <ref> if you use this flag β it's exclusive, it doesn't share the spotlight π€
Without --all and without any <ref>, the heads that exist both on the local side and on the remote side are updated. the overlap, the mutuals, iykyk π€
When one or more <ref> are specified explicitly (whether on the command line or via --stdin), it can be either a single pattern, or a pair of such patterns separated by a colon ":" β which means a ref name cannot have a colon in it, sorry to that one ref name π«. A single pattern <name> is just shorthand for <name>:<name>. cute, efficient, iconic β¨
Each pattern pair consists of the source side (before the colon π) and the destination side (after the colon π―). The ref to be pushed is determined by finding a match that matches the source side, and where it's pushed is determined by using the destination side. The rules used to match a ref are the same rules used by git rev-parse to resolve a symbolic ref name. See git-rev-parse(1) π
- It is an error if
<src>does not match exactly one of the local refs π - It is an error if
<dst>matches more than one remote ref π - If
<dst>does not match any remote ref, either:- it has to start with
"refs/";<dst>is used as the destination literally in this case π <src>==<dst>and the ref that matched the<src>must not exist in the set of remote refs; the ref matched<src>locally is used as the name of the destination πͺ
- it has to start with
Without --force, the <src> ref is stored at the remote only if <dst> does not exist, or <dst> is a proper subset (i.e. an ancestor) of <src>. This check, known as the "fast-forward check", is performed to avoid accidentally overwriting the remote ref and losing other people's commits from there. protect the commits at all costs π‘οΈπ
With --force, the fast-forward check is disabled for all refs. all of them. no survivors π₯
Optionally, a <ref> parameter can be prefixed with a plus + sign to disable the fast-forward check only on that ref. targeted chaos, we love a precise queen π
π GIT π
Part of the git(1) suite π«Ά
that's the whole page bestie, go forth and push responsibly πβ¨
this was Git 2.56.0, dated 2026-09-27 β mwah, see you in the next manpage π
π¦ where this page comes from
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms