Documentation: more git push examples
Include examples of using HEAD. The order of examples introduces new concepts one by one. This pushes the example of deleting a ref to the end of the list. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Anders Melchiorsen committed
Jan 26, 2009 at 00:45 UTC
17507832ca9a5e54e2b65a5e1ad2d17255f1b925
1 file changed
+13
-3
Documentation/git-push.txt
+13
-3
@@ -191,9 +191,9 @@ git push origin master::
191
with it. If `master` did not exist remotely, it would be
192
created.
193
194
-git push origin :experimental::
195
- Find a ref that matches `experimental` in the `origin` repository
196
- (e.g. `refs/heads/experimental`), and delete it.
194
+git push origin HEAD::
195
+ A handy way to push the current branch to the same name on the
196
+ remote.
197
198
git push origin master:satellite/master dev:satellite/dev::
199
Use the source ref that matches `master` (e.g. `refs/heads/master`)
@@ -201,6 +201,11 @@ git push origin master:satellite/master dev:satellite/dev::
201
`refs/remotes/satellite/master`) in the `origin` repository, then
202
do the same for `dev` and `satellite/dev`.
203
204
+git push origin HEAD:master::
205
+ Push the current branch to the remote ref matching `master` in the
206
+ `origin` repository. This form is convenient to push the current
207
+ branch without thinking about its local name.
208
+
209
git push origin master:refs/heads/experimental::
210
Create the branch `experimental` in the `origin` repository
211
by copying the current `master` branch. This form is only
@@ -208,6 +213,11 @@ git push origin master:refs/heads/experimental::
213
the local name and the remote name are different; otherwise,
214
the ref name on its own will work.
215
216
+git push origin :experimental::
217
+ Find a ref that matches `experimental` in the `origin` repository
218
+ (e.g. `refs/heads/experimental`), and delete it.
219
+
220
+
221
Author
222
------
223
Written by Junio C Hamano <gitster@pobox.com>, later rewritten in C