git-push: Update description of refspecs and add examples
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jun 9, 2007 at 11:01 UTC
bb9fca80ce27eeb5a29a9ef1d2b4447b28882e54
1 file changed
+22
-3
Documentation/git-push.txt
+22
-3
@@ -53,9 +53,8 @@ side are updated.
53
+
54
`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
55
+
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.
58
+
59
Pushing an empty <src> allows you to delete the <dst> ref from
60
the remote repository.
@@ -98,6 +97,26 @@ the remote repository.
97
98
include::urls.txt[]
99
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
+
120
Author
121
------
122
Written by Junio C Hamano <junkio@cox.net>, later rewritten in C