Amend git-push refspec documentation
These paragraphs are a little confusing. Also, make it clearer when you have to specify the full name for <dst> Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sam Vilain committed
Apr 21, 2008 at 15:31 UTC
491b1b11213c373a3e91004b1ab775d7e52ac1f3
1 file changed
+13
-10
Documentation/git-push.txt
+13
-10
@@ -35,14 +35,15 @@ OPTIONS
35
by the source ref, followed by a colon `:`, followed by
36
the destination ref.
37
+
38
-The <src> side can be an
39
-arbitrary "SHA1 expression" that can be used as an
40
-argument to `git-cat-file -t`. E.g. `master~4` (push
41
-four parents before the current master head).
38
+The <src> side represents the source branch (or arbitrary
39
+"SHA1 expression", such as `master~4` (four parents before the
40
+tip of `master` branch); see linkgit:git-rev-parse[1]) that you
41
+want to push. The <dst> side represents the destination location.
42
+
43
The local ref that matches <src> is used
44
-to fast forward the remote ref that matches <dst>. If
45
-the optional plus `+` is used, the remote ref is updated
44
+to fast forward the remote ref that matches <dst> (or, if no <dst> was
45
+specified, the same ref that <src> referred to locally). If
46
+the optional leading plus `+` is used, the remote ref is updated
47
even if it does not result in a fast forward update.
48
+
49
Note: If no explicit refspec is found, (that is neither
@@ -165,7 +166,8 @@ git push origin master::
166
Find a ref that matches `master` in the source repository
167
(most likely, it would find `refs/heads/master`), and update
168
the same ref (e.g. `refs/heads/master`) in `origin` repository
168
- with it.
169
+ with it. If `master` did not exist remotely, it would be
170
+ created.
171
172
git push origin :experimental::
173
Find a ref that matches `experimental` in the `origin` repository
@@ -179,9 +181,10 @@ git push origin master:satellite/master::
181
182
git push origin master:refs/heads/experimental::
183
Create the branch `experimental` in the `origin` repository
182
- by copying the current `master` branch. This form is usually
183
- needed to create a new branch in the remote repository as
184
- there is no `experimental` branch to match.
184
+ by copying the current `master` branch. This form is only
185
+ needed to create a new branch or tag in the remote repository when
186
+ the local name and the remote name are different; otherwise,
187
+ the ref name on its own will work.
188
189
Author
190
------