From: Junio C Hamano Date: Tue, 26 Mar 2013 19:40:13 +0000 (-0700) Subject: Merge branch 'jc/maint-push-refspec-default-doc' into maint X-Git-Tag: v1.8.2.1~41 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f4bdb255f672d953ab6150c80af9db32e6dbe6bb?hp=-c Merge branch 'jc/maint-push-refspec-default-doc' into maint * jc/maint-push-refspec-default-doc: Documentation/git-push: clarify the description of defaults --- f4bdb255f672d953ab6150c80af9db32e6dbe6bb diff --combined Documentation/git-push.txt index 13980257ee,3b41e72f88..577d201c00 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@@ -23,6 -23,17 +23,17 @@@ You can make interesting things happen 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 +44,10 @@@ 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 @@@ -51,11 -59,10 +59,11 @@@ be named. If `:` is omitted, the s updated. + The object referenced by is used to update the reference -on the remote side, but by default this is only allowed if the -update can fast-forward . By having the optional leading `+`, -you can tell git to update the ref even when the update is not a -fast-forward. This does *not* attempt to merge into . See +on the remote side. By default this is only allowed if is not +a tag (annotated or lightweight), and then only if it can fast-forward +. By having the optional leading `+`, you can tell Git to update +the ref even if it is not allowed by default (e.g., it is not a +fast-forward.) This does *not* attempt to merge into . See EXAMPLES below for details. + `tag ` means the same as `refs/tags/:refs/tags/`. @@@ -64,12 -71,9 +72,9 @@@ Pushing an empty allows you to de 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 +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 @@@ -177,7 -181,7 +182,7 @@@ useful if you write an alias or script --recurse-submodules=check|on-demand:: Make sure all submodule commits used by the revisions to be pushed are available on a remote-tracking branch. If 'check' is - used git will verify that all submodule commits that changed in + used Git will verify that all submodule commits that changed in the revisions to be pushed are available on at least one remote of the submodule. If any commits are missing the push will be aborted and exit with non-zero status. If 'on-demand' is used @@@ -192,7 -196,7 +197,7 @@@ OUTPU ------ The output of "git push" depends on the transport method used; this -section describes the output when pushing over the git protocol (either +section describes the output when pushing over the Git protocol (either locally or via ssh). The status of the push is output in tabular form, with each line