git-send-pack.txt 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. git-send-pack(1)
  2. ================
  3. NAME
  4. ----
  5. git-send-pack - Push objects over Git protocol to another repository
  6. SYNOPSIS
  7. --------
  8. [verse]
  9. 'git send-pack' [--all] [--dry-run] [--force] [--receive-pack=<git-receive-pack>]
  10. [--verbose] [--thin] [--atomic]
  11. [--[no-]signed|--signed=(true|false|if-asked)]
  12. [<host>:]<directory> [<ref>...]
  13. DESCRIPTION
  14. -----------
  15. Usually you would want to use 'git push', which is a
  16. higher-level wrapper of this command, instead. See linkgit:git-push[1].
  17. Invokes 'git-receive-pack' on a possibly remote repository, and
  18. updates it from the current repository, sending named refs.
  19. OPTIONS
  20. -------
  21. --receive-pack=<git-receive-pack>::
  22. Path to the 'git-receive-pack' program on the remote
  23. end. Sometimes useful when pushing to a remote
  24. repository over ssh, and you do not have the program in
  25. a directory on the default $PATH.
  26. --exec=<git-receive-pack>::
  27. Same as --receive-pack=<git-receive-pack>.
  28. --all::
  29. Instead of explicitly specifying which refs to update,
  30. update all heads that locally exist.
  31. --stdin::
  32. Take the list of refs from stdin, one per line. If there
  33. are refs specified on the command line in addition to this
  34. option, then the refs from stdin are processed after those
  35. on the command line.
  36. +
  37. If `--stateless-rpc` is specified together with this option then
  38. the list of refs must be in packet format (pkt-line). Each ref must
  39. be in a separate packet, and the list must end with a flush packet.
  40. --dry-run::
  41. Do everything except actually send the updates.
  42. --force::
  43. Usually, the command refuses to update a remote ref that
  44. is not an ancestor of the local ref used to overwrite it.
  45. This flag disables the check. What this means is that
  46. the remote repository can lose commits; use it with
  47. care.
  48. --verbose::
  49. Run verbosely.
  50. --thin::
  51. Send a "thin" pack, which records objects in deltified form based
  52. on objects not included in the pack to reduce network traffic.
  53. --atomic::
  54. Use an atomic transaction for updating the refs. If any of the refs
  55. fails to update then the entire push will fail without changing any
  56. refs.
  57. --[no-]signed::
  58. --signed=(true|false|if-asked)::
  59. GPG-sign the push request to update refs on the receiving
  60. side, to allow it to be checked by the hooks and/or be
  61. logged. If `false` or `--no-signed`, no signing will be
  62. attempted. If `true` or `--signed`, the push will fail if the
  63. server does not support signed pushes. If set to `if-asked`,
  64. sign if and only if the server supports signed pushes. The push
  65. will also fail if the actual call to `gpg --sign` fails. See
  66. linkgit:git-receive-pack[1] for the details on the receiving end.
  67. --push-option=<string>::
  68. Pass the specified string as a push option for consumption by
  69. hooks on the server side. If the server doesn't support push
  70. options, error out. See linkgit:git-push[1] and
  71. linkgit:githooks[5] for details.
  72. <host>::
  73. A remote host to house the repository. When this
  74. part is specified, 'git-receive-pack' is invoked via
  75. ssh.
  76. <directory>::
  77. The repository to update.
  78. <ref>...::
  79. The remote refs to update.
  80. SPECIFYING THE REFS
  81. -------------------
  82. There are three ways to specify which refs to update on the
  83. remote end.
  84. With `--all` flag, all refs that exist locally are transferred to
  85. the remote side. You cannot specify any '<ref>' if you use
  86. this flag.
  87. Without `--all` and without any '<ref>', the heads that exist
  88. both on the local side and on the remote side are updated.
  89. When one or more '<ref>' are specified explicitly (whether on the
  90. command line or via `--stdin`), it can be either a
  91. single pattern, or a pair of such pattern separated by a colon
  92. ":" (this means that a ref name cannot have a colon in it). A
  93. single pattern '<name>' is just a shorthand for '<name>:<name>'.
  94. Each pattern pair consists of the source side (before the colon)
  95. and the destination side (after the colon). The ref to be
  96. pushed is determined by finding a match that matches the source
  97. side, and where it is pushed is determined by using the
  98. destination side. The rules used to match a ref are the same
  99. rules used by 'git rev-parse' to resolve a symbolic ref
  100. name. See linkgit:git-rev-parse[1].
  101. - It is an error if <src> does not match exactly one of the
  102. local refs.
  103. - It is an error if <dst> matches more than one remote refs.
  104. - If <dst> does not match any remote ref, either
  105. * it has to start with "refs/"; <dst> is used as the
  106. destination literally in this case.
  107. * <src> == <dst> and the ref that matched the <src> must not
  108. exist in the set of remote refs; the ref matched <src>
  109. locally is used as the name of the destination.
  110. Without `--force`, the <src> ref is stored at the remote only if
  111. <dst> does not exist, or <dst> is a proper subset (i.e. an
  112. ancestor) of <src>. This check, known as "fast-forward check",
  113. is performed in order to avoid accidentally overwriting the
  114. remote ref and lose other peoples' commits from there.
  115. With `--force`, the fast-forward check is disabled for all refs.
  116. Optionally, a <ref> parameter can be prefixed with a plus '+' sign
  117. to disable the fast-forward check only on that ref.
  118. GIT
  119. ---
  120. Part of the linkgit:git[1] suite