Skip to content

Commit

Permalink
Documentation: more git push examples
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Anders Melchiorsen authored and Junio C Hamano committed Jan 26, 2009
1 parent 7a0d911 commit 1750783
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Documentation/git-push.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,23 +191,33 @@ git push origin master::
with it. If `master` did not exist remotely, it would be
created.

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

git push origin master:satellite/master dev:satellite/dev::
Use the source ref that matches `master` (e.g. `refs/heads/master`)
to update the ref that matches `satellite/master` (most probably
`refs/remotes/satellite/master`) in the `origin` repository, then
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::
Create the branch `experimental` in the `origin` repository
by copying the current `master` branch. This form is only
needed to create a new branch or tag in the remote repository when
the local name and the remote name are different; otherwise,
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
------
Written by Junio C Hamano <gitster@pobox.com>, later rewritten in C
Expand Down

0 comments on commit 1750783

Please sign in to comment.