mirror of
https://github.com/git/git.git
synced 2026-01-10 01:56:42 +00:00
Git uses `rebase.autostash` or `merge.autostash` to determine whether a dirty worktree is allowed during pull. However, this behavior is not clearly documented, making it difficult for users to discover how to enable autostash, or causing them to unknowingly enable it. Add new config option `pull.autostash` along with its documentation and test cases. `pull.autostash` provides the same functionality as `rebase.autostash` and `merge.autostash`, but overrides them when set. If `pull.autostash` is not set, it falls back to `rebase.autostash` or `merge.autostash`, depending on the value of `pull.rebase`. Signed-off-by: Lidong Yan <yldhome2d2@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
50 lines
2.0 KiB
Plaintext
50 lines
2.0 KiB
Plaintext
pull.ff::
|
|
By default, Git does not create an extra merge commit when merging
|
|
a commit that is a descendant of the current commit. Instead, the
|
|
tip of the current branch is fast-forwarded. When set to `false`,
|
|
this variable tells Git to create an extra merge commit in such
|
|
a case (equivalent to giving the `--no-ff` option from the command
|
|
line). When set to `only`, only such fast-forward merges are
|
|
allowed (equivalent to giving the `--ff-only` option from the
|
|
command line). This setting overrides `merge.ff` when pulling.
|
|
|
|
pull.rebase::
|
|
When true, rebase branches on top of the fetched branch, instead
|
|
of merging the default branch from the default remote when "git
|
|
pull" is run. See "branch.<name>.rebase" for setting this on a
|
|
per-branch basis.
|
|
+
|
|
When `merges` (or just 'm'), pass the `--rebase-merges` option to 'git rebase'
|
|
so that the local merge commits are included in the rebase (see
|
|
linkgit:git-rebase[1] for details).
|
|
+
|
|
When the value is `interactive` (or just 'i'), the rebase is run in interactive
|
|
mode.
|
|
+
|
|
*NOTE*: this is a possibly dangerous operation; do *not* use
|
|
it unless you understand the implications (see linkgit:git-rebase[1]
|
|
for details).
|
|
|
|
pull.octopus::
|
|
The default merge strategy to use when pulling multiple branches
|
|
at once.
|
|
|
|
pull.autoStash::
|
|
When set to true, automatically create a temporary stash entry
|
|
to record the local changes before the operation begins, and
|
|
restore them after the operation completes. When your "git
|
|
pull" rebases (instead of merges), this may be convenient, since
|
|
unlike merging pull that tolerates local changes that do not
|
|
interfere with the merge, rebasing pull refuses to work with any
|
|
local changes.
|
|
+
|
|
If `pull.autostash` is set (either to true or false),
|
|
`merge.autostash` and `rebase.autostash` are ignored. If
|
|
`pull.autostash` is not set at all, depending on the value of
|
|
`pull.rebase`, `merge.autostash` or `rebase.autostash` is used
|
|
instead. Can be overridden by the `--[no-]autostash` command line
|
|
option.
|
|
|
|
pull.twohead::
|
|
The default merge strategy to use when pulling a single branch.
|