Re: Request: `git restore $commit $file` shouldn’t override uncommited changes

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

 



Robin Moussu <moussu.robin@xxxxx> writes:

> That’s the first time I’m interacting with the git community,
> I’m not very familiar with the process. I hope I’m at the right
> place for a feature request.
>
> Currently, I don’t think that it’s possible to get an error when
> copying the content of a file from another revision into your
> working tree if said file has uncommitted changes.

Yes, "git restore <from-where> <pathspec>" is like "I made a mess in
the paths <pathspec> in the working tree and I want to start from a
known state, so please take the contents for these paths from
<from-where> and overwrite the garbage I have in the working tree".

It would be a grave regression to stop overwriting by default, as it
misses the entire point of the command.

The same applies to "git checkout <from-where> -- <pathspec>".





[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