@@ -33,25 +33,27 @@ OPTIONS
3333 of a remote (see the section <<REMOTES,REMOTES>> below).
3434
3535<refspec>...::
36- The canonical format of a <refspec> parameter is
37- `+?<src>:<dst>`; that is, an optional plus `{plus}`, followed
38- by the source ref, followed by a colon `:`, followed by
39- the destination ref.
36+ The format of a <refspec> parameter is an optional plus
37+ `{plus}`, followed by the source ref <src>, followed
38+ by a colon `:`, followed by the destination ref <dst>.
39+ It is used to specify with what <src> object the <dst> ref
40+ in the remote repository is to be updated.
4041+
41- The <src> side represents the source branch (or arbitrary
42- "SHA1 expression", such as `master~4` (four parents before the
43- tip of `master` branch); see linkgit:git-rev-parse[1]) that you
44- want to push. The <dst> side represents the destination location.
42+ The <src> is often the name of the branch you would want to push, but
43+ it can be any arbitrary "SHA-1 expression", such as `master~4` or
44+ `HEAD` (see linkgit:git-rev-parse[1]).
4545+
46- The local ref that matches <src> is used
47- to fast forward the remote ref that matches <dst>. If
48- the optional leading plus `+` is used , the remote ref is updated
49- even if it does not result in a fast forward update .
46+ The <dst> tells which ref on the remote side is updated with this
47+ push. Arbitrary expressions cannot be used here, an actual ref must
48+ be named. If `:`<dst> is omitted , the same ref as <src> will be
49+ updated .
5050+
51- `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
51+ The object referenced by <src> is used to fast forward the ref <dst>
52+ on the remote side. If the optional leading plus `{plus}` is used, the
53+ remote ref is updated even if it does not result in a fast forward
54+ update.
5255+
53- A lonely <src> parameter (without a colon and a destination) pushes
54- the <src> to the same name in the destination repository.
56+ `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
5557+
5658Pushing an empty <src> allows you to delete the <dst> ref from
5759the remote repository.
@@ -190,23 +192,33 @@ git push origin master::
190192 with it. If `master` did not exist remotely, it would be
191193 created.
192194
193- git push origin :experimental ::
194- Find a ref that matches `experimental` in the `origin` repository
195- (e.g. `refs/heads/experimental`), and delete it .
195+ git push origin HEAD ::
196+ A handy way to push the current branch to the same name on the
197+ remote .
196198
197199git push origin master:satellite/master dev:satellite/dev::
198200 Use the source ref that matches `master` (e.g. `refs/heads/master`)
199201 to update the ref that matches `satellite/master` (most probably
200202 `refs/remotes/satellite/master`) in the `origin` repository, then
201203 do the same for `dev` and `satellite/dev`.
202204
205+ git push origin HEAD:master::
206+ Push the current branch to the remote ref matching `master` in the
207+ `origin` repository. This form is convenient to push the current
208+ branch without thinking about its local name.
209+
203210git push origin master:refs/heads/experimental::
204211 Create the branch `experimental` in the `origin` repository
205212 by copying the current `master` branch. This form is only
206213 needed to create a new branch or tag in the remote repository when
207214 the local name and the remote name are different; otherwise,
208215 the ref name on its own will work.
209216
217+ git push origin :experimental::
218+ Find a ref that matches `experimental` in the `origin` repository
219+ (e.g. `refs/heads/experimental`), and delete it.
220+
221+
210222Author
211223------
212224Written by Junio C Hamano <gitster@pobox.com>, later rewritten in C
0 commit comments