Re: git read-tree doesn't accept tree-ish

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

 



Hi,

On Mon, Aug 23, 2021 at 12:09 PM Nikita Bobko <nikitabobko@xxxxxxxxx> wrote:
>
> Yes, now I see. Thanks!
>
> I was trying to read state of a particular directory/file from a
> particular revision into my index but so far didn't manage to do it
> reliably.

Please don't top-post on this list.

> I was using `git read-tree <hash>:<path>` and it doesn't work for
> files (because they are blobs not tree-ish as you elaborated it to me)
> and for directories, in my cases, it fails with not so helpful
> message:
> ```
> error: Entry '<path>/<subpath>' overlaps with '<path>/<subpath>'.  Cannot bind.
> ```
>
> `git checkout <hash> -- <path>` also doesn't work in my case because
> if any file is removed in `<hash>` but not in my HEAD then `git
> checkout` doesn't remove the file in my HEAD

Have you tried `git restore --source=<hash> -- <path>` ?



[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