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

Re: [PATCH] pull: add --hard mode

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 18, 2026, 14:48 UTC
Message-ID
<xmqqwltn1o4e.fsf@gitster.g>
In-Reply-To
<pull.2384.git.git.1787052873141.gitgitgadget@gmail.com>
"Artur Bieniek via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 5 quoted lines
> From: Artur Bieniek <ar2rekb@gmail.com>
>
> Add --hard as an explicit alternative to merge and rebase. After
> fetching, require a single integration candidate and reset the current
> branch, index, and working tree to it.

There may be a population of users who *never* make changes to their history or working tree, and always want to "hard reset to the updated upstream". Doing so would be safe for them because they create nothing in their tree whose loss matters.

Giving them a convenient and safe way to do so might be worth considering, but the behavior is already safely and explicitly achieved by running 'git fetch' followed by 'git reset --hard @{u}', so I am not sure whether it is worth adding another way to do so.

More importantly, throwing it into 'git pull' feels very wrong.

The core purpose of 'git pull' is history integration. The command is designed to help those who make their own changes and advance history. Adding a destructive option to the command makes it easier for them to trigger it by accident, and unlike the main target of this new feature, they have things in their tree that they cannot afford to lose to accidents or mistakes.

So, I am mildly against adding anything of this sort to 'git pull'. For that matter, I am generally against making it convenient to discard or destroy history. I prefer to keep these destructive operations explicit, e.g., "fetch + reset --hard".

Thanks.
Previous: Artur Bieniek via GitGitGadgetNext: Phillip Wood
Message 2 of 9 in “pull: add --hard mode”
  1. pull: add --hard modeArtur Bieniek via GitGitGadget, Aug 18, 2026
  2. Junio C HamanoAug 18, 2026
  3. Phillip WoodAug 20, 2026
  4. Junio C HamanoAug 20, 2026
  5. Artur BieniekAug 20, 2026
  6. Kristoffer HaugsbakkAug 20, 2026
  7. Artur BieniekAug 24, 2026
  8. Junio C HamanoAug 24, 2026
  9. Junio C HamanoAug 21, 2026

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.