Documentation: mention `push.default` in git-push.txt
It already is listed in the "git config" documentation, but people interested in pushing would first look at "git push" documentation. Noticed-by: David Glasser Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> Fixed-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramkumar Ramachandra committed
Oct 2, 2012 at 21:08 UTC
1ec6f488de495a3b77b6a6b6fb42919f64a4bff0
1 file changed
+7
-3
Documentation/git-push.txt
+7
-3
@@ -37,7 +37,9 @@ OPTIONS[[OPTIONS]]
37
`+`, followed by the source ref <src>, followed
38
by a colon `:`, followed by the destination ref <dst>.
39
It is used to specify with what <src> object the <dst> ref
40
- in the remote repository is to be updated.
40
+ in the remote repository is to be updated. If not specified,
41
+ the behavior of the command is controlled by the `push.default`
42
+ configuration variable.
43
+
44
The <src> is often the name of the branch you would want to push, but
45
it can be any arbitrary "SHA-1 expression", such as `master~4` or
@@ -65,7 +67,8 @@ directs git to push "matching" branches: for every branch that exists on
67
the local side, the remote side is updated if a branch of the same name
68
already exists on the remote side. This is the default operation mode
69
if no explicit refspec is found (that is neither on the command line
68
-nor in any Push line of the corresponding remotes file---see below).
70
+nor in any Push line of the corresponding remotes file---see below) and
71
+no `push.default` configuration variable is set.
72
73
--all::
74
Instead of naming each ref to push, specifies that all
@@ -357,7 +360,8 @@ Examples
360
`git push origin :`.
361
+
362
The default behavior of this command when no <refspec> is given can be
360
-configured by setting the `push` option of the remote.
363
+configured by setting the `push` option of the remote, or the `push.default`
364
+configuration variable.
365
+
366
For example, to default to pushing only the current branch to `origin`
367
use `git config remote.origin.push HEAD`. Any valid <refspec> (like