Skip to content

Commit bb9fca8

Browse files
committed
git-push: Update description of refspecs and add examples
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1ed10b8 commit bb9fca8

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

Documentation/git-push.txt

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ side are updated.
5353
+
5454
`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
5555
+
56-
A parameter <ref> without a colon is equivalent to
57-
<ref>`:`<ref>, hence updates <ref> in the destination from <ref>
58-
in the source.
56+
A parameter <ref> without a colon pushes the <ref> from the source
57+
repository to the destination repository under the same name.
5958
+
6059
Pushing an empty <src> allows you to delete the <dst> ref from
6160
the remote repository.
@@ -98,6 +97,26 @@ the remote repository.
9897

9998
include::urls.txt[]
10099

100+
101+
Examples
102+
--------
103+
104+
git push origin master::
105+
Find a ref that matches `master` in the source repository
106+
(most likely, it would find `refs/heads/master`), and update
107+
the same ref (e.g. `refs/heads/master`) in `origin` repository
108+
with it.
109+
110+
git push origin :experimental::
111+
Find a ref that matches `experimental` in the `origin` repository
112+
(e.g. `refs/heads/experimental`), and delete it.
113+
114+
git push origin master:satellite/master::
115+
Find a ref that matches `master` in the source repository
116+
(most likely, it would find `refs/heads/master`), and update
117+
the ref that matches `satellite/master` (most likely, it would
118+
be `refs/remotes/satellite/master`) in `origin` repository with it.
119+
101120
Author
102121
------
103122
Written by Junio C Hamano <junkio@cox.net>, later rewritten in C

0 commit comments

Comments
 (0)