Browse Source

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>
maint
Anders Melchiorsen 16 years ago committed by Junio C Hamano
parent
commit
17507832ca
  1. 16
      Documentation/git-push.txt

16
Documentation/git-push.txt

@ -191,9 +191,9 @@ git push origin master::
with it. If `master` did not exist remotely, it would be with it. If `master` did not exist remotely, it would be
created. created.


git push origin :experimental:: git push origin HEAD::
Find a ref that matches `experimental` in the `origin` repository A handy way to push the current branch to the same name on the
(e.g. `refs/heads/experimental`), and delete it. remote.


git push origin master:satellite/master dev:satellite/dev:: git push origin master:satellite/master dev:satellite/dev::
Use the source ref that matches `master` (e.g. `refs/heads/master`) 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::
`refs/remotes/satellite/master`) in the `origin` repository, then `refs/remotes/satellite/master`) in the `origin` repository, then
do the same for `dev` and `satellite/dev`. do the same for `dev` and `satellite/dev`.


git push origin HEAD:master::
Push the current branch to the remote ref matching `master` in the
`origin` repository. This form is convenient to push the current
branch without thinking about its local name.

git push origin master:refs/heads/experimental:: git push origin master:refs/heads/experimental::
Create the branch `experimental` in the `origin` repository Create the branch `experimental` in the `origin` repository
by copying the current `master` branch. This form is only by copying the current `master` branch. This form is only
@ -208,6 +213,11 @@ git push origin master:refs/heads/experimental::
the local name and the remote name are different; otherwise, the local name and the remote name are different; otherwise,
the ref name on its own will work. the ref name on its own will work.


git push origin :experimental::
Find a ref that matches `experimental` in the `origin` repository
(e.g. `refs/heads/experimental`), and delete it.


Author Author
------ ------
Written by Junio C Hamano <gitster@pobox.com>, later rewritten in C Written by Junio C Hamano <gitster@pobox.com>, later rewritten in C

Loading…
Cancel
Save