Re: [RFC] reset --hard: warn before discarding staged content with no commit history
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 11, 2025, 05:25 UTC
- Message-ID
- <xmqqcy4lfv3k.fsf@gitster.g>
- In-Reply-To
- <CAPig+cSep7+i2R-DDK+B6p6c3gy2Ehvm4U5N_PwSR-yZF3n1hA@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 11 quoted lines
> On Wed, Dec 10, 2025 at 10:24 PM Junio C Hamano <gitster@pobox.com> wrote: >> Koutsouflakis Stefanos <koutsouflakis.stefanos@proton.me> writes: >> > When running "git reset --hard" in a repository where staged >> > content has never been committed, the staged files are lost. This >> > seems like a case where requiring --force could be helpful. >> >> The thinking has always been "'--hard' means what it says! HARD >> removes things harder than other modes---there is need to add >> '--force' to it". > > Presumably, you meant "there is *no* need" rather than "there is need".
Thanks. I rewrote the paragraph a few times and somehow losing the crucial negation from there..