Git应用跳过补丁 [英] Git apply skips patches

查看:160
本文介绍了Git应用跳过补丁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试应用一个补丁,该补丁包含带有git apply的二进制文件,但仅添加了文件.我尝试运行git apply failing.patch -v,它会显示类似以下内容的

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 prints something like:

跳过补丁'file.txt'.
正在检查补丁文件.bin ...
干净地应用了补丁文件file.bin.

Skipped patch 'file.txt'.
Checking patch file.bin...
Applied patch file.bin cleanly.

我如何找出跳过的原因?由于当前消息不是很有启发性.

How can I find out what's the reason of the skip? As the current message is not very enlightening.

推荐答案

我通过运行打印出的patch -p1 < failing.patch发现了问题:

I found out the problem by running patch -p1 < failing.patch which printed:

在输入第5行上找不到要修补的文件

can't find file to patch at input line 5

并提醒我我不在根目录中.

and reminded me that I was not in the root directory.

我不明白为什么没人问过之前,为什么冗长的消息不那么冗长.

I can't understand why no one had asked this before and why is the verbose message not verbose.

此外,甚至官方文档都没有提到跳过和可能的原因.

Also, not even the official documentation mentions skipping and possible causes.

这篇关于Git应用跳过补丁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆