From cfe1348da60b75f6093f8fb6741630b06693e57a Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 8 Mar 2013 09:44:33 -0800 Subject: [PATCH] Documentation/git-push: clarify the description of defaults We describe what gets pushed by default when the command line does not give any under the bullet point of . It is a bit unfriendly to expect users to read on when they are not giving any in the first place. "What gets pushed" is determined by taking many factors ( argument being only one of them) into account, and is a property of the entire command, not an individual argument. Also we do not describe "Where the push goes" when the command line does not say. Give the description on "what gets pushed to where" upfront before explaining individual arguments and options. Also update the description of to say what it is, what it is used for, before explaining what shape it takes. Signed-off-by: Junio C Hamano --- Documentation/git-push.txt | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 8b637d339f..3b41e72f88 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -23,6 +23,17 @@ You can make interesting things happen to a repository every time you push into it, by setting up 'hooks' there. See documentation for linkgit:git-receive-pack[1]. +When the command line does not specify where to push with the +`` argument, `branch.*.remote` configuration for the +current branch is consulted to determine where to push. If the +configuration is missing, it defaults to 'origin'. + +When the command line does not specify what to push with `...` +arguments or `--all`, `--mirror`, `--tags` options, the command finds +the default `` by consulting `remote.*.push` configuration, +and if it is not found, honors `push.default` configuration to decide +what to push (See gitlink:git-config[1] for the meaning of `push.default`). + OPTIONS[[OPTIONS]] ------------------ @@ -33,13 +44,10 @@ OPTIONS[[OPTIONS]] of a remote (see the section <> below). ...:: + Specify what destination ref to update with what source object. The format of a parameter is an optional plus - `+`, followed by the source ref , followed + `+`, followed by the source object , 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. If not specified, - the behavior of the command is controlled by the `push.default` - configuration variable. + 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 @@ -65,10 +73,7 @@ the remote repository. The special refspec `:` (or `+:` to allow non-fast-forward updates) directs git to push "matching" branches: for every branch that exists on the local side, the remote side is updated if a branch of the same name -already exists on the remote side. This is the default operation mode -if no explicit refspec is found (that is neither on the command line -nor in any Push line of the corresponding remotes file---see below) and -no `push.default` configuration variable is set. +already exists on the remote side. --all:: Instead of naming each ref to push, specifies that all