Re: Bug report: `git restore --source --staged` deals poorly with sparse-checkout

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

 



Victoria Dye <vdye@xxxxxxxxxx> writes:

>> Restoring only into the index (as I think `git restore --staged` is supposed
>> to do) is weird. 
>
> 'git restore --staged' is intended to restore to both the worktree and index
> (per 183fb44fd2 (restore: add --worktree and --staged, 2019-04-25)). The bug
> you've identified is that it's not restoring to the worktree.

I think you misread 183fb44fd2, which says --staged is to restore
the contents in the index and --worktree is to restore the contents
in the working tree, and both of them can be used at the same time
to affect both destinations.  As gitcli(7) says, --staged here is a
synonym to --cached here and should not touch the working tree.

Having needless synonym may be a source of confusion, so we may want
to straighten out the UI a bit around here, but that is a separate
topic.

Thanks.



[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