From 7a0d911f116e437628035d7b07035dbff707a172 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 25 Jan 2009 22:25:20 -0800 Subject: Documentation: simplify refspec format description The refspec format description was a mix of regexp and BNF, making it very difficult to read. The format was also wrong: it did not show that each part of a refspec is optional in different situations. Rather than having a confusing grammar, just present the format in informal prose. Signed-off-by: Anders Melchiorsen Signed-off-by: Junio C Hamano --- Documentation/git-push.txt | 9 +++++---- Documentation/pull-fetch-param.txt | 9 ++++----- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 7b27dc60bd..ea45935a7b 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -33,10 +33,11 @@ OPTIONS of a remote (see the section <> below). ...:: - The canonical format of a parameter is - `+?:`; that is, an optional plus `{plus}`, followed - by the source ref, followed by a colon `:`, followed by - the destination ref. + The format of a parameter is an optional plus + `{plus}`, followed by the source ref , followed + by a colon `:`, followed by the destination ref . + It is used to specify with what object the ref + in the remote repository is to be updated. + The side represents the source branch (or arbitrary "SHA1 expression", such as `master~4` (four parents before the diff --git a/Documentation/pull-fetch-param.txt b/Documentation/pull-fetch-param.txt index ebdd948cd2..f9811f2473 100644 --- a/Documentation/pull-fetch-param.txt +++ b/Documentation/pull-fetch-param.txt @@ -5,15 +5,14 @@ of a remote (see the section <> below). :: - The canonical format of a parameter is - `+?:`; that is, an optional plus `{plus}`, followed - by the source ref, followed by a colon `:`, followed by - the destination ref. + The format of a parameter is an optional plus + `{plus}`, followed by the source ref , followed + by a colon `:`, followed by the destination ref . + The remote ref that matches is fetched, and if is not empty string, the local ref that matches it is fast forwarded using . -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 update. + -- cgit v1.2.3 From 17507832ca9a5e54e2b65a5e1ad2d17255f1b925 Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Mon, 26 Jan 2009 00:45:32 +0100 Subject: 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 --- Documentation/git-push.txt | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index ea45935a7b..60de47d439 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -191,9 +191,9 @@ 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`) @@ -201,6 +201,11 @@ git push origin master:satellite/master dev:satellite/dev:: `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 @@ -208,6 +213,11 @@ git push origin master:refs/heads/experimental:: 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 , later rewritten in C -- cgit v1.2.3 From 803918462e58005d18c0ab63686dbd9e91330dfe Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Mon, 26 Jan 2009 00:45:33 +0100 Subject: Documentation: rework src/dst description in git push This tries to make the description of ref matching in git push easier to read. Beauty is in the eye of the beholder, though. Signed-off-by: Anders Melchiorsen Signed-off-by: Junio C Hamano --- Documentation/git-push.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 60de47d439..7d1eced7d2 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -39,20 +39,21 @@ OPTIONS It is used to specify with what object the ref in the remote repository is to be updated. + -The side represents the source branch (or arbitrary -"SHA1 expression", such as `master~4` (four parents before the -tip of `master` branch); see linkgit:git-rev-parse[1]) that you -want to push. The side represents the destination location. +The is often the name of the branch you would want to push, but +it can be any arbitrary "SHA-1 expression", such as `master~4` or +`HEAD` (see linkgit:git-rev-parse[1]). + -The local ref that matches is used -to fast forward the remote ref that matches . If -the optional leading plus `+` is used, the remote ref is updated -even if it does not result in a fast forward update. +The tells which ref on the remote side is updated with this +push. Arbitrary expressions cannot be used here, an actual ref must +be named. If `:` is omitted, the same ref as will be +updated. + -`tag ` means the same as `refs/tags/:refs/tags/`. +The object referenced by is used to fast forward the ref +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 parameter (without a colon and a destination) pushes -the to the same name in the destination repository. +`tag ` means the same as `refs/tags/:refs/tags/`. + Pushing an empty allows you to delete the ref from the remote repository. -- cgit v1.2.3