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

Re: [PATCH] restore: allow --staged on unborn branch

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 7, 2024, 16:06 UTC
Message-ID
<xmqqle7wcl7h.fsf@gitster.g>
In-Reply-To
<20240206230357.1097505-2-shyamthakkar001@gmail.com>
Ghanshyam Thakkar <shyamthakkar001@gmail.com> writes:
Show 5 quoted lines
> Some users expect that being on an unborn branch is similar to having an
> empty tree checked out. However, when running "git restore --staged ."
> on unborn branch having staged changes, the follwing error gets printed,
>
>     fatal: could not resolve HEAD

Sounds like a sensible behaviour---there is no HEAD so there is nothing to resolve. With "git resetore --staged ." in such a state, what did the user try to do? "git reset" (no other arguments)?

BTW, "follwing" -> "following".
Previous: Ghanshyam ThakkarNext: Ghanshyam Thakkar
Message 2 of 3 in “restore: allow --staged on unborn branch”
  1. restore: allow --staged on unborn branchGhanshyam Thakkar, Feb 6, 2024
  2. Junio C HamanoFeb 7, 2024
  3. Ghanshyam ThakkarFeb 7, 2024

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.