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

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

From
Artur Bieniek <abieniek@antmicro.com>
Date
Aug 24, 2026, 10:55 UTC
Message-ID
<248fc3ca-7907-4720-ab71-1cf5926b82a0@antmicro.com>
In-Reply-To
<fa62cf90-61ae-4352-b823-455ccffe403a@app.fastmail.com>
On 8/20/26 7:29 PM, Kristoffer Haugsbakk wrote:
Show 15 quoted lines
> On Thu, Aug 20, 2026, at 18:43, Artur Bieniek wrote:
>> One case where --ff-only does not seem to cover that audience is when
>> the upstream branch itself is rewritten.
>>
>> For example, a checkout may contain no local development at all and only
>> be used to track the latest state of an upstream branch, but if that
>> branch is rebased or otherwise force-updated, git pull --ff-only will
>> refuse to update it because the histories have diverged.
> 
> I don’t understand what you need a branch for in that case. I just use
> the remote-tracking branch in that case (`origin/main` e.g.).
> 
> PS: Bottom posting is strongly preferred on this list.
> 
>> ...

The branch itself is not essential; the point is to update the checked-out working tree as well. git fetch updates origin/main, but leaves the checkout at the old commit.

If resetting does not belong under pull, would the inverse design be more appropriate, e.g. git reset --pull --hard, meaning “fetch the configured upstream and reset to it”? Or would making reset perform network I/O be undesirable for the same reason?

Thanks, Artur

Previous: Kristoffer HaugsbakkNext: Junio C Hamano
Message 7 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.