t, doc: update tests, reference for "--force-if-includes"
[git] / Documentation / config / push.txt
1 push.default::
2         Defines the action `git push` should take if no refspec is
3         given (whether from the command-line, config, or elsewhere).
4         Different values are well-suited for
5         specific workflows; for instance, in a purely central workflow
6         (i.e. the fetch source is equal to the push destination),
7         `upstream` is probably what you want.  Possible values are:
8 +
9 --
10
11 * `nothing` - do not push anything (error out) unless a refspec is
12   given. This is primarily meant for people who want to
13   avoid mistakes by always being explicit.
14
15 * `current` - push the current branch to update a branch with the same
16   name on the receiving end.  Works in both central and non-central
17   workflows.
18
19 * `upstream` - push the current branch back to the branch whose
20   changes are usually integrated into the current branch (which is
21   called `@{upstream}`).  This mode only makes sense if you are
22   pushing to the same repository you would normally pull from
23   (i.e. central workflow).
24
25 * `tracking` - This is a deprecated synonym for `upstream`.
26
27 * `simple` - in centralized workflow, work like `upstream` with an
28   added safety to refuse to push if the upstream branch's name is
29   different from the local one.
30 +
31 When pushing to a remote that is different from the remote you normally
32 pull from, work as `current`.  This is the safest option and is suited
33 for beginners.
34 +
35 This mode has become the default in Git 2.0.
36
37 * `matching` - push all branches having the same name on both ends.
38   This makes the repository you are pushing to remember the set of
39   branches that will be pushed out (e.g. if you always push 'maint'
40   and 'master' there and no other branches, the repository you push
41   to will have these two branches, and your local 'maint' and
42   'master' will be pushed there).
43 +
44 To use this mode effectively, you have to make sure _all_ the
45 branches you would push out are ready to be pushed out before
46 running 'git push', as the whole point of this mode is to allow you
47 to push all of the branches in one go.  If you usually finish work
48 on only one branch and push out the result, while other branches are
49 unfinished, this mode is not for you.  Also this mode is not
50 suitable for pushing into a shared central repository, as other
51 people may add new branches there, or update the tip of existing
52 branches outside your control.
53 +
54 This used to be the default, but not since Git 2.0 (`simple` is the
55 new default).
56
57 --
58
59 push.followTags::
60         If set to true enable `--follow-tags` option by default.  You
61         may override this configuration at time of push by specifying
62         `--no-follow-tags`.
63
64 push.gpgSign::
65         May be set to a boolean value, or the string 'if-asked'. A true
66         value causes all pushes to be GPG signed, as if `--signed` is
67         passed to linkgit:git-push[1]. The string 'if-asked' causes
68         pushes to be signed if the server supports it, as if
69         `--signed=if-asked` is passed to 'git push'. A false value may
70         override a value from a lower-priority config file. An explicit
71         command-line flag always overrides this config option.
72
73 push.pushOption::
74         When no `--push-option=<option>` argument is given from the
75         command line, `git push` behaves as if each <value> of
76         this variable is given as `--push-option=<value>`.
77 +
78 This is a multi-valued variable, and an empty value can be used in a
79 higher priority configuration file (e.g. `.git/config` in a
80 repository) to clear the values inherited from a lower priority
81 configuration files (e.g. `$HOME/.gitconfig`).
82 +
83 ----
84
85 Example:
86
87 /etc/gitconfig
88   push.pushoption = a
89   push.pushoption = b
90
91 ~/.gitconfig
92   push.pushoption = c
93
94 repo/.git/config
95   push.pushoption =
96   push.pushoption = b
97
98 This will result in only b (a and c are cleared).
99
100 ----
101
102 push.recurseSubmodules::
103         Make sure all submodule commits used by the revisions to be pushed
104         are available on a remote-tracking branch. If the value is 'check'
105         then Git will verify that all submodule commits that changed in the
106         revisions to be pushed are available on at least one remote of the
107         submodule. If any commits are missing, the push will be aborted and
108         exit with non-zero status. If the value is 'on-demand' then all
109         submodules that changed in the revisions to be pushed will be
110         pushed. If on-demand was not able to push all necessary revisions
111         it will also be aborted and exit with non-zero status. If the value
112         is 'no' then default behavior of ignoring submodules when pushing
113         is retained. You may override this configuration at time of push by
114         specifying '--recurse-submodules=check|on-demand|no'.
115         If not set, 'no' is used by default, unless 'submodule.recurse' is
116         set (in which case a 'true' value means 'on-demand').
117
118 push.useForceIfIncludes::
119         If set to "true", it is equivalent to specifying
120         `--force-if-includes` as an option to linkgit:git-push[1]
121         in the command line. Adding `--no-force-if-includes` at the
122         time of push overrides this configuration setting.