Git apply skips patches

后端 未结 3 1617
傲寒
傲寒 2021-02-12 07:32

I\'m trying to apply a patch that includes binary files with git apply but only the files are added. I tried running git apply failing.patch -v and it

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-12 07:59

    Suffering this issue whilst attempting to port changes across projects. git apply seems to ignore any directory names on the patch file paths, also it refuses to apply if the Index line does not match a file hash in the target repository. I had better success using these options (of which --no-index seems to be undocumented):

    git apply --verbose --no-index --directory {subdir} {patch-file} 
    

提交回复
热议问题