Browse Source

Merge branch 'am/maint-push-doc' into maint

* am/maint-push-doc:
  Documentation: rework src/dst description in git push
  Documentation: more git push examples
  Documentation: simplify refspec format description
maint
Junio C Hamano 16 years ago
parent
commit
7b261711a6
  1. 48
      Documentation/git-push.txt
  2. 9
      Documentation/pull-fetch-param.txt

48
Documentation/git-push.txt

@ -33,25 +33,27 @@ OPTIONS
of a remote (see the section <<REMOTES,REMOTES>> below). of a remote (see the section <<REMOTES,REMOTES>> below).


<refspec>...:: <refspec>...::
The canonical format of a <refspec> parameter is The format of a <refspec> parameter is an optional plus
`+?<src>:<dst>`; that is, an optional plus `{plus}`, followed `{plus}`, followed by the source ref <src>, followed
by the source ref, followed by a colon `:`, followed by by a colon `:`, followed by the destination ref <dst>.
the destination ref. It is used to specify with what <src> object the <dst> ref
in the remote repository is to be updated.
+ +
The <src> side represents the source branch (or arbitrary The <src> is often the name of the branch you would want to push, but
"SHA1 expression", such as `master~4` (four parents before the it can be any arbitrary "SHA-1 expression", such as `master~4` or
tip of `master` branch); see linkgit:git-rev-parse[1]) that you `HEAD` (see linkgit:git-rev-parse[1]).
want to push. The <dst> side represents the destination location.
+ +
The local ref that matches <src> is used The <dst> tells which ref on the remote side is updated with this
to fast forward the remote ref that matches <dst>. If push. Arbitrary expressions cannot be used here, an actual ref must
the optional leading plus `+` is used, the remote ref is updated be named. If `:`<dst> is omitted, the same ref as <src> will be
even if it does not result in a fast forward update. updated.
+ +
`tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`. The object referenced by <src> is used to fast forward the ref <dst>
on the remote side. If the optional leading plus `{plus}` is used, the
remote ref is updated even if it does not result in a fast forward
update.
+ +
A lonely <src> parameter (without a colon and a destination) pushes `tag <tag>` means the same as `refs/tags/<tag>:refs/tags/<tag>`.
the <src> to the same name in the destination repository.
+ +
Pushing an empty <src> allows you to delete the <dst> ref from Pushing an empty <src> allows you to delete the <dst> ref from
the remote repository. the remote repository.
@ -190,9 +192,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`)
@ -200,6 +202,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
@ -207,6 +214,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

9
Documentation/pull-fetch-param.txt

@ -5,15 +5,14 @@
of a remote (see the section <<REMOTES,REMOTES>> below). of a remote (see the section <<REMOTES,REMOTES>> below).


<refspec>:: <refspec>::
The canonical format of a <refspec> parameter is The format of a <refspec> parameter is an optional plus
`+?<src>:<dst>`; that is, an optional plus `{plus}`, followed `{plus}`, followed by the source ref <src>, followed
by the source ref, followed by a colon `:`, followed by by a colon `:`, followed by the destination ref <dst>.
the destination ref.
+ +
The remote ref that matches <src> The remote ref that matches <src>
is fetched, and if <dst> is not empty string, the local is fetched, and if <dst> is not empty string, the local
ref that matches it is fast forwarded using <src>. ref that matches it is fast forwarded using <src>.
Again, if the optional plus `+` is used, the local ref If the optional plus `+` is used, the local ref
is updated even if it does not result in a fast forward is updated even if it does not result in a fast forward
update. update.
+ +

Loading…
Cancel
Save