How to apply a patch for a Drupal module? I'm trying to us this patch http://qa.drupal.org/pifr/test/298933

Save the patch file to the root directory of feeds module (sites/all/modules/feeds) then apply the patch by using git bash.

So I typed:

git apply -v fcollection.patch


and it returns the following error:


  checking patch field_collection.module...
  error: field_collection.module: No such file directory


I hve a field_collection module installed in my site.

So what I did to experiment is to copy the patch to field_collection module folder and run the patch from that folder.

Then I got this error:


  error: patch_failed: field_collection.module:1142
  error: field_collection.module: Patch does not apply.


How can I apply the patch successfully?
This patch also exists at this #1063434 - the original issue for the test you reference above. One easy way to apply this patch would be to use the Drush Issue Queue commands.

Install with:

drush dl drush_iq


Then use it like this:

cd /path/to/drupal/root
drush am 1063434-#40


Presto!  Patch applied! Then drush-iq will work even better if you check out the module from git (i.e. drush dl field_collection --package-handler=git_drupalorg).

If you don't want to use drush-iq, try:

cd /path/to/drupal/root/sites/all/modules/field_collection
wget http://drupal.org/files/field_collection-feeds_integration-1063434-40.patch
patch -Np1 &lt; field_collection-feeds_integration-1063434-40.patch