git apply does output nothing and does not patch anything

I am having a little trouble here with git and applying a patch.

I am trying to apply this patch: https://www.drupal.org/node/2309321

To this module: https://www.drupal.org/node/2309089

I know, that those are both Drupal links, but that is not the problem here. You can simply download the module and put the patch in the same folder. No Drupal needed for this.

For reference: I named the patch eck_test.patch .

This what I have tried so far:

git apply -v eck_test.patch

No output at all.


git apply -v --whitespace fix eck_test.patch

No output at all.


git am eck_test.patch

Patch format detection failed.


I have no idea, why this is not working.

Both line endings are the same, regarding to Sublime Text.

There are a lot of topics about this on the net, but I found none of them working for me. I hope you have some idea, because git seems like, it does not want to help me. :/


I had the same symptoms. When I tried patch -p1 --dry-run < [patch name].patch , as suggested by @martin in a comment, it gave some helpful output: "Hunk #1 FAILED". Looking more closely at the patch, I realized that there was a conflict in the patch, which git apply had failed to report. (The patch was trying to delete a line, but the line being deleted was different in the patch vs. my working copy.) So the solution was to fix the patch.


I have similar problem with you in a MAC git project. It turns out the solution for me is applying the patch in the same folder (in your Git project) as the patch happens.

For example, if you do the "git format-patch" at folder dirAdirB in one repository, then you have to apply the patch in another repository also in dirAdirB. Run the "git app" at dirA will cause the problem.

链接地址: http://www.djcxy.com/p/80822.html

上一篇: 如何在不使用外部库的情况下在windows phone 8或8.1中绘制图表?

下一篇: git apply确实没有输出,也没有修补任何东西