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

Re: Init-add-reset bug in a fresh repo

From
RReto <reto@labrat.space>
Date
Aug 7, 2022, 17:22 UTC
Message-ID
<20220807172220.z35ilb4z3xyywkor@feather>
In-Reply-To
<CAKBAyV4XaXC=Gw5SN9So9UAMJ9ZQE=8dA7B5D8+Wn4JKuFRDeA@mail.gmail.com>
> What did you expect to happen? (Expected behavior)
> - Files created prior to repo aren't getting removed
> What happened instead? (Actual behavior)
> - Files are gone.
That's literally what you instructed git to do...

--hard really means that, reset I don't care YOLO, --force, just do it mate.

>--hard
>   Resets the index and working tree. Any changes to tracked files in the working tree since <commit> are discarded.
>   Any untracked files or directories in the way of writing any tracked files are simply deleted.
In other words, the flag does exactly what it's meant to do.

Kind regards, Reto

Previous: Alex A. Davronov
Message 2 of 2 in “Init-add-reset bug in a fresh repo”
  1. Alex A. DavronovAug 7, 2022
  2. RetoAug 7, 2022

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.