git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] pull: add pull.autoStash config option

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 17, 2025, 05:48 UTC
Message-ID
<xmqq5xfr8j0r.fsf@gitster.g>
In-Reply-To
<174669ED-8E02-49BB-BD61-277DBCA4D890@gmail.com>
Lidong Yan <yldhome2d2@gmail.com> writes:
> Yeah. Though I considered that when pull.rebase = false, checking
> merge.autoStash instead of rebase.autoStashmight confuse users
> who rely on setting rebase.autoStash for their merge operations.

Yes, that would be a behaviour change, but it is just one time thing. You notice your "git pull" do not autostash and instead stops, you scratch your head and go read the documentation, and set pull.autostash to true (which as I said I would not necessarily recommend) or merge.autostash to true (which may not be as bad) and move on.

I didn't consider it when I wrote my earlier message, but I like your idea of defeating rebase.autostash and merge.autostash when pull.autostash is explicitly set to false very much. With it, users can set {rebase,merge}.autostash to true so that their local rebases and merges, for which they are familiar with what both sides did, would autostash (and autounstash), and set pull.autostash to false so their "git pull" would be stopped when they have local changes that would interfere with the operation, if they wanted to.

Thanks.
Previous: Lidong YanNext: Junio C Hamano
Message 16 of 23 in “[BUG] git pull ignores pull.autostash=true configuration when used with --git-dir and --work-tree flags on a bare repository”
  1. Bryan LeeJul 15, 2025
  2. Lidong YanJul 15, 2025
  3. Bryan LeeJul 15, 2025
  4. Bryan LeeJul 15, 2025
  5. Lidong YanJul 15, 2025
  6. Junio C HamanoJul 15, 2025
  7. Lidong YanJul 16, 2025
  8. Johannes SixtJul 16, 2025
  9. Lidong YanJul 16, 2025
  10. Junio C HamanoJul 16, 2025
  11. pull: add pull.autoStash config optionLidong Yan, Jul 17, 2025
  12. Eric SunshineJul 17, 2025
  13. Lidong YanJul 17, 2025
  14. Junio C HamanoJul 17, 2025
  15. Lidong YanJul 17, 2025
  16. Junio C HamanoJul 17, 2025
  17. Junio C HamanoJul 17, 2025
  18. pull: add pull.autoStash config optionLidong Yan, Jul 18, 2025
  19. Junio C HamanoJul 18, 2025
  20. Lidong YanJul 19, 2025
  21. pull: add pull.autoStash config optionLidong Yan, Jul 20, 2025
  22. Junio C HamanoJul 21, 2025
  23. Ben KnobleJul 17, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.