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

Re: [RFC] reset --hard: warn before discarding staged content with no commit history

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Dec 11, 2025, 03:59 UTC
Message-ID
<CAPig+cSep7+i2R-DDK+B6p6c3gy2Ehvm4U5N_PwSR-yZF3n1hA@mail.gmail.com>
In-Reply-To
<xmqqldj9g0pj.fsf@gitster.g>
On Wed, Dec 10, 2025 at 10:24 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> 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".
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 13 in “[RFC] reset --hard: warn before discarding staged content with no commit history”
  1. Koutsouflakis StefanosDec 10, 2025
  2. Junio C HamanoDec 11, 2025
  3. Eric SunshineDec 11, 2025
  4. Junio C HamanoDec 11, 2025
  5. Koutsouflakis StefanosDec 11, 2025
  6. Johannes SixtDec 11, 2025
  7. Koutsouflakis StefanosDec 11, 2025
  8. Junio C HamanoDec 12, 2025
  9. Koutsouflakis StefanosDec 14, 2025
  10. Štefan BalogDec 14, 2025
  11. Junio C HamanoDec 14, 2025
  12. Koutsouflakis StefanosDec 15, 2025
  13. D. Ben KnobleDec 12, 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.