git restore --staged --worktree does not restore the index (Git 2.24.1)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



git help restore says:

    The command can also be used to restore the content in the index
with --staged, or restore both the working tree and the index with
--staged --worktree.

However, this doesn't seem to work as advertised:

    $ mkdir foo; cd foo; git init
    $ touch a b; git add a b && git commit -m "Initial commit"
    $ echo "Foo" > a; echo "Bar" > b
    $ git add a
    $ git status --short
    M  a
     M b
    $ git restore --staged --worktree .
    $ git status --short
    M  a

I'm not sure whether I expect 'a' to be empty at the end of this
sequence, but I definitely expect it not to contain staged changes.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux