From: Junio C Hamano <gitster@pobox.com>
To: "Artur Bieniek via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Artur Bieniek <abieniek@antmicro.com>,
Artur Bieniek <ar2rekb@gmail.com>
Subject: Re: [PATCH] pull: add --hard mode
Date: Tue, 18 Aug 2026 07:48:01 -0700 [thread overview]
Message-ID: <xmqqwltn1o4e.fsf@gitster.g> (raw)
In-Reply-To: <pull.2384.git.git.1787052873141.gitgitgadget@gmail.com> (Artur Bieniek via GitGitGadget's message of "Tue, 18 Aug 2026 11:34:33 +0000")
"Artur Bieniek via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 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.
prev parent reply other threads:[~2026-08-18 14:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 11:34 [PATCH] pull: add --hard mode Artur Bieniek via GitGitGadget
2026-08-18 14:48 ` Junio C Hamano [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqwltn1o4e.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=abieniek@antmicro.com \
--cc=ar2rekb@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.