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