解决一个困扰1个小时的问题
git apply --verbose --no-index --unsafe-paths --directory=path xxx.diff
幸亏以下三篇文章提示了下
- https://github.com/rjust/defects4j/issues/6 文章中的这句话 知道了 --unsafe-paths 参数
The root cause is a change in the behavior of git apply (git >2.3.0), which became "safer". I could reproduce this problem and will push a fix soon. In the meanwhile, setting the --unsafe-paths flag as Thomas suggested is a good workaround.
- https://blog.csdn.net/DaSunWarman/article/details/78488756 文章中 知道了--directory 参数
- https://blog.csdn.net/l1hxl1hx/article/details/102749274?spm=1001.2101.3001.6650.2&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-2-102749274-blog-78488756.235%5Ev36%5Epc_relevant_default_base3&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-2-102749274-blog-78488756.235%5Ev36%5Epc_relevant_default_base3&utm_relevant_index=5 这篇文章中的
使用apply时路径不正确,要在git工作路径的根路径使用patch,便可作用到所有文件。
- 复制链接
- 举报