]> git.ipfire.org Git - thirdparty/git.git/commit
pull: add pull.autoStash config option
authorLidong Yan <yldhome2d2@gmail.com>
Sun, 20 Jul 2025 12:43:34 +0000 (20:43 +0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Jul 2025 22:01:21 +0000 (15:01 -0700)
commite3378607c8675a2db6d997bd9781ae5500a2ec57
treed75190749bc4dbe2e2dad5da071a895a9b7a93fa
parent16bd9f20a403117f2e0d9bcda6c6e621d3763e77
pull: add pull.autoStash config option

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>
Documentation/config/pull.adoc
builtin/pull.c
t/t5520-pull.sh