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

Bug: git restore --staged --worktree not working in git version 2.26.2.windows.1

From
HMHarri Mehtälä <harri.mehtala@finago.com>
Date
Apr 28, 2020, 09:01 UTC
Message-ID
<AM6PR09MB298072F9FEB469130EAEB8F18BAC0@AM6PR09MB2980.eurprd09.prod.outlook.com>
Hello
In git version 2.26.2.windows.1
I am trying to do git restore --staged --worktree for a file. I understood from the documentation that you can do both.
"Specify the restore location. If neither option is specified, by default the working tree is restored. Specifying --staged will only restore the index. Specifying both restores both."

______________________ $ git status On branch ... Your branch is up to date with ...

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   pom.xml
$ git restore --staged --worktree pom.xml

$ git status On branch ... Your branch is up to date with ...

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   pom.xml
______________________
It looks like currently I have to do both separately. 
- Harri Mehtälä
Next: Eric Sunshine
Message 1 of 2 in “Bug: git restore --staged --worktree not working in git version 2.26.2.windows.1”
  1. Harri MehtäläApr 28, 2020
  2. Eric SunshineMay 1, 2020

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.