Skip to content

Commit 1ec6f48

Browse files
artagnongitster
authored andcommitted
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 <[email protected]> Acked-by: Matthieu Moy <[email protected]> Fixed-by: Junio C Hamano <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d117dd2 commit 1ec6f48

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Documentation/git-push.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ OPTIONS[[OPTIONS]]
3737
`+`, followed by the source ref <src>, followed
3838
by a colon `:`, followed by the destination ref <dst>.
3939
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.
4143
+
4244
The <src> is often the name of the branch you would want to push, but
4345
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
6567
the local side, the remote side is updated if a branch of the same name
6668
already exists on the remote side. This is the default operation mode
6769
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.
6972

7073
--all::
7174
Instead of naming each ref to push, specifies that all
@@ -357,7 +360,8 @@ Examples
357360
`git push origin :`.
358361
+
359362
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.
361365
+
362366
For example, to default to pushing only the current branch to `origin`
363367
use `git config remote.origin.push HEAD`. Any valid <refspec> (like

0 commit comments

Comments
 (0)